claude-flow 1.0.53 → 1.0.55

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
@@ -1,20 +1,58 @@
1
1
  #!/usr/bin/env node
2
2
  // note to AI never remove this script from the repository bin directory
3
3
 
4
- // Check if we're in an ES module environment
5
- let isESM = false;
6
- try {
7
- // This will fail in CommonJS environments
8
- eval('import.meta.url');
9
- isESM = true;
10
- } catch {
11
- isESM = false;
4
+ const { spawn } = require('child_process');
5
+ const path = require('path');
6
+ const fs = require('fs');
7
+ const os = require('os');
8
+
9
+ // Check if Deno is installed
10
+ function checkDeno() {
11
+ try {
12
+ const denoPath = process.env.PATH.includes('.deno/bin') ? 'deno' : path.join(os.homedir(), '.deno', 'bin', 'deno');
13
+ require('child_process').execSync(`${denoPath} --version`, { stdio: 'ignore' });
14
+ return denoPath;
15
+ } catch {
16
+ try {
17
+ require('child_process').execSync('deno --version', { stdio: 'ignore' });
18
+ return 'deno';
19
+ } catch {
20
+ return null;
21
+ }
22
+ }
23
+ }
24
+
25
+ const denoPath = checkDeno();
26
+
27
+ if (!denoPath) {
28
+ console.error('Error: Deno is not installed.');
29
+ console.error('');
30
+ console.error('Please install Deno first:');
31
+ console.error(' curl -fsSL https://deno.land/x/install/install.sh | sh');
32
+ console.error('');
33
+ console.error('Or on Windows:');
34
+ console.error(' irm https://deno.land/install.ps1 | iex');
35
+ process.exit(1);
12
36
  }
13
37
 
14
- if (isESM) {
15
- // ES Module version
16
- import('./claude-flow-esm.mjs');
17
- } else {
18
- // CommonJS version
19
- require('./claude-flow-cjs.js');
20
- }
38
+ // Use the simple CLI JavaScript file which works well
39
+ const cliPath = path.join(__dirname, '..', 'src', 'cli', 'simple-cli.js');
40
+
41
+ // Run the CLI with Deno
42
+ const deno = spawn(denoPath, ['run', '--allow-all', '--no-check', cliPath, ...process.argv.slice(2)], {
43
+ stdio: 'inherit',
44
+ // Don't change cwd - stay in the current directory
45
+ env: {
46
+ ...process.env,
47
+ PWD: process.cwd()
48
+ }
49
+ });
50
+
51
+ deno.on('error', (err) => {
52
+ console.error('Failed to start Claude-Flow:', err.message);
53
+ process.exit(1);
54
+ });
55
+
56
+ deno.on('close', (code) => {
57
+ process.exit(code || 0);
58
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow",
3
- "version": "1.0.53",
3
+ "version": "1.0.55",
4
4
  "description": "Advanced AI agent orchestration system for Claude Code",
5
5
  "main": "src/cli/main.ts",
6
6
  "bin": {
@@ -36,9 +36,6 @@
36
36
  },
37
37
  "files": [
38
38
  "bin/claude-flow",
39
- "bin/claude-flow-esm.mjs",
40
- "bin/claude-flow-cjs.js",
41
- "bin/claude-flow-node",
42
39
  "bin/claude-flow-swarm",
43
40
  "bin/claude-flow-swarm-ui",
44
41
  "bin/claude-flow-swarm-monitor",
@@ -13,7 +13,7 @@ import {
13
13
  } from './command-registry.js';
14
14
  import { parseFlags } from './utils.js';
15
15
 
16
- const VERSION = '1.0.49';
16
+ const VERSION = '1.0.55';
17
17
 
18
18
  function printHelp() {
19
19
  console.log(`
@@ -3,8 +3,20 @@
3
3
  * Actual swarm executor that creates files
4
4
  */
5
5
 
6
- import { ensureDir } from "https://deno.land/std@0.208.0/fs/mod.ts";
7
- import { join } from "https://deno.land/std@0.208.0/path/mod.ts";
6
+ // Node.js compatible imports
7
+ import fs from 'fs';
8
+ import path from 'path';
9
+
10
+ // Polyfill for Deno's ensureDir using Node.js fs
11
+ async function ensureDir(dirPath) {
12
+ try {
13
+ await fs.promises.mkdir(dirPath, { recursive: true });
14
+ } catch (error) {
15
+ if (error.code !== 'EEXIST') throw error;
16
+ }
17
+ }
18
+
19
+ const join = path.join;
8
20
 
9
21
  export async function executeSwarm(objective, options = {}) {
10
22
  const swarmId = `swarm_${Math.random().toString(36).substring(2, 11)}_${Math.random().toString(36).substring(2, 11)}`;
@@ -1,102 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { spawn } = require('child_process');
4
- const path = require('path');
5
- const fs = require('fs');
6
- const os = require('os');
7
-
8
- // Check if Deno is installed
9
- function checkDeno() {
10
- try {
11
- const denoPath = process.env.PATH.includes('.deno/bin') ? 'deno' : path.join(os.homedir(), '.deno', 'bin', 'deno');
12
- require('child_process').execSync(`${denoPath} --version`, { stdio: 'ignore' });
13
- return denoPath;
14
- } catch {
15
- try {
16
- require('child_process').execSync('deno --version', { stdio: 'ignore' });
17
- return 'deno';
18
- } catch {
19
- return null;
20
- }
21
- }
22
- }
23
-
24
- // Fallback to Node.js if Deno is not available
25
- function runNodeFallback() {
26
- const nodeCliPath = path.join(__dirname, '..', 'src', 'cli', 'node-fallback.js');
27
-
28
- if (fs.existsSync(nodeCliPath)) {
29
- const nodeProcess = spawn('node', [nodeCliPath, ...process.argv.slice(2)], {
30
- stdio: 'inherit',
31
- env: {
32
- ...process.env,
33
- PWD: process.cwd()
34
- }
35
- });
36
-
37
- nodeProcess.on('error', (err) => {
38
- console.error('Failed to start Claude-Flow with Node.js fallback:', err.message);
39
- process.exit(1);
40
- });
41
-
42
- nodeProcess.on('close', (code) => {
43
- process.exit(code || 0);
44
- });
45
-
46
- return true;
47
- }
48
-
49
- return false;
50
- }
51
-
52
- const denoPath = checkDeno();
53
-
54
- if (!denoPath) {
55
- // Try Node.js fallback
56
- if (runNodeFallback()) {
57
- return;
58
- }
59
-
60
- console.error('Error: Deno is not installed.');
61
- console.error('');
62
- console.error('Please install Deno first:');
63
- console.error(' curl -fsSL https://deno.land/x/install/install.sh | sh');
64
- console.error('');
65
- console.error('Or on Windows:');
66
- console.error(' irm https://deno.land/install.ps1 | iex');
67
- process.exit(1);
68
- }
69
-
70
- // Use the simple CLI JavaScript file which works well
71
- const cliPath = path.join(__dirname, '..', 'src', 'cli', 'simple-cli.js');
72
-
73
- // Check if the CLI file exists
74
- if (!fs.existsSync(cliPath)) {
75
- console.error('Error: CLI file not found at:', cliPath);
76
- console.error('Please reinstall claude-flow or check your installation.');
77
- process.exit(1);
78
- }
79
-
80
- // Run the CLI with Deno
81
- const deno = spawn(denoPath, ['run', '--allow-all', '--no-check', cliPath, ...process.argv.slice(2)], {
82
- stdio: 'inherit',
83
- env: {
84
- ...process.env,
85
- PWD: process.cwd()
86
- }
87
- });
88
-
89
- deno.on('error', (err) => {
90
- console.error('Failed to start Claude-Flow:', err.message);
91
-
92
- // Try fallback if Deno fails
93
- if (runNodeFallback()) {
94
- return;
95
- }
96
-
97
- process.exit(1);
98
- });
99
-
100
- deno.on('close', (code) => {
101
- process.exit(code || 0);
102
- });
@@ -1,62 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { spawn } from 'child_process';
4
- import path from 'path';
5
- import fs from 'fs';
6
- import os from 'os';
7
- import { execSync } from 'child_process';
8
- import { fileURLToPath } from 'url';
9
- import { dirname } from 'path';
10
-
11
- const __filename = fileURLToPath(import.meta.url);
12
- const __dirname = dirname(__filename);
13
-
14
- // Check if Deno is installed
15
- function checkDeno() {
16
- try {
17
- const denoPath = process.env.PATH.includes('.deno/bin') ? 'deno' : path.join(os.homedir(), '.deno', 'bin', 'deno');
18
- execSync(`${denoPath} --version`, { stdio: 'ignore' });
19
- return denoPath;
20
- } catch {
21
- try {
22
- execSync('deno --version', { stdio: 'ignore' });
23
- return 'deno';
24
- } catch {
25
- return null;
26
- }
27
- }
28
- }
29
-
30
- const denoPath = checkDeno();
31
-
32
- if (!denoPath) {
33
- console.error('Error: Deno is not installed.');
34
- console.error('');
35
- console.error('Please install Deno first:');
36
- console.error(' curl -fsSL https://deno.land/x/install/install.sh | sh');
37
- console.error('');
38
- console.error('Or on Windows:');
39
- console.error(' irm https://deno.land/install.ps1 | iex');
40
- process.exit(1);
41
- }
42
-
43
- // Use the simple CLI JavaScript file which works well
44
- const cliPath = path.join(__dirname, '..', 'src', 'cli', 'simple-cli.js');
45
-
46
- // Run the CLI with Deno
47
- const deno = spawn(denoPath, ['run', '--allow-all', '--no-check', cliPath, ...process.argv.slice(2)], {
48
- stdio: 'inherit',
49
- env: {
50
- ...process.env,
51
- PWD: process.cwd()
52
- }
53
- });
54
-
55
- deno.on('error', (err) => {
56
- console.error('Failed to start Claude-Flow:', err.message);
57
- process.exit(1);
58
- });
59
-
60
- deno.on('close', (code) => {
61
- process.exit(code || 0);
62
- });
@@ -1,92 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // Node.js compatible wrapper for Claude-Flow
4
- // This version works in npm-installed environments
5
-
6
- const { spawn } = require('child_process');
7
- const path = require('path');
8
- const fs = require('fs');
9
- const os = require('os');
10
-
11
- // Check if Deno is installed
12
- function checkDeno() {
13
- try {
14
- const denoPath = process.env.PATH.includes('.deno/bin') ? 'deno' : path.join(os.homedir(), '.deno', 'bin', 'deno');
15
- require('child_process').execSync(`${denoPath} --version`, { stdio: 'ignore' });
16
- return denoPath;
17
- } catch {
18
- try {
19
- require('child_process').execSync('deno --version', { stdio: 'ignore' });
20
- return 'deno';
21
- } catch {
22
- return null;
23
- }
24
- }
25
- }
26
-
27
- // Fallback to Node.js if Deno is not available
28
- function runNodeFallback() {
29
- const nodeCliPath = path.join(__dirname, '..', 'src', 'cli', 'node-fallback.js');
30
-
31
- if (fs.existsSync(nodeCliPath)) {
32
- const nodeProcess = spawn('node', [nodeCliPath, ...process.argv.slice(2)], {
33
- stdio: 'inherit',
34
- env: {
35
- ...process.env,
36
- PWD: process.cwd()
37
- }
38
- });
39
-
40
- nodeProcess.on('error', (err) => {
41
- console.error('Failed to start Claude-Flow with Node.js fallback:', err.message);
42
- process.exit(1);
43
- });
44
-
45
- nodeProcess.on('close', (code) => {
46
- process.exit(code || 0);
47
- });
48
-
49
- return true;
50
- }
51
-
52
- return false;
53
- }
54
-
55
- const denoPath = checkDeno();
56
-
57
- if (!denoPath) {
58
- console.log('Deno not found, trying Node.js fallback...');
59
- if (runNodeFallback()) {
60
- return;
61
- }
62
-
63
- console.error('Error: Neither Deno nor Node.js fallback is available.');
64
- console.error('');
65
- console.error('Please install Deno first:');
66
- console.error(' curl -fsSL https://deno.land/x/install/install.sh | sh');
67
- console.error('');
68
- console.error('Or on Windows:');
69
- console.error(' irm https://deno.land/install.ps1 | iex');
70
- process.exit(1);
71
- }
72
-
73
- // Use the simple CLI JavaScript file which works well
74
- const cliPath = path.join(__dirname, '..', 'src', 'cli', 'simple-cli.js');
75
-
76
- // Run the CLI with Deno
77
- const deno = spawn(denoPath, ['run', '--allow-all', '--no-check', cliPath, ...process.argv.slice(2)], {
78
- stdio: 'inherit',
79
- env: {
80
- ...process.env,
81
- PWD: process.cwd()
82
- }
83
- });
84
-
85
- deno.on('error', (err) => {
86
- console.error('Failed to start Claude-Flow:', err.message);
87
- process.exit(1);
88
- });
89
-
90
- deno.on('close', (code) => {
91
- process.exit(code || 0);
92
- });
@@ -1,86 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Node.js fallback for Claude-Flow CLI
4
- * Used when Deno is not available or when running in npm environments
5
- */
6
-
7
- const VERSION = '1.0.50';
8
-
9
- function printHelp() {
10
- console.log(`
11
- 🧠 Claude-Flow v${VERSION} - Advanced AI Agent Orchestration System
12
-
13
- USAGE:
14
- claude-flow <command> [options]
15
-
16
- INSTALLATION & SETUP:
17
- npx claude-flow@latest init --sparc # Initialize SPARC development environment
18
-
19
- The --sparc flag creates:
20
- • .roomodes file with 17 pre-configured SPARC modes
21
- • CLAUDE.md for project instructions
22
- • Ready-to-use TDD and code generation environment
23
-
24
- KEY COMMANDS:
25
- init [--sparc] Initialize project with Claude integration
26
- start [--ui] Start orchestration (--ui for enhanced UI)
27
- spawn <type> [--name <name>] Create AI agent (alias for agent spawn)
28
- agent spawn <type> [--name <name>] Create AI agent (researcher, coder, analyst)
29
- sparc <subcommand> SPARC-based development modes
30
- memory <subcommand> Manage persistent memory
31
- status Show system status
32
-
33
- QUICK START:
34
- npx -y claude-flow@latest init --sparc # First-time setup with SPARC modes
35
- ./claude-flow start --ui # Interactive process management UI
36
- ./claude-flow sparc modes # List available development modes
37
- ./claude-flow sparc "build app" # Run SPARC orchestrator (default)
38
- ./claude-flow status # Check system status
39
-
40
- DENO REQUIREMENT:
41
- This tool requires Deno to run. Please install Deno first:
42
-
43
- Linux/macOS: curl -fsSL https://deno.land/x/install/install.sh | sh
44
- Windows: irm https://deno.land/install.ps1 | iex
45
-
46
- After installing Deno, you can use all Claude-Flow features.
47
-
48
- Documentation: https://github.com/ruvnet/claude-code-flow
49
-
50
- Created by rUv - Built with ❤️ for the Claude community
51
- `);
52
- }
53
-
54
- function main() {
55
- const args = process.argv.slice(2);
56
-
57
- if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
58
- printHelp();
59
- return;
60
- }
61
-
62
- if (args.includes('--version') || args.includes('-v')) {
63
- console.log(`v${VERSION}`);
64
- return;
65
- }
66
-
67
- console.log('❌ This is a Node.js fallback version of Claude-Flow.');
68
- console.log('');
69
- console.log('🦕 Claude-Flow requires Deno for full functionality.');
70
- console.log('');
71
- console.log('Please install Deno:');
72
- console.log(' Linux/macOS: curl -fsSL https://deno.land/x/install/install.sh | sh');
73
- console.log(' Windows: irm https://deno.land/install.ps1 | iex');
74
- console.log('');
75
- console.log('After installation, restart your terminal and try again.');
76
- console.log('');
77
- console.log('For more information, visit: https://github.com/ruvnet/claude-code-flow');
78
-
79
- process.exit(1);
80
- }
81
-
82
- if (require.main === module) {
83
- main();
84
- }
85
-
86
- module.exports = { main };