@camstack/server 1.2.497 → 1.2.498
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/agent/agent-http.js +21 -3
- package/dist/agent/agent-service.js +29 -0
- package/package.json +16 -11
package/dist/agent/agent-http.js
CHANGED
|
@@ -47,6 +47,7 @@ exports.pickUiDist = pickUiDist;
|
|
|
47
47
|
exports.resolveUiDistDir = resolveUiDistDir;
|
|
48
48
|
exports.getRegistryNodes = getRegistryNodes;
|
|
49
49
|
exports.resolveHubEndpoint = resolveHubEndpoint;
|
|
50
|
+
exports.nodeDisplayName = nodeDisplayName;
|
|
50
51
|
exports.mapDiscoveredNodes = mapDiscoveredNodes;
|
|
51
52
|
exports.createAgentHttpServer = createAgentHttpServer;
|
|
52
53
|
exports.startAgentHttpServer = startAgentHttpServer;
|
|
@@ -181,15 +182,32 @@ function resolveHubEndpoint(nodes) {
|
|
|
181
182
|
return null;
|
|
182
183
|
return (0, derive_hub_url_js_1.pickIpv4)(hub.ipList) ?? hub.hostname ?? null;
|
|
183
184
|
}
|
|
185
|
+
/** Prefer a name an operator can recognise over the bare Moleculer node id. */
|
|
186
|
+
function nodeDisplayName(node) {
|
|
187
|
+
const hostname = typeof node.hostname === 'string' ? node.hostname.trim() : '';
|
|
188
|
+
if (hostname.length > 0 && hostname !== node.id)
|
|
189
|
+
return hostname;
|
|
190
|
+
const ip = (0, derive_hub_url_js_1.pickIpv4)(node.ipList);
|
|
191
|
+
if (ip !== null)
|
|
192
|
+
return ip;
|
|
193
|
+
return hostname.length > 0 ? hostname : node.id;
|
|
194
|
+
}
|
|
184
195
|
/**
|
|
185
196
|
* Map raw registry nodes (minus self) to the UI-facing shape: the hub carries
|
|
186
|
-
*
|
|
187
|
-
* `hub` node id.
|
|
197
|
+
* a human `displayName` (hostname or IPv4) so the UI never shows only `hub`.
|
|
188
198
|
*/
|
|
189
199
|
function mapDiscoveredNodes(nodes, selfId) {
|
|
190
200
|
return nodes
|
|
191
201
|
.filter((n) => n.id !== selfId)
|
|
192
|
-
.map((n) =>
|
|
202
|
+
.map((n) => {
|
|
203
|
+
const hostname = n.hostname ?? n.id;
|
|
204
|
+
return {
|
|
205
|
+
id: n.id,
|
|
206
|
+
hostname,
|
|
207
|
+
displayName: nodeDisplayName(n),
|
|
208
|
+
isHub: n.id === 'hub',
|
|
209
|
+
};
|
|
210
|
+
});
|
|
193
211
|
}
|
|
194
212
|
/**
|
|
195
213
|
* Derive the hub connection state from broker registry + config when no
|
|
@@ -50,6 +50,32 @@ const fetch_bundle_from_hub_js_1 = require("./fetch-bundle-from-hub.js");
|
|
|
50
50
|
* file). `applyDeployedBundle` logs only on the rare restore-after-failed-swap
|
|
51
51
|
* path, so a thin console adapter is sufficient.
|
|
52
52
|
*/
|
|
53
|
+
const DEFAULT_DRI_RENDER_NODE = '/dev/dri/renderD128';
|
|
54
|
+
/**
|
|
55
|
+
* Light decode + detection hardware facts for the agent UI — cheap local
|
|
56
|
+
* probes, no registry walk. `hwaccel` is the first preferred backend or
|
|
57
|
+
* `software`; `detectionDevices` lists enabled accelerator keys.
|
|
58
|
+
*/
|
|
59
|
+
function buildDecodeDetectionSlice() {
|
|
60
|
+
const hw = (0, system_1.resolveHwAccel)();
|
|
61
|
+
const signals = (0, system_1.probePlatform)();
|
|
62
|
+
const inference = (0, system_1.mapSignalsToInferenceHardware)(signals);
|
|
63
|
+
const driDevice = fs.existsSync(DEFAULT_DRI_RENDER_NODE) ? DEFAULT_DRI_RENDER_NODE : null;
|
|
64
|
+
const detectionDevices = [];
|
|
65
|
+
if (inference.gpu !== null)
|
|
66
|
+
detectionDevices.push(inference.gpu.type);
|
|
67
|
+
if (inference.npu !== null)
|
|
68
|
+
detectionDevices.push(inference.npu.type);
|
|
69
|
+
if (inference.coral != null)
|
|
70
|
+
detectionDevices.push(inference.coral.type);
|
|
71
|
+
return {
|
|
72
|
+
decode: {
|
|
73
|
+
hwaccel: hw.preferred[0] ?? 'software',
|
|
74
|
+
driDevice,
|
|
75
|
+
},
|
|
76
|
+
detectionDevices,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
53
79
|
const deploySwapLogger = {
|
|
54
80
|
info: (msg) => console.log(`[Agent] ${msg}`),
|
|
55
81
|
warn: (msg) => console.warn(`[Agent] ${msg}`),
|
|
@@ -203,6 +229,7 @@ function createAgentService(deps) {
|
|
|
203
229
|
}
|
|
204
230
|
}
|
|
205
231
|
const mem = process.memoryUsage();
|
|
232
|
+
const decodeDetection = buildDecodeDetectionSlice();
|
|
206
233
|
return {
|
|
207
234
|
nodeId: broker.nodeID,
|
|
208
235
|
name: deps.agentName,
|
|
@@ -227,6 +254,8 @@ function createAgentService(deps) {
|
|
|
227
254
|
heapTotalMB: Math.round(mem.heapTotal / 1024 / 1024),
|
|
228
255
|
},
|
|
229
256
|
localIps: getLocalIps(),
|
|
257
|
+
decode: decodeDetection.decode,
|
|
258
|
+
detectionDevices: decodeDetection.detectionDevices,
|
|
230
259
|
addons: [...deps.loadedAddons.values()].map((a) => ({
|
|
231
260
|
id: a.id,
|
|
232
261
|
status: a.status,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.498",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"files": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"./starter.js": "./dist/starter.js"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "../../scripts/tsc7 -p tsconfig.build.json && tsup && node scripts/copy-closure-patches.mjs",
|
|
20
20
|
"postinstall": "node scripts/closure-postinstall.mjs",
|
|
21
21
|
"dev": "npx concurrently -n server,ui -c blue,magenta \"CAMSTACK_RESTART_TOUCH_FILE=src/launcher.ts tsx watch --env-file=.env --ignore=./camstack-data --ignore=../../packages/core/dist --ignore=../../packages/sdk/dist --ignore=../../packages/ui-library/dist src/launcher.ts\" \"cd ../../packages/addon-admin-ui && npx vite --port 3001\"",
|
|
22
22
|
"serve": "CAMSTACK_RESTART_TOUCH_FILE=src/launcher.ts tsx watch --env-file=.env --ignore=./camstack-data --ignore=../../packages/core/dist --ignore=../../packages/sdk/dist --ignore=../../packages/ui-library/dist src/launcher.ts",
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
]
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@camstack/addon-admin-ui": "1.2.
|
|
41
|
-
"@camstack/addon-agent-ui": "1.2.
|
|
40
|
+
"@camstack/addon-admin-ui": "1.2.367",
|
|
41
|
+
"@camstack/addon-agent-ui": "1.2.201",
|
|
42
42
|
"@camstack/addon-auth": "1.2.136",
|
|
43
43
|
"@camstack/addon-decoder-nodeav": "1.2.122",
|
|
44
44
|
"@camstack/addon-notifiers": "1.2.129",
|
|
45
|
-
"@camstack/addon-pipeline": "1.2.
|
|
45
|
+
"@camstack/addon-pipeline": "1.2.349",
|
|
46
46
|
"@camstack/addon-pipeline-orchestrator": "1.2.303",
|
|
47
|
-
"@camstack/addon-post-analysis": "1.2.
|
|
48
|
-
"@camstack/sdk": "1.2.
|
|
49
|
-
"@camstack/system": "1.2.
|
|
50
|
-
"@camstack/types": "1.2.
|
|
51
|
-
"@camstack/ui-library": "1.2.
|
|
47
|
+
"@camstack/addon-post-analysis": "1.2.351",
|
|
48
|
+
"@camstack/sdk": "1.2.129",
|
|
49
|
+
"@camstack/system": "1.2.391",
|
|
50
|
+
"@camstack/types": "1.2.337",
|
|
51
|
+
"@camstack/ui-library": "1.2.258",
|
|
52
52
|
"@fastify/compress": "^9.0.0",
|
|
53
53
|
"@fastify/cookie": "^11.0.2",
|
|
54
54
|
"@fastify/cors": "^11.2.0",
|
|
@@ -86,6 +86,11 @@
|
|
|
86
86
|
"nx": {
|
|
87
87
|
"implicitDependencies": [
|
|
88
88
|
"@camstack/addon-benchmark"
|
|
89
|
-
]
|
|
89
|
+
],
|
|
90
|
+
"targets": {
|
|
91
|
+
"build": {
|
|
92
|
+
"parallelism": false
|
|
93
|
+
}
|
|
94
|
+
}
|
|
90
95
|
}
|
|
91
96
|
}
|