@openagents-org/agent-launcher 0.2.48 → 0.2.50
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 +1 -1
- package/src/adapters/openclaw.js +1 -1
- package/src/installer.js +7 -4
- package/src/paths.js +2 -3
package/package.json
CHANGED
package/src/adapters/openclaw.js
CHANGED
|
@@ -73,7 +73,7 @@ class OpenClawAdapter extends BaseAdapter {
|
|
|
73
73
|
if (home) dirs.push(path.join(home, '.openagents', 'nodejs'));
|
|
74
74
|
} else {
|
|
75
75
|
const home = process.env.HOME || '';
|
|
76
|
-
dirs.push(path.join(home, '.
|
|
76
|
+
dirs.push(path.join(home, '.openagents', 'nodejs', 'bin'), '/usr/local/bin');
|
|
77
77
|
}
|
|
78
78
|
for (const d of dirs) {
|
|
79
79
|
for (const name of ['openclaw.cmd', 'openclaw']) {
|
package/src/installer.js
CHANGED
|
@@ -170,7 +170,8 @@ class Installer {
|
|
|
170
170
|
|
|
171
171
|
// Use bundled node/npm if system npm not available
|
|
172
172
|
if (cmd.startsWith('npm install')) {
|
|
173
|
-
const
|
|
173
|
+
const prefixDir = path.join(os.homedir(), '.openagents', 'nodejs');
|
|
174
|
+
const args = cmd.replace('npm install', 'install --ignore-scripts').replace(' -g ', ` --prefix "${prefixDir}" `);
|
|
174
175
|
cmd = this._resolveNpmCommand(args);
|
|
175
176
|
}
|
|
176
177
|
|
|
@@ -205,7 +206,8 @@ class Installer {
|
|
|
205
206
|
// Resolve npm command
|
|
206
207
|
let cmd = rawCmd;
|
|
207
208
|
if (rawCmd.startsWith('npm install')) {
|
|
208
|
-
const
|
|
209
|
+
const prefixDir2 = path.join(os.homedir(), '.openagents', 'nodejs');
|
|
210
|
+
const args = rawCmd.replace('npm install', 'install --loglevel=verbose --ignore-scripts').replace(' -g ', ` --prefix "${prefixDir2}" `);
|
|
209
211
|
cmd = this._resolveNpmCommand(args);
|
|
210
212
|
} else if (rawCmd.startsWith('pip install') || rawCmd.startsWith('pipx install')) {
|
|
211
213
|
cmd = rawCmd; // pip commands stay as-is
|
|
@@ -345,10 +347,11 @@ class Installer {
|
|
|
345
347
|
_deriveUninstallCommand(installCmd) {
|
|
346
348
|
if (!installCmd) return null;
|
|
347
349
|
|
|
348
|
-
// npm install -g <pkg> → npm uninstall
|
|
350
|
+
// npm install -g <pkg> → npm uninstall --prefix <dir> <pkg>
|
|
349
351
|
if (installCmd.includes('npm install')) {
|
|
352
|
+
const prefixDir = path.join(os.homedir(), '.openagents', 'nodejs');
|
|
350
353
|
return installCmd
|
|
351
|
-
.replace('npm install -g',
|
|
354
|
+
.replace('npm install -g', `npm uninstall --prefix "${prefixDir}"`)
|
|
352
355
|
.replace('npm install', 'npm uninstall')
|
|
353
356
|
.replace(/@latest/g, '')
|
|
354
357
|
.replace(/@[\d.]+/g, '');
|
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
|
|
181
|
-
|
|
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');
|