claude-flow 2.7.43 → 2.7.45

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/bin/claude-flow CHANGED
@@ -2,7 +2,7 @@
2
2
  # Claude-Flow Smart Dispatcher - Detects and uses the best available runtime
3
3
  # Enhanced with NPX cache error handling and retry logic
4
4
 
5
- VERSION="2.7.43"
5
+ VERSION="2.7.45"
6
6
 
7
7
  # Determine the correct path based on how the script is invoked
8
8
  if [ -L "$0" ]; then
@@ -1,47 +1,18 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env -S deno run --allow-all
2
+ import { promises as fs } from 'node:fs';
2
3
  import { executeCommand, hasCommand, showCommandHelp, listCommands } from './command-registry.js';
3
4
  import { parseFlags } from './utils.js';
4
- import { args, cwd, isMainModule, exit, readTextFile, writeTextFile, mkdirAsync, errors } from './node-compat.js';
5
- import { spawn } from 'child_process';
6
- import process from 'process';
7
- import readline from 'readline';
8
- import { getMainHelp, getCommandHelp, getStandardizedCommandHelp } from './help-text.js';
9
5
  import { VERSION } from '../core/version.js';
10
- const LEGACY_AGENT_MAPPING = {
11
- analyst: 'code-analyzer',
12
- coordinator: 'task-orchestrator',
13
- optimizer: 'perf-analyzer',
14
- documenter: 'api-docs',
15
- monitor: 'performance-benchmarker',
16
- specialist: 'system-architect',
17
- architect: 'system-architect'
18
- };
19
- function resolveLegacyAgentType(legacyType) {
20
- return LEGACY_AGENT_MAPPING[legacyType] || legacyType;
21
- }
22
- function printHelp(plain = false) {
23
- console.log(getMainHelp(plain));
24
- }
25
- function printCommandHelp(command) {
26
- const standardCommands = [
27
- 'agent',
28
- 'sparc',
29
- 'memory'
30
- ];
31
- if (standardCommands.includes(command)) {
32
- const help = getStandardizedCommandHelp(command);
33
- console.log(help);
34
- } else {
35
- const help = getCommandHelp(command);
36
- console.log(help);
37
- }
38
- }
39
- function printLegacyHelp() {
6
+ function printHelp() {
40
7
  console.log(`
41
8
  🌊 Claude-Flow v${VERSION} - Enterprise-Grade AI Agent Orchestration Platform
42
9
 
43
- 🎯 ENTERPRISE FEATURES: Complete ruv-swarm integration with 90+ MCP tools, neural networking, and production-ready infrastructure
44
- ALPHA 85: Advanced automation capabilities & stream-JSON chaining for multi-agent pipelines
10
+ 🎯 NEW IN v2.6.0: Multi-Provider Execution Engine with Agentic-Flow Integration
11
+ 66+ specialized agents with multi-provider support (Anthropic, OpenRouter, ONNX, Gemini)
12
+ • 99% cost savings with OpenRouter, 352x faster local edits with Agent Booster
13
+ • Complete backwards compatibility with existing features
14
+
15
+ 🎯 ENTERPRISE FEATURES: Complete ruv-swarm integration with 27 MCP tools, neural networking, and production-ready infrastructure
45
16
 
46
17
  USAGE:
47
18
  claude-flow <command> [options]
@@ -77,9 +48,10 @@ USAGE:
77
48
  init [--sparc] # Initialize with enterprise environment + ruv-swarm
78
49
  start [--ui] [--swarm] # Start orchestration with swarm intelligence
79
50
  spawn <type> [--name] # Create AI agent with swarm coordination
80
- agent <subcommand> # Advanced agent management with neural patterns
51
+ agent <subcommand> # 🆕 Multi-provider agent execution + management
81
52
  sparc <subcommand> # 17 SPARC modes with neural enhancement
82
53
  memory <subcommand> # Cross-session persistent memory with neural learning
54
+ config <subcommand> # 🆕 Provider configuration management
83
55
  status # Comprehensive system status with performance metrics
84
56
 
85
57
  🤖 NEURAL AGENT TYPES (ruv-swarm Integration):
@@ -94,20 +66,25 @@ USAGE:
94
66
 
95
67
  🎮 ENTERPRISE QUICK START:
96
68
  # Initialize enterprise environment
97
- npx claude-flow@2.0.0 init --sparc
98
-
69
+ npx claude-flow@2.6.0-alpha.1 init --sparc
70
+
71
+ # 🆕 Execute agents with multi-provider support
72
+ ./claude-flow agent run coder "Build REST API with auth" --provider anthropic
73
+ ./claude-flow agent run researcher "Research React 19" --provider openrouter # 99% cost savings
74
+ ./claude-flow agent agents # List all 66+ available agents
75
+
99
76
  # Start enterprise orchestration with swarm intelligence
100
77
  ./claude-flow start --ui --swarm
101
-
78
+
102
79
  # Deploy intelligent multi-agent development workflow
103
80
  ./claude-flow swarm "build enterprise API" --strategy development --parallel --monitor
104
-
81
+
105
82
  # GitHub workflow automation
106
83
  ./claude-flow github pr-manager "coordinate release with automated testing"
107
-
84
+
108
85
  # Neural memory management
109
86
  ./claude-flow memory store "architecture" "microservices with API gateway pattern"
110
-
87
+
111
88
  # Real-time system monitoring
112
89
  ./claude-flow status --verbose
113
90
 
@@ -175,8 +152,8 @@ function printSuccess(message) {
175
152
  function printWarning(message) {
176
153
  console.warn(`⚠️ Warning: ${message}`);
177
154
  }
178
- function showHelpWithCommands(plain = false) {
179
- printHelp(plain);
155
+ function showHelpWithCommands() {
156
+ printHelp();
180
157
  console.log('\nRegistered Commands:');
181
158
  const commands = listCommands();
182
159
  for (const command of commands){
@@ -185,58 +162,14 @@ function showHelpWithCommands(plain = false) {
185
162
  console.log('\nUse "claude-flow help <command>" for detailed usage information');
186
163
  }
187
164
  async function main() {
165
+ const args = Deno.args;
188
166
  if (args.length === 0) {
189
- printHelp(usePlainHelp);
167
+ printHelp();
190
168
  return;
191
169
  }
192
170
  const command = args[0];
193
171
  const { flags, args: parsedArgs } = parseFlags(args.slice(1));
194
- const usePlainHelp = args.includes('--plain');
195
- let enhancedFlags = flags;
196
- try {
197
- const { detectExecutionEnvironment, applySmartDefaults } = await import('./utils/environment-detector.js');
198
- enhancedFlags = applySmartDefaults(flags);
199
- enhancedFlags._environment = detectExecutionEnvironment({
200
- skipWarnings: true
201
- });
202
- } catch (e) {
203
- enhancedFlags = flags;
204
- }
205
- if (command !== 'help' && command !== '--help' && command !== '-h' && (enhancedFlags.help || enhancedFlags.h)) {
206
- const detailedHelp = getCommandHelp(command);
207
- if (detailedHelp && !detailedHelp.includes('Help not available')) {
208
- printCommandHelp(command);
209
- } else if (hasCommand(command)) {
210
- showCommandHelp(command);
211
- } else {
212
- printError(`Unknown command: ${command}`);
213
- console.log('\nRun "claude-flow --help" to see available commands.');
214
- }
215
- return;
216
- }
217
172
  switch(command){
218
- case 'env-check':
219
- case 'environment':
220
- if (enhancedFlags._environment) {
221
- const env = enhancedFlags._environment;
222
- console.log(`\n🖥️ Environment Detection Results:`);
223
- console.log(` Terminal: ${env.terminalType}`);
224
- console.log(` Interactive: ${env.isInteractive ? 'Yes' : 'No'}`);
225
- console.log(` TTY Support: ${env.supportsRawMode ? 'Yes' : 'No'}`);
226
- console.log(` Detected: ${env.isVSCode ? 'VS Code' : env.isCI ? 'CI/CD' : env.isDocker ? 'Docker' : env.isSSH ? 'SSH' : 'Standard Terminal'}`);
227
- if (env.recommendedFlags.length > 0) {
228
- console.log(`\n💡 Recommended flags:`);
229
- console.log(` ${env.recommendedFlags.join(' ')}`);
230
- }
231
- if (enhancedFlags.appliedDefaults && enhancedFlags.appliedDefaults.length > 0) {
232
- console.log(`\n✅ Auto-applied:`);
233
- console.log(` ${enhancedFlags.appliedDefaults.join(' ')}`);
234
- }
235
- console.log();
236
- } else {
237
- console.log('Environment detection not available');
238
- }
239
- return;
240
173
  case 'version':
241
174
  case '--version':
242
175
  case '-v':
@@ -246,14 +179,9 @@ async function main() {
246
179
  case '--help':
247
180
  case '-h':
248
181
  if (parsedArgs.length > 0) {
249
- const detailedHelp = getCommandHelp(parsedArgs[0]);
250
- if (detailedHelp && !detailedHelp.includes('Help not available')) {
251
- printCommandHelp(parsedArgs[0]);
252
- } else {
253
- showCommandHelp(parsedArgs[0]);
254
- }
182
+ showCommandHelp(parsedArgs[0]);
255
183
  } else {
256
- printHelp(usePlainHelp);
184
+ showHelpWithCommands();
257
185
  }
258
186
  return;
259
187
  }
@@ -263,7 +191,6 @@ async function main() {
263
191
  return;
264
192
  } catch (err) {
265
193
  printError(err.message);
266
- console.log(`\nRun "claude-flow ${command} --help" for usage information.`);
267
194
  return;
268
195
  }
269
196
  }
@@ -283,12 +210,11 @@ async function main() {
283
210
  console.log('📊 Real-time monitoring would display here');
284
211
  break;
285
212
  case 'spawn':
286
- const rawSpawnType = subArgs[0] || 'general';
287
- const spawnType = resolveLegacyAgentType(rawSpawnType);
213
+ const spawnType = subArgs[0] || 'general';
288
214
  const spawnName = flags.name || `agent-${Date.now()}`;
289
215
  printSuccess(`Spawning ${spawnType} agent: ${spawnName}`);
290
216
  console.log('🤖 Agent would be created with the following configuration:');
291
- console.log(` Type: ${spawnType}${rawSpawnType !== spawnType ? ` (resolved from: ${rawSpawnType})` : ''}`);
217
+ console.log(` Type: ${spawnType}`);
292
218
  console.log(` Name: ${spawnName}`);
293
219
  console.log(' Capabilities: Research, Analysis, Code Generation');
294
220
  console.log(' Status: Ready');
@@ -313,7 +239,7 @@ async function main() {
313
239
  console.log(' • Max Pool Size: 10');
314
240
  console.log(' • Idle Timeout: 5 minutes');
315
241
  console.log(' • Shell: /bin/bash');
316
- console.log(' • Working Directory: ' + cwd());
242
+ console.log(' • Working Directory: ' + process.cwd());
317
243
  console.log(' Performance:');
318
244
  console.log(' • Average Response Time: N/A');
319
245
  console.log(' • Terminal Creation Time: N/A');
@@ -362,7 +288,7 @@ async function main() {
362
288
  const terminalConfig = {
363
289
  name: nameIndex >= 0 ? subArgs[nameIndex + 1] : 'terminal-' + Date.now(),
364
290
  shell: shellIndex >= 0 ? subArgs[shellIndex + 1] : 'bash',
365
- workingDirectory: wdIndex >= 0 ? subArgs[wdIndex + 1] : cwd(),
291
+ workingDirectory: wdIndex >= 0 ? subArgs[wdIndex + 1] : process.cwd(),
366
292
  env: envIndex >= 0 ? subArgs[envIndex + 1] : '',
367
293
  persistent: persistentIndex >= 0
368
294
  };
@@ -1319,9 +1245,10 @@ ${flags1.mode === 'full' || !flags1.mode ? `Full-stack development covering all
1319
1245
  console.log('Debug - Executing command:');
1320
1246
  console.log(`claude ${claudeArgs.map((arg)=>arg.includes(' ') || arg.includes('\n') ? `"${arg}"` : arg).join(' ')}`);
1321
1247
  }
1322
- const child = spawn('claude', claudeArgs, {
1248
+ const command = new Deno.Command('claude', {
1249
+ args: claudeArgs,
1323
1250
  env: {
1324
- ...process.env,
1251
+ ...Deno.env.toObject(),
1325
1252
  CLAUDE_INSTANCE_ID: instanceId,
1326
1253
  CLAUDE_FLOW_MODE: flags1.mode || 'full',
1327
1254
  CLAUDE_FLOW_COVERAGE: (flags1.coverage || 80).toString(),
@@ -1331,18 +1258,17 @@ ${flags1.mode === 'full' || !flags1.mode ? `Full-stack development covering all
1331
1258
  CLAUDE_FLOW_COORDINATION_ENABLED: flags1.parallel ? 'true' : 'false',
1332
1259
  CLAUDE_FLOW_FEATURES: 'memory,coordination,swarm'
1333
1260
  },
1334
- stdio: 'inherit'
1335
- });
1336
- await new Promise((resolve)=>{
1337
- child.on('exit', (code)=>{
1338
- if (code === 0) {
1339
- printSuccess(`Claude instance ${instanceId} completed successfully`);
1340
- } else {
1341
- printError(`Claude instance ${instanceId} exited with code ${code}`);
1342
- }
1343
- resolve();
1344
- });
1261
+ stdin: 'inherit',
1262
+ stdout: 'inherit',
1263
+ stderr: 'inherit'
1345
1264
  });
1265
+ const child = command.spawn();
1266
+ const status = await child.status;
1267
+ if (status.success) {
1268
+ printSuccess(`Claude instance ${instanceId} completed successfully`);
1269
+ } else {
1270
+ printError(`Claude instance ${instanceId} exited with code ${status.code}`);
1271
+ }
1346
1272
  } catch (err) {
1347
1273
  printError(`Failed to spawn Claude: ${err.message}`);
1348
1274
  console.log('Make sure you have the Claude CLI installed.');
@@ -1895,7 +1821,7 @@ ${flags1.mode === 'full' || !flags1.mode ? `Full-stack development covering all
1895
1821
  console.log('\nDid you mean:');
1896
1822
  suggestions.forEach((cmd)=>console.log(` claude-flow ${cmd}`));
1897
1823
  }
1898
- exit(1);
1824
+ process.exit(1);
1899
1825
  }
1900
1826
  }
1901
1827
  async function startRepl() {
@@ -1973,7 +1899,7 @@ Shortcuts:
1973
1899
  },
1974
1900
  config: async (key)=>{
1975
1901
  try {
1976
- const config = JSON.parse(await readTextFile('claude-flow.config.json'));
1902
+ const config = JSON.parse(await fs.readFile('claude-flow.config.json', 'utf-8'));
1977
1903
  if (key) {
1978
1904
  const keys = key.split('.');
1979
1905
  let value = config;
@@ -2001,25 +1927,21 @@ Shortcuts:
2001
1927
  if (trimmed.startsWith('!')) {
2002
1928
  const shellCmd = trimmed.substring(1);
2003
1929
  try {
2004
- await new Promise((resolve)=>{
2005
- const proc = spawn('sh', [
1930
+ const command = new Deno.Command('sh', {
1931
+ args: [
2006
1932
  '-c',
2007
1933
  shellCmd
2008
- ], {
2009
- stdio: [
2010
- 'inherit',
2011
- 'pipe',
2012
- 'pipe'
2013
- ]
2014
- });
2015
- proc.stdout.on('data', (data)=>{
2016
- console.log(data.toString());
2017
- });
2018
- proc.stderr.on('data', (data)=>{
2019
- console.error(data.toString());
2020
- });
2021
- proc.on('exit', resolve);
1934
+ ],
1935
+ stdout: 'piped',
1936
+ stderr: 'piped'
2022
1937
  });
1938
+ const { stdout, stderr } = await command.output();
1939
+ if (stdout.length > 0) {
1940
+ console.log(new TextDecoder().decode(stdout));
1941
+ }
1942
+ if (stderr.length > 0) {
1943
+ console.error(new TextDecoder().decode(stderr));
1944
+ }
2023
1945
  } catch (err) {
2024
1946
  console.error(`Shell error: ${err.message}`);
2025
1947
  }
@@ -2039,7 +1961,7 @@ Shortcuts:
2039
1961
  const parts = trimmed.split(' ');
2040
1962
  const command = parts[0];
2041
1963
  const args = parts.slice(1);
2042
- if (replCommands[command]) {
1964
+ if (command in replCommands) {
2043
1965
  await replCommands[command](...args);
2044
1966
  return true;
2045
1967
  }
@@ -2060,8 +1982,7 @@ Shortcuts:
2060
1982
  const subCmd = args[0];
2061
1983
  switch(subCmd){
2062
1984
  case 'spawn':
2063
- const rawType = args[1] || 'researcher';
2064
- const type = resolveLegacyAgentType(rawType);
1985
+ const type = args[1] || 'researcher';
2065
1986
  const name = args[2] || `agent-${Date.now()}`;
2066
1987
  const agent = {
2067
1988
  id: `agent-${Date.now()}`,
@@ -2266,33 +2187,18 @@ Shortcuts:
2266
2187
  console.log('Terminal commands: create, list, exec, attach, detach');
2267
2188
  }
2268
2189
  }
2269
- const rl = readline.createInterface({
2270
- input: process.stdin,
2271
- output: process.stdout
2272
- });
2273
- function updatePrompt() {
2274
- rl.setPrompt(replState.currentSession ? `claude-flow:${replState.currentSession}> ` : 'claude-flow> ');
2275
- }
2276
- updatePrompt();
2277
- rl.prompt();
2278
- rl.on('line', async (input)=>{
2279
- input = input.trim();
2190
+ const decoder = new TextDecoder();
2191
+ const encoder = new TextEncoder();
2192
+ while(true){
2193
+ const prompt = replState.currentSession ? `claude-flow:${replState.currentSession}> ` : 'claude-flow> ';
2194
+ await Deno.stdout.write(encoder.encode(prompt));
2195
+ const buf = new Uint8Array(1024);
2196
+ const n = await Deno.stdin.read(buf);
2197
+ if (n === null) break;
2198
+ const input = decoder.decode(buf.subarray(0, n)).trim();
2280
2199
  const shouldContinue = await processReplCommand(input);
2281
- if (!shouldContinue) {
2282
- rl.close();
2283
- } else {
2284
- updatePrompt();
2285
- rl.prompt();
2286
- }
2287
- });
2288
- rl.on('SIGINT', ()=>{
2289
- console.log('\nExiting Claude-Flow...');
2290
- rl.close();
2291
- process.exit(0);
2292
- });
2293
- return new Promise((resolve)=>{
2294
- rl.on('close', resolve);
2295
- });
2200
+ if (!shouldContinue) break;
2201
+ }
2296
2202
  }
2297
2203
  function createMinimalClaudeMd() {
2298
2204
  return `# Claude Code Integration
@@ -2609,30 +2515,30 @@ async function createSparcStructureManually() {
2609
2515
  ];
2610
2516
  for (const dir of rooDirectories){
2611
2517
  try {
2612
- await mkdirAsync(dir, {
2518
+ await Deno.mkdir(dir, {
2613
2519
  recursive: true
2614
2520
  });
2615
2521
  console.log(` ✓ Created ${dir}/`);
2616
2522
  } catch (err) {
2617
- if (!(err instanceof errors.AlreadyExists)) {
2523
+ if (!(err instanceof Deno.errors.AlreadyExists)) {
2618
2524
  throw err;
2619
2525
  }
2620
2526
  }
2621
2527
  }
2622
2528
  let roomodesContent;
2623
2529
  try {
2624
- roomodesContent = await readTextFile('.roomodes');
2530
+ roomodesContent = await fs.readFile('.roomodes');
2625
2531
  console.log(' ✓ Using existing .roomodes configuration');
2626
2532
  } catch {
2627
2533
  roomodesContent = createBasicRoomodesConfig();
2628
- await writeTextFile('.roomodes', roomodesContent);
2534
+ await fs.writeFile('.roomodes', roomodesContent);
2629
2535
  console.log(' ✓ Created .roomodes configuration');
2630
2536
  }
2631
2537
  const basicWorkflow = createBasicSparcWorkflow();
2632
- await writeTextFile('.roo/workflows/basic-tdd.json', basicWorkflow);
2538
+ await fs.writeFile('.roo/workflows/basic-tdd.json', basicWorkflow);
2633
2539
  console.log(' ✓ Created .roo/workflows/basic-tdd.json');
2634
2540
  const rooReadme = createRooReadme();
2635
- await writeTextFile('.roo/README.md', rooReadme);
2541
+ await fs.writeFile('.roo/README.md', rooReadme);
2636
2542
  console.log(' ✓ Created .roo/README.md');
2637
2543
  console.log(' ✅ Basic SPARC structure created successfully');
2638
2544
  } catch (err) {
@@ -3063,7 +2969,7 @@ This SPARC-enabled project follows a systematic development approach:
3063
2969
  For more information about SPARC methodology, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md
3064
2970
  `;
3065
2971
  }
3066
- if (isMainModule(import.meta.url)) {
2972
+ if (import.meta.url === `file://${process.argv[1]}`) {
3067
2973
  await main();
3068
2974
  }
3069
2975