@openagents-org/agent-launcher 0.2.65 → 0.2.66
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 +18 -2
package/package.json
CHANGED
package/src/adapters/claude.js
CHANGED
|
@@ -268,12 +268,28 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
268
268
|
this._log('Could not find openagents binary — MCP tools may not be available');
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
// On Windows, .cmd shims can't be used as MCP server commands —
|
|
272
|
+
// resolve to node.exe + the actual JS entry point
|
|
273
|
+
let mcpCommand = oaBin;
|
|
274
|
+
let mcpFinalArgs = mcpArgs;
|
|
275
|
+
if (IS_WINDOWS && oaBin.toLowerCase().endsWith('.cmd')) {
|
|
276
|
+
const cmdContent = fs.readFileSync(oaBin, 'utf-8');
|
|
277
|
+
const jsMatch = cmdContent.match(/%dp0%\\([^\s"*?]+\.js)/i);
|
|
278
|
+
if (jsMatch) {
|
|
279
|
+
const cmdDir = path.dirname(path.resolve(oaBin));
|
|
280
|
+
const jsPath = path.resolve(cmdDir, jsMatch[1]);
|
|
281
|
+
const nodeExe = path.join(os.homedir(), '.openagents', 'nodejs', 'node.exe');
|
|
282
|
+
mcpCommand = fs.existsSync(nodeExe) ? nodeExe : 'node';
|
|
283
|
+
mcpFinalArgs = [jsPath, ...mcpArgs];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
271
287
|
const mcpConfig = {
|
|
272
288
|
mcpServers: {
|
|
273
289
|
'openagents-workspace': {
|
|
274
290
|
type: 'stdio',
|
|
275
|
-
command:
|
|
276
|
-
args:
|
|
291
|
+
command: mcpCommand,
|
|
292
|
+
args: mcpFinalArgs,
|
|
277
293
|
env: { OA_WORKSPACE_TOKEN: this.token },
|
|
278
294
|
},
|
|
279
295
|
},
|