ruflo 3.10.31 → 3.10.33

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 +21 -1
  2. package/package.json +1 -1
package/bin/ruflo.js CHANGED
@@ -2,10 +2,30 @@
2
2
  // Ruflo CLI - thin wrapper around @claude-flow/cli with ruflo branding
3
3
  import { fileURLToPath, pathToFileURL } from 'node:url';
4
4
  import { dirname, resolve, join } from 'node:path';
5
- import { existsSync } from 'node:fs';
5
+ 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
+
9
29
  // Walk up from ruflo/bin/ to find @claude-flow/cli in node_modules
10
30
  function findCliPath() {
11
31
  let dir = resolve(__dirname, '..');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ruflo",
3
- "version": "3.10.31",
3
+ "version": "3.10.33",
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",