claude-recall 0.34.0 → 0.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -406,6 +406,12 @@ class ClaudeRecallCLI {
406
406
  console.error('\nCheck your connection, then run `claude-recall upgrade` again.');
407
407
  process.exit(1);
408
408
  }
409
+ // `latest` is interpolated into an npm argument (via a shell on Windows) —
410
+ // accept only a plausible semver string from the registry response.
411
+ if (!/^\d+\.\d+\.\d+(-[\w.]+)?$/.test(latest)) {
412
+ console.error(`❌ Unexpected version string from the registry: "${latest}"`);
413
+ process.exit(1);
414
+ }
409
415
  console.log(`Installed: ${current}`);
410
416
  console.log(`Latest: ${latest}`);
411
417
  const needsInstall = current !== latest;
@@ -413,7 +419,11 @@ class ClaudeRecallCLI {
413
419
  console.log(`\n📦 Upgrading ${current} → ${latest}...\n`);
414
420
  // Run npm install -g, streaming output so the user sees progress / errors live.
415
421
  // shell: true on Windows — npm is npm.cmd there and a bare spawnSync ENOENTs.
416
- const install = spawnSync('npm', ['install', '-g', 'claude-recall@latest'], {
422
+ // Pin the exact version `npm view` just resolved instead of `@latest`:
423
+ // right after a publish, the dist-tag replica npm installs from can lag
424
+ // the metadata endpoint `npm view` read — `@latest` then silently
425
+ // reinstalls the OLD version with exit 0 (observed live on 0.34.0).
426
+ const install = spawnSync('npm', ['install', '-g', `claude-recall@${latest}`], {
417
427
  stdio: 'inherit',
418
428
  shell: process.platform === 'win32',
419
429
  });
@@ -429,7 +439,9 @@ class ClaudeRecallCLI {
429
439
  if (install.status !== 0) {
430
440
  // npm prints its own error — add the practical remediation on top
431
441
  console.error('\n❌ Install failed.');
432
- console.error('\nMost common cause: your global npm prefix is owned by root (EACCES).');
442
+ console.error(`\nIf npm said it can't find claude-recall@${latest} (ETARGET): the release`);
443
+ console.error('is minutes old and the registry is still propagating — wait a minute and re-run.');
444
+ console.error('\nMost common cause otherwise: your global npm prefix is owned by root (EACCES).');
433
445
  console.error('\nQuick fix:');
434
446
  console.error(' sudo npm install -g claude-recall');
435
447
  console.error('\nPermanent fix (no more sudo for any global install on this machine):');
@@ -440,6 +452,26 @@ class ClaudeRecallCLI {
440
452
  console.error('\nThen re-run: claude-recall upgrade');
441
453
  process.exit(install.status ?? 1);
442
454
  }
455
+ // Trust but verify: confirm the globally installed version actually IS
456
+ // `latest` before claiming success. The success message used to report
457
+ // intent, not fact — a propagation race left 0.33.0 installed while the
458
+ // command printed "✓ Upgraded to 0.34.0".
459
+ let installedNow = '';
460
+ try {
461
+ const ls = JSON.parse(execSync('npm ls -g claude-recall --json', {
462
+ encoding: 'utf-8',
463
+ stdio: ['pipe', 'pipe', 'pipe'],
464
+ }));
465
+ installedNow = ls?.dependencies?.['claude-recall']?.version ?? '';
466
+ }
467
+ catch { /* verification is best-effort; fall through to the mismatch path */ }
468
+ if (installedNow !== latest) {
469
+ console.error(`\n❌ Install reported success but the global version is ${installedNow || 'unreadable'}, not ${latest}.`);
470
+ console.error(' This usually means the npm registry is still propagating a very recent');
471
+ console.error(' release. Wait a minute, then re-run: claude-recall upgrade');
472
+ console.error(` Or install the exact version directly: npm install -g claude-recall@${latest}`);
473
+ process.exit(1);
474
+ }
443
475
  // Kill any running MCP servers so Claude Code respawns them with the new binary
444
476
  console.log('\n🧹 Cleaning up running MCP servers (Claude Code respawns them on next tool call)...');
445
477
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-recall",
3
- "version": "0.34.0",
3
+ "version": "0.34.1",
4
4
  "description": "Persistent memory for Claude Code and Pi with native Skills integration, automatic capture, failure learning, and project scoping",
5
5
  "main": "dist/index.js",
6
6
  "bin": {