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

rUv03ff39cfd19f
diff --git a/.claude/checkpoints/1754338130.json b/.claude/checkpoints/1754338130.json
new file mode 100644
index 0000000000..65b65d56fd
--- /dev/null
+++ b/.claude/checkpoints/1754338130.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250804-200849", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/automation-executor.js", "timestamp": "2025-08-04T20:08:50Z", "type": "pre-edit", "original_branch": "alpha-85"}
diff --git a/.claude/checkpoints/1754338131.json b/.claude/checkpoints/1754338131.json
new file mode 100644
index 0000000000..ef59c5b436
--- /dev/null
+++ b/.claude/checkpoints/1754338131.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250804-200851", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/automation-executor.js", "timestamp": "2025-08-04T20:08:51Z", "type": "post-edit", "branch": "alpha-85", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/task-metrics.json | 6 ++-- .claude/checkpoints/task-1754338111.json | 1 + claude-flow-wiki | 0 src/cli/simple-commands/automation-executor.js | 47 ++++++++++++++++++++++---- 5 files changed, 45 insertions(+), 11 deletions(-) "}
diff --git a/src/cli/simple-commands/automation-executor.js b/src/cli/simple-commands/automation-executor.js
index 72d6d086b1..2ad38eb3b1 100644
--- a/src/cli/simple-commands/automation-executor.js
+++ b/src/cli/simple-commands/automation-executor.js
@@ -518,6 +518,19 @@ Execute your role in the MLE-STAR workflow with full coordination and hook integ
let failedTasks = 0;
const totalTasks = tasks.length;
+ // Task status tracking
+ const taskStatuses = new Map();
+ tasks.forEach(task => {
+ taskStatuses.set(task.id, {
+ name: task.name || task.id,
+ status: 'pending',
+ agent: task.assignTo,
+ startTime: null,
+ endTime: null,
+ summary: ''
+ });
+ });
+
// Create task execution plan based on dependencies
const executionPlan = this.createExecutionPlan(tasks, dependencies);
@@ -526,20 +539,57 @@ Execute your role in the MLE-STAR workflow with full coordination and hook integ
// Execute tasks phase by phase
for (const [phaseIndex, phaseTasks] of executionPlan.entries()) {
- console.log(`πŸ”„ Phase ${phaseIndex + 1}: ${phaseTasks.map(t => t.name || t.id).join(', ')}`);
+ this.currentPhase = `Phase ${phaseIndex + 1}`;
+ console.log(`\nπŸ”„ Phase ${phaseIndex + 1}: ${phaseTasks.length} concurrent tasks`);
+
+ // Show task board
+ this.displayTaskBoard(taskStatuses, phaseTasks);
+
+ // Mark tasks as in-progress
+ phaseTasks.forEach(task => {
+ const status = taskStatuses.get(task.id);
+ status.status = 'in-progress';
+ status.startTime = Date.now();
+ });
// Execute tasks in this phase (potentially in parallel)
- const phasePromises = phaseTasks.map(task => this.executeTask(task, workflow));
+ const phasePromises = phaseTasks.map(async (task) => {
+ const taskStatus = taskStatuses.get(task.id);
+
+ try {
+ // Show task starting
+ console.log(`\n πŸš€ Starting: ${task.name || task.id}`);
+ console.log(` Agent: ${task.assignTo}`);
+ console.log(` Description: ${task.description?.substring(0, 80)}...`);
+
+ const result = await this.executeTask(task, workflow);
+
+ taskStatus.status = result.success ? 'completed' : 'failed';
+ taskStatus.endTime = Date.now();
+ taskStatus.summary = result.success ?
+ `βœ… Completed in ${this.formatDuration(result.duration)}` :
+ `❌ Failed: ${result.error?.message || 'Unknown error'}`;
+
+ return result;
+ } catch (error) {
+ taskStatus.status = 'failed';
+ taskStatus.endTime = Date.now();
+ taskStatus.summary = `❌ Error: ${error.message}`;
+ throw error;
+ }
+ });
+
+ // Wait for all phase tasks to complete
const phaseResults = await Promise.allSettled(phasePromises);
// Process phase results
for (const [taskIndex, result] of phaseResults.entries()) {
const task = phaseTasks[taskIndex];
+ const taskStatus = taskStatuses.get(task.id);
if (result.status === 'fulfilled' && result.value.success) {
completedTasks++;
this.results.set(task.id, result.value);
- console.log(` βœ… ${task.name || task.id}`);
} else {
failedTasks++;
const error = result.status === 'rejected' ? result.reason : result.value.error;
@@ -549,17 +599,18 @@ Execute your role in the MLE-STAR workflow with full coordination and hook integ
error: error.message || error,
timestamp: new Date()
});
- console.log(` ❌ ${task.name || task.id}: ${error.message || error}`);
// Check if we should fail fast
if (workflow.settings?.failurePolicy === 'fail-fast') {
- console.log(`πŸ›‘ Failing fast due to task failure`);
+ console.log(`\nπŸ›‘ Failing fast due to task failure`);
break;
}
}
}
- console.log();
+ // Show updated task board
+ console.log(`\nπŸ“Š Phase ${phaseIndex + 1} Complete:`);
+ this.displayTaskBoard(taskStatuses);
// Stop if fail-fast and we have failures
if (workflow.settings?.failurePolicy === 'fail-fast' && failedTasks > 0) {
@@ -567,6 +618,10 @@ Execute your role in the MLE-STAR workflow with full coordination and hook integ
}
}
+ // Final summary
+ console.log(`\nπŸ“Š Final Workflow Summary:`);
+ this.displayTaskBoard(taskStatuses);
+
return {
success: failedTasks === 0,
totalTasks,
@@ -578,6 +633,57 @@ Execute your role in the MLE-STAR workflow with full coordination and hook integ
errors: this.errors
};
}
+
+ /**
+ * Display task board showing current status
+ */
+ displayTaskBoard(taskStatuses, highlightTasks = []) {
+ console.log('\nβ”Œβ”€ Task Status Board ─────────────────────────────────────┐');
+
+ // Group by status
+ const statusGroups = {
+ 'in-progress': [],
+ 'completed': [],
+ 'failed': [],
+ 'pending': []
+ };
+
+ taskStatuses.forEach((status, taskId) => {
+ statusGroups[status.status].push({ taskId, ...status });
+ });
+
+ // Show in-progress tasks
+ if (statusGroups['in-progress'].length > 0) {
+ console.log('β”‚ πŸ”„ IN PROGRESS: β”‚');
+ statusGroups['in-progress'].forEach(task => {
+ const duration = task.startTime ? this.formatDuration(Date.now() - task.startTime) : '';
+ console.log(`β”‚ β€’ ${task.name.padEnd(35)} ${duration.padStart(10)} β”‚`);
+ });
+ }
+
+ // Show completed tasks
+ if (statusGroups['completed'].length > 0) {
+ console.log('β”‚ βœ… COMPLETED: β”‚');
+ statusGroups['completed'].forEach(task => {
+ console.log(`β”‚ β€’ ${task.name.padEnd(35)} ${task.summary.substring(0, 15).padStart(10)} β”‚`);
+ });
+ }
+
+ // Show failed tasks
+ if (statusGroups['failed'].length > 0) {
+ console.log('β”‚ ❌ FAILED: β”‚');
+ statusGroups['failed'].forEach(task => {
+ console.log(`β”‚ β€’ ${task.name.padEnd(35)} ${task.summary.substring(0, 15).padStart(10)} β”‚`);
+ });
+ }
+
+ // Show pending tasks count
+ if (statusGroups['pending'].length > 0) {
+ console.log(`β”‚ ⏳ PENDING: ${statusGroups['pending'].length} tasks waiting β”‚`);
+ }
+
+ console.log('β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜');
+ }
/**
* Execute a single task