@openagents-org/agent-launcher 0.2.62 → 0.2.64

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.62",
3
+ "version": "0.2.64",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -226,8 +226,12 @@ class ClaudeAdapter extends BaseAdapter {
226
226
 
227
227
  // Find openagents binary (multi-tier)
228
228
  let oaBin = null;
229
+ const home3 = os.homedir();
230
+ // Tier 0: Portable install at ~/.openagents/nodejs/node_modules/.bin/
231
+ const oaPortable = path.join(home3, '.openagents', 'nodejs', 'node_modules', '.bin', `openagents${IS_WINDOWS ? '.cmd' : ''}`);
232
+ if (fs.existsSync(oaPortable)) oaBin = oaPortable;
229
233
  // Tier 1: PATH
230
- try {
234
+ if (!oaBin) try {
231
235
  if (IS_WINDOWS) {
232
236
  oaBin = execSync('where openagents.cmd 2>nul || where openagents.exe 2>nul || where openagents 2>nul', {
233
237
  encoding: 'utf-8', timeout: 5000,
@@ -349,12 +353,15 @@ class ClaudeAdapter extends BaseAdapter {
349
353
  // visible console windows and Unicode path issues
350
354
  if (IS_WINDOWS && cmd[0].toLowerCase().endsWith('.cmd')) {
351
355
  // Resolve .cmd shim → actual JS entry point
356
+ // npm shims use %dp0% (directory of the .cmd file) as a relative base
357
+ const cmdDir = path.dirname(path.resolve(cmd[0]));
352
358
  const cmdContent = fs.readFileSync(cmd[0], 'utf-8');
353
- const jsMatch = cmdContent.match(/"([^"]+\.js)"/);
359
+ const jsMatch = cmdContent.match(/"?%dp0%\\([^"*?]+\.js)"?/i);
354
360
  if (jsMatch) {
361
+ const jsPath = path.resolve(cmdDir, jsMatch[1]);
355
362
  const nodeExe = path.join(os.homedir(), '.openagents', 'nodejs', 'node.exe');
356
363
  const nodeBin = fs.existsSync(nodeExe) ? nodeExe : 'node';
357
- cmd = [nodeBin, jsMatch[1], ...cmd.slice(1)];
364
+ cmd = [nodeBin, jsPath, ...cmd.slice(1)];
358
365
  } else {
359
366
  cmd = ['cmd.exe', '/c', ...cmd];
360
367
  }