@cryptiklemur/lattice 1.40.4 → 1.40.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptiklemur/lattice",
3
- "version": "1.40.4",
3
+ "version": "1.40.5",
4
4
  "description": "Multi-machine agentic dashboard for Claude Code. Monitor sessions, manage MCP servers and skills, orchestrate across mesh-networked nodes.",
5
5
  "license": "MIT",
6
6
  "author": "Aaron Scherer <me@aaronscherer.me>",
@@ -224,7 +224,10 @@ export async function startDaemon(portOverride?: number | null): Promise<void> {
224
224
 
225
225
  var protocol = tlsOptions ? "https" : "http";
226
226
 
227
- Bun.serve<WsData>({
227
+ var maxRetries = 10;
228
+ for (var attempt = 0; attempt < maxRetries; attempt++) {
229
+ try {
230
+ Bun.serve<WsData>({
228
231
  port: config.port,
229
232
  hostname: "0.0.0.0",
230
233
  ...(tlsOptions ? { tls: tlsOptions } : {}),
@@ -356,6 +359,16 @@ export async function startDaemon(portOverride?: number | null): Promise<void> {
356
359
  },
357
360
  },
358
361
  });
362
+ break;
363
+ } catch (err: unknown) {
364
+ if (attempt < maxRetries - 1 && err instanceof Error && (err as any).code === "EADDRINUSE") {
365
+ log.server("Port %d in use, retrying in 1s (%d/%d)...", config.port, attempt + 1, maxRetries);
366
+ await new Promise(function (r) { setTimeout(r, 1000); });
367
+ continue;
368
+ }
369
+ throw err;
370
+ }
371
+ }
359
372
 
360
373
  log.server("Listening on %s://0.0.0.0:%d", protocol, config.port);
361
374