@camstack/server 1.2.678 → 1.2.680
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/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.680] - 2026-10-28
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- A desktop or container agent renamed from its own page now shows the new name on the hub right away, even when the rename was made while it was pairing
|
|
15
|
+
|
|
16
|
+
## [1.2.679] - 2026-10-28
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- A pet feeder shows whether it runs on mains or on its battery
|
|
21
|
+
- Added the ir-transmitter capability routes.
|
|
22
|
+
|
|
10
23
|
## [1.2.678] - 2026-10-28
|
|
11
24
|
|
|
12
25
|
### Changed
|
|
@@ -55,7 +55,7 @@ function describe(s) {
|
|
|
55
55
|
return [
|
|
56
56
|
`Pairing request from hub "${s.hub.nodeId}" (${s.hub.url}), CA ${fp}`,
|
|
57
57
|
` PIN: ${s.pin} (type it on this agent's page with the code the HUB shows)`,
|
|
58
|
-
` this agent's code: ${s.code ??
|
|
58
|
+
` this agent's code: ${s.code ?? "(shown here once you confirmed on this agent's page)"} (type this on the hub)`,
|
|
59
59
|
` expires: ${new Date(s.expiresAt).toISOString()}`,
|
|
60
60
|
].join('\n');
|
|
61
61
|
}
|
|
@@ -211,6 +211,26 @@ function isHubConnected(broker) {
|
|
|
211
211
|
return false;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* The agent's name as persisted in `agent.json` — the single source of truth the agent UI
|
|
216
|
+
* writes (`POST /api/agent/config`). The in-memory `deps.agentName` is only a fallback: the
|
|
217
|
+
* UI's follow-up `$agent.rename` call is best-effort and can be lost (broker mid-reconnect
|
|
218
|
+
* while pairing), which left the hub on the old name until a restart.
|
|
219
|
+
*/
|
|
220
|
+
function persistedAgentName(configPath, fallback) {
|
|
221
|
+
try {
|
|
222
|
+
const raw = JSON.parse(fs.readFileSync(path.resolve(configPath), 'utf-8'));
|
|
223
|
+
if (typeof raw === 'object' && raw !== null && 'name' in raw) {
|
|
224
|
+
const name = raw.name;
|
|
225
|
+
if (typeof name === 'string' && name.trim().length > 0)
|
|
226
|
+
return name.trim();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
/* no file yet, or unreadable: the in-memory name stands */
|
|
231
|
+
}
|
|
232
|
+
return fallback;
|
|
233
|
+
}
|
|
214
234
|
function createAgentService(deps) {
|
|
215
235
|
return {
|
|
216
236
|
name: '$agent',
|
|
@@ -235,7 +255,7 @@ function createAgentService(deps) {
|
|
|
235
255
|
const decodeDetection = buildDecodeDetectionSlice();
|
|
236
256
|
return {
|
|
237
257
|
nodeId: broker.nodeID,
|
|
238
|
-
name: deps.agentName,
|
|
258
|
+
name: persistedAgentName(deps.configPath, deps.agentName),
|
|
239
259
|
platform: os.platform(),
|
|
240
260
|
arch: os.arch(),
|
|
241
261
|
hostname: os.hostname(),
|
|
@@ -307,7 +327,7 @@ function createAgentService(deps) {
|
|
|
307
327
|
return {
|
|
308
328
|
ok: errored === 0,
|
|
309
329
|
nodeId: broker.nodeID,
|
|
310
|
-
name: deps.agentName,
|
|
330
|
+
name: persistedAgentName(deps.configPath, deps.agentName),
|
|
311
331
|
version: deps.agentVersion ?? 'unknown',
|
|
312
332
|
uptimeSeconds: Math.round(process.uptime()),
|
|
313
333
|
pid: process.pid,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// AUTO-GENERATED by scripts/generate-cap-mounts.ts — DO NOT EDIT
|
|
3
3
|
// Re-run: npx tsx scripts/generate-cap-mounts.ts
|
|
4
4
|
//
|
|
5
|
-
// Mounted:
|
|
5
|
+
// Mounted: 185 Skipped (legacy): 3
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LEGACY_SHAPE_SKIP = void 0;
|
|
8
8
|
exports.mountAllCaps = mountAllCaps;
|
|
@@ -320,6 +320,7 @@ function mountAllCaps(services) {
|
|
|
320
320
|
imageSettings: (0, generated_cap_routers_js_1.createCapRouter_imageSettings)((_ctx) => (0, cap_mount_helpers_js_1.requireDeviceScoped)(reg, 'image-settings'), remoteCapProxy),
|
|
321
321
|
integrations: (0, generated_cap_routers_js_1.createCapRouter_integrations)((_ctx) => reg?.getSingleton('integrations') ?? null, remoteCapProxy),
|
|
322
322
|
intercom: (0, generated_cap_routers_js_1.createCapRouter_intercom)((_ctx) => (0, cap_mount_helpers_js_1.requireDeviceScoped)(reg, 'intercom'), remoteCapProxy),
|
|
323
|
+
irTransmitter: (0, generated_cap_routers_js_1.createCapRouter_irTransmitter)((_ctx) => (0, cap_mount_helpers_js_1.requireDeviceScoped)(reg, 'ir-transmitter'), remoteCapProxy),
|
|
323
324
|
keychain: (0, generated_cap_routers_js_1.createCapRouter_keychain)((_ctx) => reg?.getSingleton('keychain') ?? null, remoteCapProxy),
|
|
324
325
|
keychainAdmin: (0, generated_cap_routers_js_1.createCapRouter_keychainAdmin)((_ctx) => reg?.getSingleton('keychain-admin') ?? null, remoteCapProxy),
|
|
325
326
|
lawnMowerControl: (0, generated_cap_routers_js_1.createCapRouter_lawnMowerControl)((_ctx) => (0, cap_mount_helpers_js_1.requireDeviceScoped)(reg, 'lawn-mower-control'), remoteCapProxy),
|