claude-flow-novice 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-flow-novice/preferences/generation.json +147 -0
- package/.claude-flow-novice/preferences/language-configs/javascript.json +51 -0
- package/.claude-flow-novice/preferences/language-configs/python.json +50 -0
- package/.claude-flow-novice/preferences/language-configs/rust.json +237 -0
- package/.claude-flow-novice/preferences/language-configs/typescript.json +54 -0
- package/.claude-flow-novice/preferences/project-local.json +91 -0
- package/.claude-flow-novice/preferences/resource-delegation.json +120 -0
- package/.claude-flow-novice/preferences/team-shared.json +195 -0
- package/.claude-flow-novice/preferences/user-global.json +247 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-JAVASCRIPT.md +769 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-PYTHON.md +1214 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-RUST.md +475 -0
- package/.claude-flow-novice/templates/claude-md-templates/CLAUDE-TYPESCRIPT.md +851 -0
- package/.claude-flow-novice/templates/claude-md-templates/README.md +263 -0
- package/CLAUDE.md +81 -0
- package/README-NPM.md +0 -0
- package/package.json +11 -7
- package/scripts/build/README.md +167 -0
- package/scripts/build/build-config.js +27 -0
- package/scripts/build/build-prompt-copier.sh +30 -0
- package/scripts/build/performance-monitor.js +869 -0
- package/scripts/build/prepare-publish.js +150 -0
- package/scripts/build/typescript-fixer.js +621 -0
- package/scripts/build/unified-builder.sh +428 -0
- package/scripts/build/update-bin-version.js +32 -0
- package/scripts/dev/README.md +264 -0
- package/scripts/dev/claude-flow-wrapper.sh +35 -0
- package/scripts/dev/claude-monitor.py +419 -0
- package/scripts/dev/claude-sparc.sh +562 -0
- package/scripts/dev/claude-wrapper.sh +17 -0
- package/scripts/dev/demo-phase3-compliance.js +172 -0
- package/scripts/dev/demo-task-system.ts +224 -0
- package/scripts/dev/deployment-validator.js +315 -0
- package/scripts/dev/spawn-claude-terminal.sh +32 -0
- package/scripts/dev/start-portal.sh +506 -0
- package/scripts/dev/start-web-ui.js +15 -0
- package/scripts/dev/stop-portal.sh +311 -0
- package/scripts/dev/validate-examples.ts +288 -0
- package/scripts/dev/validate-phase2.cjs +451 -0
- package/scripts/dev/validate-phase2.js +785 -0
- package/scripts/dev/validate-phase3.cjs +208 -0
- package/scripts/dev/validate-security-remediation.js +1 -0
- package/scripts/legacy/README.md +272 -0
- package/scripts/legacy/batch-fix-ts.sh +54 -0
- package/scripts/legacy/build-migration.sh +105 -0
- package/scripts/legacy/build-monitor.js +209 -0
- package/scripts/legacy/build-with-filter.sh +84 -0
- package/scripts/legacy/build-workaround.sh +71 -0
- package/scripts/legacy/fix-ts-advanced.js +358 -0
- package/scripts/legacy/fix-ts-final.sh +50 -0
- package/scripts/legacy/fix-ts-targeted.sh +49 -0
- package/scripts/legacy/fix-typescript-errors.js +305 -0
- package/scripts/legacy/force-build.sh +63 -0
- package/scripts/legacy/optimize-performance.js +400 -0
- package/scripts/legacy/performance-monitor.js +263 -0
- package/scripts/legacy/performance-monitoring.js +532 -0
- package/scripts/legacy/performance-test-runner.js +645 -0
- package/scripts/legacy/quick-fix-ts.js +281 -0
- package/scripts/legacy/safe-build.sh +63 -0
- package/scripts/migration/README.md +434 -0
- package/scripts/migration/install-arm64.js +78 -0
- package/scripts/migration/install.js +83 -0
- package/scripts/migration/migrate-hooks.js +173 -0
- package/scripts/migration/migration-examples.ts +318 -0
- package/scripts/optimization/build-optimizer.js +438 -0
- package/scripts/optimization/config-validator.js +761 -0
- package/scripts/optimization/test-optimization.js +432 -0
- package/scripts/optimization/unified-activation.js +839 -0
- package/scripts/performance/ACTIVATION_COMMANDS.md +292 -0
- package/scripts/performance/sqlite-enhanced-activation.sh +583 -0
- package/scripts/performance/test-enhanced-backend.sh +504 -0
- package/scripts/performance-test-runner.js +698 -0
- package/scripts/security/README.md +339 -0
- package/scripts/security/install-git-hooks.sh +132 -0
- package/scripts/security/ruv-swarm-safe.js +74 -0
- package/scripts/test/README.md +236 -0
- package/scripts/test/check-links.ts +274 -0
- package/scripts/test/check-performance-regression.ts +168 -0
- package/scripts/test/coverage-report.ts +692 -0
- package/scripts/test/generate-swarm-tests.js +633 -0
- package/scripts/test/integration-test-validation.cjs +253 -0
- package/scripts/test/load-test-swarm.js +576 -0
- package/scripts/test/run-phase3-compliance-tests.js +427 -0
- package/scripts/test/test-batch-tasks.ts +29 -0
- package/scripts/test/test-byzantine-resolution.js +246 -0
- package/scripts/test/test-claude-spawn-options.sh +63 -0
- package/scripts/test/test-cli-wizard.js +331 -0
- package/scripts/test/test-comprehensive.js +401 -0
- package/scripts/test/test-coordination-features.ts +238 -0
- package/scripts/test/test-fallback-systems.js +276 -0
- package/scripts/test/test-init-command.ts +302 -0
- package/scripts/test/test-mcp.ts +251 -0
- package/scripts/test/test-runner.ts +568 -0
- package/scripts/test/test-swarm-integration.sh +92 -0
- package/scripts/test/test-swarm.ts +142 -0
- package/scripts/test/validation-summary.ts +408 -0
- package/scripts/utils/README.md +261 -0
- package/scripts/utils/clean-build-artifacts.sh +94 -0
- package/scripts/utils/cleanup-root.sh +69 -0
- package/scripts/utils/fix-cliffy-imports.js +307 -0
- package/scripts/utils/fix-duplicate-imports.js +114 -0
- package/scripts/utils/fix-error-handling.cjs +70 -0
- package/scripts/utils/fix-import-paths.js +104 -0
- package/scripts/utils/fix-imports.js +116 -0
- package/scripts/utils/fix-shebang.js +78 -0
- package/scripts/utils/fix-test-modules.js +27 -0
- package/scripts/utils/fix-timezone-issue-246.js +200 -0
- package/scripts/utils/fix-ts-comprehensive.py +182 -0
- package/scripts/utils/fix-ts-targeted-batch.js +250 -0
- package/scripts/utils/remove-benchmark-conflicts.sh +140 -0
- package/scripts/utils/simple-test-fixer.js +190 -0
- package/scripts/utils/validate-metrics-structure.cjs +144 -0
- package/scripts/verify-mcp-server.js +86 -0
- package/src/cli/simple-commands/__tests__/agent.test.js +291 -0
- package/src/cli/simple-commands/__tests__/memory.test.js +8 -0
- package/src/cli/simple-commands/__tests__/swarm.test.js +371 -0
- package/src/cli/simple-commands/__tests__/task.test.js +8 -0
- package/src/cli/simple-commands/agent.js +216 -0
- package/src/cli/simple-commands/analysis.js +570 -0
- package/src/cli/simple-commands/automation-executor.js +1603 -0
- package/src/cli/simple-commands/automation.js +627 -0
- package/src/cli/simple-commands/batch-manager.js +338 -0
- package/src/cli/simple-commands/claude-telemetry.js +311 -0
- package/src/cli/simple-commands/claude-track.js +102 -0
- package/src/cli/simple-commands/concurrent-display.js +348 -0
- package/src/cli/simple-commands/config.js +319 -0
- package/src/cli/simple-commands/coordination.js +307 -0
- package/src/cli/simple-commands/enhanced-ui-views.js +654 -0
- package/src/cli/simple-commands/enhanced-webui-complete.js +1038 -0
- package/src/cli/simple-commands/fix-hook-variables.js +363 -0
- package/src/cli/simple-commands/github/gh-coordinator.js +605 -0
- package/src/cli/simple-commands/github/github-api.js +624 -0
- package/src/cli/simple-commands/github/init.js +543 -0
- package/src/cli/simple-commands/github.js +377 -0
- package/src/cli/simple-commands/goal.js +145 -0
- package/src/cli/simple-commands/hive-mind/auto-save-middleware.js +311 -0
- package/src/cli/simple-commands/hive-mind/communication.js +740 -0
- package/src/cli/simple-commands/hive-mind/core.js +1031 -0
- package/src/cli/simple-commands/hive-mind/db-optimizer.js +872 -0
- package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +1364 -0
- package/src/cli/simple-commands/hive-mind/memory.js +1292 -0
- package/src/cli/simple-commands/hive-mind/performance-optimizer.js +618 -0
- package/src/cli/simple-commands/hive-mind/performance-test.js +373 -0
- package/src/cli/simple-commands/hive-mind/queen.js +809 -0
- package/src/cli/simple-commands/hive-mind/session-manager.js +1223 -0
- package/src/cli/simple-commands/hive-mind-optimize.js +361 -0
- package/src/cli/simple-commands/hive-mind-wizard.js +281 -0
- package/src/cli/simple-commands/hive-mind.js +3112 -0
- package/src/cli/simple-commands/hive.js +140 -0
- package/src/cli/simple-commands/hook-safety.js +671 -0
- package/src/cli/simple-commands/hooks.js +1268 -0
- package/src/cli/simple-commands/init/.claude/checkpoints/1756224542.json +7 -0
- package/src/cli/simple-commands/init/.claude/checkpoints/1756224544.json +8 -0
- package/src/cli/simple-commands/init/README.md +106 -0
- package/src/cli/simple-commands/init/VALIDATION_ROLLBACK.md +488 -0
- package/src/cli/simple-commands/init/agent-copier.js +347 -0
- package/src/cli/simple-commands/init/batch-init.js +663 -0
- package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +438 -0
- package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +876 -0
- package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +356 -0
- package/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +501 -0
- package/src/cli/simple-commands/init/claude-commands/slash-commands.js +57 -0
- package/src/cli/simple-commands/init/claude-commands/sparc-commands.js +296 -0
- package/src/cli/simple-commands/init/copy-revised-templates.js +175 -0
- package/src/cli/simple-commands/init/executable-wrapper.js +122 -0
- package/src/cli/simple-commands/init/gitignore-updater.js +137 -0
- package/src/cli/simple-commands/init/help.js +110 -0
- package/src/cli/simple-commands/init/hive-mind-init.js +749 -0
- package/src/cli/simple-commands/init/index.js +1953 -0
- package/src/cli/simple-commands/init/performance-monitor.js +344 -0
- package/src/cli/simple-commands/init/rollback/backup-manager.js +542 -0
- package/src/cli/simple-commands/init/rollback/index.js +399 -0
- package/src/cli/simple-commands/init/rollback/recovery-manager.js +778 -0
- package/src/cli/simple-commands/init/rollback/rollback-executor.js +521 -0
- package/src/cli/simple-commands/init/rollback/state-tracker.js +486 -0
- package/src/cli/simple-commands/init/sparc/roo-readme.js +61 -0
- package/src/cli/simple-commands/init/sparc/roomodes-config.js +102 -0
- package/src/cli/simple-commands/init/sparc/workflows.js +40 -0
- package/src/cli/simple-commands/init/sparc-structure.js +68 -0
- package/src/cli/simple-commands/init/template-copier.js +640 -0
- package/src/cli/simple-commands/init/templates/CLAUDE.md +1185 -0
- package/src/cli/simple-commands/init/templates/CLAUDE.md.optimized +265 -0
- package/src/cli/simple-commands/init/templates/claude-flow-universal +81 -0
- package/src/cli/simple-commands/init/templates/claude-flow.bat +18 -0
- package/src/cli/simple-commands/init/templates/claude-flow.ps1 +24 -0
- package/src/cli/simple-commands/init/templates/claude-md.js +1101 -0
- package/src/cli/simple-commands/init/templates/commands/analysis/bottleneck-detect.md +162 -0
- package/src/cli/simple-commands/init/templates/commands/automation/auto-agent.md +122 -0
- package/src/cli/simple-commands/init/templates/commands/coordination/swarm-init.md +85 -0
- package/src/cli/simple-commands/init/templates/commands/github/github-swarm.md +121 -0
- package/src/cli/simple-commands/init/templates/commands/helpers/standard-checkpoint-hooks.sh +179 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +113 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +116 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +117 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +112 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +113 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +113 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +112 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +111 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +118 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +118 -0
- package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +117 -0
- package/src/cli/simple-commands/init/templates/coordination-md.js +340 -0
- package/src/cli/simple-commands/init/templates/coordination.md +16 -0
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +2347 -0
- package/src/cli/simple-commands/init/templates/github-safe-enhanced.js +331 -0
- package/src/cli/simple-commands/init/templates/github-safe.js +106 -0
- package/src/cli/simple-commands/init/templates/memory-bank-md.js +259 -0
- package/src/cli/simple-commands/init/templates/memory-bank.md +16 -0
- package/src/cli/simple-commands/init/templates/readme-files.js +72 -0
- package/src/cli/simple-commands/init/templates/safe-hook-patterns.js +430 -0
- package/src/cli/simple-commands/init/templates/settings.json +109 -0
- package/src/cli/simple-commands/init/templates/settings.json.enhanced +35 -0
- package/src/cli/simple-commands/init/templates/sparc-modes.js +1401 -0
- package/src/cli/simple-commands/init/templates/verification-claude-md.js +432 -0
- package/src/cli/simple-commands/init/validation/config-validator.js +354 -0
- package/src/cli/simple-commands/init/validation/health-checker.js +599 -0
- package/src/cli/simple-commands/init/validation/index.js +388 -0
- package/src/cli/simple-commands/init/validation/mode-validator.js +387 -0
- package/src/cli/simple-commands/init/validation/post-init-validator.js +390 -0
- package/src/cli/simple-commands/init/validation/pre-init-validator.js +290 -0
- package/src/cli/simple-commands/init/validation/test-runner.js +488 -0
- package/src/cli/simple-commands/init.js +4 -0
- package/src/cli/simple-commands/mcp-health.js +163 -0
- package/src/cli/simple-commands/mcp-integration-layer.js +689 -0
- package/src/cli/simple-commands/mcp.js +420 -0
- package/src/cli/simple-commands/memory-consolidation.js +631 -0
- package/src/cli/simple-commands/memory.js +345 -0
- package/src/cli/simple-commands/migrate-hooks.js +63 -0
- package/src/cli/simple-commands/monitor.js +417 -0
- package/src/cli/simple-commands/neural.js +148 -0
- package/src/cli/simple-commands/pair-autofix-only.js +755 -0
- package/src/cli/simple-commands/pair-basic.js +751 -0
- package/src/cli/simple-commands/pair-old.js +623 -0
- package/src/cli/simple-commands/pair-working.js +849 -0
- package/src/cli/simple-commands/pair.js +849 -0
- package/src/cli/simple-commands/performance-hooks.js +149 -0
- package/src/cli/simple-commands/performance-metrics.js +601 -0
- package/src/cli/simple-commands/process-ui-enhanced.js +821 -0
- package/src/cli/simple-commands/process-ui.js +274 -0
- package/src/cli/simple-commands/realtime-update-system.js +659 -0
- package/src/cli/simple-commands/sparc/architecture.js +1750 -0
- package/src/cli/simple-commands/sparc/commands.js +575 -0
- package/src/cli/simple-commands/sparc/completion.js +1831 -0
- package/src/cli/simple-commands/sparc/coordinator.js +1045 -0
- package/src/cli/simple-commands/sparc/index.js +321 -0
- package/src/cli/simple-commands/sparc/phase-base.js +430 -0
- package/src/cli/simple-commands/sparc/pseudocode.js +984 -0
- package/src/cli/simple-commands/sparc/refinement.js +1856 -0
- package/src/cli/simple-commands/sparc/specification.js +736 -0
- package/src/cli/simple-commands/sparc-modes/architect.js +125 -0
- package/src/cli/simple-commands/sparc-modes/ask.js +126 -0
- package/src/cli/simple-commands/sparc-modes/code.js +148 -0
- package/src/cli/simple-commands/sparc-modes/debug.js +112 -0
- package/src/cli/simple-commands/sparc-modes/devops.js +137 -0
- package/src/cli/simple-commands/sparc-modes/docs-writer.js +38 -0
- package/src/cli/simple-commands/sparc-modes/generic.js +34 -0
- package/src/cli/simple-commands/sparc-modes/index.js +201 -0
- package/src/cli/simple-commands/sparc-modes/integration.js +55 -0
- package/src/cli/simple-commands/sparc-modes/mcp.js +38 -0
- package/src/cli/simple-commands/sparc-modes/monitoring.js +38 -0
- package/src/cli/simple-commands/sparc-modes/optimization.js +38 -0
- package/src/cli/simple-commands/sparc-modes/security-review.js +130 -0
- package/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +167 -0
- package/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +38 -0
- package/src/cli/simple-commands/sparc-modes/supabase-admin.js +149 -0
- package/src/cli/simple-commands/sparc-modes/swarm.js +436 -0
- package/src/cli/simple-commands/sparc-modes/tdd.js +112 -0
- package/src/cli/simple-commands/sparc-modes/tutorial.js +277 -0
- package/src/cli/simple-commands/sparc.js +530 -0
- package/src/cli/simple-commands/start-ui.js +147 -0
- package/src/cli/simple-commands/start-wrapper.js +285 -0
- package/src/cli/simple-commands/start.js +2 -0
- package/src/cli/simple-commands/status.js +303 -0
- package/src/cli/simple-commands/stream-chain-clean.js +221 -0
- package/src/cli/simple-commands/stream-chain-fixed.js +89 -0
- package/src/cli/simple-commands/stream-chain-real.js +408 -0
- package/src/cli/simple-commands/stream-chain-working.js +323 -0
- package/src/cli/simple-commands/stream-chain.js +491 -0
- package/src/cli/simple-commands/stream-processor.js +340 -0
- package/src/cli/simple-commands/swarm-executor.js +253 -0
- package/src/cli/simple-commands/swarm-metrics-integration.js +371 -0
- package/src/cli/simple-commands/swarm-ui.js +741 -0
- package/src/cli/simple-commands/swarm-webui-integration.js +311 -0
- package/src/cli/simple-commands/swarm.js +2277 -0
- package/src/cli/simple-commands/task.js +228 -0
- package/src/cli/simple-commands/templates/mle-star-workflow.json +294 -0
- package/src/cli/simple-commands/timestamp-fix.js +104 -0
- package/src/cli/simple-commands/token-tracker.js +372 -0
- package/src/cli/simple-commands/tool-execution-framework.js +555 -0
- package/src/cli/simple-commands/train-and-stream.js +354 -0
- package/src/cli/simple-commands/training-pipeline.js +874 -0
- package/src/cli/simple-commands/training.js +288 -0
- package/src/cli/simple-commands/verification-hooks.js +336 -0
- package/src/cli/simple-commands/verification-integration.js +464 -0
- package/src/cli/simple-commands/verification-training-integration.js +646 -0
- package/src/cli/simple-commands/verification.js +551 -0
- package/src/cli/simple-commands/web-server.js +929 -0
- package/src/cli/simple-commands/webui-validator.js +136 -0
- package/src/language/README.md +503 -0
- package/src/language/claude-md-generator.js +618 -0
- package/src/language/cli.js +422 -0
- package/src/language/example.js +347 -0
- package/src/language/integration-system.js +619 -0
- package/src/language/language-detector.js +581 -0
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
import { printSuccess, printError, printWarning } from '../utils.js';
|
|
2
|
+
import {
|
|
3
|
+
WorkflowExecutor,
|
|
4
|
+
loadWorkflowFromFile,
|
|
5
|
+
getMLEStarWorkflowPath,
|
|
6
|
+
} from './automation-executor.js';
|
|
7
|
+
import { existsSync } from 'fs';
|
|
8
|
+
import { join } from 'path';
|
|
9
|
+
|
|
10
|
+
// Simple ID generator
|
|
11
|
+
function generateId(prefix = 'id') {
|
|
12
|
+
return `${prefix}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function automationAction(subArgs, flags) {
|
|
16
|
+
const subcommand = subArgs[0];
|
|
17
|
+
const options = flags;
|
|
18
|
+
|
|
19
|
+
if (options.help || options.h || !subcommand) {
|
|
20
|
+
showAutomationHelp();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
switch (subcommand) {
|
|
26
|
+
case 'auto-agent':
|
|
27
|
+
await autoAgentCommand(subArgs, flags);
|
|
28
|
+
break;
|
|
29
|
+
case 'smart-spawn':
|
|
30
|
+
await smartSpawnCommand(subArgs, flags);
|
|
31
|
+
break;
|
|
32
|
+
case 'workflow-select':
|
|
33
|
+
await workflowSelectCommand(subArgs, flags);
|
|
34
|
+
break;
|
|
35
|
+
case 'run-workflow':
|
|
36
|
+
await runWorkflowCommand(subArgs, flags);
|
|
37
|
+
break;
|
|
38
|
+
case 'mle-star':
|
|
39
|
+
await mleStarCommand(subArgs, flags);
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
printError(`Unknown automation command: ${subcommand}`);
|
|
43
|
+
showAutomationHelp();
|
|
44
|
+
}
|
|
45
|
+
} catch (err) {
|
|
46
|
+
printError(`Automation command failed: ${err.message}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function autoAgentCommand(subArgs, flags) {
|
|
51
|
+
const options = flags;
|
|
52
|
+
const complexity = options['task-complexity'] || options.complexity || 'medium';
|
|
53
|
+
const swarmId = options['swarm-id'] || options.swarmId || generateId('swarm');
|
|
54
|
+
|
|
55
|
+
console.log(`🤖 Auto-spawning agents based on task complexity...`);
|
|
56
|
+
console.log(`📊 Task complexity: ${complexity}`);
|
|
57
|
+
console.log(`🐝 Swarm ID: ${swarmId}`);
|
|
58
|
+
|
|
59
|
+
// Determine optimal agent configuration based on complexity
|
|
60
|
+
let agentConfig;
|
|
61
|
+
switch (complexity.toLowerCase()) {
|
|
62
|
+
case 'low':
|
|
63
|
+
case 'simple':
|
|
64
|
+
agentConfig = { coordinator: 1, developer: 1, total: 2 };
|
|
65
|
+
break;
|
|
66
|
+
case 'medium':
|
|
67
|
+
case 'moderate':
|
|
68
|
+
agentConfig = { coordinator: 1, developer: 2, researcher: 1, total: 4 };
|
|
69
|
+
break;
|
|
70
|
+
case 'high':
|
|
71
|
+
case 'complex':
|
|
72
|
+
agentConfig = { coordinator: 2, developer: 3, researcher: 2, analyzer: 1, total: 8 };
|
|
73
|
+
break;
|
|
74
|
+
case 'enterprise':
|
|
75
|
+
case 'massive':
|
|
76
|
+
agentConfig = {
|
|
77
|
+
coordinator: 3,
|
|
78
|
+
developer: 5,
|
|
79
|
+
researcher: 3,
|
|
80
|
+
analyzer: 2,
|
|
81
|
+
tester: 2,
|
|
82
|
+
total: 15,
|
|
83
|
+
};
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
agentConfig = { coordinator: 1, developer: 2, researcher: 1, total: 4 };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
console.log(`\n🎯 OPTIMAL AGENT CONFIGURATION:`);
|
|
90
|
+
Object.entries(agentConfig).forEach(([type, count]) => {
|
|
91
|
+
if (type !== 'total') {
|
|
92
|
+
console.log(` 🤖 ${type}: ${count} agents`);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
console.log(` 📊 Total agents: ${agentConfig.total}`);
|
|
96
|
+
|
|
97
|
+
// Simulate auto-spawning
|
|
98
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
99
|
+
|
|
100
|
+
printSuccess(`✅ Auto-agent spawning completed`);
|
|
101
|
+
console.log(
|
|
102
|
+
`🚀 ${agentConfig.total} agents spawned and configured for ${complexity} complexity tasks`,
|
|
103
|
+
);
|
|
104
|
+
console.log(`💾 Agent configuration saved to swarm memory: ${swarmId}`);
|
|
105
|
+
console.log(`📋 Agents ready for task assignment`);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async function smartSpawnCommand(subArgs, flags) {
|
|
109
|
+
const options = flags;
|
|
110
|
+
const requirement = options.requirement || 'general-development';
|
|
111
|
+
const maxAgents = parseInt(options['max-agents'] || options.maxAgents || '10');
|
|
112
|
+
|
|
113
|
+
console.log(`🧠 Smart spawning agents based on requirements...`);
|
|
114
|
+
console.log(`📋 Requirement: ${requirement}`);
|
|
115
|
+
console.log(`🔢 Max agents: ${maxAgents}`);
|
|
116
|
+
|
|
117
|
+
// Analyze requirements and suggest optimal agent mix
|
|
118
|
+
let recommendedAgents = [];
|
|
119
|
+
|
|
120
|
+
if (requirement.includes('development') || requirement.includes('coding')) {
|
|
121
|
+
recommendedAgents.push(
|
|
122
|
+
{ type: 'coordinator', count: 1, reason: 'Task orchestration' },
|
|
123
|
+
{ type: 'coder', count: 3, reason: 'Core development work' },
|
|
124
|
+
{ type: 'tester', count: 1, reason: 'Quality assurance' },
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (requirement.includes('research') || requirement.includes('analysis')) {
|
|
129
|
+
recommendedAgents.push(
|
|
130
|
+
{ type: 'researcher', count: 2, reason: 'Information gathering' },
|
|
131
|
+
{ type: 'analyst', count: 1, reason: 'Data analysis' },
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (requirement.includes('enterprise') || requirement.includes('production')) {
|
|
136
|
+
recommendedAgents.push(
|
|
137
|
+
{ type: 'coordinator', count: 2, reason: 'Multi-tier coordination' },
|
|
138
|
+
{ type: 'coder', count: 4, reason: 'Parallel development' },
|
|
139
|
+
{ type: 'researcher', count: 2, reason: 'Requirements analysis' },
|
|
140
|
+
{ type: 'analyst', count: 1, reason: 'Performance monitoring' },
|
|
141
|
+
{ type: 'tester', count: 2, reason: 'Comprehensive testing' },
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Default fallback
|
|
146
|
+
if (recommendedAgents.length === 0) {
|
|
147
|
+
recommendedAgents = [
|
|
148
|
+
{ type: 'coordinator', count: 1, reason: 'General coordination' },
|
|
149
|
+
{ type: 'coder', count: 2, reason: 'General development' },
|
|
150
|
+
{ type: 'researcher', count: 1, reason: 'Support research' },
|
|
151
|
+
];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
155
|
+
|
|
156
|
+
printSuccess(`✅ Smart spawn analysis completed`);
|
|
157
|
+
console.log(`\n🎯 RECOMMENDED AGENT CONFIGURATION:`);
|
|
158
|
+
|
|
159
|
+
let totalRecommended = 0;
|
|
160
|
+
recommendedAgents.forEach((agent) => {
|
|
161
|
+
console.log(` 🤖 ${agent.type}: ${agent.count} agents - ${agent.reason}`);
|
|
162
|
+
totalRecommended += agent.count;
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
console.log(`\n📊 SUMMARY:`);
|
|
166
|
+
console.log(` 📝 Total recommended: ${totalRecommended} agents`);
|
|
167
|
+
console.log(` 🔢 Max allowed: ${maxAgents} agents`);
|
|
168
|
+
console.log(
|
|
169
|
+
` ✅ Configuration: ${totalRecommended <= maxAgents ? 'Within limits' : 'Exceeds limits - scaling down required'}`,
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
if (totalRecommended > maxAgents) {
|
|
173
|
+
printWarning(
|
|
174
|
+
`⚠️ Recommended configuration exceeds max agents. Consider increasing limit or simplifying requirements.`,
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
async function workflowSelectCommand(subArgs, flags) {
|
|
180
|
+
const options = flags;
|
|
181
|
+
const projectType = options['project-type'] || options.project || 'general';
|
|
182
|
+
const priority = options.priority || 'balanced';
|
|
183
|
+
|
|
184
|
+
console.log(`🔄 Selecting optimal workflow configuration...`);
|
|
185
|
+
console.log(`📁 Project type: ${projectType}`);
|
|
186
|
+
console.log(`⚡ Priority: ${priority}`);
|
|
187
|
+
|
|
188
|
+
// Define workflow templates
|
|
189
|
+
const workflows = {
|
|
190
|
+
'web-app': {
|
|
191
|
+
phases: ['planning', 'design', 'frontend', 'backend', 'testing', 'deployment'],
|
|
192
|
+
agents: { coordinator: 1, developer: 3, tester: 1, researcher: 1 },
|
|
193
|
+
duration: '2-4 weeks',
|
|
194
|
+
},
|
|
195
|
+
api: {
|
|
196
|
+
phases: ['specification', 'design', 'implementation', 'testing', 'documentation'],
|
|
197
|
+
agents: { coordinator: 1, developer: 2, tester: 1, researcher: 1 },
|
|
198
|
+
duration: '1-2 weeks',
|
|
199
|
+
},
|
|
200
|
+
'data-analysis': {
|
|
201
|
+
phases: ['collection', 'cleaning', 'analysis', 'visualization', 'reporting'],
|
|
202
|
+
agents: { coordinator: 1, researcher: 2, analyzer: 2, developer: 1 },
|
|
203
|
+
duration: '1-3 weeks',
|
|
204
|
+
},
|
|
205
|
+
enterprise: {
|
|
206
|
+
phases: [
|
|
207
|
+
'requirements',
|
|
208
|
+
'architecture',
|
|
209
|
+
'development',
|
|
210
|
+
'integration',
|
|
211
|
+
'testing',
|
|
212
|
+
'deployment',
|
|
213
|
+
'monitoring',
|
|
214
|
+
],
|
|
215
|
+
agents: { coordinator: 2, developer: 5, researcher: 2, analyzer: 1, tester: 2 },
|
|
216
|
+
duration: '2-6 months',
|
|
217
|
+
},
|
|
218
|
+
general: {
|
|
219
|
+
phases: ['planning', 'implementation', 'testing', 'delivery'],
|
|
220
|
+
agents: { coordinator: 1, developer: 2, researcher: 1 },
|
|
221
|
+
duration: '1-2 weeks',
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
const selectedWorkflow = workflows[projectType] || workflows['general'];
|
|
226
|
+
|
|
227
|
+
await new Promise((resolve) => setTimeout(resolve, 800));
|
|
228
|
+
|
|
229
|
+
printSuccess(`✅ Workflow selection completed`);
|
|
230
|
+
console.log(`\n🔄 SELECTED WORKFLOW: ${projectType.toUpperCase()}`);
|
|
231
|
+
console.log(`⏱️ Estimated duration: ${selectedWorkflow.duration}`);
|
|
232
|
+
|
|
233
|
+
console.log(`\n📋 WORKFLOW PHASES:`);
|
|
234
|
+
selectedWorkflow.phases.forEach((phase, index) => {
|
|
235
|
+
console.log(` ${index + 1}. ${phase.charAt(0).toUpperCase() + phase.slice(1)}`);
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
console.log(`\n🤖 RECOMMENDED AGENTS:`);
|
|
239
|
+
Object.entries(selectedWorkflow.agents).forEach(([type, count]) => {
|
|
240
|
+
console.log(` • ${type}: ${count} agent${count > 1 ? 's' : ''}`);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
console.log(`\n⚡ PRIORITY OPTIMIZATIONS:`);
|
|
244
|
+
switch (priority) {
|
|
245
|
+
case 'speed':
|
|
246
|
+
console.log(` 🚀 Speed-optimized: +50% agents, parallel execution`);
|
|
247
|
+
break;
|
|
248
|
+
case 'quality':
|
|
249
|
+
console.log(` 🎯 Quality-focused: +100% testing, code review stages`);
|
|
250
|
+
break;
|
|
251
|
+
case 'cost':
|
|
252
|
+
console.log(` 💰 Cost-efficient: Minimal agents, sequential execution`);
|
|
253
|
+
break;
|
|
254
|
+
default:
|
|
255
|
+
console.log(` ⚖️ Balanced approach: Optimal speed/quality/cost ratio`);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
console.log(`\n📄 Workflow template saved for project: ${projectType}`);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Execute a workflow from file - NEW IMPLEMENTATION
|
|
263
|
+
*/
|
|
264
|
+
async function runWorkflowCommand(subArgs, flags) {
|
|
265
|
+
const workflowFile = subArgs[1];
|
|
266
|
+
const options = flags;
|
|
267
|
+
|
|
268
|
+
if (!workflowFile) {
|
|
269
|
+
printError('Usage: automation run-workflow <workflow-file> [options]');
|
|
270
|
+
console.log('\nExample:');
|
|
271
|
+
console.log(' claude-flow automation run-workflow workflow.json --claude --non-interactive');
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (!existsSync(workflowFile)) {
|
|
276
|
+
printError(`Workflow file not found: ${workflowFile}`);
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
try {
|
|
281
|
+
console.log(`🔄 Loading workflow: ${workflowFile}`);
|
|
282
|
+
|
|
283
|
+
// Load workflow definition
|
|
284
|
+
const workflowData = await loadWorkflowFromFile(workflowFile);
|
|
285
|
+
|
|
286
|
+
// Create executor with options
|
|
287
|
+
const executor = new WorkflowExecutor({
|
|
288
|
+
enableClaude: options.claude || false,
|
|
289
|
+
nonInteractive: options['non-interactive'] || options.nonInteractive || false,
|
|
290
|
+
outputFormat:
|
|
291
|
+
options['output-format'] ||
|
|
292
|
+
(options['non-interactive'] || options.nonInteractive ? 'stream-json' : 'text'),
|
|
293
|
+
maxConcurrency: parseInt(options['max-concurrency']) || 3,
|
|
294
|
+
timeout: parseInt(options.timeout) || 3600000,
|
|
295
|
+
logLevel: options.verbose ? 'debug' : 'info',
|
|
296
|
+
workflowName: workflowData.name,
|
|
297
|
+
workflowType:
|
|
298
|
+
workflowData.type || (workflowData.name?.toLowerCase().includes('ml') ? 'ml' : 'general'),
|
|
299
|
+
enableChaining: options.chaining !== false, // Default to true for stream-json chaining
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// Apply variable overrides if provided
|
|
303
|
+
const variables = {};
|
|
304
|
+
if (options.variables) {
|
|
305
|
+
try {
|
|
306
|
+
Object.assign(variables, JSON.parse(options.variables));
|
|
307
|
+
} catch (error) {
|
|
308
|
+
printWarning(`Invalid variables JSON: ${error.message}`);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Execute workflow
|
|
313
|
+
const result = await executor.executeWorkflow(workflowData, variables);
|
|
314
|
+
|
|
315
|
+
if (options['output-format'] === 'json') {
|
|
316
|
+
console.log(JSON.stringify(result, null, 2));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
printSuccess(`Workflow execution ${result.success ? 'completed' : 'failed'}`);
|
|
320
|
+
|
|
321
|
+
if (!result.success && result.errors.length > 0) {
|
|
322
|
+
console.log('\n❌ Errors encountered:');
|
|
323
|
+
result.errors.forEach((error) => {
|
|
324
|
+
console.log(` • ${error.type}: ${error.error}`);
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// Ensure process exits properly in non-interactive mode
|
|
329
|
+
if (options['non-interactive'] || options.nonInteractive) {
|
|
330
|
+
process.exit(result.success ? 0 : 1);
|
|
331
|
+
}
|
|
332
|
+
} catch (error) {
|
|
333
|
+
printError(`Failed to execute workflow: ${error.message}`);
|
|
334
|
+
if (options['non-interactive'] || options.nonInteractive) {
|
|
335
|
+
process.exit(1);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Run MLE-STAR workflow - NEW FLAGSHIP COMMAND
|
|
342
|
+
*/
|
|
343
|
+
async function mleStarCommand(subArgs, flags) {
|
|
344
|
+
const options = flags;
|
|
345
|
+
|
|
346
|
+
console.log(`🧠 MLE-STAR: Machine Learning Engineering via Search and Targeted Refinement`);
|
|
347
|
+
console.log(`🎯 This is the flagship automation workflow for ML engineering tasks`);
|
|
348
|
+
console.log();
|
|
349
|
+
|
|
350
|
+
try {
|
|
351
|
+
// Get the built-in MLE-STAR workflow
|
|
352
|
+
const workflowPath = getMLEStarWorkflowPath();
|
|
353
|
+
|
|
354
|
+
if (!existsSync(workflowPath)) {
|
|
355
|
+
printError('MLE-STAR workflow template not found');
|
|
356
|
+
console.log('Please ensure the template is installed at:');
|
|
357
|
+
console.log(workflowPath);
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// Load MLE-STAR workflow
|
|
362
|
+
const workflowData = await loadWorkflowFromFile(workflowPath);
|
|
363
|
+
|
|
364
|
+
console.log(`📋 Workflow: ${workflowData.name}`);
|
|
365
|
+
console.log(`📄 Description: ${workflowData.description}`);
|
|
366
|
+
console.log(`🎓 Methodology: Search → Foundation → Refinement → Ensemble → Validation`);
|
|
367
|
+
console.log(`⏱️ Expected Runtime: ${workflowData.metadata.expected_runtime}`);
|
|
368
|
+
console.log();
|
|
369
|
+
|
|
370
|
+
// Detect dataset if provided
|
|
371
|
+
const datasetPath = options.dataset || options.data || './data/dataset.csv';
|
|
372
|
+
const targetColumn = options.target || 'target';
|
|
373
|
+
|
|
374
|
+
// Create executor with MLE-STAR optimized settings
|
|
375
|
+
// IMPORTANT: Default to non-interactive mode to prevent multiple Claude spawns
|
|
376
|
+
const isNonInteractive = options.interactive
|
|
377
|
+
? false // If --interactive is explicitly set, use interactive mode
|
|
378
|
+
: options['non-interactive'] !== undefined
|
|
379
|
+
? options['non-interactive'] || options.nonInteractive
|
|
380
|
+
: true; // Default to true for MLE-STAR to avoid multiple interactive sessions
|
|
381
|
+
|
|
382
|
+
const executor = new WorkflowExecutor({
|
|
383
|
+
enableClaude: options.claude !== false, // Default to true for MLE-STAR
|
|
384
|
+
nonInteractive: isNonInteractive,
|
|
385
|
+
outputFormat: options['output-format'] || (isNonInteractive ? 'stream-json' : 'text'),
|
|
386
|
+
maxConcurrency: parseInt(options['max-agents']) || 6,
|
|
387
|
+
timeout: parseInt(options.timeout) || 14400000, // 4 hours for ML workflows
|
|
388
|
+
logLevel: options.quiet ? 'quiet' : options.verbose ? 'debug' : 'info',
|
|
389
|
+
workflowName: 'MLE-STAR Machine Learning Engineering Workflow',
|
|
390
|
+
workflowType: 'ml',
|
|
391
|
+
enableChaining: options.chaining !== false, // Default to true for stream-json chaining
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
// Prepare MLE-STAR specific variables
|
|
395
|
+
const variables = {
|
|
396
|
+
dataset_path: datasetPath,
|
|
397
|
+
target_column: targetColumn,
|
|
398
|
+
experiment_name: options.name || `mle-star-${Date.now()}`,
|
|
399
|
+
model_output_dir: options.output || './models/',
|
|
400
|
+
search_iterations: parseInt(options['search-iterations']) || 3,
|
|
401
|
+
refinement_iterations: parseInt(options['refinement-iterations']) || 5,
|
|
402
|
+
...((options.variables && JSON.parse(options.variables)) || {}),
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
if (options.quiet) {
|
|
406
|
+
console.log(
|
|
407
|
+
`📊 Running MLE-STAR: ${variables.dataset_path} → ${variables.target_column} (${executor.options.enableClaude ? 'Claude enabled' : 'Simulation'})`,
|
|
408
|
+
);
|
|
409
|
+
console.log();
|
|
410
|
+
} else {
|
|
411
|
+
console.log(`📊 Configuration:`);
|
|
412
|
+
console.log(` Dataset: ${variables.dataset_path}`);
|
|
413
|
+
console.log(` Target: ${variables.target_column}`);
|
|
414
|
+
console.log(` Output: ${variables.model_output_dir}`);
|
|
415
|
+
console.log(
|
|
416
|
+
` Claude Integration: ${executor.options.enableClaude ? 'Enabled' : 'Disabled'}`,
|
|
417
|
+
);
|
|
418
|
+
console.log(
|
|
419
|
+
` Execution Mode: ${isNonInteractive ? 'Non-interactive (default)' : 'Interactive'}`,
|
|
420
|
+
);
|
|
421
|
+
console.log(
|
|
422
|
+
` Stream Chaining: ${executor.options.enableChaining && executor.options.outputFormat === 'stream-json' ? 'Enabled' : 'Disabled'}`,
|
|
423
|
+
);
|
|
424
|
+
console.log();
|
|
425
|
+
|
|
426
|
+
if (isNonInteractive && options.claude !== false) {
|
|
427
|
+
console.log(`💡 Running in non-interactive mode: Each agent will execute independently`);
|
|
428
|
+
if (executor.options.enableChaining && executor.options.outputFormat === 'stream-json') {
|
|
429
|
+
console.log(
|
|
430
|
+
`🔗 Stream chaining enabled: Agent outputs will be piped to dependent agents`,
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
console.log(` To use interactive mode instead, add --interactive flag`);
|
|
434
|
+
console.log();
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
if (!options.claude && !options['no-claude-warning']) {
|
|
439
|
+
printWarning(
|
|
440
|
+
'MLE-STAR works best with Claude integration. Add --claude flag for full automation.',
|
|
441
|
+
);
|
|
442
|
+
console.log('Without Claude, this will simulate the workflow execution.');
|
|
443
|
+
console.log();
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// Execute MLE-STAR workflow
|
|
447
|
+
const result = await executor.executeWorkflow(workflowData, variables);
|
|
448
|
+
|
|
449
|
+
if (result.success) {
|
|
450
|
+
console.log();
|
|
451
|
+
printSuccess('🎉 MLE-STAR workflow completed successfully!');
|
|
452
|
+
console.log(`📊 Results: ${result.completedTasks}/${result.totalTasks} tasks completed`);
|
|
453
|
+
console.log(`⏱️ Duration: ${executor.formatDuration(result.duration)}`);
|
|
454
|
+
console.log(`🆔 Execution ID: ${result.executionId}`);
|
|
455
|
+
|
|
456
|
+
if (result.results && Object.keys(result.results).length > 0) {
|
|
457
|
+
console.log(`\n📈 Key Results:`);
|
|
458
|
+
Object.entries(result.results).forEach(([taskId, taskResult]) => {
|
|
459
|
+
if (taskResult.output?.status === 'completed') {
|
|
460
|
+
console.log(` ✅ ${taskId}: Completed successfully`);
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
console.log(`\n💡 Next Steps:`);
|
|
466
|
+
console.log(` • Check models in: ${variables.model_output_dir}`);
|
|
467
|
+
console.log(` • Review experiment: ${variables.experiment_name}`);
|
|
468
|
+
console.log(` • Validate results with your test data`);
|
|
469
|
+
} else {
|
|
470
|
+
printError('❌ MLE-STAR workflow failed');
|
|
471
|
+
console.log(`📊 Progress: ${result.completedTasks}/${result.totalTasks} tasks completed`);
|
|
472
|
+
|
|
473
|
+
if (result.errors.length > 0) {
|
|
474
|
+
console.log('\n🔍 Errors:');
|
|
475
|
+
result.errors.forEach((error) => {
|
|
476
|
+
console.log(` • ${error.type}: ${error.error}`);
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
if (options['output-format'] === 'json') {
|
|
482
|
+
console.log('\n' + JSON.stringify(result, null, 2));
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Ensure process exits properly in non-interactive mode
|
|
486
|
+
if (options['non-interactive'] || options.nonInteractive) {
|
|
487
|
+
process.exit(result.success ? 0 : 1);
|
|
488
|
+
}
|
|
489
|
+
} catch (error) {
|
|
490
|
+
printError(`MLE-STAR execution failed: ${error.message}`);
|
|
491
|
+
if (options['non-interactive'] || options.nonInteractive) {
|
|
492
|
+
process.exit(1);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
function showAutomationHelp() {
|
|
498
|
+
console.log(`
|
|
499
|
+
🤖 Automation Commands - Intelligent Agent & Workflow Management
|
|
500
|
+
|
|
501
|
+
USAGE:
|
|
502
|
+
claude-flow automation <command> [options]
|
|
503
|
+
|
|
504
|
+
COMMANDS:
|
|
505
|
+
auto-agent Automatically spawn optimal agents based on task complexity
|
|
506
|
+
smart-spawn Intelligently spawn agents based on specific requirements
|
|
507
|
+
workflow-select Select and configure optimal workflows for project types
|
|
508
|
+
run-workflow Execute workflows from JSON/YAML files with Claude integration
|
|
509
|
+
mle-star Run MLE-STAR Machine Learning Engineering workflow (flagship)
|
|
510
|
+
|
|
511
|
+
AUTO-AGENT OPTIONS:
|
|
512
|
+
--task-complexity <level> Task complexity level (default: medium)
|
|
513
|
+
Options: low, medium, high, enterprise
|
|
514
|
+
--swarm-id <id> Target swarm ID for agent spawning
|
|
515
|
+
|
|
516
|
+
SMART-SPAWN OPTIONS:
|
|
517
|
+
--requirement <req> Specific requirement description
|
|
518
|
+
Examples: "web-development", "data-analysis", "enterprise-api"
|
|
519
|
+
--max-agents <n> Maximum number of agents to spawn (default: 10)
|
|
520
|
+
|
|
521
|
+
WORKFLOW-SELECT OPTIONS:
|
|
522
|
+
--project-type <type> Project type (default: general)
|
|
523
|
+
Options: web-app, api, data-analysis, enterprise, general
|
|
524
|
+
--priority <priority> Optimization priority (default: balanced)
|
|
525
|
+
Options: speed, quality, cost, balanced
|
|
526
|
+
|
|
527
|
+
RUN-WORKFLOW OPTIONS:
|
|
528
|
+
--claude Enable Claude CLI integration for actual execution
|
|
529
|
+
--non-interactive Run in non-interactive mode (no prompts)
|
|
530
|
+
--output-format <format> Output format (text, json)
|
|
531
|
+
--variables <json> Override workflow variables (JSON format)
|
|
532
|
+
--max-concurrency <n> Maximum concurrent tasks (default: 3)
|
|
533
|
+
--timeout <ms> Execution timeout in milliseconds
|
|
534
|
+
--verbose Enable detailed logging
|
|
535
|
+
|
|
536
|
+
MLE-STAR OPTIONS:
|
|
537
|
+
--claude Enable Claude CLI integration (recommended)
|
|
538
|
+
--dataset <path> Path to dataset file (default: ./data/dataset.csv)
|
|
539
|
+
--target <column> Target column name (default: target)
|
|
540
|
+
--output <dir> Model output directory (default: ./models/)
|
|
541
|
+
--name <experiment> Experiment name for tracking
|
|
542
|
+
--search-iterations <n> Web search iterations (default: 3)
|
|
543
|
+
--refinement-iterations <n> Refinement cycles (default: 5)
|
|
544
|
+
--max-agents <n> Maximum agents to spawn (default: 6)
|
|
545
|
+
--interactive Use interactive mode with master coordinator (single Claude instance)
|
|
546
|
+
--non-interactive Force non-interactive mode (default for MLE-STAR)
|
|
547
|
+
--output-format <format> Output format (stream-json enables chaining)
|
|
548
|
+
--chaining Enable stream-json chaining between agents (default: true)
|
|
549
|
+
--no-chaining Disable stream-json chaining
|
|
550
|
+
--no-claude-warning Suppress Claude integration warnings
|
|
551
|
+
--quiet Minimal output (only show major progress milestones)
|
|
552
|
+
--verbose Detailed output with all agent activities
|
|
553
|
+
|
|
554
|
+
STREAM CHAINING:
|
|
555
|
+
Stream chaining automatically pipes output from one agent to the next based on task dependencies.
|
|
556
|
+
When enabled (default), agents can pass rich context and results directly to dependent tasks.
|
|
557
|
+
|
|
558
|
+
Benefits:
|
|
559
|
+
• 40-60% faster execution vs file-based handoffs
|
|
560
|
+
• 100% context preservation between agents
|
|
561
|
+
• Real-time processing without intermediate files
|
|
562
|
+
• Automatic dependency detection and piping
|
|
563
|
+
|
|
564
|
+
The system detects task dependencies and creates chains like:
|
|
565
|
+
search_agent → foundation_agent → refinement_agent → validation_agent
|
|
566
|
+
|
|
567
|
+
Example workflow with chaining:
|
|
568
|
+
{
|
|
569
|
+
"tasks": [
|
|
570
|
+
{ "id": "analyze", "assignTo": "researcher" },
|
|
571
|
+
{ "id": "process", "assignTo": "processor", "depends": ["analyze"] },
|
|
572
|
+
{ "id": "validate", "assignTo": "validator", "depends": ["process"] }
|
|
573
|
+
]
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
With stream-json chaining, the researcher's output flows directly to the processor,
|
|
577
|
+
and the processor's output flows to the validator - no intermediate files needed!
|
|
578
|
+
|
|
579
|
+
EXAMPLES:
|
|
580
|
+
# Auto-spawn for complex enterprise task
|
|
581
|
+
claude-flow automation auto-agent --task-complexity enterprise --swarm-id swarm-123
|
|
582
|
+
|
|
583
|
+
# Smart spawn for web development
|
|
584
|
+
claude-flow automation smart-spawn --requirement "web-development" --max-agents 8
|
|
585
|
+
|
|
586
|
+
# Select workflow for API project optimized for speed
|
|
587
|
+
claude-flow automation workflow-select --project-type api --priority speed
|
|
588
|
+
|
|
589
|
+
# Execute custom workflow with Claude integration
|
|
590
|
+
claude-flow automation run-workflow my-workflow.json --claude --non-interactive
|
|
591
|
+
|
|
592
|
+
# Run MLE-STAR ML engineering workflow (flagship command) - non-interactive by default
|
|
593
|
+
claude-flow automation mle-star --dataset data/train.csv --target price --claude
|
|
594
|
+
|
|
595
|
+
# MLE-STAR with custom configuration
|
|
596
|
+
claude-flow automation mle-star --dataset sales.csv --target revenue --output models/sales/ --name "sales-prediction" --search-iterations 5
|
|
597
|
+
|
|
598
|
+
# MLE-STAR with interactive mode (single Claude coordinator)
|
|
599
|
+
claude-flow automation mle-star --dataset data.csv --target label --claude --interactive
|
|
600
|
+
|
|
601
|
+
# MLE-STAR with stream-json chaining (agents pipe outputs to each other)
|
|
602
|
+
claude-flow automation mle-star --dataset data.csv --target label --claude --output-format stream-json
|
|
603
|
+
|
|
604
|
+
# MLE-STAR with minimal output for CI/CD pipelines
|
|
605
|
+
claude-flow automation mle-star --dataset data.csv --target label --claude --quiet
|
|
606
|
+
|
|
607
|
+
# Custom workflow with stream chaining enabled
|
|
608
|
+
claude-flow automation run-workflow analysis-pipeline.json --claude --output-format stream-json
|
|
609
|
+
|
|
610
|
+
# Disable chaining for independent task execution
|
|
611
|
+
claude-flow automation mle-star --dataset data.csv --target label --claude --no-chaining
|
|
612
|
+
|
|
613
|
+
# View stream chaining in action with verbose output
|
|
614
|
+
claude-flow automation mle-star --dataset data.csv --target label --claude --verbose
|
|
615
|
+
|
|
616
|
+
🎯 Automation benefits:
|
|
617
|
+
• Optimal resource allocation
|
|
618
|
+
• Intelligent agent selection
|
|
619
|
+
• Workflow optimization
|
|
620
|
+
• Reduced manual configuration
|
|
621
|
+
• Performance-based scaling
|
|
622
|
+
• Claude CLI integration for actual execution
|
|
623
|
+
• MLE-STAR methodology for ML engineering
|
|
624
|
+
• Non-interactive mode for CI/CD integration
|
|
625
|
+
• Comprehensive workflow templates
|
|
626
|
+
`);
|
|
627
|
+
}
|