@camstack/server 1.2.566 → 1.2.568

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.
@@ -310,6 +310,7 @@ function buildCapabilityRouters(services) {
310
310
  registry: services.capabilityRegistry,
311
311
  agentRegistry: services.agentRegistry,
312
312
  nodeClient: (nodeId) => (0, node_certificates_client_js_1.createNodeCertificatesClient)(services.moleculer, nodeId),
313
+ nodeAddonIds: (nodeId) => services.moleculer.getNodeAddonIds(nodeId),
313
314
  hubDataDir: path.resolve(services.configService.get('server.dataPath') ?? 'camstack-data'),
314
315
  log: services.loggingService.createLogger('certificates'),
315
316
  }),
@@ -929,9 +929,12 @@ class MoleculerService {
929
929
  else
930
930
  this.nodeOwners.set(params.nodeId, owner);
931
931
  this.applyNodeManifest(params, previousManifest, owner, previousOwner);
932
+ // The leaf this node presents NOW is recorded, and a renewal leaf it no longer presents (it
933
+ // reverted to its previous one) is set aside at once.
934
+ this.observePresentedMeshLeaf(params.nodeId);
932
935
  // The node's capabilities are routable now: whoever waits for this registration (a mesh
933
936
  // leaf renewal confirming the node came back WITH the new leaf) is told, with no polling.
934
- (0, system_1.emitProcessNodeRegistered)(params.nodeId);
937
+ (0, system_1.emitProcessNodeRegistered)(params.nodeId, params.addons.map((addon) => addon.addonId));
935
938
  // Notify AgentRegistryService to reconcile placement for bare-ID
936
939
  // agent nodes (no '/' = not a hub child worker, not the hub itself).
937
940
  // The handshake is the authoritative completeness signal — the full
@@ -1299,6 +1302,34 @@ class MoleculerService {
1299
1302
  isNodeRegistered(nodeId) {
1300
1303
  return this.nodeRegistry.getNodeManifest(nodeId) !== undefined;
1301
1304
  }
1305
+ /**
1306
+ * Record the mesh leaf `nodeId` presents on its live connection (D856). Fire and forget: a
1307
+ * registry that is not up, or a write that fails, must not fail the node's registration.
1308
+ */
1309
+ observePresentedMeshLeaf(nodeId) {
1310
+ const registry = (0, system_1.getProcessMeshCertificateRegistry)();
1311
+ const leaf = (0, system_1.getProcessPeerLeaf)(nodeId);
1312
+ if (registry === null || leaf === undefined)
1313
+ return;
1314
+ registry
1315
+ .recordObserved(nodeId, {
1316
+ cn: nodeId,
1317
+ serial: leaf.serial,
1318
+ fingerprint: leaf.fingerprint,
1319
+ notBefore: leaf.notBefore,
1320
+ notAfter: leaf.notAfter,
1321
+ })
1322
+ .catch((error) => {
1323
+ this.logger.warn('Could not record the mesh leaf the node presents', {
1324
+ tags: { nodeId },
1325
+ meta: { error: error instanceof Error ? error.message : String(error) },
1326
+ });
1327
+ });
1328
+ }
1329
+ /** The addon ids a node's registration holds (its own and its children's); empty when none. */
1330
+ getNodeAddonIds(nodeId) {
1331
+ return (this.nodeRegistry.getNodeManifest(nodeId) ?? []).map((entry) => entry.addonId);
1332
+ }
1302
1333
  /**
1303
1334
  * The root-package identity a node reported in its `registerNode`
1304
1335
  * manifest (runtime-updatable node packages: version visibility), or null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.566",
3
+ "version": "1.2.568",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "files": [
@@ -38,8 +38,8 @@
38
38
  ]
39
39
  },
40
40
  "dependencies": {
41
- "@camstack/addon-admin-ui": "1.2.420",
42
- "@camstack/addon-agent-ui": "1.2.231",
41
+ "@camstack/addon-admin-ui": "1.2.422",
42
+ "@camstack/addon-agent-ui": "1.2.232",
43
43
  "@camstack/addon-auth": "1.2.144",
44
44
  "@camstack/addon-decoder-nodeav": "1.2.123",
45
45
  "@camstack/addon-notifiers": "1.2.134",
@@ -48,9 +48,9 @@
48
48
  "@camstack/addon-post-analysis": "1.2.369",
49
49
  "@camstack/develop": "0.1.8",
50
50
  "@camstack/sdk": "1.2.131",
51
- "@camstack/system": "1.2.430",
52
- "@camstack/types": "1.2.366",
53
- "@camstack/ui-library": "1.2.288",
51
+ "@camstack/system": "1.2.432",
52
+ "@camstack/types": "1.2.368",
53
+ "@camstack/ui-library": "1.2.289",
54
54
  "@fastify/compress": "^9.0.0",
55
55
  "@fastify/cookie": "^11.0.2",
56
56
  "@fastify/cors": "^11.2.0",
@@ -60,7 +60,7 @@
60
60
  "@trpc/server": "^11.16.0",
61
61
  "fastify": "^5",
62
62
  "js-yaml": "^4",
63
- "moleculer": "^0.15.0",
63
+ "moleculer": "0.15.0",
64
64
  "node-av": "^6.0.0",
65
65
  "node-pty": "^1.0.0",
66
66
  "sharp": "^0.35.2",