@camstack/server 1.2.822 → 1.2.823
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 +6 -0
- package/package.json +8 -9
- package/system/dist/addon-runner.js +18 -13
- package/system/dist/addon-runner.mjs +19 -14
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-C4yxMErF.mjs → agent-https-CDl7mB_F.mjs} +1 -1
- package/system/dist/{agent-https-SGBI0xP8.js → agent-https-Df53Fvk1.js} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +3 -3
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composed-device-set.d.ts +5 -1
- package/system/dist/builtins/composer/composed-device.d.ts +4 -0
- package/system/dist/builtins/composer/composed-name.d.ts +30 -0
- package/system/dist/builtins/composer/composer.addon.js +94 -6
- package/system/dist/builtins/composer/composer.addon.mjs +94 -6
- package/system/dist/builtins/composer/composer.d.ts +13 -0
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/composition-api.d.ts +6 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +68 -4
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +68 -4
- package/system/dist/builtins/core-blocks/rename-composition-block.d.ts +16 -0
- package/system/dist/builtins/core-blocks/sync-composed-device-name.d.ts +19 -0
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +37 -3
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +37 -3
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +10 -10
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +115 -115
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-6MVUyUry.js → capture-engine-C0Z5rwCO.js} +1 -1
- package/system/dist/{capture-engine-BSjE-CQA.mjs → capture-engine-D_GQBgrZ.mjs} +1 -1
- package/system/dist/{composition-sources-BBAOXZdC.js → composition-sources-DIZx3mW3.js} +1 -1
- package/system/dist/{composition-sources-C8T9DRbZ.mjs → composition-sources-mx-2yCDv.mjs} +1 -1
- package/system/dist/{constants-CReG6K4k.mjs → constants-BQlx9HDp.mjs} +1 -1
- package/system/dist/{constants-v0g9--wN.js → constants-CAOcKiWT.js} +1 -1
- package/system/dist/{coral-accelerators-DBlgWB8k.mjs → coral-accelerators-BW3OcrLD.mjs} +6 -6
- package/system/dist/{custom-action-registry-B9zFBNVa.mjs → custom-action-registry-N7flBDwT.mjs} +37 -37
- package/system/dist/{device-ca-BFcBTfff.js → device-ca-93LsCF_Q.js} +1 -1
- package/system/dist/{device-ca-cX8qUs2s.mjs → device-ca-CK6GTnNh.mjs} +1 -1
- package/system/dist/{dist-DjBZ1HhF.mjs → dist-BQiyo22b.mjs} +76 -26
- package/system/dist/{dist-C2czR9xK.js → dist-izXDzt4g.js} +81 -25
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-CpCleue0.js → hub-mdns-ciao-Dt_tgvol.js} +2 -2
- package/system/dist/{hub-mdns-ciao-Cnr8xiSd.mjs → hub-mdns-ciao-srpOrqIP.mjs} +2 -2
- package/system/dist/index.js +26 -21
- package/system/dist/index.mjs +238 -233
- package/system/dist/{legacy-integration-rows-door-DhW6mPZj.js → legacy-integration-rows-door-BH43eDu6.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-CGajkVPh.mjs → legacy-integration-rows-door-wu2GWY6U.mjs} +1 -1
- package/system/dist/rename-composition-block-6oLQVzft.js +112 -0
- package/system/dist/rename-composition-block-CH6ZoSJA.mjs +101 -0
- package/system/dist/{restore-archive-eA7L58KT.mjs → restore-archive-C4rR2SYV.mjs} +94 -94
- package/system/dist/{restore-archive-BLab80kx.js → restore-archive-DpZ2PbLN.js} +1 -1
- package/system/dist/{wal-maintenance-DeBxoOFh.mjs → wal-maintenance-CNfp0HHX.mjs} +0 -0
- package/system/dist/{wal-maintenance-DhnSF7K-.js → wal-maintenance-DAA2qJja.js} +0 -0
- package/system/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.823",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,10 +66,9 @@
|
|
|
66
66
|
],
|
|
67
67
|
"requires": {
|
|
68
68
|
"addons": {
|
|
69
|
-
"@camstack/addon-admin-ui": ">=1.2.
|
|
70
|
-
"@camstack/addon-agent-ui": ">=1.2.
|
|
71
|
-
"@camstack/addon-
|
|
72
|
-
"@camstack/addon-provider-bosch": ">=0.1.46"
|
|
69
|
+
"@camstack/addon-admin-ui": ">=1.2.630",
|
|
70
|
+
"@camstack/addon-agent-ui": ">=1.2.355",
|
|
71
|
+
"@camstack/addon-provider-bosch": ">=0.1.47"
|
|
73
72
|
},
|
|
74
73
|
"wrapper": {
|
|
75
74
|
"desktop": ">=0.0.1",
|
|
@@ -78,8 +77,8 @@
|
|
|
78
77
|
}
|
|
79
78
|
},
|
|
80
79
|
"dependencies": {
|
|
81
|
-
"@camstack/addon-admin-ui": "1.2.
|
|
82
|
-
"@camstack/addon-agent-ui": "1.2.
|
|
80
|
+
"@camstack/addon-admin-ui": "1.2.630",
|
|
81
|
+
"@camstack/addon-agent-ui": "1.2.355",
|
|
83
82
|
"@camstack/addon-auth": "1.2.180",
|
|
84
83
|
"@camstack/addon-benchmark": "1.2.312",
|
|
85
84
|
"@camstack/addon-decoder-nodeav": "1.2.149",
|
|
@@ -89,8 +88,8 @@
|
|
|
89
88
|
"@camstack/addon-post-analysis": "1.2.689",
|
|
90
89
|
"@camstack/develop": "0.1.51",
|
|
91
90
|
"@camstack/sdk": "1.2.157",
|
|
92
|
-
"@camstack/types": "1.2.
|
|
93
|
-
"@camstack/ui-library": "1.2.
|
|
91
|
+
"@camstack/types": "1.2.537",
|
|
92
|
+
"@camstack/ui-library": "1.2.414",
|
|
94
93
|
"@fastify/compress": "^9.0.0",
|
|
95
94
|
"@fastify/cookie": "^11.0.2",
|
|
96
95
|
"@fastify/cors": "^11.2.0",
|
|
@@ -6504,18 +6504,22 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
6504
6504
|
create: async (stableId, DeviceClass, config, parentDeviceId = null, initialMeta = void 0) => {
|
|
6505
6505
|
const id = await deviceApi.allocateDeviceId(stableId);
|
|
6506
6506
|
if (initialMeta) {
|
|
6507
|
-
if (initialMeta.name !== void 0)
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6507
|
+
if (initialMeta.name !== void 0) {
|
|
6508
|
+
const systemName = stableId.startsWith(_camstack_types_addon.COMPOSED_DEVICE_STABLE_ID_PREFIX);
|
|
6509
|
+
await callDeviceManager(api, "setName", {
|
|
6510
|
+
deviceId: id,
|
|
6511
|
+
name: initialMeta.name,
|
|
6512
|
+
...systemName ? { stampUserNamed: false } : {}
|
|
6513
|
+
}).catch((err) => {
|
|
6514
|
+
opts.logger.warn("create: setName pre-seed failed", {
|
|
6515
|
+
tags: {
|
|
6516
|
+
stableId,
|
|
6517
|
+
deviceId: id
|
|
6518
|
+
},
|
|
6519
|
+
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
6520
|
+
});
|
|
6517
6521
|
});
|
|
6518
|
-
}
|
|
6522
|
+
}
|
|
6519
6523
|
if (initialMeta.location !== void 0) await callDeviceManager(api, "setLocation", {
|
|
6520
6524
|
deviceId: id,
|
|
6521
6525
|
location: initialMeta.location
|
|
@@ -6633,10 +6637,11 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
6633
6637
|
});
|
|
6634
6638
|
return id;
|
|
6635
6639
|
},
|
|
6636
|
-
setName: async (deviceId, name) => {
|
|
6640
|
+
setName: async (deviceId, name, write) => {
|
|
6637
6641
|
await callDeviceManager(api, "setName", {
|
|
6638
6642
|
deviceId,
|
|
6639
|
-
name
|
|
6643
|
+
name,
|
|
6644
|
+
...write?.stampUserNamed === false ? { stampUserNamed: false } : {}
|
|
6640
6645
|
});
|
|
6641
6646
|
},
|
|
6642
6647
|
setLocation: async (deviceId, location) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { register } from "node:module";
|
|
2
|
-
import { BOOT_RECOVERY_BACKOFF_MS, CALLER_STAMPED_CAPABILITIES, CAP_METHOD_TIMEOUTS_MS, COLLECTION_ARRAY_METHODS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, ErrorI18nPayloadSchema, EventCategory, MIGRATION_API_VERSION, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry, ReadinessTimeoutError, addonSliceHandleApi, asJsonObject, asString, collectZodSecretPaths, createDebugEmitter, createDeviceProxy, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, describeCustomActions, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, findMigrationsBlocked, isCollectionArrayMethodName, isProviderOptionalMethodName, maskUrlCredentials, nodeIdOfScopedKey, normalizeAddonInitResult, readCommandOrigin, readErrorI18n, readNodePin, resolveDeviceSettings, resolveSecretViewsIn, scopeKey, scrubKnownSecrets, withCapInputDefaults } from "@camstack/types/addon";
|
|
2
|
+
import { BOOT_RECOVERY_BACKOFF_MS, CALLER_STAMPED_CAPABILITIES, CAP_METHOD_TIMEOUTS_MS, COLLECTION_ARRAY_METHODS, COMPOSED_DEVICE_STABLE_ID_PREFIX, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, ErrorI18nPayloadSchema, EventCategory, MIGRATION_API_VERSION, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry, ReadinessTimeoutError, addonSliceHandleApi, asJsonObject, asString, collectZodSecretPaths, createDebugEmitter, createDeviceProxy, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, describeCustomActions, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, findMigrationsBlocked, isCollectionArrayMethodName, isProviderOptionalMethodName, maskUrlCredentials, nodeIdOfScopedKey, normalizeAddonInitResult, readCommandOrigin, readErrorI18n, readNodePin, resolveDeviceSettings, resolveSecretViewsIn, scopeKey, scrubKnownSecrets, withCapInputDefaults } from "@camstack/types/addon";
|
|
3
3
|
import * as fs$1 from "node:fs";
|
|
4
4
|
import fs, { createReadStream, createWriteStream, existsSync, readFileSync, readdirSync } from "node:fs";
|
|
5
5
|
import * as path from "node:path";
|
|
@@ -6449,18 +6449,22 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
6449
6449
|
create: async (stableId, DeviceClass, config, parentDeviceId = null, initialMeta = void 0) => {
|
|
6450
6450
|
const id = await deviceApi.allocateDeviceId(stableId);
|
|
6451
6451
|
if (initialMeta) {
|
|
6452
|
-
if (initialMeta.name !== void 0)
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6452
|
+
if (initialMeta.name !== void 0) {
|
|
6453
|
+
const systemName = stableId.startsWith(COMPOSED_DEVICE_STABLE_ID_PREFIX);
|
|
6454
|
+
await callDeviceManager(api, "setName", {
|
|
6455
|
+
deviceId: id,
|
|
6456
|
+
name: initialMeta.name,
|
|
6457
|
+
...systemName ? { stampUserNamed: false } : {}
|
|
6458
|
+
}).catch((err) => {
|
|
6459
|
+
opts.logger.warn("create: setName pre-seed failed", {
|
|
6460
|
+
tags: {
|
|
6461
|
+
stableId,
|
|
6462
|
+
deviceId: id
|
|
6463
|
+
},
|
|
6464
|
+
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
6465
|
+
});
|
|
6462
6466
|
});
|
|
6463
|
-
}
|
|
6467
|
+
}
|
|
6464
6468
|
if (initialMeta.location !== void 0) await callDeviceManager(api, "setLocation", {
|
|
6465
6469
|
deviceId: id,
|
|
6466
6470
|
location: initialMeta.location
|
|
@@ -6578,10 +6582,11 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
6578
6582
|
});
|
|
6579
6583
|
return id;
|
|
6580
6584
|
},
|
|
6581
|
-
setName: async (deviceId, name) => {
|
|
6585
|
+
setName: async (deviceId, name, write) => {
|
|
6582
6586
|
await callDeviceManager(api, "setName", {
|
|
6583
6587
|
deviceId,
|
|
6584
|
-
name
|
|
6588
|
+
name,
|
|
6589
|
+
...write?.stampUserNamed === false ? { stampUserNamed: false } : {}
|
|
6585
6590
|
});
|
|
6586
6591
|
},
|
|
6587
6592
|
setLocation: async (deviceId, location) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as isModelDownloaded, S as isModelDownloadHttpError, _ as downloadFile, a as startEventLoopStallMonitor, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, p as ModelDownloadHttpError, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-
|
|
1
|
+
import { C as isModelDownloaded, S as isModelDownloadHttpError, _ as downloadFile, a as startEventLoopStallMonitor, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, p as ModelDownloadHttpError, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-N7flBDwT.mjs";
|
|
2
2
|
import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg, t as COURTESY_DEFAULT_WIDTH } from "./snapshot-courtesy-CyFs1M3I.mjs";
|
|
3
3
|
export { COURTESY_DEFAULT_WIDTH, CustomActionRegistry, ModelDownloadHttpError, ModelDownloadService, STALL_REPORT_MS, STALL_TICK_MS, adoptModelRevisions, attributeStall, collectModelFiles, contentTypeFor, courtesyCacheKey, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloadHttpError, isModelDownloaded, parseRangeHeader, renderCourtesyJpeg, renderCourtesyOverlayJpeg, resolveFormatRevision, startEventLoopStallMonitor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sc as defineRecordKinds } from "./dist-
|
|
1
|
+
import { sc as defineRecordKinds } from "./dist-BQiyo22b.mjs";
|
|
2
2
|
import { C as backdatedNotBefore, S as withUtcTimeEncoding, _ as NameConstraints, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, g as GeneralSubtrees, h as GeneralSubtree, i as Extension, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension, v as GeneralName, x as AsnConvert } from "./x509.es-BRiJgOvu.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { X509Certificate, createHash, createPrivateKey, randomBytes, webcrypto } from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-izXDzt4g.js");
|
|
3
3
|
const require_x509_es = require("./x509.es-WtnRNyYS.js");
|
|
4
4
|
let zod = require("zod");
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-izXDzt4g.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { al as EventCategory, gn as addonPagesCapability, os as BaseAddon, rl as errMsg } from "../../dist-BQiyo22b.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
|
-
import * as fs
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
//#region src/builtins/addon-pages-aggregator/dedupe-pages.ts
|
|
7
7
|
/** Stable identity for an addon page, independent of which node reported it. */
|
|
@@ -211,11 +211,11 @@ var AddonPagesAggregatorAddon = class extends BaseAddon {
|
|
|
211
211
|
const bundlePath = this.resolveBundlePath(addonId, bundle);
|
|
212
212
|
if (bundlePath === null) return `/api/addon-pages/${addonId}/${bundle}?v=${Math.floor(Date.now())}`;
|
|
213
213
|
try {
|
|
214
|
-
const stat = fs
|
|
214
|
+
const stat = fs.statSync(bundlePath);
|
|
215
215
|
const cacheKey = `${bundlePath}:${stat.size}:${stat.mtimeMs}`;
|
|
216
216
|
let v = this.bundleHashCache.get(cacheKey);
|
|
217
217
|
if (v === void 0) {
|
|
218
|
-
v = createHash("sha1").update(fs
|
|
218
|
+
v = createHash("sha1").update(fs.readFileSync(bundlePath)).digest("hex").slice(0, 12);
|
|
219
219
|
this.bundleHashCache.set(cacheKey, v);
|
|
220
220
|
}
|
|
221
221
|
return `/api/addon-pages/${addonId}/${bundle}?v=${v}`;
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-izXDzt4g.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { al as EventCategory, os as BaseAddon, rl as errMsg, vn as addonWidgetsCapability } from "../../dist-BQiyo22b.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
|
-
import * as fs
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
//#region src/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.ts
|
|
7
7
|
/**
|
|
@@ -204,9 +204,9 @@ var AddonWidgetsAggregatorAddon = class extends BaseAddon {
|
|
|
204
204
|
if (entryPath === null) return String(Math.floor(Date.now()));
|
|
205
205
|
try {
|
|
206
206
|
const dir = path$1.dirname(entryPath);
|
|
207
|
-
const files = fs
|
|
207
|
+
const files = fs.readdirSync(dir).filter((f) => fs.statSync(path$1.join(dir, f)).isFile()).sort();
|
|
208
208
|
const cacheKey = `${dir}#${files.map((f) => {
|
|
209
|
-
const s = fs
|
|
209
|
+
const s = fs.statSync(path$1.join(dir, f));
|
|
210
210
|
return `${f}:${s.size}:${s.mtimeMs}`;
|
|
211
211
|
}).join("|")}`;
|
|
212
212
|
const cached = this.bundleHashCache.get(cacheKey);
|
|
@@ -214,7 +214,7 @@ var AddonWidgetsAggregatorAddon = class extends BaseAddon {
|
|
|
214
214
|
const hash = createHash("sha1");
|
|
215
215
|
for (const f of files) {
|
|
216
216
|
hash.update(f);
|
|
217
|
-
hash.update(fs
|
|
217
|
+
hash.update(fs.readFileSync(path$1.join(dir, f)));
|
|
218
218
|
}
|
|
219
219
|
const digest = hash.digest("hex").slice(0, 12);
|
|
220
220
|
this.bundleHashCache.set(cacheKey, digest);
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-izXDzt4g.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
const require_log_redactor = require("../../log-redactor-BhIEMaG9.js");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $r as isAlertEpisodeSeverity, Qr as isAlertEpisodeOpen,
|
|
1
|
+
import { $r as isAlertEpisodeSeverity, Qr as isAlertEpisodeOpen, al as EventCategory, bn as alertEpisodePayload, f as AlertSchema, nc as createEvent, os as BaseAddon, rl as errMsg, sc as defineRecordKinds, w as CORE_BLOCK_ADDON_PREFIX, xn as alertsCapability, yn as alertEpisodeId } from "../../dist-BQiyo22b.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
import { a as redactLogText } from "../../log-redactor-XLDrPzOi.mjs";
|
|
4
|
-
import * as fs
|
|
4
|
+
import * as fs from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
//#region src/builtins/alerts/alert-episode-policy.ts
|
|
7
7
|
/**
|
|
@@ -148,7 +148,7 @@ function lastCauseAfterChunk(previous, chunk) {
|
|
|
148
148
|
function readRunnerDisplayName(addonDirs, runnerId) {
|
|
149
149
|
const names = [];
|
|
150
150
|
for (const dir of addonDirs) try {
|
|
151
|
-
const raw = JSON.parse(fs
|
|
151
|
+
const raw = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
152
152
|
const camstack = typeof raw === "object" && raw !== null ? Reflect.get(raw, "camstack") : null;
|
|
153
153
|
const addons = typeof camstack === "object" && camstack !== null ? Reflect.get(camstack, "addons") : null;
|
|
154
154
|
if (!Array.isArray(addons)) continue;
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-izXDzt4g.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
9
9
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { En as bareAddonId,
|
|
1
|
+
import { En as bareAddonId, al as EventCategory, bc as isEvent, os as BaseAddon, ot as FIRST_LEVEL_MACRO_CLASSES, rl as errMsg, sa as ptzAutotrackCapability } from "../../dist-BQiyo22b.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
4
4
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
@@ -3,9 +3,9 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-izXDzt4g.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
|
-
const require_restore_archive = require("../../restore-archive-
|
|
8
|
+
const require_restore_archive = require("../../restore-archive-DpZ2PbLN.js");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
10
10
|
let node_fs = require("node:fs");
|
|
11
11
|
node_fs = require_chunk.__toESM(node_fs);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $a as storageOccupancyCapability, Mc as nodePin, Ti as mayWriteToLocation, Tn as backupCapability,
|
|
1
|
+
import { $a as storageOccupancyCapability, Mc as nodePin, Ti as mayWriteToLocation, Tn as backupCapability, al as EventCategory, os as BaseAddon, qc as toNodeId } from "../../dist-BQiyo22b.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
-
import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-
|
|
3
|
+
import { _ as backupRecordStoresOf, a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-C4rR2SYV.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
|
-
import * as fs
|
|
5
|
+
import * as fs from "node:fs";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
7
7
|
import * as fsp from "node:fs/promises";
|
|
8
8
|
//#region src/builtins/backup-orchestrator/backup-databases.ts
|
|
@@ -1018,7 +1018,7 @@ async function downloadArchiveToCache(input) {
|
|
|
1018
1018
|
location: input.locationId,
|
|
1019
1019
|
relativePath: input.filename
|
|
1020
1020
|
});
|
|
1021
|
-
const writeStream = fs
|
|
1021
|
+
const writeStream = fs.createWriteStream(input.cachePath);
|
|
1022
1022
|
let offset = 0;
|
|
1023
1023
|
try {
|
|
1024
1024
|
while (offset < sizeBytes) {
|
|
@@ -2502,7 +2502,7 @@ var BackupOrchestratorAddon = class extends BaseAddon {
|
|
|
2502
2502
|
});
|
|
2503
2503
|
try {
|
|
2504
2504
|
let offset = 0;
|
|
2505
|
-
const stream = fs
|
|
2505
|
+
const stream = fs.createReadStream(input.cachePath, { highWaterMark: UPLOAD_CHUNK_BYTES });
|
|
2506
2506
|
for await (const rawChunk of stream) {
|
|
2507
2507
|
if (input.signal?.aborted) {
|
|
2508
2508
|
stream.destroy();
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-izXDzt4g.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/builtins/calendars/calendar-color.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as CalendarPreferencesSchema, Fn as calendarsCapability, os as BaseAddon, sc as defineRecordKinds } from "../../dist-
|
|
1
|
+
import { E as CalendarPreferencesSchema, Fn as calendarsCapability, os as BaseAddon, sc as defineRecordKinds } from "../../dist-BQiyo22b.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/builtins/calendars/calendar-color.ts
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-izXDzt4g.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let _camstack_types_node = require("@camstack/types/node");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { As as RecordIntegrationInstances, Dt as MOTION_CLOSE_AFTER_MS, En as bareAddonId, Fo as buildFfmpegArgs, In as cameraGridLayoutCapability, Oi as memoizePinnedFfmpeg, Pi as motionCapability, Yr as integrationInstancesCapability, Z as DeclaredDevices, al as EventCategory, el as DeviceFeature, gc as hydrateSchema, h as BaseDevice, lr as declarationOwnerNodeId, nc as createEvent, nl as DeviceType, oc as defineEntryKind, os as BaseAddon, qa as snapshotCapability, rl as errMsg, to as streamCatalogCapability, xc as isInstanceEnabled, z as DERIVED_CAMERA_SILENCED_CAP_NAMES } from "../../dist-BQiyo22b.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { FfmpegProcess } from "@camstack/types/node";
|
|
@@ -16,8 +16,12 @@ import { type DeviceDeclaration, type IScopedLogger } from "@camstack/types";
|
|
|
16
16
|
import type { ComposedDeviceHandle } from "./composed-device.js";
|
|
17
17
|
import type { ComposerDerivedSpec, PlannedBlock } from "./composer-plan.js";
|
|
18
18
|
import type { PersistedComposedRow } from "./composition-declarations.js";
|
|
19
|
+
/** `stampUserNamed` marks an operator write. Absent is a system copy of the block name. */
|
|
20
|
+
export interface ComposerDeviceNameWrite {
|
|
21
|
+
readonly stampUserNamed: boolean;
|
|
22
|
+
}
|
|
19
23
|
export interface ComposerDevicePorts {
|
|
20
|
-
setName(deviceId: number, name: string): Promise<void>;
|
|
24
|
+
setName(deviceId: number, name: string, write?: ComposerDeviceNameWrite): Promise<void>;
|
|
21
25
|
decommission(deviceId: number): Promise<void>;
|
|
22
26
|
applyDerivedSpec(deviceId: number, derived: ComposerDerivedSpec): Promise<void>;
|
|
23
27
|
}
|
|
@@ -5,6 +5,8 @@ import type { SlicePatch } from "./slice-assembler.js";
|
|
|
5
5
|
declare const COMPOSED_DEVICE_CONFIG_SCHEMA: z.ZodObject<Record<string, never>>;
|
|
6
6
|
export interface ComposedDeviceHandle extends ComposedWriteTarget {
|
|
7
7
|
readonly name: string;
|
|
8
|
+
/** True once an operator renamed this device. Absent on test doubles that predate the flag. */
|
|
9
|
+
readonly userNamed?: boolean;
|
|
8
10
|
/** Copies a source reading's quantity onto this device (D944). Optional so test doubles stay small. */
|
|
9
11
|
adoptQuantity?(quantity: ReadingQuantity): Promise<void>;
|
|
10
12
|
/** Publishes the features the device's bound caps stand for (`featuresOfBoundCaps`). Optional so test doubles stay small. */
|
|
@@ -19,6 +21,8 @@ export declare class ComposedDevice extends BaseDevice<typeof COMPOSED_DEVICE_CO
|
|
|
19
21
|
private readonly derivesWater;
|
|
20
22
|
/** The `consumables` items the composition last wrote — the derived water item is added to these. */
|
|
21
23
|
private composedItems;
|
|
24
|
+
/** The row's flag, read at use: a restart loads it with the meta, and a system rename never sets it. */
|
|
25
|
+
get userNamed(): boolean;
|
|
22
26
|
get features(): readonly DeviceFeature[];
|
|
23
27
|
syncBoundFeatures(features: readonly DeviceFeature[]): void;
|
|
24
28
|
constructor(ctx: DeviceContext, type: DeviceType, caps: readonly CapabilityDefinition[]);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which name wins when a user-named composed device and its block disagree.
|
|
3
|
+
*
|
|
4
|
+
* Both operator renames write both sides: the device page writes the block,
|
|
5
|
+
* the composition editor writes the device. A mismatch is a write that did
|
|
6
|
+
* not land. The device row has no name-change time, so the two failures look
|
|
7
|
+
* the same once nothing is remembered:
|
|
8
|
+
*
|
|
9
|
+
* - a device-page rename whose block write failed (the device name is newer);
|
|
10
|
+
* - an editor rename whose device write failed (the block name is newer).
|
|
11
|
+
*
|
|
12
|
+
* A restart remembers nothing. The handle was just built from the row, so its
|
|
13
|
+
* name is the stored one, and that name wins — copying the block onto a row
|
|
14
|
+
* the operator named was the bug. While this process remembers the previous
|
|
15
|
+
* apply, a block whose name changed keeps it, and the stamped device write is
|
|
16
|
+
* retried (`nameOwed`) until it lands. `setName` does not update the live
|
|
17
|
+
* handle, so the handle still showing the old name after that write is stale,
|
|
18
|
+
* not a newer device-page rename. A device-page rename whose block write
|
|
19
|
+
* failed is repaired on the restart that rebuilds the handle from the row.
|
|
20
|
+
*/
|
|
21
|
+
export type ComposedNameAuthority = "device" | "block";
|
|
22
|
+
export interface RememberedCompositionName {
|
|
23
|
+
/** The name the previous apply decided. Null when that row's name was unreadable. */
|
|
24
|
+
readonly appliedName: string | null;
|
|
25
|
+
/** The block name at the previous apply. Null when that row's name was unreadable. */
|
|
26
|
+
readonly blockName: string | null;
|
|
27
|
+
/** A block name whose device write has not landed yet. */
|
|
28
|
+
readonly nameOwed: string | null;
|
|
29
|
+
}
|
|
30
|
+
export declare function composedNameAuthority(deviceName: string, blockName: string, remembered: RememberedCompositionName | null): ComposedNameAuthority;
|
|
@@ -3,10 +3,11 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
7
|
-
const require_composition_sources = require("../../composition-sources-
|
|
8
|
-
const require_capture_engine = require("../../capture-engine-
|
|
6
|
+
const require_dist = require("../../dist-izXDzt4g.js");
|
|
7
|
+
const require_composition_sources = require("../../composition-sources-DIZx3mW3.js");
|
|
8
|
+
const require_capture_engine = require("../../capture-engine-C0Z5rwCO.js");
|
|
9
9
|
const require_retention = require("../../retention-BcOSL6b9.js");
|
|
10
|
+
const require_rename_composition_block = require("../../rename-composition-block-6oLQVzft.js");
|
|
10
11
|
let zod = require("zod");
|
|
11
12
|
//#region src/builtins/composer/actuator-invoke.ts
|
|
12
13
|
/**
|
|
@@ -166,6 +167,10 @@ var ComposedDevice = class extends require_dist.BaseDevice {
|
|
|
166
167
|
derivesWater;
|
|
167
168
|
/** The `consumables` items the composition last wrote — the derived water item is added to these. */
|
|
168
169
|
composedItems = [];
|
|
170
|
+
/** The row's flag, read at use: a restart loads it with the meta, and a system rename never sets it. */
|
|
171
|
+
get userNamed() {
|
|
172
|
+
return this.ctx.deviceMeta.userNamed === true;
|
|
173
|
+
}
|
|
169
174
|
get features() {
|
|
170
175
|
return [...new Set([...this.sharedFeatures, ...this.boundFeatures])];
|
|
171
176
|
}
|
|
@@ -870,6 +875,15 @@ function copyMember(member) {
|
|
|
870
875
|
};
|
|
871
876
|
}
|
|
872
877
|
//#endregion
|
|
878
|
+
//#region src/builtins/composer/composed-name.ts
|
|
879
|
+
function composedNameAuthority(deviceName, blockName, remembered) {
|
|
880
|
+
if (remembered === null) return "device";
|
|
881
|
+
if (remembered.nameOwed === blockName) return "block";
|
|
882
|
+
if (blockName !== remembered.blockName) return "block";
|
|
883
|
+
if (deviceName !== blockName && remembered.appliedName === deviceName) return "device";
|
|
884
|
+
return "block";
|
|
885
|
+
}
|
|
886
|
+
//#endregion
|
|
873
887
|
//#region src/builtins/composer/composed-device-set.ts
|
|
874
888
|
/**
|
|
875
889
|
* The composed devices the composer DECLARED (D659): one row per `new`-target
|
|
@@ -4414,6 +4428,11 @@ var Composer = class {
|
|
|
4414
4428
|
/** Applies never interleave: each one reads and replaces the whole live set. */
|
|
4415
4429
|
applyChain = Promise.resolve();
|
|
4416
4430
|
/**
|
|
4431
|
+
* Block names an editor rename still owes the device row. In memory only:
|
|
4432
|
+
* a restart has no entry, and the row's name wins (see `composedNameAuthority`).
|
|
4433
|
+
*/
|
|
4434
|
+
nameOwed = /* @__PURE__ */ new Map();
|
|
4435
|
+
/**
|
|
4417
4436
|
* Runtimes built by an apply and not started yet: that apply's sync starts
|
|
4418
4437
|
* them, with their sources tracked. An event in between never does (N-5) —
|
|
4419
4438
|
* it would start one on sources "not tracked yet".
|
|
@@ -4714,7 +4733,11 @@ var Composer = class {
|
|
|
4714
4733
|
continue;
|
|
4715
4734
|
}
|
|
4716
4735
|
const device = p.target.kind === "existing" ? null : this.composed.get(require_dist.composedDeviceStableId(p.block.id));
|
|
4717
|
-
const appliedName = device === null ? null : p.block.name === null ? previous?.appliedName ?? device.name : await this.applyName(device, p.block.name, previous
|
|
4736
|
+
const appliedName = device === null ? null : p.block.name === null ? previous?.appliedName ?? device.name : await this.applyName(device, p.block.id, p.block.name, previous === void 0 ? null : {
|
|
4737
|
+
appliedName: previous.appliedName,
|
|
4738
|
+
blockName: previous.planned.block.name,
|
|
4739
|
+
nameOwed: this.nameOwed.get(p.block.id) ?? null
|
|
4740
|
+
});
|
|
4718
4741
|
if (previous?.runtime != null && previous.device === device && sameTarget(previous.planned.target, p.target) && previous.planned.block.updatedAt === p.block.updatedAt && previous.planned.block.enabled === p.block.enabled && !restart.has(p.block.id)) {
|
|
4719
4742
|
next.set(p.block.id, {
|
|
4720
4743
|
planned: p,
|
|
@@ -4854,7 +4877,44 @@ var Composer = class {
|
|
|
4854
4877
|
if (previous.runtime === null) return previous.heldFields;
|
|
4855
4878
|
return heldFieldsOf(previous.runtime.state().fields, `the composition no longer plans — the field keeps its last value on the device: ${p.problems.join("; ")}`);
|
|
4856
4879
|
}
|
|
4857
|
-
async applyName(device, name,
|
|
4880
|
+
async applyName(device, blockId, name, remembered) {
|
|
4881
|
+
if (device.userNamed === true && device.name !== name) {
|
|
4882
|
+
if (composedNameAuthority(device.name, name, remembered) === "device") {
|
|
4883
|
+
this.nameOwed.delete(blockId);
|
|
4884
|
+
this.deps.logger.info("composed device keeps the name the operator gave it", {
|
|
4885
|
+
tags: { deviceId: device.id },
|
|
4886
|
+
meta: {
|
|
4887
|
+
name: device.name,
|
|
4888
|
+
blockName: name
|
|
4889
|
+
}
|
|
4890
|
+
});
|
|
4891
|
+
await this.syncBlockName(device.id, blockId, device.name);
|
|
4892
|
+
return device.name;
|
|
4893
|
+
}
|
|
4894
|
+
if (!(remembered?.nameOwed === name) && remembered?.appliedName === name) return name;
|
|
4895
|
+
try {
|
|
4896
|
+
await this.deps.devices.setName(device.id, name, { stampUserNamed: true });
|
|
4897
|
+
this.nameOwed.delete(blockId);
|
|
4898
|
+
this.deps.logger.info("composed device renamed after its block", {
|
|
4899
|
+
tags: { deviceId: device.id },
|
|
4900
|
+
meta: { name }
|
|
4901
|
+
});
|
|
4902
|
+
return name;
|
|
4903
|
+
} catch (err) {
|
|
4904
|
+
this.nameOwed.set(blockId, name);
|
|
4905
|
+
this.deps.logger.warn("composed block was renamed but the device name was not written — retried on the next apply", {
|
|
4906
|
+
tags: { deviceId: device.id },
|
|
4907
|
+
meta: {
|
|
4908
|
+
blockId,
|
|
4909
|
+
name,
|
|
4910
|
+
error: require_dist.errMsg(err)
|
|
4911
|
+
}
|
|
4912
|
+
});
|
|
4913
|
+
return remembered?.appliedName ?? device.name;
|
|
4914
|
+
}
|
|
4915
|
+
}
|
|
4916
|
+
this.nameOwed.delete(blockId);
|
|
4917
|
+
const applied = remembered?.appliedName ?? null;
|
|
4858
4918
|
if ((applied ?? device.name) === name) return name;
|
|
4859
4919
|
try {
|
|
4860
4920
|
await this.deps.devices.setName(device.id, name);
|
|
@@ -4874,6 +4934,23 @@ var Composer = class {
|
|
|
4874
4934
|
return applied ?? device.name;
|
|
4875
4935
|
}
|
|
4876
4936
|
}
|
|
4937
|
+
/** The block follows the name that was kept. A missed write is retried on the next apply. */
|
|
4938
|
+
async syncBlockName(deviceId, blockId, name) {
|
|
4939
|
+
const sync = this.deps.syncBlockName;
|
|
4940
|
+
if (sync === void 0) return;
|
|
4941
|
+
try {
|
|
4942
|
+
await sync(deviceId, blockId, name);
|
|
4943
|
+
} catch (err) {
|
|
4944
|
+
this.deps.logger.warn("composed device kept its name but the block was not updated — retried on the next apply", {
|
|
4945
|
+
tags: { deviceId },
|
|
4946
|
+
meta: {
|
|
4947
|
+
blockId,
|
|
4948
|
+
name,
|
|
4949
|
+
error: require_dist.errMsg(err)
|
|
4950
|
+
}
|
|
4951
|
+
});
|
|
4952
|
+
}
|
|
4953
|
+
}
|
|
4877
4954
|
async syncSources(rebuilt) {
|
|
4878
4955
|
const requests = trackedSourceRequests(this.live.values());
|
|
4879
4956
|
const changed = await this.syncTracker(requests, rebuilt.reset);
|
|
@@ -6101,7 +6178,7 @@ var ComposerAddon = class extends require_dist.BaseAddon {
|
|
|
6101
6178
|
return { devices: handles };
|
|
6102
6179
|
},
|
|
6103
6180
|
devices: {
|
|
6104
|
-
setName: (deviceId, name) => devices.setName(deviceId, name),
|
|
6181
|
+
setName: (deviceId, name, write) => devices.setName(deviceId, name, { stampUserNamed: write?.stampUserNamed === true }),
|
|
6105
6182
|
decommission: (deviceId) => devices.decommission(deviceId),
|
|
6106
6183
|
applyDerivedSpec: (deviceId, derived) => devices.applyDerivedSpec(deviceId, derived)
|
|
6107
6184
|
},
|
|
@@ -6180,6 +6257,17 @@ var ComposerAddon = class extends require_dist.BaseAddon {
|
|
|
6180
6257
|
...args
|
|
6181
6258
|
});
|
|
6182
6259
|
},
|
|
6260
|
+
syncBlockName: async (deviceId, blockId, name) => {
|
|
6261
|
+
const blocks = this.ctx.api;
|
|
6262
|
+
if (blocks === void 0) {
|
|
6263
|
+
this.ctx.logger.warn("composed device kept its name but the block was not updated — no api on this runner", {
|
|
6264
|
+
tags: { deviceId },
|
|
6265
|
+
meta: { blockId }
|
|
6266
|
+
});
|
|
6267
|
+
return;
|
|
6268
|
+
}
|
|
6269
|
+
await require_rename_composition_block.renameCompositionBlock(blocks, this.ctx.logger, deviceId, blockId, name);
|
|
6270
|
+
},
|
|
6183
6271
|
boundCapNames: async (deviceId) => {
|
|
6184
6272
|
try {
|
|
6185
6273
|
return (await api.deviceManager.getBindings.query({ deviceId })).entries.map((entry) => entry.capName);
|