@openagents-org/agent-launcher 0.2.49 → 0.2.51

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openagents-org/agent-launcher",
3
- "version": "0.2.49",
3
+ "version": "0.2.51",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -65,15 +65,16 @@ class OpenClawAdapter extends BaseAdapter {
65
65
 
66
66
  // Check common npm global directories
67
67
  const dirs = [];
68
+ const home = process.env.USERPROFILE || process.env.HOME || '';
69
+ // --prefix installs put .bin shims in node_modules/.bin/
70
+ if (home) dirs.push(path.join(home, '.openagents', 'nodejs', 'node_modules', '.bin'));
68
71
  if (IS_WINDOWS) {
72
+ if (home) dirs.push(path.join(home, '.openagents', 'nodejs'));
69
73
  const appdata = process.env.APPDATA || '';
70
74
  if (appdata) dirs.push(path.join(appdata, 'npm'));
71
- // Portable Node.js installed by OpenAgents Launcher
72
- const home = process.env.USERPROFILE || process.env.HOME || '';
73
- if (home) dirs.push(path.join(home, '.openagents', 'nodejs'));
74
75
  } else {
75
- const home = process.env.HOME || '';
76
- dirs.push(path.join(home, '.npm-global', 'bin'), '/usr/local/bin');
76
+ if (home) dirs.push(path.join(home, '.openagents', 'nodejs', 'bin'));
77
+ dirs.push('/usr/local/bin');
77
78
  }
78
79
  for (const d of dirs) {
79
80
  for (const name of ['openclaw.cmd', 'openclaw']) {
package/src/installer.js CHANGED
@@ -55,9 +55,11 @@ class Installer {
55
55
  if (binaryPath.startsWith(portableDir)) {
56
56
  const pkgDir = path.join(globalModules, npmPkg || binary);
57
57
  if (!fs.existsSync(path.join(pkgDir, 'package.json'))) {
58
- // Stale shim — clean it up
59
- for (const ext of ['', '.cmd', '.ps1']) {
60
- try { const p = path.join(portableDir, binary + ext); if (fs.existsSync(p)) fs.unlinkSync(p); } catch {}
58
+ // Stale shim — clean it up from all possible locations
59
+ for (const dir of [portableDir, path.join(globalModules, '.bin')]) {
60
+ for (const ext of ['', '.cmd', '.ps1']) {
61
+ try { const p = path.join(dir, binary + ext); if (fs.existsSync(p)) fs.unlinkSync(p); } catch {}
62
+ }
61
63
  }
62
64
  return false;
63
65
  }
@@ -272,9 +274,12 @@ class Installer {
272
274
  const binary = entry && entry.install ? entry.install.binary : agentType;
273
275
  if (!binary) return;
274
276
  const portableDir = path.join(os.homedir(), '.openagents', 'nodejs');
275
- for (const ext of ['', '.cmd', '.ps1']) {
276
- const shimPath = path.join(portableDir, binary + ext);
277
- try { if (fs.existsSync(shimPath)) fs.unlinkSync(shimPath); } catch {}
277
+ const binDir = path.join(portableDir, 'node_modules', '.bin');
278
+ for (const dir of [portableDir, binDir]) {
279
+ for (const ext of ['', '.cmd', '.ps1']) {
280
+ const shimPath = path.join(dir, binary + ext);
281
+ try { if (fs.existsSync(shimPath)) fs.unlinkSync(shimPath); } catch {}
282
+ }
278
283
  }
279
284
  }
280
285
 
package/src/paths.js CHANGED
@@ -177,9 +177,8 @@ function _addUnixPaths(dirs) {
177
177
  _push(dirs, '/usr/local/bin');
178
178
  _push(dirs, '/usr/bin');
179
179
 
180
- // npm global (varies by install method)
181
- _push(dirs, path.join(HOME, '.npm-global', 'bin'));
182
- _push(dirs, path.join(HOME, '.openagents', 'npm-global', 'bin'));
180
+ // npm global all installs use --prefix ~/.openagents/nodejs
181
+ // No need for ~/.npm-global or ~/.openagents/npm-global
183
182
 
184
183
  // nvm
185
184
  const nvmDir = process.env.NVM_DIR || path.join(HOME, '.nvm');