ruflo 3.54.1 → 3.56.0

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.
Files changed (2) hide show
  1. package/bin/ruflo.js +25 -20
  2. package/package.json +2 -2
package/bin/ruflo.js CHANGED
@@ -6,26 +6,6 @@ import { existsSync, readFileSync } from 'node:fs';
6
6
 
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
8
 
9
- // #2256 fast path: --version / -V must NOT trigger heavy imports (the
10
- // downstream @claude-flow/cli dist eagerly loads ruvector + a 23 MB ONNX
11
- // model on cold cache, blocking 60+ s and causing SIGTERM under common
12
- // timeout windows: npx default, MCP stdio 30s window). Resolve version
13
- // from this wrapper's own package.json and exit before any heavy import.
14
- // (bin/cli.js has the same guard for the direct path; needed here too
15
- // because the wrapper imports dist/src/index.js, bypassing bin/cli.js.)
16
- {
17
- const _argv = process.argv.slice(2);
18
- if (_argv.length === 1 && (_argv[0] === '--version' || _argv[0] === '-V')) {
19
- try {
20
- const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8'));
21
- process.stdout.write(`ruflo v${pkg.version || '0.0.0'}\n`);
22
- } catch {
23
- process.stdout.write('ruflo v0.0.0\n');
24
- }
25
- process.exit(0);
26
- }
27
- }
28
-
29
9
  // Walk up from ruflo/bin/ to find @claude-flow/cli in node_modules
30
10
  function findCliPath() {
31
11
  let dir = resolve(__dirname, '..');
@@ -49,6 +29,31 @@ const cliBase = pkgDir
49
29
  ? join(pkgDir, 'node_modules', '@claude-flow', 'cli')
50
30
  : resolve(__dirname, '../../v3/@claude-flow/cli');
51
31
 
32
+ // The exact dependency pin prevents mismatches in normal installs. Existing
33
+ // partial upgrades can still resolve a different CLI (#3306); make that
34
+ // visible on stderr without taking an otherwise working command offline.
35
+ let wrapperVersion = '0.0.0';
36
+ let cliVersion = 'unknown';
37
+ let versionProblem;
38
+ try {
39
+ wrapperVersion = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8')).version;
40
+ cliVersion = JSON.parse(readFileSync(join(cliBase, 'package.json'), 'utf-8')).version;
41
+ } catch (error) {
42
+ versionProblem = `cannot verify installed CLI version: ${error.message}`;
43
+ }
44
+ if (!versionProblem && wrapperVersion !== cliVersion) {
45
+ versionProblem = `wrapper v${wrapperVersion} expects @claude-flow/cli v${wrapperVersion}, but resolved v${cliVersion} at ${cliBase}`;
46
+ }
47
+ if (versionProblem) {
48
+ console.error(`ruflo: warning: ${versionProblem}; continuing. Reinstall ruflo to restore matching versions.`);
49
+ }
50
+
51
+ // #2256: --version / -V must not trigger heavy CLI/model imports.
52
+ if (process.argv.length === 3 && ['--version', '-V'].includes(process.argv[2])) {
53
+ process.stdout.write(`ruflo v${wrapperVersion}\n`);
54
+ process.exit(0);
55
+ }
56
+
52
57
  // MCP mode: delegate to cli.js directly (branding irrelevant for JSON-RPC)
53
58
  const cliArgs = process.argv.slice(2);
54
59
  const isExplicitMCP = cliArgs.length >= 1 && cliArgs[0] === 'mcp' && (cliArgs.length === 1 || cliArgs[1] === 'start');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ruflo",
3
- "version": "3.54.1",
3
+ "version": "3.56.0",
4
4
  "description": "Ruflo - Enterprise AI agent orchestration platform. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
5
5
  "main": "bin/ruflo.js",
6
6
  "type": "module",
@@ -40,7 +40,7 @@
40
40
  "package:rvf": "bash src/scripts/package-rvf.sh"
41
41
  },
42
42
  "dependencies": {
43
- "@claude-flow/cli": "^3.54.1"
43
+ "@claude-flow/cli": "3.56.0"
44
44
  },
45
45
  "optionalDependencies": {},
46
46
  "overrides": {