troxy-cli 1.4.13 → 1.4.15

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.
Files changed (2) hide show
  1. package/bin/troxy.js +7 -3
  2. package/package.json +1 -1
package/bin/troxy.js CHANGED
@@ -355,13 +355,17 @@ switch (command) {
355
355
  } catch (err) {
356
356
  const stderr = err.stderr?.toString() || '';
357
357
  if (stderr.includes('ENOTEMPTY')) {
358
- // npm bug on macOS: global package dir not empty during rename — uninstall first
359
- execSync('npm uninstall -g troxy-cli && npm install -g troxy-cli@latest', { stdio: 'pipe', shell: true });
358
+ // npm bug on macOS/Homebrew: rename fails because dir has contents.
359
+ // rm -rf the stale dir directly, then reinstall cleanly.
360
+ const globalRoot = execSync('npm root -g', { stdio: 'pipe' }).toString().trim();
361
+ execSync(`rm -rf "${globalRoot}/troxy-cli" && npm install -g troxy-cli@latest`, { stdio: 'pipe', shell: true });
360
362
  } else {
361
363
  throw err;
362
364
  }
363
365
  }
364
- console.log(`✓\n\n Updated to ${latest}. Restart your terminal to use the new version.\n`);
366
+ // Also refresh the npx cache so MCP servers (e.g. OpenClaw) pick up the new version
367
+ try { execSync(`npx --yes troxy-cli@${latest} --version`, { stdio: 'pipe' }); } catch { /* non-fatal */ }
368
+ console.log(`✓\n\n Updated to ${latest}. Restart your terminal and any MCP clients to use the new version.\n`);
365
369
  } catch (err) {
366
370
  const stderr = err.stderr?.toString() || err.message || '';
367
371
  if (stderr.includes('EACCES') || stderr.includes('permission')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "troxy-cli",
3
- "version": "1.4.13",
3
+ "version": "1.4.15",
4
4
  "description": "AI payment control — protect your agent's payments with policies",
5
5
  "type": "module",
6
6
  "bin": {