@cryptiklemur/lattice 5.0.7 → 5.1.0
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/dist/server/daemon.js +4 -1
- package/dist/server/index.js +18 -5
- package/package.json +1 -1
package/dist/server/daemon.js
CHANGED
|
@@ -310,9 +310,12 @@ function handleWsClose(ws) {
|
|
|
310
310
|
wsClientIds.delete(ws);
|
|
311
311
|
log.ws("Client disconnected: %s", clientId);
|
|
312
312
|
}
|
|
313
|
-
export async function startDaemon(portOverride) {
|
|
313
|
+
export async function startDaemon(portOverride, tlsOverride) {
|
|
314
314
|
var config = loadConfig();
|
|
315
315
|
var effectivePort = (portOverride && !isNaN(portOverride)) ? portOverride : config.port;
|
|
316
|
+
if (tlsOverride !== null && tlsOverride !== undefined) {
|
|
317
|
+
config.tls = tlsOverride;
|
|
318
|
+
}
|
|
316
319
|
var identity = loadOrCreateIdentity();
|
|
317
320
|
log.server("Node: %s (%s)", config.name, identity.id);
|
|
318
321
|
log.server("Home: %s", getLatticeHome());
|
package/dist/server/index.js
CHANGED
|
@@ -20,6 +20,7 @@ function getCurrentVersion() {
|
|
|
20
20
|
var args = process.argv.slice(2);
|
|
21
21
|
var command = "start";
|
|
22
22
|
var portOverride = null;
|
|
23
|
+
var tlsOverride = null;
|
|
23
24
|
for (var i = 0; i < args.length; i++) {
|
|
24
25
|
if (args[i] === "--port" && i + 1 < args.length) {
|
|
25
26
|
portOverride = parseInt(args[i + 1], 10);
|
|
@@ -28,6 +29,12 @@ for (var i = 0; i < args.length; i++) {
|
|
|
28
29
|
else if (args[i].startsWith("--port=")) {
|
|
29
30
|
portOverride = parseInt(args[i].split("=")[1], 10);
|
|
30
31
|
}
|
|
32
|
+
else if (args[i] === "--tls") {
|
|
33
|
+
tlsOverride = true;
|
|
34
|
+
}
|
|
35
|
+
else if (args[i] === "--no-tls") {
|
|
36
|
+
tlsOverride = false;
|
|
37
|
+
}
|
|
31
38
|
else if (!args[i].startsWith("-")) {
|
|
32
39
|
command = args[i];
|
|
33
40
|
}
|
|
@@ -75,7 +82,7 @@ function isDaemonRunning(pid) {
|
|
|
75
82
|
return false;
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
|
-
function spawnDaemon(port) {
|
|
85
|
+
function spawnDaemon(port, tls) {
|
|
79
86
|
var logPath = join(getLatticeHome(), "daemon.log");
|
|
80
87
|
var logFd = openSync(logPath, "a");
|
|
81
88
|
var isDev = __filename_local.endsWith(".ts");
|
|
@@ -91,6 +98,10 @@ function spawnDaemon(port) {
|
|
|
91
98
|
spawnCmd = process.execPath;
|
|
92
99
|
spawnArgs = [__filename_local, "daemon", "--port", String(port)];
|
|
93
100
|
}
|
|
101
|
+
if (tls === true)
|
|
102
|
+
spawnArgs.push("--tls");
|
|
103
|
+
if (tls === false)
|
|
104
|
+
spawnArgs.push("--no-tls");
|
|
94
105
|
var child = spawn(spawnCmd, spawnArgs, {
|
|
95
106
|
detached: true,
|
|
96
107
|
stdio: ["ignore", logFd, logFd],
|
|
@@ -179,7 +190,7 @@ async function runDaemon() {
|
|
|
179
190
|
}
|
|
180
191
|
process.on("SIGTERM", gracefulShutdown);
|
|
181
192
|
process.on("SIGINT", gracefulShutdown);
|
|
182
|
-
await startDaemon(effectivePort);
|
|
193
|
+
await startDaemon(effectivePort, tlsOverride);
|
|
183
194
|
var config = loadConfig();
|
|
184
195
|
var protocol = config.tls ? "https" : "http";
|
|
185
196
|
var url = protocol + "://localhost:" + config.port;
|
|
@@ -210,7 +221,7 @@ async function runStart() {
|
|
|
210
221
|
removePid();
|
|
211
222
|
var config = loadConfig();
|
|
212
223
|
var port = portOverride ?? config.port;
|
|
213
|
-
var childPid = spawnDaemon(port);
|
|
224
|
+
var childPid = spawnDaemon(port, tlsOverride);
|
|
214
225
|
writePid(childPid);
|
|
215
226
|
console.log("[lattice] Daemon started (PID " + childPid + ")");
|
|
216
227
|
console.log("[lattice] Logs: " + join(getLatticeHome(), "daemon.log"));
|
|
@@ -262,6 +273,8 @@ function runHelp() {
|
|
|
262
273
|
console.log("");
|
|
263
274
|
console.log(" Options:");
|
|
264
275
|
console.log(" --port=N Override the server port");
|
|
276
|
+
console.log(" --tls Enable HTTPS with auto-generated self-signed cert");
|
|
277
|
+
console.log(" --no-tls Disable HTTPS (use HTTP)");
|
|
265
278
|
console.log("");
|
|
266
279
|
console.log(" Environment:");
|
|
267
280
|
console.log(" LATTICE_HOME Data directory (default: ~/.lattice)");
|
|
@@ -291,7 +304,7 @@ async function runRestart() {
|
|
|
291
304
|
}
|
|
292
305
|
console.log("[lattice] Starting daemon...");
|
|
293
306
|
var restartPort = portOverride ?? loadConfig().port;
|
|
294
|
-
var childPid = spawnDaemon(restartPort);
|
|
307
|
+
var childPid = spawnDaemon(restartPort, tlsOverride);
|
|
295
308
|
writePid(childPid);
|
|
296
309
|
console.log("[lattice] Daemon started (PID " + childPid + ")");
|
|
297
310
|
}
|
|
@@ -406,7 +419,7 @@ async function runUpdate() {
|
|
|
406
419
|
removePid();
|
|
407
420
|
await new Promise(function (resolve) { setTimeout(resolve, 1000); });
|
|
408
421
|
var updatePort = portOverride ?? loadConfig().port;
|
|
409
|
-
var childPid = spawnDaemon(updatePort);
|
|
422
|
+
var childPid = spawnDaemon(updatePort, tlsOverride);
|
|
410
423
|
writePid(childPid);
|
|
411
424
|
console.log("[lattice] Daemon restarted (PID %d)", childPid);
|
|
412
425
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cryptiklemur/lattice",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
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>",
|