@openagents-org/agent-launcher 0.2.71 → 0.2.72

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.71",
3
+ "version": "0.2.72",
4
4
  "description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -433,6 +433,7 @@ class ClaudeAdapter extends BaseAdapter {
433
433
  let postedThinking = false;
434
434
  let stderrBuf = '';
435
435
  let lineBuffer = '';
436
+ let _pendingLines = Promise.resolve(); // chain of in-flight processLine calls
436
437
 
437
438
  // Capture stderr for diagnostics
438
439
  if (proc.stderr) {
@@ -537,6 +538,9 @@ class ClaudeAdapter extends BaseAdapter {
537
538
  proc.on('exit', async (code) => {
538
539
  if (timeoutTimer) clearInterval(timeoutTimer);
539
540
 
541
+ // Wait for all in-flight processLine calls to complete
542
+ try { await _pendingLines; } catch {}
543
+
540
544
  // Process remaining buffer
541
545
  const lines = lineBuffer.split('\n');
542
546
  for (const line of lines) {
@@ -577,14 +581,14 @@ class ClaudeAdapter extends BaseAdapter {
577
581
  reject(err);
578
582
  });
579
583
 
580
- // Process lines as they arrive
584
+ // Process lines as they arrive (chained to preserve order)
581
585
  proc.stdout.on('data', (chunk) => {
582
586
  lineBuffer += chunk.toString('utf-8');
583
587
  resetTimeout();
584
588
  const lines = lineBuffer.split('\n');
585
589
  lineBuffer = lines.pop(); // keep incomplete line
586
590
  for (const line of lines) {
587
- processLine(line).catch(() => {});
591
+ _pendingLines = _pendingLines.then(() => processLine(line)).catch(() => {});
588
592
  }
589
593
  });
590
594
  });
package/src/installer.js CHANGED
@@ -196,7 +196,7 @@ class Installer {
196
196
  // Use bundled node/npm if system npm not available
197
197
  if (cmd.startsWith('npm install')) {
198
198
  const prefixDir = path.join(os.homedir(), '.openagents', 'nodejs');
199
- const args = cmd.replace('npm install', 'install --ignore-scripts --no-save').replace(' -g ', ` --prefix "${prefixDir}" `);
199
+ const args = cmd.replace('npm install', 'install --ignore-scripts --no-save --install-strategy=nested').replace(' -g ', ` --prefix "${prefixDir}" `);
200
200
  cmd = this._resolveNpmCommand(args);
201
201
  }
202
202
 
@@ -232,7 +232,8 @@ class Installer {
232
232
  let cmd = rawCmd;
233
233
  if (rawCmd.startsWith('npm install')) {
234
234
  const prefixDir2 = path.join(os.homedir(), '.openagents', 'nodejs');
235
- const args = rawCmd.replace('npm install', 'install --loglevel=verbose --ignore-scripts --no-save').replace(' -g ', ` --prefix "${prefixDir2}" `);
235
+ // --install-strategy=nested prevents npm from pruning existing packages in the prefix
236
+ const args = rawCmd.replace('npm install', 'install --loglevel=verbose --ignore-scripts --no-save --install-strategy=nested').replace(' -g ', ` --prefix "${prefixDir2}" `);
236
237
  cmd = this._resolveNpmCommand(args);
237
238
  } else if (rawCmd.startsWith('pip install') || rawCmd.startsWith('pipx install')) {
238
239
  cmd = rawCmd; // pip commands stay as-is