@lensmcp/cluster 1.16.15 → 1.16.16

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.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../../libs/cluster/src/executors/gateway/runtime/server.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAkB,qBAAqB,EAAsB,MAAM,SAAS,CAAC;AAkDxH,wBAAsB,YAAY,CAChC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,CA0OxB"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../../libs/cluster/src/executors/gateway/runtime/server.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAkB,qBAAqB,EAAsB,MAAM,SAAS,CAAC;AAkDxH,wBAAsB,YAAY,CAChC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,CAgPxB"}
@@ -110,7 +110,18 @@ async function startGateway(options, context) {
110
110
  const registry = new route_registry_1.RouteRegistry();
111
111
  registry.register({ wsKey, root: context.root, routes: discovered, services });
112
112
  const routes = []; // the LIVE table the request pipeline reads (a stable ref, mutated in place)
113
- const rebuildRoutes = () => (0, route_registry_1.rebuildRoutesInPlace)(routes, registry);
113
+ // Assigned after the TLS servers are built (below) re-mints the gateway cert with the CURRENT route
114
+ // hosts and hot-swaps it. Declared HERE (above rebuildRoutes) so rebuildRoutes can trigger it AFTER every
115
+ // live route change; a no-op until the TLS servers exist (the boot mint happens separately, below).
116
+ let refreshCert = () => { };
117
+ const rebuildRoutes = () => {
118
+ (0, route_registry_1.rebuildRoutesInPlace)(routes, registry);
119
+ // The cert tracks the live route hosts BY CONSTRUCTION: any register/unregister rebuilds the table then
120
+ // re-mints, so a dynamically-registered workspace's hostnames always join the SANs (no ERR_CERT_COMMON_
121
+ // NAME_INVALID). Wiring it here (not in the control onRegister) avoids the ordering trap where the cert
122
+ // was minted from the STALE table because onRegister ran before the control handler's rebuild.
123
+ refreshCert();
124
+ };
114
125
  rebuildRoutes();
115
126
  // --- per-service api keys (the gateway is the trust boundary) ---------------
116
127
  const { serviceKeys, keyToProject } = (0, service_keys_1.loadServiceKeys)(context.root, services);
@@ -140,10 +151,6 @@ async function startGateway(options, context) {
140
151
  // REGISTERS its fragment here instead of fighting for :443, and the daemon HOSTS its services (spawns
141
152
  // them, model A) + its dashboard (planning/multi-workspace-gateway.md P3). Harmless for a lone gateway.
142
153
  const dashboardReapers = new Map();
143
- // Assigned after the TLS servers are built (below) — re-mints the gateway cert with the CURRENT route
144
- // hosts and hot-swaps it, so a workspace that registers AFTER boot gets its hostnames into the cert SANs
145
- // (otherwise the browser sees ERR_CERT_COMMON_NAME_INVALID for the new workspace's hosts).
146
- let refreshCert = () => { };
147
154
  let controlServer;
148
155
  try {
149
156
  controlServer = (0, control_1.startControlServer)({
@@ -151,16 +158,15 @@ async function startGateway(options, context) {
151
158
  killService: (svc, reason) => svcLayer.killSpawned(svc, reason),
152
159
  onRegister: (fragment) => {
153
160
  // Host the registered workspace's dashboard (appends its lensmcp.local/<key> route to the fragment
154
- // BEFORE the control handler's rebuild) and remember its reaper.
161
+ // BEFORE the control handler's rebuild) and remember its reaper. The cert re-mint happens in
162
+ // rebuildRoutes (called by the control handler right after this), once the full table is live.
155
163
  const reap = lens.hostWorkspaceDashboard(fragment);
156
164
  if (reap)
157
165
  dashboardReapers.set(fragment.wsKey, reap);
158
- refreshCert(); // the new workspace's hosts must join the gateway cert SANs
159
166
  },
160
167
  onUnregister: (fragment) => {
161
168
  dashboardReapers.get(fragment.wsKey)?.();
162
169
  dashboardReapers.delete(fragment.wsKey);
163
- refreshCert();
164
170
  },
165
171
  });
166
172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/cluster",
3
- "version": "1.16.15",
3
+ "version": "1.16.16",
4
4
  "description": "Run your Nx workspace as a local production cluster: pods on unix sockets with true HMR, one https gateway with per-project domains, scale-from-zero, autoscale, idle-kill, local-CA TLS — observed by the LensMCP lens.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -65,8 +65,8 @@
65
65
  }
66
66
  },
67
67
  "dependencies": {
68
- "@lensmcp/node-instrumentation": "1.16.15",
69
- "@lensmcp/nx-plugin": "1.16.15",
68
+ "@lensmcp/node-instrumentation": "1.16.16",
69
+ "@lensmcp/nx-plugin": "1.16.16",
70
70
  "fork-ts-checker-webpack-plugin": "^9.0.0",
71
71
  "glob": "^11.0.0",
72
72
  "http-proxy": "^1.18.0",