fix(statusline): bake in the real CLI version, fixing the npx-only fallback

getPkgVersion()'s runtime candidate scan can't find any version when
rendering via a pure npx invocation with no persistent local install:
npx installs into an ephemeral, unpredictably-hashed ~/.npm/_npx/<hash>/
directory that none of the probed candidate paths (marketplace, project
node_modules, global prefix) can locate. It silently fell back to a
hardcoded "3.6" placeholder — confirmed live via an isolated fresh-machine
simulation (fresh HOME + fresh npm cache, no prior npx history).

generateStatuslineScript() now bakes in the CLI's own real version at
generation time (via getInstalledCliVersion(), the same reliable
createRequire/findPackageRoot resolution helper-refresh.ts already uses)
as getPkgVersion()'s default, replacing the hardcoded placeholder. The
runtime candidate scan still wins when it finds something newer (e.g. a
later `npm update` in the same project) — this only fixes the fallback.

chore(release): bump to 3.27.3 across cli/umbrella/wrapper.

Co-Authored-By: RuFlo <ruv@ruv.net>
This commit is contained in:
ruv committed 2026-07-14 00:28:14 -04:00
1 parent 6643d44d32
commit b254e3215e
10 files changed
+41 -20

No files matched your search

+5 -2
View File
@@ -597,7 +597,6 @@ function getCostFromStdin() {
return null;
}
// Read package version from the first package.json we find.
// Compares dotted-numeric version strings (e.g. "3.27.1" vs "3.27.10").
// Returns >0 if a>b, <0 if a<b, 0 if equal-as-far-as-parseable. Deliberately
// simple (no prerelease/build-metadata handling) — this only orders local
@@ -615,7 +614,11 @@ function compareVersions(a, b) {
}
function getPkgVersion() {
let ver = '3.6';
// Baked in at generation time from the real running CLI's own resolved
// version (see generateStatuslineScript()'s doc comment) — correct even
// when this renders via a pure npx invocation with no local install for
// the candidate scan below to find.
let ver = "3.27.3";
try {
const home = os.homedir();
const pkgPaths = [
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "claude-flow",
"version": "3.27.1",
"version": "3.27.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "claude-flow",
"version": "3.27.1",
"version": "3.27.3",
"license": "MIT",
"dependencies": {
"@claude-flow/cli-core": "3.7.0-alpha.5",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "claude-flow",
"version": "3.27.1",
"version": "3.27.3",
"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",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ruflo",
"version": "3.27.1",
"version": "3.27.3",
"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",
@@ -1,13 +1,12 @@
{
"manifest": {
"version": "3.27.2",
"version": "3.23.0",
"files": {
"auto-memory-hook.mjs": "68be7e9a9eba7bf9c4e8a230db7bf61a243b965639f8504842799d6c6ca28762",
"hook-handler.cjs": "2e4927ff158c0079a67a6f0ef0b99ac748d600d33798b0a5fbd5a6a82225ec03",
"intelligence.cjs": "bd1f8e4b034944aee1df0391dc47ac2e8cc4b3aa542c65407a59d49620bbf76b",
"statusline.cjs": "f553f12a34e7df405a64501cdedb684374ef92670279380bc95f625fc68b2d1b"
"hook-handler.cjs": "bc4d2d26823d49b3ab1dded2946b66369f1f67bd76b4c30dca9f3b6df3cca8f0",
"intelligence.cjs": "760cb82ed2000031abc1ac1fa90a014e7d91d93966e3aa4741b07ab7aff8d066"
}
},
"signature": "40Y8+mFRgH7LZZ5TeeDM6aIUcAKrNaN82nyJJzFyepx/HM1chZeK2yEUIbtPhyE0PdyoO4W1OuR3mlxLHgBjCA==",
"signature": "of5l9RP68iPcmcC5dckDv+KIOiENJKifWxYKwQTwAiXiyRNNZuMwQ8y8Bd8+wGviTRxIzBfSuxL1nuJ/rX3xDQ==",
"algorithm": "ed25519"
}
@@ -597,7 +597,6 @@ function getCostFromStdin() {
return null;
}
// Read package version from the first package.json we find.
// Compares dotted-numeric version strings (e.g. "3.27.1" vs "3.27.10").
// Returns >0 if a>b, <0 if a<b, 0 if equal-as-far-as-parseable. Deliberately
// simple (no prerelease/build-metadata handling) — this only orders local
@@ -615,7 +614,11 @@ function compareVersions(a, b) {
}
function getPkgVersion() {
let ver = '3.6';
// Baked in at generation time from the real running CLI's own resolved
// version (see generateStatuslineScript()'s doc comment) — correct even
// when this renders via a pure npx invocation with no local install for
// the candidate scan below to find.
let ver = "3.27.3";
try {
const home = os.homedir();
const pkgPaths = [
+2 -2
View File
@@ -1,8 +1,8 @@
{
"schemaVersion": 1,
"generation": 1,
"generatedAt": "2026-07-14T04:02:10.768Z",
"gitSha": "dbcfe15f",
"generatedAt": "2026-07-14T04:26:59.494Z",
"gitSha": "6643d44d",
"catalog": {
"agents": 164,
"tools": 387,
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "@claude-flow/cli",
"version": "3.27.2",
"version": "3.27.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@claude-flow/cli",
"version": "3.27.2",
"version": "3.27.3",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@claude-flow/cli",
"version": "3.27.2",
"version": "3.27.3",
"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",
@@ -11,6 +11,7 @@
*/
import type { InitOptions } from './types.js';
import { getInstalledCliVersion } from './helper-refresh.js';
/**
* Generate optimized statusline script
@@ -24,6 +25,18 @@ import type { InitOptions } from './types.js';
*/
export function generateStatuslineScript(options: InitOptions): string {
const maxAgents = options.runtime.maxAgents;
// Resolved reliably HERE (inside the actual running CLI process, via
// getInstalledCliVersion()'s createRequire/findPackageRoot resolution) —
// never wrong at generation time. Baked in as getPkgVersion()'s fallback
// so a pure-npx render (no persistent local install: no marketplace
// checkout, no project node_modules, nothing under a global prefix — npx
// only ever installs into its own ephemeral, unpredictably-hashed
// ~/.npm/_npx/<hash>/ directory, which none of getPkgVersion()'s
// candidate paths can find) shows the real version instead of the
// previous hardcoded "3.6" placeholder. getPkgVersion()'s own runtime
// candidate scan still wins over this baked-in value when it finds
// something newer (e.g. a later `npm update` in the same project).
const bakedVersion = getInstalledCliVersion();
return `#!/usr/bin/env node
/**
@@ -624,7 +637,6 @@ function getCostFromStdin() {
return null;
}
// Read package version from the first package.json we find.
// Compares dotted-numeric version strings (e.g. "3.27.1" vs "3.27.10").
// Returns >0 if a>b, <0 if a<b, 0 if equal-as-far-as-parseable. Deliberately
// simple (no prerelease/build-metadata handling) — this only orders local
@@ -642,7 +654,11 @@ function compareVersions(a, b) {
}
function getPkgVersion() {
let ver = '3.6';
// Baked in at generation time from the real running CLI's own resolved
// version (see generateStatuslineScript()'s doc comment) — correct even
// when this renders via a pure npx invocation with no local install for
// the candidate scan below to find.
let ver = ${JSON.stringify(bakedVersion)};
try {
const home = os.homedir();
const pkgPaths = [