Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix(statusline): read installed version from plugin package.json (#1951) (#1960)

rUv7ca28a759369
diff --git a/.claude/helpers/statusline.cjs b/.claude/helpers/statusline.cjs
index 7ae6e47dac..7fdc24edbe 100644
--- a/.claude/helpers/statusline.cjs
+++ b/.claude/helpers/statusline.cjs
@@ -26,18 +26,29 @@ const CONFIG = {
const CWD = process.cwd();
-// Read package version once at startup
+// Read package version once at startup. Probe the plugin's own install
+// location first β€” `~/.claude/plugins/marketplaces/ruflo/package.json` β€” so
+// users who installed via `/plugin install ruflo@ruflo` see the real version,
+// not the hardcoded fallback (#1951).
let pkgVersion = '3.5';
try {
+ const os = require('os');
+ const home = os.homedir();
const pkgPaths = [
+ path.join(home, '.claude', 'plugins', 'marketplaces', 'ruflo', 'package.json'),
path.join(CWD, 'node_modules', '@claude-flow', 'cli', 'package.json'),
+ path.join(CWD, 'node_modules', 'ruflo', 'package.json'),
path.join(CWD, 'v3', '@claude-flow', 'cli', 'package.json'),
];
for (const p of pkgPaths) {
- if (fs.existsSync(p)) {
+ if (!fs.existsSync(p)) continue;
+ try {
const pkg = JSON.parse(fs.readFileSync(p, 'utf-8'));
- if (pkg.version) { pkgVersion = pkg.version; break; }
- }
+ if (pkg && typeof pkg.version === 'string' && pkg.version.length > 0) {
+ pkgVersion = pkg.version;
+ break;
+ }
+ } catch { /* malformed package.json β€” try next */ }
}
} catch { /* use default */ }
diff --git a/v3/@claude-flow/cli/.claude/helpers/statusline.cjs b/v3/@claude-flow/cli/.claude/helpers/statusline.cjs
index 85f0eb870c..d5231eb041 100644
--- a/v3/@claude-flow/cli/.claude/helpers/statusline.cjs
+++ b/v3/@claude-flow/cli/.claude/helpers/statusline.cjs
@@ -25,8 +25,37 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs');
const path = require('path');
+const os = require('os');
const { execSync, execFileSync } = require('child_process');
+// Read the installed plugin version once at startup. Probe the plugin's own
+// install location first (`~/.claude/plugins/marketplaces/ruflo/package.json`),
+// then npm-style installs, then the source-checkout location. The previous
+// code hardcoded `RuFlo V3.5` in the header β€” so users on alpha.27+ still
+// saw V3.5 in the statusline even though `ruflo doctor` reported the real
+// version (#1951).
+let RUFLO_VERSION = '3.6';
+try {
+ const home = os.homedir();
+ const cwd = process.cwd();
+ const pkgPaths = [
+ path.join(home, '.claude', 'plugins', 'marketplaces', 'ruflo', 'package.json'),
+ path.join(cwd, 'node_modules', '@claude-flow', 'cli', 'package.json'),
+ path.join(cwd, 'node_modules', 'ruflo', 'package.json'),
+ path.join(cwd, 'v3', '@claude-flow', 'cli', 'package.json'),
+ ];
+ for (const p of pkgPaths) {
+ if (!fs.existsSync(p)) continue;
+ try {
+ const pkg = JSON.parse(fs.readFileSync(p, 'utf-8'));
+ if (pkg && typeof pkg.version === 'string' && pkg.version.length > 0) {
+ RUFLO_VERSION = pkg.version;
+ break;
+ }
+ } catch { /* malformed package.json β€” try next */ }
+ }
+} catch { /* fall through to the hardcoded default */ }
+
// Configuration
const CONFIG = {
enabled: true,
@@ -402,7 +431,7 @@ function generateStatusline() {
const lines = [];
// Header Line
- let header = `${c.bold}${c.brightPurple}β–Š RuFlo V3.5 ${c.reset}`;
+ let header = `${c.bold}${c.brightPurple}β–Š RuFlo V${RUFLO_VERSION} ${c.reset}`;
header += `${swarm.coordinationActive ? c.brightCyan : c.dim}● ${c.brightCyan}${user.name}${c.reset}`;
if (user.gitBranch) {
header += ` ${c.dim}β”‚${c.reset} ${c.brightBlue}βŽ‡ ${user.gitBranch}${c.reset}`;
@@ -508,7 +537,7 @@ function generateSafeStatusline() {
const lines = [];
// Header Line
- let header = `${c.bold}${c.brightPurple}β–Š RuFlo V3.5 ${c.reset}`;
+ let header = `${c.bold}${c.brightPurple}β–Š RuFlo V${RUFLO_VERSION} ${c.reset}`;
header += `${swarm.coordinationActive ? c.brightCyan : c.dim}● ${c.brightCyan}${user.name}${c.reset}`;
if (user.gitBranch) {
header += ` ${c.dim}β”‚${c.reset} ${c.brightBlue}βŽ‡ ${user.gitBranch}${c.reset}`;
diff --git a/v3/@claude-flow/cli/src/init/statusline-generator.ts b/v3/@claude-flow/cli/src/init/statusline-generator.ts
index 063179c21b..202e288bc2 100644
--- a/v3/@claude-flow/cli/src/init/statusline-generator.ts
+++ b/v3/@claude-flow/cli/src/init/statusline-generator.ts
@@ -641,23 +641,34 @@ function generateStatusline() {
const integration = getIntegrationStatus();
const lines = [];
- // Header
- // Read version from package.json
+ // Header β€” read version from the FIRST package.json we find, preferring
+ // the plugin install at ~/.claude/plugins/marketplaces/ruflo/package.json.
+ // The previous list only checked project-local node_modules, so plugin
+ // users saw the hard-coded fallback (V3.5) even on newer alphas (#1951).
let pkgVersion = '3.6';
try {
- const pkgPath = path.join(CWD, 'node_modules', '@claude-flow', 'cli', 'package.json');
- if (fs.existsSync(pkgPath)) {
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
- if (pkg.version) pkgVersion = pkg.version;
- } else {
- // Try npx-installed location
- const npxPkg = path.join(CWD, 'v3', '@claude-flow', 'cli', 'package.json');
- if (fs.existsSync(npxPkg)) {
- const pkg = JSON.parse(fs.readFileSync(npxPkg, 'utf-8'));
- if (pkg.version) pkgVersion = pkg.version;
- }
+ const home = require('os').homedir();
+ const pkgPaths = [
+ // 1. The plugin's own root (installed via /plugin install).
+ path.join(home, '.claude', 'plugins', 'marketplaces', 'ruflo', 'package.json'),
+ // 2. Project-local @claude-flow/cli β€” npm-style install.
+ path.join(CWD, 'node_modules', '@claude-flow', 'cli', 'package.json'),
+ // 3. Project-local ruflo umbrella.
+ path.join(CWD, 'node_modules', 'ruflo', 'package.json'),
+ // 4. Source-checkout location (when developing in this repo).
+ path.join(CWD, 'v3', '@claude-flow', 'cli', 'package.json'),
+ ];
+ for (const p of pkgPaths) {
+ if (!fs.existsSync(p)) continue;
+ try {
+ const pkg = JSON.parse(fs.readFileSync(p, 'utf-8'));
+ if (pkg && typeof pkg.version === 'string' && pkg.version.length > 0) {
+ pkgVersion = pkg.version;
+ break;
+ }
+ } catch { /* malformed package.json β€” try next */ }
}
- } catch { /* use default */ }
+ } catch { /* fall through to the hardcoded default */ }
let header = c.bold + c.brightPurple + '\\u258A RuFlo V' + pkgVersion + ' ' + c.reset;
header += (swarm.coordinationActive ? c.brightCyan : c.dim) + '\\u25CF ' + c.brightCyan + git.name + c.reset;
if (git.gitBranch) {