@mrrlin-dev/external-agents 0.3.4 → 0.3.5

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.
Files changed (2) hide show
  1. package/cli.js +13 -3
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -227,10 +227,20 @@ function cmdInit(flags) {
227
227
  const child = spawn(process.execPath, [uiPath], { stdio: "inherit", env });
228
228
  // Give the UI ~600ms to bind before opening the browser (loopback listen is
229
229
  // usually instantaneous but we do not want the browser to open on a not-yet-
230
- // bound port).
230
+ // bound port). Browser-open is best-effort — swallow BOTH sync spawn errors
231
+ // AND async 'error' events (ENOENT is emitted async, not thrown; without a
232
+ // listener it crashes the process — this is what breaks curl|bash on a
233
+ // headless Linux box that has no xdg-open installed). The UI keeps running.
231
234
  setTimeout(() => {
232
- try { spawn(opener, openerArgs, { stdio: "ignore", detached: true }).unref(); }
233
- catch { /* browser open is best-effort; UI is still up on ${url} */ }
235
+ try {
236
+ const opener_proc = spawn(opener, openerArgs, { stdio: "ignore", detached: true });
237
+ opener_proc.on("error", (err) => {
238
+ console.error(`external-agents init: could not launch browser (${err.code || err.message}) — open ${url} manually.`);
239
+ });
240
+ opener_proc.unref();
241
+ } catch (err) {
242
+ console.error(`external-agents init: could not launch browser (${err.message}) — open ${url} manually.`);
243
+ }
234
244
  }, 600);
235
245
  child.on("exit", (code) => process.exit(code ?? 0));
236
246
  process.on("SIGINT", () => child.kill("SIGINT"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/external-agents",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "One MCP server for every LLM you talk to \u2014 direct-API dispatcher across Gemini, DeepSeek, Groq, OpenRouter, Cerebras, and more. Part of mrrlin.com.",
5
5
  "type": "module",
6
6
  "main": "server.js",