@camstack/server 1.2.804 → 1.2.805
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 +7 -0
- package/dist/agent/main.js +1 -1
- package/dist/api/core/addon-settings.router.js +2 -2
- package/dist/api/trpc/device-config-secret-redaction.js +3 -5
- package/dist/api/trpc/generated-cap-routers.js +10 -24
- package/dist/api/trpc/localized-schema-paths.js +0 -2
- package/dist/core/addon/addon-registry.service.js +4 -4
- package/dist/core/addon/addon-settings-provider.js +2 -49
- package/package.json +34 -13
- package/system/dist/addon-runner.js +2 -9
- package/system/dist/addon-runner.mjs +2 -9
- package/system/dist/{agent-https-BFvIRgIa.js → agent-https-CuChFRA2.js} +1 -1
- package/system/dist/{agent-https-Bp70et-W.mjs → agent-https-DS4b0ucn.mjs} +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 +1 -1
- 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 +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- 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 +2 -2
- 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/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- 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/core-blocks.addon.js +4 -5
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +4 -5
- 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-alias-actions.d.ts +45 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +958 -768
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +958 -768
- package/system/dist/builtins/device-manager/device-meta-types.d.ts +3 -0
- package/system/dist/builtins/device-manager/device-row-store.d.ts +8 -0
- package/system/dist/builtins/device-manager/device-template/mirror-resolver.d.ts +19 -0
- package/system/dist/builtins/device-manager/device-template/nunjucks-internals.d.ts +53 -0
- package/system/dist/builtins/device-manager/device-template/template-filters.d.ts +28 -0
- package/system/dist/builtins/device-manager/device-template/template-grammar.d.ts +43 -0
- package/system/dist/builtins/device-manager/device-template/template-protocol.d.ts +33 -0
- package/system/dist/builtins/device-manager/device-template/template-renderer.d.ts +54 -0
- package/system/dist/builtins/device-manager/device-template/template-worker.d.ts +1 -0
- 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 +2 -2
- 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 +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- 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 +2 -2
- package/system/dist/builtins/snapshot/index.mjs +2 -2
- package/system/dist/builtins/snapshot/snapshot.addon.d.ts +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- 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/bootstrap-form-actions.d.ts +4 -4
- package/system/dist/builtins/system-config/system-config.addon.js +7 -7
- package/system/dist/builtins/system-config/system-config.addon.mjs +288 -288
- 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-Sh4zAKR0.js → capture-engine-Byc5Fkp0.js} +1 -1
- package/system/dist/{capture-engine-CQBSd3V1.mjs → capture-engine-CnVIcnyN.mjs} +1 -1
- package/system/dist/{composition-sources-BxSmsp0_.mjs → composition-sources-BhM6G9QT.mjs} +1 -1
- package/system/dist/{composition-sources-rAsv2tZD.js → composition-sources-BxK6ttP9.js} +1 -1
- package/system/dist/{constants-BCQCUHl9.js → constants--xo6Q-KA.js} +1 -1
- package/system/dist/{constants-BfgfqUFH.mjs → constants-Bf1PEHRU.mjs} +1 -1
- package/system/dist/{device-ca-D7JZLEAn.mjs → device-ca-Do0-HV_h.mjs} +1 -1
- package/system/dist/{device-ca-BgCwLzMX.js → device-ca-Uq5KGFSq.js} +1 -1
- package/system/dist/device-template-worker.js +7289 -0
- package/system/dist/device-template-worker.mjs +7287 -0
- package/system/dist/{dist-BpIvMLVc.js → dist-2SHQaxaS.js} +607 -616
- package/system/dist/{dist-Bvw9utDk.mjs → dist-CogtCQxu.mjs} +590 -617
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-DZwGhLx-.js → hub-mdns-ciao-DqPrLiYH.js} +2 -2
- package/system/dist/{hub-mdns-ciao-qefBaLZn.mjs → hub-mdns-ciao-aFHCKrif.mjs} +2 -2
- package/system/dist/index.js +28 -48
- package/system/dist/index.mjs +28 -48
- package/system/dist/kernel/moleculer/addon-service-factory.d.ts +2 -3
- package/system/dist/kernel/transport/child-cap-protocol.d.ts +2 -2
- package/system/dist/kernel/transport/parent-unowned-call.d.ts +1 -1
- package/system/dist/{legacy-integration-rows-door-gqcsQX0L.js → legacy-integration-rows-door-Bz8rivxI.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-DCfOpaG3.mjs → legacy-integration-rows-door-CiuxDLoc.mjs} +1 -1
- package/system/dist/{restore-archive-BtgtMV29.js → restore-archive-D-3wmHDq.js} +1 -1
- package/system/dist/{restore-archive-BS6gi0i-.mjs → restore-archive-PlBC2NwT.mjs} +82 -82
- package/system/dist/{wal-maintenance-CyyJs8fh.js → wal-maintenance-BTR55y--.js} +0 -0
- package/system/dist/{wal-maintenance-DBCFpkyy.mjs → wal-maintenance-jrhYTCn2.mjs} +0 -0
- package/system/package.json +1 -1
|
@@ -1204,7 +1204,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1204
1204
|
return DeviceRole;
|
|
1205
1205
|
}({});
|
|
1206
1206
|
//#endregion
|
|
1207
|
-
//#region ../types/dist/sleep-
|
|
1207
|
+
//#region ../types/dist/sleep-7El4r5Bl.mjs
|
|
1208
1208
|
/**
|
|
1209
1209
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1210
1210
|
* window to float samples (D455).
|
|
@@ -3764,7 +3764,7 @@ function boundOf(list) {
|
|
|
3764
3764
|
* Base class for CamStack addons. Eliminates settings boilerplate:
|
|
3765
3765
|
*
|
|
3766
3766
|
* - Typed `config` property with automatic resolution from store + defaults
|
|
3767
|
-
* -
|
|
3767
|
+
* - the scoped settings API (`clusterSettings` / `nodeSettings` / `deviceDefaults`) auto-implemented
|
|
3768
3768
|
* - `getAddonSettings()` / `updateAddonSettings()` auto-implemented
|
|
3769
3769
|
* - `getDeviceSettings()` / `updateDeviceSettings()` auto-implemented
|
|
3770
3770
|
* - `ctx` accessor for the AddonContext (no manual `this.ctxRef` storage)
|
|
@@ -3774,7 +3774,7 @@ function boundOf(list) {
|
|
|
3774
3774
|
* Subclasses override:
|
|
3775
3775
|
* - `onInitialize()` — addon-specific init logic, return ProviderRegistration[]
|
|
3776
3776
|
* - `onShutdown()` — cleanup
|
|
3777
|
-
* - `
|
|
3777
|
+
* - `clusterSettingsSchema()` / `nodeSettingsSchema()` / `deviceSettingsSchema()` — UI schemas
|
|
3778
3778
|
*
|
|
3779
3779
|
* @example
|
|
3780
3780
|
* ```ts
|
|
@@ -3788,7 +3788,7 @@ function boundOf(list) {
|
|
|
3788
3788
|
* super({ maxRetries: 3, endpoint: 'http://localhost' })
|
|
3789
3789
|
* }
|
|
3790
3790
|
*
|
|
3791
|
-
* protected
|
|
3791
|
+
* protected clusterSettingsSchema() {
|
|
3792
3792
|
* return this.schema({
|
|
3793
3793
|
* sections: [{
|
|
3794
3794
|
* id: 'main', title: 'Settings',
|
|
@@ -3831,7 +3831,7 @@ var BaseAddon = class {
|
|
|
3831
3831
|
defaults;
|
|
3832
3832
|
/**
|
|
3833
3833
|
* Hidden-state paths that hold secrets (D787) — values the addon writes
|
|
3834
|
-
* itself (`
|
|
3834
|
+
* itself (`state()`, the scoped writers) that no form field declares.
|
|
3835
3835
|
* Stored in the keychain exactly like a `password` field. Syntax:
|
|
3836
3836
|
* `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
|
|
3837
3837
|
* (`key[<id field>]` addresses array items by id, never by index).
|
|
@@ -3841,7 +3841,7 @@ var BaseAddon = class {
|
|
|
3841
3841
|
/**
|
|
3842
3842
|
* D986 M4: the scoped schemas this addon declared, resolved once per capability
|
|
3843
3843
|
* (`loadScopedSchemas`) so the sync readers (`perNodeKeys`, the secret tree, the restart check)
|
|
3844
|
-
* see them. Empty until loaded
|
|
3844
|
+
* see them. Empty until loaded.
|
|
3845
3845
|
*/
|
|
3846
3846
|
_scopedByCap = /* @__PURE__ */ new Map();
|
|
3847
3847
|
_nodeKeysByCap = /* @__PURE__ */ new Map();
|
|
@@ -4027,7 +4027,7 @@ var BaseAddon = class {
|
|
|
4027
4027
|
/** Addon-specific cleanup. Override if needed. */
|
|
4028
4028
|
async onShutdown() {}
|
|
4029
4029
|
/**
|
|
4030
|
-
* Called after config is resolved during
|
|
4030
|
+
* Called after config is resolved during a settings write.
|
|
4031
4031
|
* Override to react to config changes (e.g. restart a sampler, reconnect a service).
|
|
4032
4032
|
* Not called during initialize() — use onInitialize() for initial setup.
|
|
4033
4033
|
*/
|
|
@@ -4056,82 +4056,12 @@ var BaseAddon = class {
|
|
|
4056
4056
|
scopedSettingsCapabilities() {
|
|
4057
4057
|
return [];
|
|
4058
4058
|
}
|
|
4059
|
-
/** Override to provide global-level settings UI schema. */
|
|
4060
|
-
globalSettingsSchema(_cap) {
|
|
4061
|
-
return null;
|
|
4062
|
-
}
|
|
4063
4059
|
/** Override to provide device-level settings UI schema. */
|
|
4064
4060
|
deviceSettingsSchema() {
|
|
4065
4061
|
return null;
|
|
4066
4062
|
}
|
|
4067
4063
|
/**
|
|
4068
|
-
*
|
|
4069
|
-
* ARE the configuration of its integration.
|
|
4070
|
-
*
|
|
4071
|
-
* Return the `ConfigSection.id`s, from {@link globalSettingsSchema}, that an
|
|
4072
|
-
* operator should find on the addon's integration page (System →
|
|
4073
|
-
* Integrations → <name>) rather than only in the cluster-wide list of every
|
|
4074
|
-
* addon. Empty (the default) means the addon has no integration-level
|
|
4075
|
-
* settings and no such surface is offered — this is opt-in, because whether
|
|
4076
|
-
* an addon's configuration IS its integration's configuration depends on the
|
|
4077
|
-
* nature of the integration.
|
|
4078
|
-
*
|
|
4079
|
-
* WHAT THIS IS NOT. It is not a scope. The selected sections keep living in
|
|
4080
|
-
* the ONE global schema, in the ONE addon store, written by the ONE
|
|
4081
|
-
* `updateGlobalSettings` path. There is deliberately no
|
|
4082
|
-
* `updateIntegrationSettings`: a second write path is how a surface acquires
|
|
4083
|
-
* a second store key, and this repo has shipped that twice (`btmPath@hub`,
|
|
4084
|
-
* D266). Selecting sections cannot introduce a key that selecting cannot.
|
|
4085
|
-
*
|
|
4086
|
-
* WHY IT IS A LIST OF SECTION IDS AND NOT A MARKER ON THE SECTION.
|
|
4087
|
-
* `ConfigFieldBase` used to carry `scope?: 'device' | 'global'` and it was
|
|
4088
|
-
* removed with the reason recorded at
|
|
4089
|
-
* `packages/types/src/interfaces/config-ui.ts:249` — *"a field's scope is
|
|
4090
|
-
* determined by WHICH schema it lives in, not by a field-level marker."* A
|
|
4091
|
-
* marker sprinkled across sections also has to borrow a field that already
|
|
4092
|
-
* means something else; borrowing `section.tab` put the literal word
|
|
4093
|
-
* "integration" into an operator-facing tab bar, because `tab` means "how to
|
|
4094
|
-
* GROUP this visually" and cannot also mean "where this lives" (D269
|
|
4095
|
-
* supersedes D268). One declaration, in one place, next to the schema whose
|
|
4096
|
-
* ids it names.
|
|
4097
|
-
*/
|
|
4098
|
-
integrationSettingSections() {
|
|
4099
|
-
return [];
|
|
4100
|
-
}
|
|
4101
|
-
async getGlobalSettings(overlay, cap, nodeId) {
|
|
4102
|
-
await this.loadScopedSchemas(cap);
|
|
4103
|
-
const schema = this.globalSettingsSchema(cap) ?? this.scopedFormSchema(cap);
|
|
4104
|
-
if (!schema) return { sections: [] };
|
|
4105
|
-
const projected = await this.readRawProjectedStore(nodeId, cap);
|
|
4106
|
-
return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
|
|
4107
|
-
}
|
|
4108
|
-
/**
|
|
4109
|
-
* The integration-level view of this addon's settings: exactly the sections
|
|
4110
|
-
* named by {@link integrationSettingSections}, hydrated from the SAME store
|
|
4111
|
-
* `getGlobalSettings` reads, and narrowed to cluster-scoped fields.
|
|
4112
|
-
*
|
|
4113
|
-
* Returns `null` when the addon declared nothing — an addon that opts out has
|
|
4114
|
-
* no integration settings surface at all, rather than an empty one that reads
|
|
4115
|
-
* as a failed load.
|
|
4116
|
-
*
|
|
4117
|
-
* Three properties hold BY CONSTRUCTION, which is why they are here in core
|
|
4118
|
-
* and not in whichever UI happens to render this:
|
|
4119
|
-
*
|
|
4120
|
-
* 1. **One key.** The payload is a SUBSET of the global schema, so a field
|
|
4121
|
-
* shown here is the same field, with the same bare key, that the addon's
|
|
4122
|
-
* own page shows. There is no integration-specific writer — callers save
|
|
4123
|
-
* through `updateGlobalSettings` — so a second store key is unreachable,
|
|
4124
|
-
* not merely discouraged.
|
|
4125
|
-
* 2. **No node scope.** `perNode: true` fields are DROPPED. Their store key
|
|
4126
|
-
* is `<key>@<nodeId>` and an integration is not a node; whichever node
|
|
4127
|
-
* such a field silently picked would be a wrong answer for the operator
|
|
4128
|
-
* who opened the page (D266).
|
|
4129
|
-
* 3. **No silent typo.** A declared id that names no section throws. The
|
|
4130
|
-
* alternative — skip it — turns a rename into a surface that quietly
|
|
4131
|
-
* empties, which looks exactly like an addon with nothing to configure.
|
|
4132
|
-
*/
|
|
4133
|
-
/**
|
|
4134
|
-
* The form schema of ONE integration instance, or `null` to use {@link globalSettingsSchema}.
|
|
4064
|
+
* The form schema of ONE integration instance, or `null` to use the scoped form.
|
|
4135
4065
|
*
|
|
4136
4066
|
* Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
|
|
4137
4067
|
* needs its connection fields, the default integration the addon's own sections. It is the
|
|
@@ -4342,32 +4272,15 @@ var BaseAddon = class {
|
|
|
4342
4272
|
*/
|
|
4343
4273
|
async getIntegrationFormSchema(instance, nodeId) {
|
|
4344
4274
|
const scoped = await this.integrationFormSchema(instance);
|
|
4345
|
-
if (scoped === null) return this.
|
|
4275
|
+
if (scoped === null) return this.scopedForm(nodeId);
|
|
4346
4276
|
return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
|
|
4347
4277
|
}
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
const schema = this.
|
|
4352
|
-
if (!schema)
|
|
4353
|
-
|
|
4354
|
-
const sections = [];
|
|
4355
|
-
for (const id of declared) {
|
|
4356
|
-
const section = byId.get(id);
|
|
4357
|
-
if (!section) throw new Error(`${this.constructor.name}: integrationSettingSections() names unknown section "${id}". Known sections: [${[...byId.keys()].join(", ")}].`);
|
|
4358
|
-
const fields = dropPerNodeFields(section.fields);
|
|
4359
|
-
if (fields.length === 0) continue;
|
|
4360
|
-
sections.push({
|
|
4361
|
-
...section,
|
|
4362
|
-
fields
|
|
4363
|
-
});
|
|
4364
|
-
}
|
|
4365
|
-
if (sections.length === 0) return null;
|
|
4366
|
-
const projected = await this.readRawProjectedStore(nodeId);
|
|
4367
|
-
return hydrateSchema({
|
|
4368
|
-
...schema,
|
|
4369
|
-
sections
|
|
4370
|
-
}, projected, { inlineSecretsAsViews: true });
|
|
4278
|
+
/** The form of the scoped schemas this addon declared, hydrated from its store. */
|
|
4279
|
+
async scopedForm(nodeId) {
|
|
4280
|
+
await this.loadScopedSchemas();
|
|
4281
|
+
const schema = this.scopedFormSchema();
|
|
4282
|
+
if (!schema) return { sections: [] };
|
|
4283
|
+
return hydrateSchema(schema, await this.readRawProjectedStore(nodeId), { inlineSecretsAsViews: true });
|
|
4371
4284
|
}
|
|
4372
4285
|
/**
|
|
4373
4286
|
* The raw addon store PROJECTED onto the target node's bare per-node keys:
|
|
@@ -4376,8 +4289,8 @@ var BaseAddon = class {
|
|
|
4376
4289
|
* bare fallback), all `@`-scoped and stray bare per-node keys are dropped.
|
|
4377
4290
|
* A no-op passthrough when the schema declares no `perNode` field.
|
|
4378
4291
|
*
|
|
4379
|
-
* This is the sanctioned way for
|
|
4380
|
-
* the store for custom
|
|
4292
|
+
* This is the sanctioned way for an addon that needs
|
|
4293
|
+
* the store for custom logic (option narrowing, value snapping) to
|
|
4381
4294
|
* read it per-node — never `ctx.settings.readAddonStore()` directly.
|
|
4382
4295
|
* `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
|
|
4383
4296
|
*
|
|
@@ -4429,7 +4342,7 @@ var BaseAddon = class {
|
|
|
4429
4342
|
}
|
|
4430
4343
|
/**
|
|
4431
4344
|
* Whether ONE global key of this addon's store was written, read three-way
|
|
4432
|
-
* (D651). For a question a hydrated view cannot answer:
|
|
4345
|
+
* (D651). For a question a hydrated view cannot answer: a hydrated form
|
|
4433
4346
|
* reports `value ?? default`, so "the operator chose the default" and "nobody
|
|
4434
4347
|
* chose" look the same, and a failed read looks like both. A `perNode` key is
|
|
4435
4348
|
* not supported here: its stored name is scoped.
|
|
@@ -4463,7 +4376,7 @@ var BaseAddon = class {
|
|
|
4463
4376
|
}
|
|
4464
4377
|
/**
|
|
4465
4378
|
* The OPERATOR's write — a settings form or an admin API call, dispatched by
|
|
4466
|
-
* the kernel.
|
|
4379
|
+
* the kernel. The one in-process write of the addon blob that is not a scoped write; a secret
|
|
4467
4380
|
* the operator sends is stored as sent even when it equals a pre-keychain
|
|
4468
4381
|
* inline value: the operator re-entering a password is a change, an addon
|
|
4469
4382
|
* writing back what it read is not (D787).
|
|
@@ -4476,9 +4389,6 @@ var BaseAddon = class {
|
|
|
4476
4389
|
this._operatorWriteDepth--;
|
|
4477
4390
|
}
|
|
4478
4391
|
}
|
|
4479
|
-
async updateGlobalSettings(patch, nodeId) {
|
|
4480
|
-
await this.applyGlobalPatch(patch, nodeId);
|
|
4481
|
-
}
|
|
4482
4392
|
/**
|
|
4483
4393
|
* REMOVE stored secrets — their keychain values and their markers (D787).
|
|
4484
4394
|
*
|
|
@@ -4521,8 +4431,7 @@ var BaseAddon = class {
|
|
|
4521
4431
|
await this.resolveConfig();
|
|
4522
4432
|
await this.onConfigChanged();
|
|
4523
4433
|
this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
|
|
4524
|
-
|
|
4525
|
-
this.maybeAutoRestart(Object.keys(barePatch), [...legacy === null ? [] : [legacy], ...this.loadedScopedSchemas().map((entry) => entry.schema)]);
|
|
4434
|
+
this.maybeAutoRestart(Object.keys(barePatch), this.loadedScopedSchemas().map((entry) => entry.schema));
|
|
4526
4435
|
return true;
|
|
4527
4436
|
}
|
|
4528
4437
|
/**
|
|
@@ -4560,10 +4469,7 @@ var BaseAddon = class {
|
|
|
4560
4469
|
this._nodeKeysByCap = /* @__PURE__ */ new Map();
|
|
4561
4470
|
this._addonSecretTree = null;
|
|
4562
4471
|
}
|
|
4563
|
-
/**
|
|
4564
|
-
* The form the settings API serves while an addon declares no {@link globalSettingsSchema}: the
|
|
4565
|
-
* sections of its scoped schemas, so dropping the old hook does not blank the form.
|
|
4566
|
-
*/
|
|
4472
|
+
/** The form of an addon's scoped schemas: their sections, each shown once. */
|
|
4567
4473
|
scopedFormSchema(cap) {
|
|
4568
4474
|
const byId = /* @__PURE__ */ new Map();
|
|
4569
4475
|
for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
|
|
@@ -4575,8 +4481,7 @@ var BaseAddon = class {
|
|
|
4575
4481
|
return [...this._scopedByCap.values()].flat();
|
|
4576
4482
|
}
|
|
4577
4483
|
/**
|
|
4578
|
-
* The field keys that are stored per node: every field of a {@link nodeSettingsSchema}
|
|
4579
|
-
* the fields the legacy {@link globalSettingsSchema} still marks `perNode: true`. Derived once
|
|
4484
|
+
* The field keys that are stored per node: every field of a {@link nodeSettingsSchema}. Derived once
|
|
4580
4485
|
* per `cap` argument and memoized (schemas are static declarations). Empty set ⇒ every
|
|
4581
4486
|
* per-node code path is bypassed and the settings API behaves like the node-agnostic one.
|
|
4582
4487
|
* Call {@link loadScopedSchemas} first (the async seams do).
|
|
@@ -4585,8 +4490,7 @@ var BaseAddon = class {
|
|
|
4585
4490
|
const cacheKey = cap ?? "";
|
|
4586
4491
|
const cached = this._nodeKeysByCap.get(cacheKey);
|
|
4587
4492
|
if (cached) return cached;
|
|
4588
|
-
const
|
|
4589
|
-
const keys = new Set(legacy ? legacy.sections.flatMap((section) => collectPerNodeFieldKeys(section.fields)) : []);
|
|
4493
|
+
const keys = /* @__PURE__ */ new Set();
|
|
4590
4494
|
for (const { scope, schema } of this.loadedScopedSchemas(cap)) {
|
|
4591
4495
|
if (scope !== "node") continue;
|
|
4592
4496
|
for (const section of schema.sections) for (const key of collectValueFieldKeys(section.fields)) keys.add(key);
|
|
@@ -4804,8 +4708,6 @@ var BaseAddon = class {
|
|
|
4804
4708
|
}
|
|
4805
4709
|
declaredKeySet() {
|
|
4806
4710
|
const keys = new Set(Object.keys(this.defaults));
|
|
4807
|
-
const schema = this.globalSettingsSchema();
|
|
4808
|
-
if (schema) for (const section of schema.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
|
|
4809
4711
|
for (const { schema: scoped } of this.loadedScopedSchemas()) for (const section of scoped.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
|
|
4810
4712
|
for (const key of this._declaredStateKeys) keys.add(key);
|
|
4811
4713
|
for (const path of this.secretStatePaths) {
|
|
@@ -4903,7 +4805,7 @@ var BaseAddon = class {
|
|
|
4903
4805
|
/** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
|
|
4904
4806
|
addonSecretTree() {
|
|
4905
4807
|
if (this._addonSecretTree === null) {
|
|
4906
|
-
const tree = new Map(
|
|
4808
|
+
const tree = /* @__PURE__ */ new Map();
|
|
4907
4809
|
for (const { schema } of this.loadedScopedSchemas()) for (const [key, node] of secretTreeFromSchema(schema)) tree.set(key, node);
|
|
4908
4810
|
this._addonSecretTree = mergeSecretStatePaths(tree, this.secretStatePaths);
|
|
4909
4811
|
}
|
|
@@ -5115,47 +5017,6 @@ function classifyStoreError(err) {
|
|
|
5115
5017
|
if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
|
|
5116
5018
|
return "permanent";
|
|
5117
5019
|
}
|
|
5118
|
-
/**
|
|
5119
|
-
* Collect the keys of every field marked `perNode: true`, recursing into
|
|
5120
|
-
* layout containers (`group` fields and `sub-tabs` tabs) the same way
|
|
5121
|
-
* `hydrateSchema` does. Valueless structural fields (separator/info/…)
|
|
5122
|
-
* don't declare `perNode` and are excluded by the `in` narrowing.
|
|
5123
|
-
*/
|
|
5124
|
-
/**
|
|
5125
|
-
* The same fields with every `perNode: true` one removed, recursing into layout
|
|
5126
|
-
* containers exactly as {@link collectPerNodeFieldKeys} does. A container left
|
|
5127
|
-
* with no child is dropped rather than rendered empty.
|
|
5128
|
-
*
|
|
5129
|
-
* Used by `getIntegrationSettings`: an integration is not a node, so a field
|
|
5130
|
-
* whose store key is `<key>@<nodeId>` has no node to belong to there.
|
|
5131
|
-
*/
|
|
5132
|
-
function dropPerNodeFields(fields) {
|
|
5133
|
-
const kept = [];
|
|
5134
|
-
for (const field of fields) {
|
|
5135
|
-
if (field.type === "group") {
|
|
5136
|
-
const inner = dropPerNodeFields(field.fields);
|
|
5137
|
-
if (inner.length > 0) kept.push({
|
|
5138
|
-
...field,
|
|
5139
|
-
fields: inner
|
|
5140
|
-
});
|
|
5141
|
-
continue;
|
|
5142
|
-
}
|
|
5143
|
-
if (field.type === "sub-tabs") {
|
|
5144
|
-
const tabs = field.tabs.map((tab) => ({
|
|
5145
|
-
...tab,
|
|
5146
|
-
fields: dropPerNodeFields(tab.fields)
|
|
5147
|
-
})).filter((tab) => tab.fields.length > 0);
|
|
5148
|
-
if (tabs.length > 0) kept.push({
|
|
5149
|
-
...field,
|
|
5150
|
-
tabs
|
|
5151
|
-
});
|
|
5152
|
-
continue;
|
|
5153
|
-
}
|
|
5154
|
-
if ("perNode" in field && field.perNode === true) continue;
|
|
5155
|
-
kept.push(field);
|
|
5156
|
-
}
|
|
5157
|
-
return kept;
|
|
5158
|
-
}
|
|
5159
5020
|
/** The keys of the value-holding fields, recursing into layout containers. */
|
|
5160
5021
|
function collectValueFieldKeys(fields) {
|
|
5161
5022
|
const collected = [];
|
|
@@ -5188,21 +5049,6 @@ function collectFieldKeys(fields) {
|
|
|
5188
5049
|
}
|
|
5189
5050
|
return collected;
|
|
5190
5051
|
}
|
|
5191
|
-
function collectPerNodeFieldKeys(fields) {
|
|
5192
|
-
const collected = [];
|
|
5193
|
-
for (const field of fields) {
|
|
5194
|
-
if (field.type === "group") {
|
|
5195
|
-
collected.push(...collectPerNodeFieldKeys(field.fields));
|
|
5196
|
-
continue;
|
|
5197
|
-
}
|
|
5198
|
-
if (field.type === "sub-tabs") {
|
|
5199
|
-
for (const tab of field.tabs) collected.push(...collectPerNodeFieldKeys(tab.fields));
|
|
5200
|
-
continue;
|
|
5201
|
-
}
|
|
5202
|
-
if ("perNode" in field && field.perNode === true) collected.push(field.key);
|
|
5203
|
-
}
|
|
5204
|
-
return collected;
|
|
5205
|
-
}
|
|
5206
5052
|
/**
|
|
5207
5053
|
* Normalize an `ICamstackAddon.initialize()` return value into the
|
|
5208
5054
|
* `AddonInitResult` envelope. Arrays are wrapped into `{ providers }`;
|
|
@@ -11847,6 +11693,396 @@ var NodeColorIdSchema = zod.z.enum([
|
|
|
11847
11693
|
"node-h"
|
|
11848
11694
|
]);
|
|
11849
11695
|
//#endregion
|
|
11696
|
+
//#region ../types/dist/convert-BAzH15HU.mjs
|
|
11697
|
+
/**
|
|
11698
|
+
* Frozen unit → spec table. `•` in the doc marks each dimension's canonical
|
|
11699
|
+
* unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
|
|
11700
|
+
* `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
|
|
11701
|
+
* decimals). K derives from `°C = K − 273.15`.
|
|
11702
|
+
*/
|
|
11703
|
+
var UNIT_TABLE = {
|
|
11704
|
+
"°C": {
|
|
11705
|
+
dimension: "temperature",
|
|
11706
|
+
factor: 1,
|
|
11707
|
+
offset: 0
|
|
11708
|
+
},
|
|
11709
|
+
"°F": {
|
|
11710
|
+
dimension: "temperature",
|
|
11711
|
+
factor: 5 / 9,
|
|
11712
|
+
offset: -160 / 9
|
|
11713
|
+
},
|
|
11714
|
+
K: {
|
|
11715
|
+
dimension: "temperature",
|
|
11716
|
+
factor: 1,
|
|
11717
|
+
offset: -273.15
|
|
11718
|
+
},
|
|
11719
|
+
hPa: {
|
|
11720
|
+
dimension: "pressure",
|
|
11721
|
+
factor: 1,
|
|
11722
|
+
offset: 0
|
|
11723
|
+
},
|
|
11724
|
+
kPa: {
|
|
11725
|
+
dimension: "pressure",
|
|
11726
|
+
factor: 10,
|
|
11727
|
+
offset: 0
|
|
11728
|
+
},
|
|
11729
|
+
Pa: {
|
|
11730
|
+
dimension: "pressure",
|
|
11731
|
+
factor: .01,
|
|
11732
|
+
offset: 0
|
|
11733
|
+
},
|
|
11734
|
+
mbar: {
|
|
11735
|
+
dimension: "pressure",
|
|
11736
|
+
factor: 1,
|
|
11737
|
+
offset: 0
|
|
11738
|
+
},
|
|
11739
|
+
bar: {
|
|
11740
|
+
dimension: "pressure",
|
|
11741
|
+
factor: 1e3,
|
|
11742
|
+
offset: 0
|
|
11743
|
+
},
|
|
11744
|
+
inHg: {
|
|
11745
|
+
dimension: "pressure",
|
|
11746
|
+
factor: 33.8639,
|
|
11747
|
+
offset: 0
|
|
11748
|
+
},
|
|
11749
|
+
mmHg: {
|
|
11750
|
+
dimension: "pressure",
|
|
11751
|
+
factor: 1.33322,
|
|
11752
|
+
offset: 0
|
|
11753
|
+
},
|
|
11754
|
+
psi: {
|
|
11755
|
+
dimension: "pressure",
|
|
11756
|
+
factor: 68.9476,
|
|
11757
|
+
offset: 0
|
|
11758
|
+
},
|
|
11759
|
+
"m/s": {
|
|
11760
|
+
dimension: "speed",
|
|
11761
|
+
factor: 1,
|
|
11762
|
+
offset: 0
|
|
11763
|
+
},
|
|
11764
|
+
"km/h": {
|
|
11765
|
+
dimension: "speed",
|
|
11766
|
+
factor: 1 / 3.6,
|
|
11767
|
+
offset: 0
|
|
11768
|
+
},
|
|
11769
|
+
mph: {
|
|
11770
|
+
dimension: "speed",
|
|
11771
|
+
factor: .44704,
|
|
11772
|
+
offset: 0
|
|
11773
|
+
},
|
|
11774
|
+
kn: {
|
|
11775
|
+
dimension: "speed",
|
|
11776
|
+
factor: .514444,
|
|
11777
|
+
offset: 0
|
|
11778
|
+
},
|
|
11779
|
+
"mm/h": {
|
|
11780
|
+
dimension: "precipitation-rate",
|
|
11781
|
+
factor: 1,
|
|
11782
|
+
offset: 0
|
|
11783
|
+
},
|
|
11784
|
+
"in/h": {
|
|
11785
|
+
dimension: "precipitation-rate",
|
|
11786
|
+
factor: 25.4,
|
|
11787
|
+
offset: 0
|
|
11788
|
+
},
|
|
11789
|
+
m: {
|
|
11790
|
+
dimension: "length",
|
|
11791
|
+
factor: 1,
|
|
11792
|
+
offset: 0
|
|
11793
|
+
},
|
|
11794
|
+
mm: {
|
|
11795
|
+
dimension: "length",
|
|
11796
|
+
factor: .001,
|
|
11797
|
+
offset: 0
|
|
11798
|
+
},
|
|
11799
|
+
cm: {
|
|
11800
|
+
dimension: "length",
|
|
11801
|
+
factor: .01,
|
|
11802
|
+
offset: 0
|
|
11803
|
+
},
|
|
11804
|
+
km: {
|
|
11805
|
+
dimension: "length",
|
|
11806
|
+
factor: 1e3,
|
|
11807
|
+
offset: 0
|
|
11808
|
+
},
|
|
11809
|
+
in: {
|
|
11810
|
+
dimension: "length",
|
|
11811
|
+
factor: .0254,
|
|
11812
|
+
offset: 0
|
|
11813
|
+
},
|
|
11814
|
+
ft: {
|
|
11815
|
+
dimension: "length",
|
|
11816
|
+
factor: .3048,
|
|
11817
|
+
offset: 0
|
|
11818
|
+
},
|
|
11819
|
+
mi: {
|
|
11820
|
+
dimension: "length",
|
|
11821
|
+
factor: 1609.344,
|
|
11822
|
+
offset: 0
|
|
11823
|
+
},
|
|
11824
|
+
"m²": {
|
|
11825
|
+
dimension: "area",
|
|
11826
|
+
factor: 1,
|
|
11827
|
+
offset: 0
|
|
11828
|
+
},
|
|
11829
|
+
lx: {
|
|
11830
|
+
dimension: "illuminance",
|
|
11831
|
+
factor: 1,
|
|
11832
|
+
offset: 0
|
|
11833
|
+
},
|
|
11834
|
+
"W/m²": {
|
|
11835
|
+
dimension: "irradiance",
|
|
11836
|
+
factor: 1,
|
|
11837
|
+
offset: 0
|
|
11838
|
+
},
|
|
11839
|
+
W: {
|
|
11840
|
+
dimension: "power",
|
|
11841
|
+
factor: 1,
|
|
11842
|
+
offset: 0
|
|
11843
|
+
},
|
|
11844
|
+
kW: {
|
|
11845
|
+
dimension: "power",
|
|
11846
|
+
factor: 1e3,
|
|
11847
|
+
offset: 0
|
|
11848
|
+
},
|
|
11849
|
+
VA: {
|
|
11850
|
+
dimension: "apparent-power",
|
|
11851
|
+
factor: 1,
|
|
11852
|
+
offset: 0
|
|
11853
|
+
},
|
|
11854
|
+
Wh: {
|
|
11855
|
+
dimension: "energy",
|
|
11856
|
+
factor: 1,
|
|
11857
|
+
offset: 0
|
|
11858
|
+
},
|
|
11859
|
+
kWh: {
|
|
11860
|
+
dimension: "energy",
|
|
11861
|
+
factor: 1e3,
|
|
11862
|
+
offset: 0
|
|
11863
|
+
},
|
|
11864
|
+
MWh: {
|
|
11865
|
+
dimension: "energy",
|
|
11866
|
+
factor: 1e6,
|
|
11867
|
+
offset: 0
|
|
11868
|
+
},
|
|
11869
|
+
V: {
|
|
11870
|
+
dimension: "voltage",
|
|
11871
|
+
factor: 1,
|
|
11872
|
+
offset: 0
|
|
11873
|
+
},
|
|
11874
|
+
mV: {
|
|
11875
|
+
dimension: "voltage",
|
|
11876
|
+
factor: .001,
|
|
11877
|
+
offset: 0
|
|
11878
|
+
},
|
|
11879
|
+
A: {
|
|
11880
|
+
dimension: "current",
|
|
11881
|
+
factor: 1,
|
|
11882
|
+
offset: 0
|
|
11883
|
+
},
|
|
11884
|
+
mA: {
|
|
11885
|
+
dimension: "current",
|
|
11886
|
+
factor: .001,
|
|
11887
|
+
offset: 0
|
|
11888
|
+
},
|
|
11889
|
+
ppm: {
|
|
11890
|
+
dimension: "concentration-volume",
|
|
11891
|
+
factor: 1,
|
|
11892
|
+
offset: 0
|
|
11893
|
+
},
|
|
11894
|
+
ppb: {
|
|
11895
|
+
dimension: "concentration-volume",
|
|
11896
|
+
factor: .001,
|
|
11897
|
+
offset: 0
|
|
11898
|
+
},
|
|
11899
|
+
"µg/m³": {
|
|
11900
|
+
dimension: "concentration-mass",
|
|
11901
|
+
factor: 1,
|
|
11902
|
+
offset: 0
|
|
11903
|
+
},
|
|
11904
|
+
"mg/m³": {
|
|
11905
|
+
dimension: "concentration-mass",
|
|
11906
|
+
factor: 1e3,
|
|
11907
|
+
offset: 0
|
|
11908
|
+
},
|
|
11909
|
+
kg: {
|
|
11910
|
+
dimension: "mass",
|
|
11911
|
+
factor: 1,
|
|
11912
|
+
offset: 0
|
|
11913
|
+
},
|
|
11914
|
+
g: {
|
|
11915
|
+
dimension: "mass",
|
|
11916
|
+
factor: .001,
|
|
11917
|
+
offset: 0
|
|
11918
|
+
},
|
|
11919
|
+
lb: {
|
|
11920
|
+
dimension: "mass",
|
|
11921
|
+
factor: .453592,
|
|
11922
|
+
offset: 0
|
|
11923
|
+
},
|
|
11924
|
+
oz: {
|
|
11925
|
+
dimension: "mass",
|
|
11926
|
+
factor: .0283495,
|
|
11927
|
+
offset: 0
|
|
11928
|
+
},
|
|
11929
|
+
"%": {
|
|
11930
|
+
dimension: "percentage",
|
|
11931
|
+
factor: 1,
|
|
11932
|
+
offset: 0
|
|
11933
|
+
},
|
|
11934
|
+
L: {
|
|
11935
|
+
dimension: "volume",
|
|
11936
|
+
factor: 1,
|
|
11937
|
+
offset: 0
|
|
11938
|
+
},
|
|
11939
|
+
mL: {
|
|
11940
|
+
dimension: "volume",
|
|
11941
|
+
factor: .001,
|
|
11942
|
+
offset: 0
|
|
11943
|
+
},
|
|
11944
|
+
gal: {
|
|
11945
|
+
dimension: "volume",
|
|
11946
|
+
factor: 3.785411784,
|
|
11947
|
+
offset: 0
|
|
11948
|
+
},
|
|
11949
|
+
s: {
|
|
11950
|
+
dimension: "duration",
|
|
11951
|
+
factor: 1,
|
|
11952
|
+
offset: 0
|
|
11953
|
+
},
|
|
11954
|
+
ms: {
|
|
11955
|
+
dimension: "duration",
|
|
11956
|
+
factor: .001,
|
|
11957
|
+
offset: 0
|
|
11958
|
+
},
|
|
11959
|
+
min: {
|
|
11960
|
+
dimension: "duration",
|
|
11961
|
+
factor: 60,
|
|
11962
|
+
offset: 0
|
|
11963
|
+
},
|
|
11964
|
+
h: {
|
|
11965
|
+
dimension: "duration",
|
|
11966
|
+
factor: 3600,
|
|
11967
|
+
offset: 0
|
|
11968
|
+
},
|
|
11969
|
+
d: {
|
|
11970
|
+
dimension: "duration",
|
|
11971
|
+
factor: 86400,
|
|
11972
|
+
offset: 0
|
|
11973
|
+
},
|
|
11974
|
+
B: {
|
|
11975
|
+
dimension: "information",
|
|
11976
|
+
factor: 1,
|
|
11977
|
+
offset: 0
|
|
11978
|
+
},
|
|
11979
|
+
KiB: {
|
|
11980
|
+
dimension: "information",
|
|
11981
|
+
factor: 1024,
|
|
11982
|
+
offset: 0
|
|
11983
|
+
},
|
|
11984
|
+
MiB: {
|
|
11985
|
+
dimension: "information",
|
|
11986
|
+
factor: 1024 ** 2,
|
|
11987
|
+
offset: 0
|
|
11988
|
+
},
|
|
11989
|
+
GiB: {
|
|
11990
|
+
dimension: "information",
|
|
11991
|
+
factor: 1024 ** 3,
|
|
11992
|
+
offset: 0
|
|
11993
|
+
},
|
|
11994
|
+
TiB: {
|
|
11995
|
+
dimension: "information",
|
|
11996
|
+
factor: 1024 ** 4,
|
|
11997
|
+
offset: 0
|
|
11998
|
+
},
|
|
11999
|
+
kB: {
|
|
12000
|
+
dimension: "information",
|
|
12001
|
+
factor: 1e3,
|
|
12002
|
+
offset: 0
|
|
12003
|
+
},
|
|
12004
|
+
MB: {
|
|
12005
|
+
dimension: "information",
|
|
12006
|
+
factor: 1e6,
|
|
12007
|
+
offset: 0
|
|
12008
|
+
},
|
|
12009
|
+
GB: {
|
|
12010
|
+
dimension: "information",
|
|
12011
|
+
factor: 1e9,
|
|
12012
|
+
offset: 0
|
|
12013
|
+
},
|
|
12014
|
+
"°": {
|
|
12015
|
+
dimension: "angle",
|
|
12016
|
+
factor: 1,
|
|
12017
|
+
offset: 0
|
|
12018
|
+
},
|
|
12019
|
+
dBFS: {
|
|
12020
|
+
dimension: "sound-level",
|
|
12021
|
+
factor: 1,
|
|
12022
|
+
offset: 0
|
|
12023
|
+
},
|
|
12024
|
+
dBm: {
|
|
12025
|
+
dimension: "signal-level",
|
|
12026
|
+
factor: 1,
|
|
12027
|
+
offset: 0
|
|
12028
|
+
},
|
|
12029
|
+
mired: {
|
|
12030
|
+
dimension: "colour-temperature",
|
|
12031
|
+
factor: 1,
|
|
12032
|
+
offset: 0
|
|
12033
|
+
},
|
|
12034
|
+
kbps: {
|
|
12035
|
+
dimension: "bitrate",
|
|
12036
|
+
factor: 1,
|
|
12037
|
+
offset: 0
|
|
12038
|
+
},
|
|
12039
|
+
Mbps: {
|
|
12040
|
+
dimension: "bitrate",
|
|
12041
|
+
factor: 1e3,
|
|
12042
|
+
offset: 0
|
|
12043
|
+
},
|
|
12044
|
+
fps: {
|
|
12045
|
+
dimension: "rate",
|
|
12046
|
+
factor: 1,
|
|
12047
|
+
offset: 0
|
|
12048
|
+
}
|
|
12049
|
+
};
|
|
12050
|
+
/** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
|
|
12051
|
+
function specFor(unit) {
|
|
12052
|
+
return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
|
|
12053
|
+
}
|
|
12054
|
+
/** The dimension a unit belongs to, or `undefined` for an unknown unit. */
|
|
12055
|
+
function unitDimension(unit) {
|
|
12056
|
+
return specFor(unit)?.dimension;
|
|
12057
|
+
}
|
|
12058
|
+
/** Value in `spec`'s unit → its dimension's canonical unit. */
|
|
12059
|
+
function toCanonical(value, spec) {
|
|
12060
|
+
return value * spec.factor + spec.offset;
|
|
12061
|
+
}
|
|
12062
|
+
/** Canonical-unit value → the unit described by `spec`. */
|
|
12063
|
+
function fromCanonical(canonical, spec) {
|
|
12064
|
+
return (canonical - spec.offset) / spec.factor;
|
|
12065
|
+
}
|
|
12066
|
+
/**
|
|
12067
|
+
* Graceful variant for the render path: returns the converted value, or
|
|
12068
|
+
* `undefined` when the conversion is refused (unknown unit / cross-dimension).
|
|
12069
|
+
* Never throws — a render caller falls back to the raw value + source unit.
|
|
12070
|
+
*/
|
|
12071
|
+
function tryConvertUnit(value, from, to) {
|
|
12072
|
+
if (from === to) return value;
|
|
12073
|
+
const fromSpec = specFor(from);
|
|
12074
|
+
if (!fromSpec) return void 0;
|
|
12075
|
+
const toSpec = specFor(to);
|
|
12076
|
+
if (!toSpec) return void 0;
|
|
12077
|
+
if (fromSpec.dimension !== toSpec.dimension) return void 0;
|
|
12078
|
+
return fromCanonical(toCanonical(value, fromSpec), toSpec);
|
|
12079
|
+
}
|
|
12080
|
+
function unitsForDimension(dimension) {
|
|
12081
|
+
const out = [];
|
|
12082
|
+
for (const [unit, spec] of Object.entries(UNIT_TABLE)) if (spec.dimension === dimension) out.push(unit);
|
|
12083
|
+
return out;
|
|
12084
|
+
}
|
|
12085
|
+
//#endregion
|
|
11850
12086
|
//#region ../types/dist/index.mjs
|
|
11851
12087
|
var SMTP_INBOUND_DEFAULT_PORT = 2525;
|
|
11852
12088
|
var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
|
|
@@ -41843,10 +42079,15 @@ var ExpressionLiteralBindingSchema = zod.z.object({
|
|
|
41843
42079
|
])
|
|
41844
42080
|
});
|
|
41845
42081
|
/** Read ANY device's status field, addressed by its re-sync-stable `stableId` —
|
|
41846
|
-
* never by numeric id, which a re-adoption reissues.
|
|
42082
|
+
* never by numeric id, which a re-adoption reissues. A stableId is unique per
|
|
42083
|
+
* ADDON, not per cluster, so the owning `addonId` completes the address.
|
|
42084
|
+
* Optional for wire compatibility: a binding without it still resolves while
|
|
42085
|
+
* its stableId is unique, and reads nothing (never the wrong device) once two
|
|
42086
|
+
* addons share it. */
|
|
41847
42087
|
var ExpressionGlobalBindingSchema = zod.z.object({
|
|
41848
42088
|
kind: zod.z.literal("global"),
|
|
41849
42089
|
sourceStableId: zod.z.string(),
|
|
42090
|
+
addonId: zod.z.string().optional(),
|
|
41850
42091
|
cap: zod.z.string(),
|
|
41851
42092
|
fieldPath: zod.z.string()
|
|
41852
42093
|
});
|
|
@@ -42121,394 +42362,6 @@ function extractSourceInfoFromMetadata(metadata) {
|
|
|
42121
42362
|
return parsed.data;
|
|
42122
42363
|
}
|
|
42123
42364
|
/**
|
|
42124
|
-
* Frozen unit → spec table. `•` in the doc marks each dimension's canonical
|
|
42125
|
-
* unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
|
|
42126
|
-
* `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
|
|
42127
|
-
* decimals). K derives from `°C = K − 273.15`.
|
|
42128
|
-
*/
|
|
42129
|
-
var UNIT_TABLE = {
|
|
42130
|
-
"°C": {
|
|
42131
|
-
dimension: "temperature",
|
|
42132
|
-
factor: 1,
|
|
42133
|
-
offset: 0
|
|
42134
|
-
},
|
|
42135
|
-
"°F": {
|
|
42136
|
-
dimension: "temperature",
|
|
42137
|
-
factor: 5 / 9,
|
|
42138
|
-
offset: -160 / 9
|
|
42139
|
-
},
|
|
42140
|
-
K: {
|
|
42141
|
-
dimension: "temperature",
|
|
42142
|
-
factor: 1,
|
|
42143
|
-
offset: -273.15
|
|
42144
|
-
},
|
|
42145
|
-
hPa: {
|
|
42146
|
-
dimension: "pressure",
|
|
42147
|
-
factor: 1,
|
|
42148
|
-
offset: 0
|
|
42149
|
-
},
|
|
42150
|
-
kPa: {
|
|
42151
|
-
dimension: "pressure",
|
|
42152
|
-
factor: 10,
|
|
42153
|
-
offset: 0
|
|
42154
|
-
},
|
|
42155
|
-
Pa: {
|
|
42156
|
-
dimension: "pressure",
|
|
42157
|
-
factor: .01,
|
|
42158
|
-
offset: 0
|
|
42159
|
-
},
|
|
42160
|
-
mbar: {
|
|
42161
|
-
dimension: "pressure",
|
|
42162
|
-
factor: 1,
|
|
42163
|
-
offset: 0
|
|
42164
|
-
},
|
|
42165
|
-
bar: {
|
|
42166
|
-
dimension: "pressure",
|
|
42167
|
-
factor: 1e3,
|
|
42168
|
-
offset: 0
|
|
42169
|
-
},
|
|
42170
|
-
inHg: {
|
|
42171
|
-
dimension: "pressure",
|
|
42172
|
-
factor: 33.8639,
|
|
42173
|
-
offset: 0
|
|
42174
|
-
},
|
|
42175
|
-
mmHg: {
|
|
42176
|
-
dimension: "pressure",
|
|
42177
|
-
factor: 1.33322,
|
|
42178
|
-
offset: 0
|
|
42179
|
-
},
|
|
42180
|
-
psi: {
|
|
42181
|
-
dimension: "pressure",
|
|
42182
|
-
factor: 68.9476,
|
|
42183
|
-
offset: 0
|
|
42184
|
-
},
|
|
42185
|
-
"m/s": {
|
|
42186
|
-
dimension: "speed",
|
|
42187
|
-
factor: 1,
|
|
42188
|
-
offset: 0
|
|
42189
|
-
},
|
|
42190
|
-
"km/h": {
|
|
42191
|
-
dimension: "speed",
|
|
42192
|
-
factor: 1 / 3.6,
|
|
42193
|
-
offset: 0
|
|
42194
|
-
},
|
|
42195
|
-
mph: {
|
|
42196
|
-
dimension: "speed",
|
|
42197
|
-
factor: .44704,
|
|
42198
|
-
offset: 0
|
|
42199
|
-
},
|
|
42200
|
-
kn: {
|
|
42201
|
-
dimension: "speed",
|
|
42202
|
-
factor: .514444,
|
|
42203
|
-
offset: 0
|
|
42204
|
-
},
|
|
42205
|
-
"mm/h": {
|
|
42206
|
-
dimension: "precipitation-rate",
|
|
42207
|
-
factor: 1,
|
|
42208
|
-
offset: 0
|
|
42209
|
-
},
|
|
42210
|
-
"in/h": {
|
|
42211
|
-
dimension: "precipitation-rate",
|
|
42212
|
-
factor: 25.4,
|
|
42213
|
-
offset: 0
|
|
42214
|
-
},
|
|
42215
|
-
m: {
|
|
42216
|
-
dimension: "length",
|
|
42217
|
-
factor: 1,
|
|
42218
|
-
offset: 0
|
|
42219
|
-
},
|
|
42220
|
-
mm: {
|
|
42221
|
-
dimension: "length",
|
|
42222
|
-
factor: .001,
|
|
42223
|
-
offset: 0
|
|
42224
|
-
},
|
|
42225
|
-
cm: {
|
|
42226
|
-
dimension: "length",
|
|
42227
|
-
factor: .01,
|
|
42228
|
-
offset: 0
|
|
42229
|
-
},
|
|
42230
|
-
km: {
|
|
42231
|
-
dimension: "length",
|
|
42232
|
-
factor: 1e3,
|
|
42233
|
-
offset: 0
|
|
42234
|
-
},
|
|
42235
|
-
in: {
|
|
42236
|
-
dimension: "length",
|
|
42237
|
-
factor: .0254,
|
|
42238
|
-
offset: 0
|
|
42239
|
-
},
|
|
42240
|
-
ft: {
|
|
42241
|
-
dimension: "length",
|
|
42242
|
-
factor: .3048,
|
|
42243
|
-
offset: 0
|
|
42244
|
-
},
|
|
42245
|
-
mi: {
|
|
42246
|
-
dimension: "length",
|
|
42247
|
-
factor: 1609.344,
|
|
42248
|
-
offset: 0
|
|
42249
|
-
},
|
|
42250
|
-
"m²": {
|
|
42251
|
-
dimension: "area",
|
|
42252
|
-
factor: 1,
|
|
42253
|
-
offset: 0
|
|
42254
|
-
},
|
|
42255
|
-
lx: {
|
|
42256
|
-
dimension: "illuminance",
|
|
42257
|
-
factor: 1,
|
|
42258
|
-
offset: 0
|
|
42259
|
-
},
|
|
42260
|
-
"W/m²": {
|
|
42261
|
-
dimension: "irradiance",
|
|
42262
|
-
factor: 1,
|
|
42263
|
-
offset: 0
|
|
42264
|
-
},
|
|
42265
|
-
W: {
|
|
42266
|
-
dimension: "power",
|
|
42267
|
-
factor: 1,
|
|
42268
|
-
offset: 0
|
|
42269
|
-
},
|
|
42270
|
-
kW: {
|
|
42271
|
-
dimension: "power",
|
|
42272
|
-
factor: 1e3,
|
|
42273
|
-
offset: 0
|
|
42274
|
-
},
|
|
42275
|
-
VA: {
|
|
42276
|
-
dimension: "apparent-power",
|
|
42277
|
-
factor: 1,
|
|
42278
|
-
offset: 0
|
|
42279
|
-
},
|
|
42280
|
-
Wh: {
|
|
42281
|
-
dimension: "energy",
|
|
42282
|
-
factor: 1,
|
|
42283
|
-
offset: 0
|
|
42284
|
-
},
|
|
42285
|
-
kWh: {
|
|
42286
|
-
dimension: "energy",
|
|
42287
|
-
factor: 1e3,
|
|
42288
|
-
offset: 0
|
|
42289
|
-
},
|
|
42290
|
-
MWh: {
|
|
42291
|
-
dimension: "energy",
|
|
42292
|
-
factor: 1e6,
|
|
42293
|
-
offset: 0
|
|
42294
|
-
},
|
|
42295
|
-
V: {
|
|
42296
|
-
dimension: "voltage",
|
|
42297
|
-
factor: 1,
|
|
42298
|
-
offset: 0
|
|
42299
|
-
},
|
|
42300
|
-
mV: {
|
|
42301
|
-
dimension: "voltage",
|
|
42302
|
-
factor: .001,
|
|
42303
|
-
offset: 0
|
|
42304
|
-
},
|
|
42305
|
-
A: {
|
|
42306
|
-
dimension: "current",
|
|
42307
|
-
factor: 1,
|
|
42308
|
-
offset: 0
|
|
42309
|
-
},
|
|
42310
|
-
mA: {
|
|
42311
|
-
dimension: "current",
|
|
42312
|
-
factor: .001,
|
|
42313
|
-
offset: 0
|
|
42314
|
-
},
|
|
42315
|
-
ppm: {
|
|
42316
|
-
dimension: "concentration-volume",
|
|
42317
|
-
factor: 1,
|
|
42318
|
-
offset: 0
|
|
42319
|
-
},
|
|
42320
|
-
ppb: {
|
|
42321
|
-
dimension: "concentration-volume",
|
|
42322
|
-
factor: .001,
|
|
42323
|
-
offset: 0
|
|
42324
|
-
},
|
|
42325
|
-
"µg/m³": {
|
|
42326
|
-
dimension: "concentration-mass",
|
|
42327
|
-
factor: 1,
|
|
42328
|
-
offset: 0
|
|
42329
|
-
},
|
|
42330
|
-
"mg/m³": {
|
|
42331
|
-
dimension: "concentration-mass",
|
|
42332
|
-
factor: 1e3,
|
|
42333
|
-
offset: 0
|
|
42334
|
-
},
|
|
42335
|
-
kg: {
|
|
42336
|
-
dimension: "mass",
|
|
42337
|
-
factor: 1,
|
|
42338
|
-
offset: 0
|
|
42339
|
-
},
|
|
42340
|
-
g: {
|
|
42341
|
-
dimension: "mass",
|
|
42342
|
-
factor: .001,
|
|
42343
|
-
offset: 0
|
|
42344
|
-
},
|
|
42345
|
-
lb: {
|
|
42346
|
-
dimension: "mass",
|
|
42347
|
-
factor: .453592,
|
|
42348
|
-
offset: 0
|
|
42349
|
-
},
|
|
42350
|
-
oz: {
|
|
42351
|
-
dimension: "mass",
|
|
42352
|
-
factor: .0283495,
|
|
42353
|
-
offset: 0
|
|
42354
|
-
},
|
|
42355
|
-
"%": {
|
|
42356
|
-
dimension: "percentage",
|
|
42357
|
-
factor: 1,
|
|
42358
|
-
offset: 0
|
|
42359
|
-
},
|
|
42360
|
-
L: {
|
|
42361
|
-
dimension: "volume",
|
|
42362
|
-
factor: 1,
|
|
42363
|
-
offset: 0
|
|
42364
|
-
},
|
|
42365
|
-
mL: {
|
|
42366
|
-
dimension: "volume",
|
|
42367
|
-
factor: .001,
|
|
42368
|
-
offset: 0
|
|
42369
|
-
},
|
|
42370
|
-
gal: {
|
|
42371
|
-
dimension: "volume",
|
|
42372
|
-
factor: 3.785411784,
|
|
42373
|
-
offset: 0
|
|
42374
|
-
},
|
|
42375
|
-
s: {
|
|
42376
|
-
dimension: "duration",
|
|
42377
|
-
factor: 1,
|
|
42378
|
-
offset: 0
|
|
42379
|
-
},
|
|
42380
|
-
ms: {
|
|
42381
|
-
dimension: "duration",
|
|
42382
|
-
factor: .001,
|
|
42383
|
-
offset: 0
|
|
42384
|
-
},
|
|
42385
|
-
min: {
|
|
42386
|
-
dimension: "duration",
|
|
42387
|
-
factor: 60,
|
|
42388
|
-
offset: 0
|
|
42389
|
-
},
|
|
42390
|
-
h: {
|
|
42391
|
-
dimension: "duration",
|
|
42392
|
-
factor: 3600,
|
|
42393
|
-
offset: 0
|
|
42394
|
-
},
|
|
42395
|
-
d: {
|
|
42396
|
-
dimension: "duration",
|
|
42397
|
-
factor: 86400,
|
|
42398
|
-
offset: 0
|
|
42399
|
-
},
|
|
42400
|
-
B: {
|
|
42401
|
-
dimension: "information",
|
|
42402
|
-
factor: 1,
|
|
42403
|
-
offset: 0
|
|
42404
|
-
},
|
|
42405
|
-
KiB: {
|
|
42406
|
-
dimension: "information",
|
|
42407
|
-
factor: 1024,
|
|
42408
|
-
offset: 0
|
|
42409
|
-
},
|
|
42410
|
-
MiB: {
|
|
42411
|
-
dimension: "information",
|
|
42412
|
-
factor: 1024 ** 2,
|
|
42413
|
-
offset: 0
|
|
42414
|
-
},
|
|
42415
|
-
GiB: {
|
|
42416
|
-
dimension: "information",
|
|
42417
|
-
factor: 1024 ** 3,
|
|
42418
|
-
offset: 0
|
|
42419
|
-
},
|
|
42420
|
-
TiB: {
|
|
42421
|
-
dimension: "information",
|
|
42422
|
-
factor: 1024 ** 4,
|
|
42423
|
-
offset: 0
|
|
42424
|
-
},
|
|
42425
|
-
kB: {
|
|
42426
|
-
dimension: "information",
|
|
42427
|
-
factor: 1e3,
|
|
42428
|
-
offset: 0
|
|
42429
|
-
},
|
|
42430
|
-
MB: {
|
|
42431
|
-
dimension: "information",
|
|
42432
|
-
factor: 1e6,
|
|
42433
|
-
offset: 0
|
|
42434
|
-
},
|
|
42435
|
-
GB: {
|
|
42436
|
-
dimension: "information",
|
|
42437
|
-
factor: 1e9,
|
|
42438
|
-
offset: 0
|
|
42439
|
-
},
|
|
42440
|
-
"°": {
|
|
42441
|
-
dimension: "angle",
|
|
42442
|
-
factor: 1,
|
|
42443
|
-
offset: 0
|
|
42444
|
-
},
|
|
42445
|
-
dBFS: {
|
|
42446
|
-
dimension: "sound-level",
|
|
42447
|
-
factor: 1,
|
|
42448
|
-
offset: 0
|
|
42449
|
-
},
|
|
42450
|
-
dBm: {
|
|
42451
|
-
dimension: "signal-level",
|
|
42452
|
-
factor: 1,
|
|
42453
|
-
offset: 0
|
|
42454
|
-
},
|
|
42455
|
-
mired: {
|
|
42456
|
-
dimension: "colour-temperature",
|
|
42457
|
-
factor: 1,
|
|
42458
|
-
offset: 0
|
|
42459
|
-
},
|
|
42460
|
-
kbps: {
|
|
42461
|
-
dimension: "bitrate",
|
|
42462
|
-
factor: 1,
|
|
42463
|
-
offset: 0
|
|
42464
|
-
},
|
|
42465
|
-
Mbps: {
|
|
42466
|
-
dimension: "bitrate",
|
|
42467
|
-
factor: 1e3,
|
|
42468
|
-
offset: 0
|
|
42469
|
-
},
|
|
42470
|
-
fps: {
|
|
42471
|
-
dimension: "rate",
|
|
42472
|
-
factor: 1,
|
|
42473
|
-
offset: 0
|
|
42474
|
-
}
|
|
42475
|
-
};
|
|
42476
|
-
/** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
|
|
42477
|
-
function specFor(unit) {
|
|
42478
|
-
return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
|
|
42479
|
-
}
|
|
42480
|
-
/** The dimension a unit belongs to, or `undefined` for an unknown unit. */
|
|
42481
|
-
function unitDimension(unit) {
|
|
42482
|
-
return specFor(unit)?.dimension;
|
|
42483
|
-
}
|
|
42484
|
-
/** Value in `spec`'s unit → its dimension's canonical unit. */
|
|
42485
|
-
function toCanonical(value, spec) {
|
|
42486
|
-
return value * spec.factor + spec.offset;
|
|
42487
|
-
}
|
|
42488
|
-
/** Canonical-unit value → the unit described by `spec`. */
|
|
42489
|
-
function fromCanonical(canonical, spec) {
|
|
42490
|
-
return (canonical - spec.offset) / spec.factor;
|
|
42491
|
-
}
|
|
42492
|
-
/**
|
|
42493
|
-
* Graceful variant for the render path: returns the converted value, or
|
|
42494
|
-
* `undefined` when the conversion is refused (unknown unit / cross-dimension).
|
|
42495
|
-
* Never throws — a render caller falls back to the raw value + source unit.
|
|
42496
|
-
*/
|
|
42497
|
-
function tryConvertUnit(value, from, to) {
|
|
42498
|
-
if (from === to) return value;
|
|
42499
|
-
const fromSpec = specFor(from);
|
|
42500
|
-
if (!fromSpec) return void 0;
|
|
42501
|
-
const toSpec = specFor(to);
|
|
42502
|
-
if (!toSpec) return void 0;
|
|
42503
|
-
if (fromSpec.dimension !== toSpec.dimension) return void 0;
|
|
42504
|
-
return fromCanonical(toCanonical(value, fromSpec), toSpec);
|
|
42505
|
-
}
|
|
42506
|
-
function unitsForDimension(dimension) {
|
|
42507
|
-
const out = [];
|
|
42508
|
-
for (const [unit, spec] of Object.entries(UNIT_TABLE)) if (spec.dimension === dimension) out.push(unit);
|
|
42509
|
-
return out;
|
|
42510
|
-
}
|
|
42511
|
-
/**
|
|
42512
42365
|
* A number a person types for a physical quantity — the input side of the
|
|
42513
42366
|
* value + unit contract (D972).
|
|
42514
42367
|
*
|
|
@@ -43805,6 +43658,31 @@ describe$1(STATIONARY_DESCRIPTIONS);
|
|
|
43805
43658
|
* ones a short-circuit never reached) with a stable path and a human reason, so
|
|
43806
43659
|
* the editor can paint each block.
|
|
43807
43660
|
*/
|
|
43661
|
+
/**
|
|
43662
|
+
* The key a `stableId → device id` map answers on. A pair (`addonId`, `stableId`)
|
|
43663
|
+
* is a device; a bare stableId is only a device while no other addon shares it,
|
|
43664
|
+
* so the map's producer puts the bare key in ONLY when it is unique.
|
|
43665
|
+
*/
|
|
43666
|
+
function stableIdKey(stableId, addonId) {
|
|
43667
|
+
return addonId === void 0 ? stableId : `${addonId}\u0000${stableId}`;
|
|
43668
|
+
}
|
|
43669
|
+
/**
|
|
43670
|
+
* The `stableIdKey → device id` map a mirror refresh hands back, from a device
|
|
43671
|
+
* listing. Every device is reachable by its (addonId, stableId) pair; the bare
|
|
43672
|
+
* stableId is offered only while NO other device shares it, so a legacy binding
|
|
43673
|
+
* that names no addon reads nothing rather than the wrong device.
|
|
43674
|
+
*/
|
|
43675
|
+
function stableIdMapOf(devices) {
|
|
43676
|
+
const out = /* @__PURE__ */ new Map();
|
|
43677
|
+
const bare = /* @__PURE__ */ new Map();
|
|
43678
|
+
for (const d of devices) {
|
|
43679
|
+
if (d.stableId === void 0) continue;
|
|
43680
|
+
if (d.addonId !== void 0) out.set(stableIdKey(d.stableId, d.addonId), d.id);
|
|
43681
|
+
bare.set(d.stableId, bare.has(d.stableId) ? null : d.id);
|
|
43682
|
+
}
|
|
43683
|
+
for (const [stableId, id] of bare) if (id !== null) out.set(stableId, id);
|
|
43684
|
+
return out;
|
|
43685
|
+
}
|
|
43808
43686
|
/** The cap whose runtime-state slice IS the occupancy snapshot, parked objects included. */
|
|
43809
43687
|
var ZONE_ANALYTICS_CAP = "zone-analytics";
|
|
43810
43688
|
function collectInto(cond, out) {
|
|
@@ -43834,7 +43712,8 @@ function collectInto(cond, out) {
|
|
|
43834
43712
|
for (const binding of Object.values(cond.bindings)) if (binding.kind === "global") out.push({
|
|
43835
43713
|
kind: "stable",
|
|
43836
43714
|
stableId: binding.sourceStableId,
|
|
43837
|
-
cap: binding.cap
|
|
43715
|
+
cap: binding.cap,
|
|
43716
|
+
...binding.addonId !== void 0 ? { addonId: binding.addonId } : {}
|
|
43838
43717
|
});
|
|
43839
43718
|
return;
|
|
43840
43719
|
default: return;
|
|
@@ -43847,7 +43726,7 @@ function collectWhenMirrorSources(cond) {
|
|
|
43847
43726
|
collectInto(cond, all);
|
|
43848
43727
|
const seen = /* @__PURE__ */ new Set();
|
|
43849
43728
|
return all.filter((s) => {
|
|
43850
|
-
const key = s.kind === "device" ? `d|${s.deviceId}|${s.cap}` : `s|${s.stableId}|${s.cap}`;
|
|
43729
|
+
const key = s.kind === "device" ? `d|${s.deviceId}|${s.cap}` : `s|${stableIdKey(s.stableId, s.addonId)}|${s.cap}`;
|
|
43851
43730
|
if (seen.has(key)) return false;
|
|
43852
43731
|
seen.add(key);
|
|
43853
43732
|
return true;
|
|
@@ -43884,15 +43763,19 @@ var ConditionMirror = class {
|
|
|
43884
43763
|
this.slices.set(key, slice);
|
|
43885
43764
|
}
|
|
43886
43765
|
isStableTarget(deviceId, cap) {
|
|
43887
|
-
for (const s of this.sources) if (s.kind === "stable" && s.cap === cap && this.stableIds.get(s.stableId) === deviceId) return true;
|
|
43766
|
+
for (const s of this.sources) if (s.kind === "stable" && s.cap === cap && this.stableIds.get(stableIdKey(s.stableId, s.addonId)) === deviceId) return true;
|
|
43888
43767
|
return false;
|
|
43889
43768
|
}
|
|
43890
43769
|
read(deviceId, cap, fieldPath) {
|
|
43891
43770
|
const slice = this.slices.get(sliceKey(deviceId, cap));
|
|
43892
43771
|
return slice === void 0 ? void 0 : pick$1(slice, fieldPath);
|
|
43893
43772
|
}
|
|
43894
|
-
|
|
43895
|
-
|
|
43773
|
+
/** The whole slice the mirror holds for a device cap — `undefined` when it holds none. */
|
|
43774
|
+
sliceOf(deviceId, cap) {
|
|
43775
|
+
return this.slices.get(sliceKey(deviceId, cap));
|
|
43776
|
+
}
|
|
43777
|
+
readStable(stableId, cap, fieldPath, addonId) {
|
|
43778
|
+
const deviceId = this.stableIds.get(stableIdKey(stableId, addonId));
|
|
43896
43779
|
return deviceId === void 0 ? void 0 : this.read(deviceId, cap, fieldPath);
|
|
43897
43780
|
}
|
|
43898
43781
|
/** Fill / reconcile. A read that fails or answers nothing keeps the old value. */
|
|
@@ -43904,7 +43787,7 @@ var ConditionMirror = class {
|
|
|
43904
43787
|
} catch {}
|
|
43905
43788
|
const targets = /* @__PURE__ */ new Map();
|
|
43906
43789
|
for (const s of this.sources) {
|
|
43907
|
-
const deviceId = s.kind === "device" ? s.deviceId : this.stableIds.get(s.stableId);
|
|
43790
|
+
const deviceId = s.kind === "device" ? s.deviceId : this.stableIds.get(stableIdKey(s.stableId, s.addonId));
|
|
43908
43791
|
if (deviceId === void 0) {
|
|
43909
43792
|
kept += 1;
|
|
43910
43793
|
continue;
|
|
@@ -44109,7 +43992,7 @@ function evalNode(cond, path, reader, now, out, state) {
|
|
|
44109
43992
|
values[alias] = toExpressionValue(binding.value) ?? null;
|
|
44110
43993
|
continue;
|
|
44111
43994
|
}
|
|
44112
|
-
const raw = binding.kind === "global" ? reader.readStable(binding.sourceStableId, binding.cap, binding.fieldPath) : void 0;
|
|
43995
|
+
const raw = binding.kind === "global" ? reader.readStable(binding.sourceStableId, binding.cap, binding.fieldPath, binding.addonId) : void 0;
|
|
44113
43996
|
if (raw === void 0) {
|
|
44114
43997
|
out.push({
|
|
44115
43998
|
path,
|
|
@@ -45785,20 +45668,6 @@ var addonSettingsCapability = {
|
|
|
45785
45668
|
mode: "singleton",
|
|
45786
45669
|
nodeIdMode: "data",
|
|
45787
45670
|
methods: {
|
|
45788
|
-
getGlobalSettings: method(zod.z.object({
|
|
45789
|
-
addonId: zod.z.string(),
|
|
45790
|
-
nodeId: zod.z.string().optional(),
|
|
45791
|
-
overlay: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
|
|
45792
|
-
cap: zod.z.string().optional()
|
|
45793
|
-
}), SettingsSchemaWithValuesSchema.nullable()),
|
|
45794
|
-
updateGlobalSettings: method(zod.z.object({
|
|
45795
|
-
addonId: zod.z.string(),
|
|
45796
|
-
nodeId: zod.z.string().optional(),
|
|
45797
|
-
patch: SettingsPatchSchema
|
|
45798
|
-
}), SettingsUpdateResultSchema, {
|
|
45799
|
-
kind: "mutation",
|
|
45800
|
-
auth: "admin"
|
|
45801
|
-
}),
|
|
45802
45671
|
getScopedSettings: method(zod.z.object({
|
|
45803
45672
|
addonId: zod.z.string(),
|
|
45804
45673
|
cap: zod.z.string(),
|
|
@@ -45825,10 +45694,6 @@ var addonSettingsCapability = {
|
|
|
45825
45694
|
scope: ScopedSettingsScopeSchema,
|
|
45826
45695
|
nodeId: zod.z.string().optional()
|
|
45827
45696
|
}), zod.z.record(zod.z.string(), zod.z.unknown()).nullable()),
|
|
45828
|
-
getIntegrationSettings: method(zod.z.object({
|
|
45829
|
-
addonId: zod.z.string(),
|
|
45830
|
-
nodeId: zod.z.string().optional()
|
|
45831
|
-
}), SettingsSchemaWithValuesSchema.nullable()),
|
|
45832
45697
|
getIntegrationFormSchema: method(zod.z.object({
|
|
45833
45698
|
addonId: zod.z.string(),
|
|
45834
45699
|
nodeId: zod.z.string().optional(),
|
|
@@ -47809,7 +47674,7 @@ var BackupDestinationInfoSchema = zod.z.object({
|
|
|
47809
47674
|
id: zod.z.string(),
|
|
47810
47675
|
/**
|
|
47811
47676
|
* Manifest id of the owning addon. The Settings button on the
|
|
47812
|
-
* destination card opens that addon's
|
|
47677
|
+
* destination card opens that addon's scoped settings panel.
|
|
47813
47678
|
*/
|
|
47814
47679
|
addonId: zod.z.string(),
|
|
47815
47680
|
/** Operator-toggled enable flag from the destination-policy table. */
|
|
@@ -57287,6 +57152,92 @@ var deviceExportCapability = {
|
|
|
57287
57152
|
})
|
|
57288
57153
|
}
|
|
57289
57154
|
};
|
|
57155
|
+
/** entity_id style: starts with a letter, then lowercase letters, digits and `_`. */
|
|
57156
|
+
var DEVICE_ALIAS_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
57157
|
+
/**
|
|
57158
|
+
* Words the template language gives a meaning to. An alias spelled like one
|
|
57159
|
+
* would read as the keyword, not as the device.
|
|
57160
|
+
*/
|
|
57161
|
+
var RESERVED_ALIASES = new Set([
|
|
57162
|
+
"true",
|
|
57163
|
+
"false",
|
|
57164
|
+
"none",
|
|
57165
|
+
"null",
|
|
57166
|
+
"and",
|
|
57167
|
+
"or",
|
|
57168
|
+
"not",
|
|
57169
|
+
"in",
|
|
57170
|
+
"is",
|
|
57171
|
+
"if",
|
|
57172
|
+
"elif",
|
|
57173
|
+
"else",
|
|
57174
|
+
"endif",
|
|
57175
|
+
"for",
|
|
57176
|
+
"endfor",
|
|
57177
|
+
"loop",
|
|
57178
|
+
"set",
|
|
57179
|
+
"range",
|
|
57180
|
+
"cycler",
|
|
57181
|
+
"joiner",
|
|
57182
|
+
"self",
|
|
57183
|
+
"caller",
|
|
57184
|
+
"super",
|
|
57185
|
+
"import",
|
|
57186
|
+
"include",
|
|
57187
|
+
"extends",
|
|
57188
|
+
"block",
|
|
57189
|
+
"macro",
|
|
57190
|
+
"now"
|
|
57191
|
+
]);
|
|
57192
|
+
var DeviceAliasSchema = zod.z.string().max(64).regex(DEVICE_ALIAS_PATTERN);
|
|
57193
|
+
function isReservedDeviceAlias(alias) {
|
|
57194
|
+
return RESERVED_ALIASES.has(alias);
|
|
57195
|
+
}
|
|
57196
|
+
/** A device name as an entity_id style identifier. Never empty, never digit-leading. */
|
|
57197
|
+
function slugifyDeviceAlias(name) {
|
|
57198
|
+
const slug = name.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
57199
|
+
if (slug.length === 0) return "device";
|
|
57200
|
+
return (/^[0-9]/.test(slug) ? `device_${slug}` : slug).slice(0, 60).replace(/_+$/g, "");
|
|
57201
|
+
}
|
|
57202
|
+
/**
|
|
57203
|
+
* The alias a new device gets: the slug of its name, or `<slug>_2`, `_3`, …
|
|
57204
|
+
* when that is taken (or is a template keyword).
|
|
57205
|
+
*/
|
|
57206
|
+
function generateDeviceAlias(name, isTaken) {
|
|
57207
|
+
const base = slugifyDeviceAlias(name);
|
|
57208
|
+
if (!isReservedDeviceAlias(base) && !isTaken(base)) return base;
|
|
57209
|
+
for (let n = 2;; n += 1) {
|
|
57210
|
+
const candidate = `${base}_${n}`;
|
|
57211
|
+
if (!isTaken(candidate)) return candidate;
|
|
57212
|
+
}
|
|
57213
|
+
}
|
|
57214
|
+
/** Validate an operator-typed alias. `isTaken` answers for every OTHER device. */
|
|
57215
|
+
function checkDeviceAlias(alias, isTaken) {
|
|
57216
|
+
if (alias.length === 0) return {
|
|
57217
|
+
ok: false,
|
|
57218
|
+
reason: "empty"
|
|
57219
|
+
};
|
|
57220
|
+
if (alias.length > 64) return {
|
|
57221
|
+
ok: false,
|
|
57222
|
+
reason: "too-long"
|
|
57223
|
+
};
|
|
57224
|
+
if (!DEVICE_ALIAS_PATTERN.test(alias)) return {
|
|
57225
|
+
ok: false,
|
|
57226
|
+
reason: "grammar"
|
|
57227
|
+
};
|
|
57228
|
+
if (isReservedDeviceAlias(alias)) return {
|
|
57229
|
+
ok: false,
|
|
57230
|
+
reason: "reserved"
|
|
57231
|
+
};
|
|
57232
|
+
if (isTaken(alias)) return {
|
|
57233
|
+
ok: false,
|
|
57234
|
+
reason: "taken"
|
|
57235
|
+
};
|
|
57236
|
+
return {
|
|
57237
|
+
ok: true,
|
|
57238
|
+
alias
|
|
57239
|
+
};
|
|
57240
|
+
}
|
|
57290
57241
|
/**
|
|
57291
57242
|
* A SITE ZONE — a named part of the property that several locations belong to.
|
|
57292
57243
|
*
|
|
@@ -57784,6 +57735,12 @@ var DeviceInfoSchema = zod.z.object({
|
|
|
57784
57735
|
addonId: zod.z.string(),
|
|
57785
57736
|
type: zod.z.enum(DeviceType),
|
|
57786
57737
|
name: zod.z.string(),
|
|
57738
|
+
/** The name a value template uses for this device (`{{ stufa_veranda.temperature }}`),
|
|
57739
|
+
* entity_id style. Generated once from the name at first registration, unique
|
|
57740
|
+
* cluster-wide, editable through `setAlias`, NOT changed by a rename (D1021).
|
|
57741
|
+
* Optional: a record produced by an older build omits it until the boot
|
|
57742
|
+
* backfill has run. */
|
|
57743
|
+
alias: DeviceAliasSchema.optional(),
|
|
57787
57744
|
/** Operator-organisational location label. `null` when unset. */
|
|
57788
57745
|
location: zod.z.string().nullable(),
|
|
57789
57746
|
/** Soft-disabled flag. */
|
|
@@ -58179,6 +58136,30 @@ var deviceManagerCapability = {
|
|
|
58179
58136
|
kind: "mutation",
|
|
58180
58137
|
auth: "admin"
|
|
58181
58138
|
}),
|
|
58139
|
+
/** Set the device's template alias (D1021). The refusal is a typed reason in
|
|
58140
|
+
* the answer, never a thrown string: `empty | too-long | grammar | reserved |
|
|
58141
|
+
* taken` (`takenBy` names the device that owns it). Idempotent for the
|
|
58142
|
+
* device's own current alias. */
|
|
58143
|
+
setAlias: method(zod.z.object({
|
|
58144
|
+
deviceId: zod.z.number(),
|
|
58145
|
+
alias: zod.z.string()
|
|
58146
|
+
}), zod.z.discriminatedUnion("ok", [zod.z.object({
|
|
58147
|
+
ok: zod.z.literal(true),
|
|
58148
|
+
alias: DeviceAliasSchema
|
|
58149
|
+
}), zod.z.object({
|
|
58150
|
+
ok: zod.z.literal(false),
|
|
58151
|
+
reason: zod.z.enum([
|
|
58152
|
+
"empty",
|
|
58153
|
+
"too-long",
|
|
58154
|
+
"grammar",
|
|
58155
|
+
"reserved",
|
|
58156
|
+
"taken"
|
|
58157
|
+
]),
|
|
58158
|
+
takenBy: zod.z.number().optional()
|
|
58159
|
+
})]), {
|
|
58160
|
+
kind: "mutation",
|
|
58161
|
+
auth: "admin"
|
|
58162
|
+
}),
|
|
58182
58163
|
/** Update the operator-organisational location label. `null`
|
|
58183
58164
|
* clears it. */
|
|
58184
58165
|
setLocation: method(zod.z.object({
|
|
@@ -65616,7 +65597,7 @@ var localNetworkCapability = {
|
|
|
65616
65597
|
resetAllowlistToBestMatch: method(zod.z.void(), AllowedAddressesSchema, { kind: "mutation" }),
|
|
65617
65598
|
/**
|
|
65618
65599
|
* Live TLS material for the Network → Local access certificate card.
|
|
65619
|
-
* LAN HTTP / hostname are
|
|
65600
|
+
* LAN HTTP / hostname are scoped settings (the cap's own form), not
|
|
65620
65601
|
* a second store — this query is status, not configuration.
|
|
65621
65602
|
*/
|
|
65622
65603
|
getTlsStatus: method(zod.z.void(), TlsStatusSchema),
|
|
@@ -80318,7 +80299,7 @@ var pipelineOrchestratorCapability = {
|
|
|
80318
80299
|
/**
|
|
80319
80300
|
* The operator's STORED model choice for one cluster-scoped step (D651).
|
|
80320
80301
|
* Read three-way from this addon's own store, only once its boot has
|
|
80321
|
-
* settled. Unlike `addonSettings.
|
|
80302
|
+
* settled. Unlike `addonSettings.getScopedSettings`, it never answers a
|
|
80322
80303
|
* default as though someone chose it.
|
|
80323
80304
|
*/
|
|
80324
80305
|
getClusterModelChoice: method(zod.z.object({ stepId: zod.z.string() }), ClusterModelChoiceSchema),
|
|
@@ -96577,13 +96558,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
96577
96558
|
access: "view",
|
|
96578
96559
|
role: "admin"
|
|
96579
96560
|
},
|
|
96580
|
-
"addonSettings.getGlobalSettings": {
|
|
96581
|
-
capName: "addon-settings",
|
|
96582
|
-
capScope: "system",
|
|
96583
|
-
addonId: null,
|
|
96584
|
-
access: "view",
|
|
96585
|
-
role: "admin"
|
|
96586
|
-
},
|
|
96587
96561
|
"addonSettings.getIntegrationFormSchema": {
|
|
96588
96562
|
capName: "addon-settings",
|
|
96589
96563
|
capScope: "system",
|
|
@@ -96591,13 +96565,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
96591
96565
|
access: "view",
|
|
96592
96566
|
role: "admin"
|
|
96593
96567
|
},
|
|
96594
|
-
"addonSettings.getIntegrationSettings": {
|
|
96595
|
-
capName: "addon-settings",
|
|
96596
|
-
capScope: "system",
|
|
96597
|
-
addonId: null,
|
|
96598
|
-
access: "view",
|
|
96599
|
-
role: "admin"
|
|
96600
|
-
},
|
|
96601
96568
|
"addonSettings.getScopedSettings": {
|
|
96602
96569
|
capName: "addon-settings",
|
|
96603
96570
|
capScope: "system",
|
|
@@ -96633,13 +96600,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
96633
96600
|
access: "create",
|
|
96634
96601
|
role: "admin"
|
|
96635
96602
|
},
|
|
96636
|
-
"addonSettings.updateGlobalSettings": {
|
|
96637
|
-
capName: "addon-settings",
|
|
96638
|
-
capScope: "system",
|
|
96639
|
-
addonId: null,
|
|
96640
|
-
access: "create",
|
|
96641
|
-
role: "admin"
|
|
96642
|
-
},
|
|
96643
96603
|
"addonSettings.updateScopedSettings": {
|
|
96644
96604
|
capName: "addon-settings",
|
|
96645
96605
|
capScope: "system",
|
|
@@ -98810,6 +98770,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
98810
98770
|
access: "create",
|
|
98811
98771
|
role: "admin"
|
|
98812
98772
|
},
|
|
98773
|
+
"deviceManager.setAlias": {
|
|
98774
|
+
capName: "device-manager",
|
|
98775
|
+
capScope: "system",
|
|
98776
|
+
addonId: null,
|
|
98777
|
+
access: "create",
|
|
98778
|
+
role: "admin"
|
|
98779
|
+
},
|
|
98813
98780
|
"deviceManager.setChildLayout": {
|
|
98814
98781
|
capName: "device-manager",
|
|
98815
98782
|
capScope: "system",
|
|
@@ -106551,6 +106518,7 @@ function offered(received) {
|
|
|
106551
106518
|
};
|
|
106552
106519
|
}
|
|
106553
106520
|
offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
|
|
106521
|
+
zod.z.string().min(1).max(4096);
|
|
106554
106522
|
/**
|
|
106555
106523
|
* Runtime list of cap names with status. Used by the settings
|
|
106556
106524
|
* aggregator to enumerate caps whose `status` should be polled +
|
|
@@ -107324,6 +107292,11 @@ Object.freeze({
|
|
|
107324
107292
|
form: "single",
|
|
107325
107293
|
optional: false
|
|
107326
107294
|
}],
|
|
107295
|
+
"deviceManager.setAlias": [{
|
|
107296
|
+
name: "deviceId",
|
|
107297
|
+
form: "single",
|
|
107298
|
+
optional: false
|
|
107299
|
+
}],
|
|
107327
107300
|
"deviceManager.setChildLayout": [{
|
|
107328
107301
|
name: "deviceId",
|
|
107329
107302
|
form: "single",
|
|
@@ -113010,6 +112983,12 @@ Object.defineProperty(exports, "catalogueIssues", {
|
|
|
113010
112983
|
return catalogueIssues;
|
|
113011
112984
|
}
|
|
113012
112985
|
});
|
|
112986
|
+
Object.defineProperty(exports, "checkDeviceAlias", {
|
|
112987
|
+
enumerable: true,
|
|
112988
|
+
get: function() {
|
|
112989
|
+
return checkDeviceAlias;
|
|
112990
|
+
}
|
|
112991
|
+
});
|
|
113013
112992
|
Object.defineProperty(exports, "checkRoleAddress", {
|
|
113014
112993
|
enumerable: true,
|
|
113015
112994
|
get: function() {
|
|
@@ -113502,6 +113481,12 @@ Object.defineProperty(exports, "gbToBytes", {
|
|
|
113502
113481
|
return gbToBytes;
|
|
113503
113482
|
}
|
|
113504
113483
|
});
|
|
113484
|
+
Object.defineProperty(exports, "generateDeviceAlias", {
|
|
113485
|
+
enumerable: true,
|
|
113486
|
+
get: function() {
|
|
113487
|
+
return generateDeviceAlias;
|
|
113488
|
+
}
|
|
113489
|
+
});
|
|
113505
113490
|
Object.defineProperty(exports, "getDebugInterest", {
|
|
113506
113491
|
enumerable: true,
|
|
113507
113492
|
get: function() {
|
|
@@ -114372,6 +114357,12 @@ Object.defineProperty(exports, "splitTranslationRef", {
|
|
|
114372
114357
|
return splitTranslationRef;
|
|
114373
114358
|
}
|
|
114374
114359
|
});
|
|
114360
|
+
Object.defineProperty(exports, "stableIdMapOf", {
|
|
114361
|
+
enumerable: true,
|
|
114362
|
+
get: function() {
|
|
114363
|
+
return stableIdMapOf;
|
|
114364
|
+
}
|
|
114365
|
+
});
|
|
114375
114366
|
Object.defineProperty(exports, "statisticCadenceMs", {
|
|
114376
114367
|
enumerable: true,
|
|
114377
114368
|
get: function() {
|