claude-flow 2.0.0-alpha.74 → 2.0.0-alpha.75

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,7 +1,7 @@
1
1
  #!/bin/sh
2
2
  # Claude-Flow Smart Dispatcher - Detects and uses the best available runtime
3
3
 
4
- VERSION="2.0.0-alpha.74"
4
+ VERSION="2.0.0-alpha.75"
5
5
 
6
6
  # Determine the correct path based on how the script is invoked
7
7
  if [ -L "$0" ]; then
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Claude-Flow Cross-Platform Dispatcher
5
+ * Detects and uses the best available runtime
6
+ */
7
+
8
+ import { fileURLToPath } from 'url';
9
+ import { dirname, join, resolve } from 'path';
10
+ import { existsSync } from 'fs';
11
+ import { spawn } from 'child_process';
12
+ import process from 'process';
13
+
14
+ const VERSION = "2.0.0-alpha.75";
15
+
16
+ // Get script directory and root directory
17
+ const __filename = fileURLToPath(import.meta.url);
18
+ const __dirname = dirname(__filename);
19
+ const ROOT_DIR = resolve(__dirname, '..');
20
+
21
+ // Show help if no arguments provided
22
+ const args = process.argv.slice(2);
23
+ if (args.length === 0) {
24
+ args.push('--help');
25
+ }
26
+
27
+ // Quick version check
28
+ for (const arg of args) {
29
+ if (arg === '--version' || arg === '-v') {
30
+ console.log(`v${VERSION}`);
31
+ process.exit(0);
32
+ }
33
+ }
34
+
35
+ // Try to find the best runtime and execute
36
+ async function main() {
37
+ try {
38
+ // Try JavaScript version first (most reliable)
39
+ const jsFile = join(ROOT_DIR, 'src', 'cli', 'simple-cli.js');
40
+ if (existsSync(jsFile)) {
41
+ const child = spawn('node', [jsFile, ...args], {
42
+ stdio: 'inherit',
43
+ shell: false
44
+ });
45
+
46
+ child.on('error', (error) => {
47
+ console.error('❌ Node.js execution failed:', error.message);
48
+ process.exit(1);
49
+ });
50
+
51
+ child.on('exit', (code) => {
52
+ process.exit(code || 0);
53
+ });
54
+
55
+ return;
56
+ }
57
+
58
+ // Fallback to TypeScript version with tsx
59
+ const tsFile = join(ROOT_DIR, 'src', 'cli', 'simple-cli.ts');
60
+ if (existsSync(tsFile)) {
61
+ const child = spawn('tsx', [tsFile, ...args], {
62
+ stdio: 'inherit',
63
+ shell: false
64
+ });
65
+
66
+ child.on('error', (error) => {
67
+ console.error('❌ tsx execution failed:', error.message);
68
+ console.log('\n🔄 Trying npx tsx...');
69
+
70
+ // Try npx tsx as final fallback
71
+ const npxChild = spawn('npx', ['tsx', tsFile, ...args], {
72
+ stdio: 'inherit',
73
+ shell: false
74
+ });
75
+
76
+ npxChild.on('error', (npxError) => {
77
+ console.error('❌ npx tsx also failed:', npxError.message);
78
+ showFallbackHelp();
79
+ process.exit(1);
80
+ });
81
+
82
+ npxChild.on('exit', (code) => {
83
+ process.exit(code || 0);
84
+ });
85
+ });
86
+
87
+ child.on('exit', (code) => {
88
+ process.exit(code || 0);
89
+ });
90
+
91
+ return;
92
+ }
93
+
94
+ // No runtime found
95
+ showFallbackHelp();
96
+ process.exit(1);
97
+
98
+ } catch (error) {
99
+ console.error('❌ Unexpected error:', error.message);
100
+ showFallbackHelp();
101
+ process.exit(1);
102
+ }
103
+ }
104
+
105
+ function showFallbackHelp() {
106
+ console.log(`🧠 Claude-Flow v${VERSION} - Advanced AI Agent Orchestration System`);
107
+ console.log('');
108
+ console.log('⚠️ No compatible runtime found.');
109
+ console.log('');
110
+ console.log('To install and run:');
111
+ console.log(' 1. Install tsx: npm install -g tsx');
112
+ console.log(' 2. Run: claude-flow <command>');
113
+ console.log('');
114
+ console.log('Or use directly:');
115
+ console.log(' node src/cli/simple-cli.js <command>');
116
+ console.log('');
117
+ console.log('Documentation: https://github.com/ruvnet/claude-code-flow');
118
+ }
119
+
120
+ main();
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "claude-flow",
3
- "version": "2.0.0-alpha.74",
3
+ "version": "2.0.0-alpha.75",
4
4
  "description": "Enterprise-grade AI agent orchestration with ruv-swarm integration (Alpha Release)",
