@openagents-org/agent-launcher 0.2.97 → 0.2.98

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/package.json +1 -1
  2. package/src/installer.js +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openagents-org/agent-launcher",
3
- "version": "0.2.97",
3
+ "version": "0.2.98",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/installer.js CHANGED
@@ -266,9 +266,11 @@ class Installer {
266
266
  const shell = process.platform === 'win32'
267
267
  ? (process.env.ComSpec || 'C:\\Windows\\System32\\cmd.exe')
268
268
  : true;
269
+ // Set cwd to runtime prefix dir (avoids running from System32 on Windows)
270
+ const installCwd = rawCmd.startsWith('npm install') ? getRuntimePrefix(agentType) : os.homedir();
269
271
 
270
272
  return new Promise((resolve, reject) => {
271
- const proc = spawn(cmd, [], { shell, env, stdio: ['ignore', 'pipe', 'pipe'] });
273
+ const proc = spawn(cmd, [], { shell, env, cwd: installCwd, stdio: ['ignore', 'pipe', 'pipe'] });
272
274
 
273
275
  if (proc.stdout) proc.stdout.setEncoding('utf-8');
274
276
  if (proc.stderr) proc.stderr.setEncoding('utf-8');
@@ -513,6 +515,10 @@ class Installer {
513
515
  try {
514
516
  const bundledDir = path.join(this.configDir, 'nodejs');
515
517
  if (fs.existsSync(bundledDir)) {
518
+ // Node.js may be directly in nodejs/ (launcher symlink style) or in nodejs/node-v*/
519
+ if (fs.existsSync(path.join(bundledDir, 'node.exe'))) {
520
+ extraDirs.push(bundledDir);
521
+ }
516
522
  const entries = fs.readdirSync(bundledDir).filter(e => e.startsWith('node-'));
517
523
  if (entries.length > 0) {
518
524
  extraDirs.push(path.join(bundledDir, entries[0]));