@openagents-org/agent-launcher 0.2.22 → 0.2.23

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.22",
3
+ "version": "0.2.23",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -13,6 +13,7 @@
13
13
 
14
14
  const fs = require('fs');
15
15
  const path = require('path');
16
+ const os = require('os');
16
17
  const { spawn, execSync } = require('child_process');
17
18
 
18
19
  const BaseAdapter = require('./base');
@@ -211,15 +212,30 @@ class OpenClawAdapter extends BaseAdapter {
211
212
  };
212
213
 
213
214
  if (IS_WINDOWS) {
214
- // Spawn node directly with the JS entry point instead of cmd.exe /C
215
- // to get unbuffered stderr for real-time tool status streaming
216
- const nodeBin = path.join(path.dirname(binary), 'node.exe');
217
- const entryPoint = path.join(path.dirname(binary), 'node_modules', 'openclaw', 'openclaw.mjs');
218
- if (fs.existsSync(nodeBin) && fs.existsSync(entryPoint)) {
215
+ // Find node.exe to spawn openclaw.mjs directly (unbuffered stderr)
216
+ const { getExtraBinDirs } = require('../paths');
217
+ const extraDirs = getExtraBinDirs();
218
+ let nodeBin = null;
219
+ for (const d of extraDirs) {
220
+ const candidate = path.join(d, 'node.exe');
221
+ if (fs.existsSync(candidate)) { nodeBin = candidate; break; }
222
+ }
223
+ // Find openclaw entry point
224
+ const possibleEntries = [
225
+ path.join(path.dirname(binary), 'node_modules', 'openclaw', 'openclaw.mjs'),
226
+ path.join(os.homedir(), '.openagents', 'nodejs', 'node_modules', 'openclaw', 'openclaw.mjs'),
227
+ ];
228
+ let entryPoint = null;
229
+ for (const e of possibleEntries) {
230
+ if (fs.existsSync(e)) { entryPoint = e; break; }
231
+ }
232
+
233
+ if (nodeBin && entryPoint) {
234
+ // Direct spawn — unbuffered stderr for real-time tool streaming
219
235
  spawnBinary = nodeBin;
220
236
  spawnArgs = [entryPoint, ...args];
221
237
  } else {
222
- // Fallback to cmd.exe (buffered stderr)
238
+ // Fallback to cmd.exe (buffered stderr — no real-time status)
223
239
  spawnBinary = process.env.COMSPEC || 'cmd.exe';
224
240
  const quotedArgs = args.map((a) => a.includes(' ') ? `"${a}"` : a);
225
241
  spawnArgs = ['/C', binary, ...quotedArgs];