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.js

rUvb16210dfd716
diff --git a/.claude/checkpoints/1754318776.json b/.claude/checkpoints/1754318776.json
new file mode 100644
index 0000000000..c67df29892
--- /dev/null
+++ b/.claude/checkpoints/1754318776.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250804-144616", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/automation.js", "timestamp": "2025-08-04T14:46:16Z", "type": "pre-edit", "original_branch": "alpha-85"}
diff --git a/.claude/checkpoints/1754318778.json b/.claude/checkpoints/1754318778.json
new file mode 100644
index 0000000000..6b87802bd3
--- /dev/null
+++ b/.claude/checkpoints/1754318778.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250804-144618", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/automation.js", "timestamp": "2025-08-04T14:46:18Z", "type": "post-edit", "branch": "alpha-85", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 192 +++++++++++++++++++++++++++++++ .claude-flow/metrics/task-metrics.json | 6 +- .claude/checkpoints/1754318756.json | 1 + .claude/checkpoints/1754318758.json | 1 + claude-flow-wiki | 0 src/cli/simple-commands/automation.js | 9 ++ 7 files changed, 207 insertions(+), 4 deletions(-) "}
diff --git a/src/cli/simple-commands/automation.js b/src/cli/simple-commands/automation.js
index 6942ff6335..f3f7160038 100644
--- a/src/cli/simple-commands/automation.js
+++ b/src/cli/simple-commands/automation.js
@@ -254,6 +254,185 @@ async function workflowSelectCommand(subArgs, flags) {
console.log(`\nπŸ“„ Workflow template saved for project: ${projectType}`);
}
+/**
+ * Execute a workflow from file - NEW IMPLEMENTATION
+ */
+async function runWorkflowCommand(subArgs, flags) {
+ const workflowFile = subArgs[1];
+ const options = flags;
+
+ if (!workflowFile) {
+ printError('Usage: automation run-workflow <workflow-file> [options]');
+ console.log('\nExample:');
+ console.log(' claude-flow automation run-workflow workflow.json --claude --non-interactive');
+ return;
+ }
+
+ if (!existsSync(workflowFile)) {
+ printError(`Workflow file not found: ${workflowFile}`);
+ return;
+ }
+
+ try {
+ console.log(`πŸ”„ Loading workflow: ${workflowFile}`);
+
+ // Load workflow definition
+ const workflowData = await loadWorkflowFromFile(workflowFile);
+
+ // Create executor with options
+ const executor = new WorkflowExecutor({
+ enableClaude: options.claude || false,
+ nonInteractive: options['non-interactive'] || options.nonInteractive || false,
+ outputFormat: options['output-format'] || 'text',
+ maxConcurrency: parseInt(options['max-concurrency']) || 3,
+ timeout: parseInt(options.timeout) || 3600000,
+ logLevel: options.verbose ? 'debug' : 'info'
+ });
+
+ // Apply variable overrides if provided
+ const variables = {};
+ if (options.variables) {
+ try {
+ Object.assign(variables, JSON.parse(options.variables));
+ } catch (error) {
+ printWarning(`Invalid variables JSON: ${error.message}`);
+ }
+ }
+
+ // Execute workflow
+ const result = await executor.executeWorkflow(workflowData, variables);
+
+ if (options['output-format'] === 'json') {
+ console.log(JSON.stringify(result, null, 2));
+ }
+
+ printSuccess(`Workflow execution ${result.success ? 'completed' : 'failed'}`);
+
+ if (!result.success && result.errors.length > 0) {
+ console.log('\n❌ Errors encountered:');
+ result.errors.forEach(error => {
+ console.log(` β€’ ${error.type}: ${error.error}`);
+ });
+ }
+
+ } catch (error) {
+ printError(`Failed to execute workflow: ${error.message}`);
+ }
+}
+
+/**
+ * Run MLE-STAR workflow - NEW FLAGSHIP COMMAND
+ */
+async function mleStarCommand(subArgs, flags) {
+ const options = flags;
+
+ console.log(`🧠 MLE-STAR: Machine Learning Engineering via Search and Targeted Refinement`);
+ console.log(`🎯 This is the flagship automation workflow for ML engineering tasks`);
+ console.log();
+
+ try {
+ // Get the built-in MLE-STAR workflow
+ const workflowPath = getMLEStarWorkflowPath();
+
+ if (!existsSync(workflowPath)) {
+ printError('MLE-STAR workflow template not found');
+ console.log('Please ensure the template is installed at:');
+ console.log(workflowPath);
+ return;
+ }
+
+ // Load MLE-STAR workflow
+ const workflowData = await loadWorkflowFromFile(workflowPath);
+
+ console.log(`πŸ“‹ Workflow: ${workflowData.name}`);
+ console.log(`πŸ“„ Description: ${workflowData.description}`);
+ console.log(`πŸŽ“ Methodology: Search β†’ Foundation β†’ Refinement β†’ Ensemble β†’ Validation`);
+ console.log(`⏱️ Expected Runtime: ${workflowData.metadata.expected_runtime}`);
+ console.log();
+
+ // Detect dataset if provided
+ const datasetPath = options.dataset || options.data || './data/dataset.csv';
+ const targetColumn = options.target || 'target';
+
+ // Create executor with MLE-STAR optimized settings
+ const executor = new WorkflowExecutor({
+ enableClaude: options.claude !== false, // Default to true for MLE-STAR
+ nonInteractive: options['non-interactive'] || options.nonInteractive || false,
+ outputFormat: options['output-format'] || 'text',
+ maxConcurrency: parseInt(options['max-agents']) || 6,
+ timeout: parseInt(options.timeout) || 14400000, // 4 hours for ML workflows
+ logLevel: options.verbose ? 'debug' : 'info'
+ });
+
+ // Prepare MLE-STAR specific variables
+ const variables = {
+ dataset_path: datasetPath,
+ target_column: targetColumn,
+ experiment_name: options.name || `mle-star-${Date.now()}`,
+ model_output_dir: options.output || './models/',
+ search_iterations: parseInt(options['search-iterations']) || 3,
+ refinement_iterations: parseInt(options['refinement-iterations']) || 5,
+ ...((options.variables && JSON.parse(options.variables)) || {})
+ };
+
+ console.log(`πŸ“Š Configuration:`);
+ console.log(` Dataset: ${variables.dataset_path}`);
+ console.log(` Target: ${variables.target_column}`);
+ console.log(` Output: ${variables.model_output_dir}`);
+ console.log(` Claude Integration: ${executor.options.enableClaude ? 'Enabled' : 'Disabled'}`);
+ console.log();
+
+ if (!options.claude && !options['no-claude-warning']) {
+ printWarning('MLE-STAR works best with Claude integration. Add --claude flag for full automation.');
+ console.log('Without Claude, this will simulate the workflow execution.');
+ console.log();
+ }
+
+ // Execute MLE-STAR workflow
+ const result = await executor.executeWorkflow(workflowData, variables);
+
+ if (result.success) {
+ console.log();
+ printSuccess('πŸŽ‰ MLE-STAR workflow completed successfully!');
+ console.log(`πŸ“Š Results: ${result.completedTasks}/${result.totalTasks} tasks completed`);
+ console.log(`⏱️ Duration: ${executor.formatDuration(result.duration)}`);
+ console.log(`πŸ†” Execution ID: ${result.executionId}`);
+
+ if (result.results && Object.keys(result.results).length > 0) {
+ console.log(`\nπŸ“ˆ Key Results:`);
+ Object.entries(result.results).forEach(([taskId, taskResult]) => {
+ if (taskResult.output?.status === 'completed') {
+ console.log(` βœ… ${taskId}: Completed successfully`);
+ }
+ });
+ }
+
+ console.log(`\nπŸ’‘ Next Steps:`);
+ console.log(` β€’ Check models in: ${variables.model_output_dir}`);
+ console.log(` β€’ Review experiment: ${variables.experiment_name}`);
+ console.log(` β€’ Validate results with your test data`);
+
+ } else {
+ printError('❌ MLE-STAR workflow failed');
+ console.log(`πŸ“Š Progress: ${result.completedTasks}/${result.totalTasks} tasks completed`);
+
+ if (result.errors.length > 0) {
+ console.log('\nπŸ” Errors:');
+ result.errors.forEach(error => {
+ console.log(` β€’ ${error.type}: ${error.error}`);
+ });
+ }
+ }
+
+ if (options['output-format'] === 'json') {
+ console.log('\n' + JSON.stringify(result, null, 2));
+ }
+
+ } catch (error) {
+ printError(`MLE-STAR execution failed: ${error.message}`);
+ }
+}
+
function showAutomationHelp() {
console.log(`
πŸ€– Automation Commands - Intelligent Agent & Workflow Management