From b254e3215e89e4cefb397d6da5085bcac914e882 Mon Sep 17 00:00:00 2001 From: ruv Date: Tue, 14 Jul 2026 00:28:14 -0400 Subject: [PATCH] fix(statusline): bake in the real CLI version, fixing the npx-only fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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// 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 --- .claude/helpers/statusline.cjs | 7 +++++-- package-lock.json | 4 ++-- package.json | 2 +- ruflo/package.json | 2 +- .../cli/.claude/helpers/helpers.manifest.json | 9 ++++----- .../cli/.claude/helpers/statusline.cjs | 7 +++++-- v3/@claude-flow/cli/catalog-manifest.json | 4 ++-- v3/@claude-flow/cli/package-lock.json | 4 ++-- v3/@claude-flow/cli/package.json | 2 +- .../cli/src/init/statusline-generator.ts | 20 +++++++++++++++++-- 10 files changed, 41 insertions(+), 20 deletions(-) diff --git a/.claude/helpers/statusline.cjs b/.claude/helpers/statusline.cjs index 85f64b6188..afcffb035e 100755 --- a/.claude/helpers/statusline.cjs +++ b/.claude/helpers/statusline.cjs @@ -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 a0 if a>b, <0 if a/ 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