π 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
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
π 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.jsonnew file mode 100644index 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.jsonnew file mode 100644index 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.jsindex 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 integlet 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 dependenciesconst 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 phasefor (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 completeconst phaseResults = await Promise.allSettled(phasePromises);// Process phase resultsfor (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 integerror: error.message || error,timestamp: new Date()});- console.log(` β ${task.name || task.id}: ${error.message || error}`);// Check if we should fail fastif (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 failuresif (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 integerrors: 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