@openagents-org/agent-launcher 0.2.40 → 0.2.42

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.40",
3
+ "version": "0.2.42",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -413,10 +413,11 @@ class ClaudeAdapter extends BaseAdapter {
413
413
  }
414
414
  lastResponseText.push(block.text.trim());
415
415
  postedThinking = true;
416
- // Don't post text as "thinking" it will be sent as the final response
417
- // Only send a brief status indicator
418
- const preview = block.text.trim().slice(0, 60);
419
- await this.sendStatus(msgChannel, preview.length < block.text.trim().length ? preview + '...' : preview);
416
+ // Only send status preview for longer responses (short ones arrive too quickly)
417
+ if (block.text.trim().length > 80) {
418
+ const preview = block.text.trim().slice(0, 60) + '...';
419
+ await this.sendStatus(msgChannel, preview);
420
+ }
420
421
  } else if (block.type === 'tool_use') {
421
422
  hasToolUseSinceLastText = true;
422
423
  postedThinking = false;
package/src/daemon.js CHANGED
@@ -369,8 +369,15 @@ class Daemon {
369
369
  info.state = 'error';
370
370
  info.lastError = (err.message || String(err)).slice(0, 200);
371
371
  this._writeStatus();
372
- this._log(`${name} crashed: ${info.lastError}, restarting in ${info._backoff}s (attempt ${info.restarts})`);
373
372
 
373
+ if (info.restarts >= 10) {
374
+ this._log(`${name} crashed ${info.restarts} times, giving up. Fix the issue and restart manually.`);
375
+ info.state = 'stopped';
376
+ this._writeStatus();
377
+ break;
378
+ }
379
+
380
+ this._log(`${name} crashed: ${info.lastError}, restarting in ${info._backoff}s (attempt ${info.restarts})`);
374
381
  await this._sleep(info._backoff * 1000);
375
382
  info._backoff = Math.min(info._backoff * 2, 60);
376
383
  }
package/src/installer.js CHANGED
@@ -500,13 +500,34 @@ class Installer {
500
500
  });
501
501
  });
502
502
 
503
- // The zip extracts to node-vX.X.X-win-x64/ subfolder
503
+ // The zip extracts to node-vX.X.X-win-x64/ subfolder — flatten it
504
504
  const extractedDir = path.join(nodejsDir, `node-${nodeVersion}-win-${arch}`);
505
+ if (fs.existsSync(extractedDir)) {
506
+ if (onData) onData('Flattening Node.js directory...\n');
507
+ const entries = fs.readdirSync(extractedDir);
508
+ for (const entry of entries) {
509
+ const src = path.join(extractedDir, entry);
510
+ const dest = path.join(nodejsDir, entry);
511
+ if (!fs.existsSync(dest)) {
512
+ fs.renameSync(src, dest);
513
+ } else if (fs.statSync(src).isDirectory() && fs.statSync(dest).isDirectory()) {
514
+ // Merge directories (e.g. node_modules)
515
+ const subEntries = fs.readdirSync(src);
516
+ for (const sub of subEntries) {
517
+ const subSrc = path.join(src, sub);
518
+ const subDest = path.join(dest, sub);
519
+ if (!fs.existsSync(subDest)) fs.renameSync(subSrc, subDest);
520
+ }
521
+ }
522
+ }
523
+ // Remove empty nested dir
524
+ try { fs.rmdirSync(extractedDir, { recursive: true }); } catch {}
525
+ }
505
526
  const sep = ';';
506
527
 
507
- // Add extracted node dir to PATH for this session
508
- if (!(process.env.PATH || '').includes(extractedDir)) {
509
- process.env.PATH = extractedDir + sep + (process.env.PATH || '');
528
+ // Add nodejs dir to PATH for this session
529
+ if (!(process.env.PATH || '').includes(nodejsDir)) {
530
+ process.env.PATH = nodejsDir + sep + (process.env.PATH || '');
510
531
  }
511
532
  // npm global installs go to %APPDATA%\npm
512
533
  const npmGlobal = path.join(process.env.APPDATA || '', 'npm');