@cryptiklemur/lattice 5.3.0 → 5.3.1

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.
@@ -14,7 +14,6 @@ import { startDiscovery } from "./mesh/discovery.js";
14
14
  import { startMeshConnections, onPeerConnected, onPeerDisconnected, onPeerMessage, getAllRemoteProjects } from "./mesh/connector.js";
15
15
  import { handleProxyRequest, handleProxyResponse } from "./mesh/proxy.js";
16
16
  import { verifyPassphrase, generateSessionToken, addSession, isValidSession } from "./auth/passphrase.js";
17
- import { ensureCerts } from "./tls.js";
18
17
  import { log } from "./logger.js";
19
18
  import { detectIdeProjectName } from "./handlers/settings.js";
20
19
  import "./handlers/session.js";
@@ -398,32 +397,29 @@ export async function startDaemon(portOverride, tlsOverride) {
398
397
  });
399
398
  var tlsOptions;
400
399
  if (config.tls) {
401
- try {
402
- var certs = ensureCerts();
403
- tlsOptions = {
404
- cert: readFileSync(certs.cert),
405
- key: readFileSync(certs.key),
406
- };
407
- log.server("TLS enabled (cert: %s)", certs.cert);
408
- }
409
- catch (err) {
410
- if (err?.code === "EACCES") {
411
- console.error("[lattice] Permission denied reading TLS certs. Run 'lattice setup-tls' to fix permissions.");
400
+ var certsDir = join(getLatticeHome(), "certs");
401
+ var certPath = join(certsDir, "cert.pem");
402
+ var keyPath = join(certsDir, "key.pem");
403
+ if (existsSync(certPath) && existsSync(keyPath)) {
404
+ try {
405
+ tlsOptions = {
406
+ cert: readFileSync(certPath),
407
+ key: readFileSync(keyPath),
408
+ };
409
+ log.server("TLS enabled (cert: %s)", certPath);
412
410
  }
413
- else {
414
- console.error("[lattice] Failed to load TLS certs, falling back to HTTP:", err);
411
+ catch (err) {
412
+ if (err?.code === "EACCES") {
413
+ console.error("[lattice] Permission denied reading TLS certs. Run 'lattice setup-tls' to fix permissions.");
414
+ }
415
+ else {
416
+ console.error("[lattice] Failed to load TLS certs, falling back to HTTP:", err);
417
+ }
415
418
  }
416
419
  }
417
- }
418
- if (tlsOptions) {
419
- var certsDir = join(getLatticeHome(), "certs");
420
- log.server("TLS cert: %s", join(certsDir, "cert.pem"));
421
- log.server("To trust the self-signed cert:");
422
- log.server(" Linux: sudo cp %s /usr/local/share/ca-certificates/lattice.crt && sudo update-ca-certificates", join(certsDir, "cert.pem"));
423
- log.server(" macOS: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain %s", join(certsDir, "cert.pem"));
424
- log.server(" Or use Tailscale HTTPS (no trust needed):");
425
- log.server(" tailscale cert $(tailscale status --json | jq -r '.Self.DNSName' | sed 's/\\.$//')");
426
- log.server(" Then copy: cp <hostname>.crt %s && cp <hostname>.key %s", join(certsDir, "cert.pem"), join(certsDir, "key.pem"));
420
+ else {
421
+ console.error("[lattice] TLS enabled but no certs found. Run 'lattice setup-tls' to generate them.");
422
+ }
427
423
  }
428
424
  var protocol = tlsOptions ? "https" : "http";
429
425
  var httpServer = tlsOptions
@@ -4,7 +4,7 @@ delete process.env.CLAUDE_CODE_ENTRYPOINT;
4
4
  import { existsSync, readFileSync, writeFileSync, unlinkSync, openSync } from "node:fs";
5
5
  import { join, dirname } from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
- import { spawn } from "node:child_process";
7
+ import { spawn, execSync } from "node:child_process";
8
8
  import { getLatticeHome, loadConfig } from "./config.js";
9
9
  var __filename_local = fileURLToPath(import.meta.url);
10
10
  var __dirname_local = dirname(__filename_local);
@@ -209,9 +209,18 @@ async function runDaemon() {
209
209
  }
210
210
  }
211
211
  catch { }
212
+ var tailscaleUrl;
213
+ try {
214
+ var tsResult = execSync("tailscale status --json", { encoding: "utf-8" });
215
+ var tsHostname = JSON.parse(tsResult).Self.DNSName.replace(/\.$/, "");
216
+ if (tsHostname) {
217
+ tailscaleUrl = protocol + "://" + tsHostname + ":" + config.port;
218
+ }
219
+ }
220
+ catch { }
212
221
  printBanner();
213
222
  await printQrCode(url);
214
- printStatus(config, version, projectCount, sessionCount);
223
+ printStatus(config, version, projectCount, sessionCount, tailscaleUrl);
215
224
  }
216
225
  async function runStart() {
217
226
  var pid = readPid();
@@ -14,14 +14,18 @@ var BANNER = `
14
14
  export function printBanner() {
15
15
  console.log(BANNER);
16
16
  }
17
- export function printStatus(config, version, projectCount, sessionCount) {
17
+ export function printStatus(config, version, projectCount, sessionCount, tailscaleUrl) {
18
18
  var protocol = config.tls ? "https" : "http";
19
19
  var url = protocol + "://localhost:" + config.port;
20
- console.log("");
21
- p.note("lattice v" + version + " — " + url + "\n" +
22
- projectCount + " project" + (projectCount !== 1 ? "s" : "") +
20
+ var lines = "lattice v" + version + " — " + url + "\n";
21
+ if (tailscaleUrl) {
22
+ lines += tailscaleUrl + "\n";
23
+ }
24
+ lines += projectCount + " project" + (projectCount !== 1 ? "s" : "") +
23
25
  " · " + sessionCount + " session" + (sessionCount !== 1 ? "s" : "") + "\n" +
24
- "Press Ctrl+C to stop", "Running");
26
+ "Press Ctrl+C to stop";
27
+ console.log("");
28
+ p.note(lines, "Running");
25
29
  console.log("");
26
30
  }
27
31
  export async function printQrCode(url) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptiklemur/lattice",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
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>",