From a3b06313075da0060ecabccdadc9d14f892a166b Mon Sep 17 00:00:00 2001 From: rUv Date: Tue, 13 Jan 2026 17:31:45 +0000 Subject: [PATCH] Checkpoint: File edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic checkpoint created by Claude Code - Branch: v3 - Timestamp: 2026-01-13T17:31:45Z - Changes: 6 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- agents/architect.yaml | 2 +- agents/coder.yaml | 2 +- agents/reviewer.yaml | 2 +- agents/security-architect.yaml | 2 +- agents/tester.yaml | 2 +- v3/@claude-flow/cli/src/commands/doctor.ts | 76 ++++++++++++++++++++++ 6 files changed, 81 insertions(+), 5 deletions(-) diff --git a/agents/architect.yaml b/agents/architect.yaml index e55972ec5c..19fed772ea 100644 --- a/agents/architect.yaml +++ b/agents/architect.yaml @@ -8,4 +8,4 @@ capabilities: optimizations: - context-caching - memory-persistence -createdAt: "2026-01-13T17:09:34.521Z" +createdAt: "2026-01-13T17:31:20.578Z" diff --git a/agents/coder.yaml b/agents/coder.yaml index c2bc518c7e..3e978e96c8 100644 --- a/agents/coder.yaml +++ b/agents/coder.yaml @@ -8,4 +8,4 @@ capabilities: optimizations: - flash-attention - token-reduction -createdAt: "2026-01-13T17:09:34.521Z" +createdAt: "2026-01-13T17:31:20.578Z" diff --git a/agents/reviewer.yaml b/agents/reviewer.yaml index 940a12e4cc..8aa61917e7 100644 --- a/agents/reviewer.yaml +++ b/agents/reviewer.yaml @@ -7,4 +7,4 @@ capabilities: - best-practices optimizations: - incremental-analysis -createdAt: "2026-01-13T17:09:34.521Z" +createdAt: "2026-01-13T17:31:20.578Z" diff --git a/agents/security-architect.yaml b/agents/security-architect.yaml index 7421b57882..04fa806762 100644 --- a/agents/security-architect.yaml +++ b/agents/security-architect.yaml @@ -7,4 +7,4 @@ capabilities: - security-review optimizations: - pattern-matching -createdAt: "2026-01-13T17:09:34.521Z" +createdAt: "2026-01-13T17:31:20.578Z" diff --git a/agents/tester.yaml b/agents/tester.yaml index 7446d434ef..a8b748f327 100644 --- a/agents/tester.yaml +++ b/agents/tester.yaml @@ -7,4 +7,4 @@ capabilities: - coverage optimizations: - parallel-execution -createdAt: "2026-01-13T17:09:34.521Z" +createdAt: "2026-01-13T17:31:20.578Z" diff --git a/v3/@claude-flow/cli/src/commands/doctor.ts b/v3/@claude-flow/cli/src/commands/doctor.ts index 537de486fd..1f1316d258 100644 --- a/v3/@claude-flow/cli/src/commands/doctor.ts +++ b/v3/@claude-flow/cli/src/commands/doctor.ts @@ -236,6 +236,82 @@ async function checkBuildTools(): Promise { } } +// Check for stale npx cache (version freshness) +async function checkVersionFreshness(): Promise { + try { + // Get current CLI version + const packageJsonPath = new URL('../package.json', import.meta.url).pathname; + let currentVersion = '0.0.0'; + + try { + const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8')); + currentVersion = packageJson.version || '0.0.0'; + } catch { + // Try alternative approach - check if we can get version from module + try { + currentVersion = await runCommand('npx @claude-flow/cli@latest --version 2>/dev/null | head -1', 3000); + currentVersion = currentVersion.replace(/[^0-9.-]/g, '').trim() || '0.0.0'; + } catch { + currentVersion = '0.0.0'; + } + } + + // Check if running via npx (look for _npx in process path or argv) + const isNpx = process.argv[1]?.includes('_npx') || + process.env.npm_execpath?.includes('npx') || + process.cwd().includes('_npx'); + + // Query npm for latest version + let latestVersion = currentVersion; + try { + const npmInfo = await runCommand('npm view @claude-flow/cli version 2>/dev/null', 5000); + latestVersion = npmInfo.trim(); + } catch { + // Can't reach npm registry - skip check + return { + name: 'Version Freshness', + status: 'warn', + message: `v${currentVersion} (cannot check registry)` + }; + } + + // Compare versions + const current = currentVersion.split('-')[0].split('.').map(n => parseInt(n, 10) || 0); + const latest = latestVersion.split('-')[0].split('.').map(n => parseInt(n, 10) || 0); + + const isOutdated = ( + latest[0] > current[0] || + (latest[0] === current[0] && latest[1] > current[1]) || + (latest[0] === current[0] && latest[1] === current[1] && latest[2] > current[2]) + ); + + if (isOutdated) { + const fix = isNpx + ? 'rm -rf ~/.npm/_npx/* && npx -y @claude-flow/cli@latest' + : 'npm update @claude-flow/cli'; + + return { + name: 'Version Freshness', + status: 'warn', + message: `v${currentVersion} (latest: v${latestVersion})${isNpx ? ' [npx cache stale]' : ''}`, + fix + }; + } + + return { + name: 'Version Freshness', + status: 'pass', + message: `v${currentVersion} (up to date)` + }; + } catch (error) { + return { + name: 'Version Freshness', + status: 'warn', + message: 'Unable to check version freshness' + }; + } +} + // Check Claude Code CLI (async with proper env inheritance) async function checkClaudeCode(): Promise { try {