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: auto-regenerate statusline on older installs, show real version

Reuvena0ef36cbbd44
diff --git a/.claude/helpers/statusline.cjs b/.claude/helpers/statusline.cjs
index 174ac10f1f..81f6cfc4c3 100644
--- a/.claude/helpers/statusline.cjs
+++ b/.claude/helpers/statusline.cjs
@@ -26,6 +26,21 @@ const CONFIG = {
const CWD = process.cwd();
+// Read package version once at startup
+let pkgVersion = '3.5';
+try {
+ const pkgPaths = [
+ path.join(CWD, 'node_modules', '@claude-flow', 'cli', 'package.json'),
+ path.join(CWD, 'v3', '@claude-flow', 'cli', 'package.json'),
+ ];
+ for (const p of pkgPaths) {
+ if (fs.existsSync(p)) {
+ const pkg = JSON.parse(fs.readFileSync(p, 'utf-8'));
+ if (pkg.version) { pkgVersion = pkg.version; break; }
+ }
+ }
+} catch { /* use default */ }
+
// ANSI colors
const c = {
reset: '\x1b[0m',
@@ -601,7 +616,7 @@ function generateStatusline() {
const parts = [];
// Branding
- parts.push(`${c.bold}${c.brightPurple}\u258A RuFlo V3${c.reset}`);
+ parts.push(`${c.bold}${c.brightPurple}\u258A RuFlo v${pkgVersion || '3.5'}${c.reset}`);
// User + swarm indicator
const dot = swarm.coordinationActive ? `${c.brightGreen}\u25CF${c.reset}` : `${c.brightCyan}\u25CF${c.reset}`;
@@ -668,7 +683,7 @@ function generateDashboard() {
const lines = [];
// Header
- let header = `${c.bold}${c.brightPurple}\u258A RuFlo V3 ${c.reset}`;
+ 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) {
header += ` ${c.dim}\u2502${c.reset} ${c.brightBlue}\u23C7 ${git.gitBranch}${c.reset}`;
diff --git a/package.json b/package.json
index 643e60c9d3..726b45d92f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "claude-flow",
- "version": "3.5.60",
+ "version": "3.5.63",
"description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
"main": "dist/index.js",
"type": "module",
diff --git a/ruflo/package.json b/ruflo/package.json
index b8487c1d5f..25fcbae889 100644
--- a/ruflo/package.json
+++ b/ruflo/package.json
@@ -1,6 +1,6 @@
{
"name": "ruflo",
- "version": "3.5.59",
+ "version": "3.5.63",
"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",
"main": "bin/ruflo.js",
"type": "module",
diff --git a/v3/@claude-flow/cli/package.json b/v3/@claude-flow/cli/package.json
index def293af4b..fdbbae2e02 100644
--- a/v3/@claude-flow/cli/package.json
+++ b/v3/@claude-flow/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@claude-flow/cli",
- "version": "3.5.60",
+ "version": "3.5.63",
"type": "module",
"description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
"main": "dist/src/index.js",
diff --git a/v3/@claude-flow/cli/src/init/statusline-generator.ts b/v3/@claude-flow/cli/src/init/statusline-generator.ts
index 30f197201b..1e90d8f60a 100644
--- a/v3/@claude-flow/cli/src/init/statusline-generator.ts
+++ b/v3/@claude-flow/cli/src/init/statusline-generator.ts
@@ -642,7 +642,23 @@ function generateStatusline() {
const lines = [];
// Header
- let header = c.bold + c.brightPurple + '\\u258A RuFlo V3.5 ' + c.reset;
+ // Read version from package.json
+ let pkgVersion = '3.5';
+ 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;
+ }
+ }
+ } catch { /* use 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) {
header += ' ' + c.dim + '\\u2502' + c.reset + ' ' + c.brightBlue + '\\u23C7 ' + git.gitBranch + c.reset;
diff --git a/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts b/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts
index ee2031ecc5..2c50b182da 100644
--- a/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts
+++ b/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts
@@ -1716,6 +1716,25 @@ export const hooksSessionStart: MCPTool = {
const restoreLatest = params.restoreLatest as boolean;
const shouldStartDaemon = params.startDaemon === true;
+ // Auto-regenerate statusline if outdated (fixes older installs)
+ // Checks for the old fake heuristic: "Math.floor(sizeKB / 2)"
+ try {
+ const statuslinePath = join(getProjectCwd(), '.claude', 'helpers', 'statusline.cjs');
+ if (existsSync(statuslinePath)) {
+ const content = readFileSync(statuslinePath, 'utf-8');
+ if (content.includes('Math.floor(sizeKB / 2)') || content.includes('Maturity fallback')) {
+ // Old version detected — regenerate from current generator
+ const { generateStatuslineScript } = await import('../init/statusline-generator.js');
+ const newContent = generateStatuslineScript({
+ runtime: { maxAgents: 15, topology: 'hierarchical', strategy: 'specialized' },
+ } as any);
+ writeFileSync(statuslinePath, newContent, 'utf-8');
+ }
+ }
+ } catch {
+ // Non-critical — old statusline continues to work, just with stale heuristics
+ }
+
// Auto-start daemon if enabled
let daemonStatus: { started: boolean; pid?: number; error?: string } = { started: false };
if (shouldStartDaemon) {