5
5
  "main": "cli.mjs",
6
6
  "bin": {
7
- "claude-flow": "./bin/claude-flow"
7
+ "claude-flow": "./bin/claude-flow.js"
8
8
  },
9
9
  "scripts": {
10
+ "preinstall": "node -e \"if(process.platform === 'win32' && process.env.npm_config_user_agent && process.env.npm_config_user_agent.includes('npm')) { console.warn('⚠️ Warning: On Windows, it is recommended to use pnpm to install this package to avoid potential native dependency build issues.'); console.warn('💡 Try: pnpm install or pnpx claude-flow@alpha'); }\"",
10
11
  "dev": "tsx src/cli/main.ts",
11
12
  "build": "npm run clean && npm run update-version && npm run build:esm && npm run build:cjs && npm run build:binary",
12
13
  "update-version": "node scripts/update-bin-version.js",
@@ -45,7 +46,7 @@
45
46
  "format": "prettier --write 'src/**/*.{ts,js,json}'",
46
47
  "diagnostics": "node -e \"import('./dist/monitoring/diagnostics.js').then(m => m.DiagnosticManager.quickDiagnostic().then(console.log))\"",
47
48
  "health-check": "node -e \"import('./dist/monitoring/health-check.js').then(m => new m.HealthCheckManager().performHealthCheck().then(console.log))\"",
48
- "postinstall": "node scripts/install.js && node scripts/install-arm64.js",
49
+ "postinstall": "node scripts/install-arm64.js",
49
50
  "prepublishOnly": "npm run update-version",
50
51
  "publish:alpha": "npm publish --tag alpha",
51
52
  "publish:major": "npm version major && npm publish",
@@ -105,13 +106,11 @@
105
106
  "dependencies": {
106
107
  "@modelcontextprotocol/sdk": "^1.0.4",
107
108
  "@types/better-sqlite3": "^7.6.13",
108
- "better-sqlite3": "^12.2.0",
109
109
  "blessed": "^0.1.81",
110
110
  "chalk": "^4.1.2",
111
111
  "cli-table3": "^0.6.3",
112
112
  "commander": "^11.1.0",
113
113
  "cors": "^2.8.5",
114
- "diskusage": "^1.1.3",
115
114
  "express": "^4.18.2",
116
115
  "figlet": "^1.8.1",
117
116
  "fs-extra": "^11.2.0",
@@ -120,12 +119,16 @@
120
119
  "helmet": "^7.1.0",
121
120
  "inquirer": "^9.2.12",
122
121
  "nanoid": "^5.0.4",
123
- "node-pty": "^1.0.0",
124
122
  "ora": "^7.0.1",
125
123
  "p-queue": "^8.1.0",
126
124
  "ruv-swarm": "^1.0.14",
127
125
  "ws": "^8.18.3"
128
126
  },
127
+ "optionalDependencies": {
128
+ "better-sqlite3": "^12.2.0",
129
+ "diskusage": "^1.1.3",
130
+ "node-pty": "^1.0.0"
131
+ },
129
132
  "devDependencies": {
130
133
  "@babel/core": "^7.28.0",
131
134
  "@babel/plugin-syntax-import-attributes": "^7.27.1",
@@ -4,7 +4,7 @@ import os from 'node:os';
4
4
  import path from 'node:path';
5
5
  import fs from 'node:fs';
6
6
  import https from 'node:https';
7
- import { spawn } from 'node:child_process';
7
+ import { spawn, exec } from 'node:child_process';
8
8
 
9
9
  console.log('Installing Claude-Flow...');
10
10
 
@@ -26,28 +26,39 @@ async function installDeno() {
26
26
  console.log('Deno not found. Installing Deno...');
27
27
 
28
28
  const platform = os.platform();
29
- const arch = os.arch();
30
29
 
31
30
  if (platform === 'win32') {
32
- console.log('Please install Deno manually from https://deno.land/');
33
- process.exit(1);
34
- }
35
-
36
- return new Promise((resolve, reject) => {
37
- const installScript = spawn('curl', ['-fsSL', 'https://deno.land/x/install/install.sh'], { stdio: 'pipe' });
38
- const sh = spawn('sh', [], { stdio: ['pipe', 'inherit', 'inherit'] });
39
-
40
- installScript.stdout.pipe(sh.stdin);
41
-
42
- sh.on('close', (code) => {
43
- if (code === 0) {
44
- console.log('Deno installed successfully!');
45
- resolve();
46
- } else {
47
- reject(new Error('Failed to install Deno'));
48
- }
31
+ return new Promise((resolve, reject) => {
32
+ console.log('Installing Deno on Windows using PowerShell...');
33
+ const psCommand = `powershell -Command "irm https://deno.land/install.ps1 | iex"`;
34
+ exec(psCommand, (error, stdout, stderr) => {
35
+ if (error) {
36
+ console.error('Failed to install Deno with PowerShell:', stderr);
37
+ console.log('Please install Deno manually from https://deno.land/');
38
+ reject(new Error('Failed to install Deno'));
39
+ } else {
40
+ console.log('Deno installed successfully!');
41
+ resolve();
42
+ }
43
+ });
49
44
  });
50
- });
45
+ } else {
46
+ return new Promise((resolve, reject) => {
47
+ const installScript = spawn('curl', ['-fsSL', 'https://deno.land/x/install/install.sh'], { stdio: 'pipe' });
48
+ const sh = spawn('sh', [], { stdio: ['pipe', 'inherit', 'inherit'] });
49
+
50
+ installScript.stdout.pipe(sh.stdin);
51
+
52
+ sh.on('close', (code) => {
53
+ if (code === 0) {
54
+ console.log('Deno installed successfully!');
55
+ resolve();
56
+ } else {
57
+ reject(new Error('Failed to install Deno'));
58
+ }
59
+ });
60
+ });
61
+ }
51
62
  }
52
63
 
53
64
  // Main installation process
@@ -5,14 +5,14 @@
5
5
 
6
6
  import { HelpFormatter } from './help-formatter.js';
7
7
 
8
- export const VERSION = '2.0.0-alpha.74';
8
+ export const VERSION = '2.0.0-alpha.75';
9
9
 
10
10
  export const MAIN_HELP = `
11
11
  🌊 Claude-Flow v${VERSION} - Enterprise-Grade AI Agent Orchestration Platform
12
12
 
13
13
  🎯 ENTERPRISE FEATURES: Complete ruv-swarm integration with 87 MCP tools, neural networking, and production-ready infrastructure
14
14
  🐝 NEW: Advanced Hive Mind System with Queen-led coordination, collective intelligence, and unlimited scaling
15
- ⚡ ALPHA 74: Fixed SQLite loading & hive-mind sessions, async/await corrections for better reliability
15
+ ⚡ ALPHA 75: Windows compatibility overhaul with cross-platform Node.js dispatcher
16
16
 
17
17
  USAGE:
18
18
  claude-flow <command> [options]
@@ -6,7 +6,7 @@
6
6
  import { readdir, stat, mkdir, readFile, writeFile, unlink, rmdir } from 'fs/promises';
7
7
  import { existsSync } from 'fs';
8
8
  import { fileURLToPath } from 'url';
9
- import { dirname, join } from 'path';
9
+ import { dirname, join, normalize } from 'path';
10
10
  import process from 'process';
11
11
  import { spawn } from 'child_process';
12
12
 
@@ -163,7 +163,7 @@ export const getFilename = (importMetaUrl) => {
163
163
  // Check if this is the main module (Node.js equivalent of import.meta.main)
164
164
  export const isMainModule = (importMetaUrl) => {
165
165
  const __filename = fileURLToPath(importMetaUrl);
166
- return process.argv[1] === __filename;
166
+ return normalize(process.argv[1]) === normalize(__filename);
167
167
  };
168
168
 
169
169
  // Helper to check file existence