@openagents-org/agent-launcher 0.2.88 → 0.2.90
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 +2 -2
- package/src/adapters/openclaw.js +17 -7
package/package.json
CHANGED
package/src/adapters/claude.js
CHANGED
|
@@ -111,8 +111,8 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
111
111
|
const home = os.homedir();
|
|
112
112
|
const candidates = IS_WINDOWS
|
|
113
113
|
? [path.join(home, '.openagents', 'nodejs', 'node.exe')]
|
|
114
|
-
: [path.join(home, '.openagents', 'nodejs', '
|
|
115
|
-
path.join(home, '.openagents', 'nodejs', 'node')];
|
|
114
|
+
: [path.join(home, '.openagents', 'nodejs', 'node'),
|
|
115
|
+
path.join(home, '.openagents', 'nodejs', 'bin', 'node')];
|
|
116
116
|
for (const c of candidates) {
|
|
117
117
|
if (fs.existsSync(c)) return c;
|
|
118
118
|
}
|
package/src/adapters/openclaw.js
CHANGED
|
@@ -19,6 +19,7 @@ const { spawn, execSync } = require('child_process');
|
|
|
19
19
|
const BaseAdapter = require('./base');
|
|
20
20
|
const { formatAttachmentsForPrompt } = require('./utils');
|
|
21
21
|
const { buildOpenclawSkillMd, buildOpenclawSystemPrompt } = require('./workspace-prompt');
|
|
22
|
+
const { getRuntimePrefix } = require('../paths');
|
|
22
23
|
|
|
23
24
|
const IS_WINDOWS = process.platform === 'win32';
|
|
24
25
|
const OPENCLAW_STATE_DIR = path.join(
|
|
@@ -55,8 +56,13 @@ class OpenClawAdapter extends BaseAdapter {
|
|
|
55
56
|
// ------------------------------------------------------------------
|
|
56
57
|
|
|
57
58
|
_findOpenclawBinary() {
|
|
58
|
-
// We know exactly where openclaw is — installed via --prefix ~/.openagents/nodejs
|
|
59
59
|
const home = process.env.USERPROFILE || process.env.HOME || '';
|
|
60
|
+
|
|
61
|
+
// Tier 0: Isolated runtime prefix (~/.openagents/runtimes/openclaw/)
|
|
62
|
+
const runtimeMjs = path.join(getRuntimePrefix('openclaw'), 'node_modules', 'openclaw', 'openclaw.mjs');
|
|
63
|
+
if (fs.existsSync(runtimeMjs)) return runtimeMjs;
|
|
64
|
+
|
|
65
|
+
// Tier 0b: Legacy shared prefix
|
|
60
66
|
const portableDir = path.join(home, '.openagents', 'nodejs');
|
|
61
67
|
const mjs = path.join(portableDir, 'node_modules', 'openclaw', 'openclaw.mjs');
|
|
62
68
|
if (fs.existsSync(mjs)) return mjs;
|
|
@@ -194,8 +200,9 @@ class OpenClawAdapter extends BaseAdapter {
|
|
|
194
200
|
if (IS_WINDOWS) {
|
|
195
201
|
const nodeBinDir = path.dirname(process.execPath);
|
|
196
202
|
const npmBin = path.join(process.env.APPDATA || '', 'npm');
|
|
197
|
-
const
|
|
198
|
-
|
|
203
|
+
const portableDir2 = path.join(os.homedir(), '.openagents', 'nodejs');
|
|
204
|
+
const runtimeBin = path.join(getRuntimePrefix('openclaw'), 'node_modules', '.bin');
|
|
205
|
+
for (const p of [runtimeBin, nodeBinDir, npmBin, portableDir2]) {
|
|
199
206
|
if (p && !(spawnEnv.PATH || '').includes(p)) {
|
|
200
207
|
spawnEnv.PATH = p + path.delimiter + (spawnEnv.PATH || '');
|
|
201
208
|
}
|
|
@@ -240,10 +247,13 @@ class OpenClawAdapter extends BaseAdapter {
|
|
|
240
247
|
|
|
241
248
|
// Always spawn node + openclaw.mjs directly (no shims, no cmd.exe, cross-platform)
|
|
242
249
|
const portableDir = path.join(os.homedir(), '.openagents', 'nodejs');
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
250
|
+
// Unified path first (symlink on Unix), then legacy bin/ fallback
|
|
251
|
+
const nodeUnified = path.join(portableDir, IS_WINDOWS ? 'node.exe' : 'node');
|
|
252
|
+
const nodeBin = fs.existsSync(nodeUnified) ? nodeUnified : path.join(portableDir, 'bin', 'node');
|
|
253
|
+
// Check isolated runtime first, then legacy
|
|
254
|
+
const runtimeMjs = path.join(getRuntimePrefix('openclaw'), 'node_modules', 'openclaw', 'openclaw.mjs');
|
|
255
|
+
const legacyMjs = path.join(portableDir, 'node_modules', 'openclaw', 'openclaw.mjs');
|
|
256
|
+
const openclawMjs = fs.existsSync(runtimeMjs) ? runtimeMjs : legacyMjs;
|
|
247
257
|
|
|
248
258
|
let spawnBin, spawnArgs;
|
|
249
259
|
if (fs.existsSync(nodeBin) && fs.existsSync(openclawMjs)) {
|