@openagents-org/agent-launcher 0.2.30 → 0.2.32

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.30",
3
+ "version": "0.2.32",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -290,16 +290,21 @@ class OpenClawAdapter extends BaseAdapter {
290
290
  let stderrContent = '';
291
291
  try {
292
292
  stderrContent = fs.readFileSync(stderrFile, 'utf-8');
293
+ this._log(`CLI exit code=${code}, stdout=${output.length}b, stderr=${stderrContent.length}b`);
293
294
  // Process any remaining lines for tool events
294
295
  const remaining = stderrContent.slice(stderrOffset);
295
296
  if (remaining) {
296
297
  for (const line of remaining.split('\n')) processLine(line);
297
298
  }
298
- } catch {}
299
+ } catch (e) {
300
+ this._log(`CLI stderr read error: ${e.message}`);
301
+ }
299
302
  try { fs.unlinkSync(stderrFile); } catch {}
300
303
 
301
304
  // OpenClaw --json writes JSON to stderr, so combine stdout + stderr
302
305
  const allOutput = output + '\n' + stderrContent;
306
+ const hasPayloads = allOutput.includes('"payloads"');
307
+ this._log(`CLI parse: hasPayloads=${hasPayloads}, total=${allOutput.length}b`);
303
308
 
304
309
  if (code !== 0) {
305
310
  reject(new Error(`CLI exited ${code}: ${allOutput.slice(-300)}`));
@@ -360,11 +365,17 @@ class OpenClawAdapter extends BaseAdapter {
360
365
  try {
361
366
  const data = JSON.parse(jsonStr);
362
367
  const payloads = data.payloads || [];
368
+ this._log(`CLI parsed: ${payloads.length} payloads, keys=${payloads.map(p=>Object.keys(p).join('/')).join(', ')}, text=${payloads.map(p=>(p.text||'').slice(0,50)).join('|')}`);
363
369
  if (payloads.length > 0) {
364
- resolve(payloads.filter(p => p.text).map(p => p.text).join('\n\n'));
365
- return;
370
+ const texts = payloads.filter(p => p.text).map(p => p.text);
371
+ if (texts.length > 0) {
372
+ resolve(texts.join('\n\n'));
373
+ return;
374
+ }
366
375
  }
367
- } catch {}
376
+ } catch (e) {
377
+ this._log(`CLI JSON parse error: ${e.message}`);
378
+ }
368
379
  }
369
380
 
370
381
  // Fallback: return non-diagnostic text