@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 +1 -1
- package/src/adapters/claude.js +10 -3
package/package.json
CHANGED
package/src/adapters/claude.js
CHANGED
|
@@ -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,
|
|
364
|
+
cmd = [nodeBin, jsPath, ...cmd.slice(1)];
|
|
358
365
|
} else {
|
|
359
366
|
cmd = ['cmd.exe', '/c', ...cmd];
|
|
360
367
|
}
|