@camstack/server 1.2.803 → 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.
Files changed (113) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/agent/main.js +1 -1
  3. package/dist/api/core/addon-settings.router.js +2 -2
  4. package/dist/api/trpc/device-config-secret-redaction.js +3 -5
  5. package/dist/api/trpc/generated-cap-routers.js +10 -24
  6. package/dist/api/trpc/localized-schema-paths.js +0 -2
  7. package/dist/core/addon/addon-registry.service.js +4 -4
  8. package/dist/core/addon/addon-settings-provider.js +2 -49
  9. package/package.json +34 -15
  10. package/system/dist/addon-runner.js +2 -9
  11. package/system/dist/addon-runner.mjs +2 -9
  12. package/system/dist/{agent-https-DtYiXPGm.js → agent-https-CuChFRA2.js} +1 -1
  13. package/system/dist/{agent-https-BRfJO9ZR.mjs → agent-https-DS4b0ucn.mjs} +1 -1
  14. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  15. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  16. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  17. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  18. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  19. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  20. package/system/dist/builtins/autotrack/index.js +1 -1
  21. package/system/dist/builtins/autotrack/index.mjs +1 -1
  22. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  23. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  24. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  25. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  26. package/system/dist/builtins/camera-grid/index.js +1 -1
  27. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  28. package/system/dist/builtins/composer/composed-device.d.ts +5 -0
  29. package/system/dist/builtins/composer/composer.addon.js +39 -4
  30. package/system/dist/builtins/composer/composer.addon.mjs +39 -4
  31. package/system/dist/builtins/composer/composer.d.ts +13 -0
  32. package/system/dist/builtins/console-logging/index.js +1 -1
  33. package/system/dist/builtins/console-logging/index.mjs +1 -1
  34. package/system/dist/builtins/core-blocks/core-blocks.addon.js +4 -5
  35. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +4 -5
  36. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  37. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  38. package/system/dist/builtins/device-manager/device-alias-actions.d.ts +45 -0
  39. package/system/dist/builtins/device-manager/device-manager.addon.js +958 -768
  40. package/system/dist/builtins/device-manager/device-manager.addon.mjs +958 -768
  41. package/system/dist/builtins/device-manager/device-meta-types.d.ts +3 -0
  42. package/system/dist/builtins/device-manager/device-row-store.d.ts +8 -0
  43. package/system/dist/builtins/device-manager/device-template/mirror-resolver.d.ts +19 -0
  44. package/system/dist/builtins/device-manager/device-template/nunjucks-internals.d.ts +53 -0
  45. package/system/dist/builtins/device-manager/device-template/template-filters.d.ts +28 -0
  46. package/system/dist/builtins/device-manager/device-template/template-grammar.d.ts +43 -0
  47. package/system/dist/builtins/device-manager/device-template/template-protocol.d.ts +33 -0
  48. package/system/dist/builtins/device-manager/device-template/template-renderer.d.ts +54 -0
  49. package/system/dist/builtins/device-manager/device-template/template-worker.d.ts +1 -0
  50. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  51. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  52. package/system/dist/builtins/keychain/index.js +4 -4
  53. package/system/dist/builtins/keychain/index.mjs +4 -4
  54. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  55. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  56. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  57. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  58. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  59. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  60. package/system/dist/builtins/loki-logging/index.js +1 -1
  61. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  62. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  63. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  64. package/system/dist/builtins/platform-probe/index.js +1 -1
  65. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  66. package/system/dist/builtins/record-entries/index.js +1 -1
  67. package/system/dist/builtins/record-entries/index.mjs +1 -1
  68. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  69. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  70. package/system/dist/builtins/snapshot/index.js +2 -2
  71. package/system/dist/builtins/snapshot/index.mjs +2 -2
  72. package/system/dist/builtins/snapshot/snapshot.addon.d.ts +1 -1
  73. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  74. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  75. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  76. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  77. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  78. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  79. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  80. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  81. package/system/dist/builtins/system-config/bootstrap-form-actions.d.ts +4 -4
  82. package/system/dist/builtins/system-config/system-config.addon.js +7 -7
  83. package/system/dist/builtins/system-config/system-config.addon.mjs +7 -7
  84. package/system/dist/builtins/winston-logging/index.js +1 -1
  85. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  86. package/system/dist/{capture-engine-BQ08XTnZ.js → capture-engine-Byc5Fkp0.js} +1 -1
  87. package/system/dist/{capture-engine-BFgeAHa9.mjs → capture-engine-CnVIcnyN.mjs} +1 -1
  88. package/system/dist/{composition-sources-DkOfzgpS.mjs → composition-sources-BhM6G9QT.mjs} +1 -1
  89. package/system/dist/{composition-sources-DNHNUvTr.js → composition-sources-BxK6ttP9.js} +1 -1
  90. package/system/dist/{constants-D5CG3Gvc.js → constants--xo6Q-KA.js} +1 -1
  91. package/system/dist/{constants-GCrIKhD_.mjs → constants-Bf1PEHRU.mjs} +1 -1
  92. package/system/dist/{device-ca-Dk2sx_18.mjs → device-ca-Do0-HV_h.mjs} +1 -1
  93. package/system/dist/{device-ca-DgZeLVC1.js → device-ca-Uq5KGFSq.js} +1 -1
  94. package/system/dist/device-template-worker.js +7289 -0
  95. package/system/dist/device-template-worker.mjs +7287 -0
  96. package/system/dist/{dist-D5nGm8Sd.js → dist-2SHQaxaS.js} +631 -618
  97. package/system/dist/{dist-ze-qVU7x.mjs → dist-CogtCQxu.mjs} +608 -619
  98. package/system/dist/file-host-worker.js +1 -1
  99. package/system/dist/file-host-worker.mjs +1 -1
  100. package/system/dist/{hub-mdns-ciao-D4g9qsNL.js → hub-mdns-ciao-DqPrLiYH.js} +2 -2
  101. package/system/dist/{hub-mdns-ciao-DD2QP3w5.mjs → hub-mdns-ciao-aFHCKrif.mjs} +2 -2
  102. package/system/dist/index.js +28 -48
  103. package/system/dist/index.mjs +28 -48
  104. package/system/dist/kernel/moleculer/addon-service-factory.d.ts +2 -3
  105. package/system/dist/kernel/transport/child-cap-protocol.d.ts +2 -2
  106. package/system/dist/kernel/transport/parent-unowned-call.d.ts +1 -1
  107. package/system/dist/{legacy-integration-rows-door-MRr8Ncb_.js → legacy-integration-rows-door-Bz8rivxI.js} +1 -1
  108. package/system/dist/{legacy-integration-rows-door-BvEFQrAa.mjs → legacy-integration-rows-door-CiuxDLoc.mjs} +1 -1
  109. package/system/dist/{restore-archive-aG7OlQNo.js → restore-archive-D-3wmHDq.js} +1 -1
  110. package/system/dist/{restore-archive-DBc5sNQS.mjs → restore-archive-PlBC2NwT.mjs} +1 -1
  111. package/system/dist/{wal-maintenance-C-ddHy-q.js → wal-maintenance-BTR55y--.js} +0 -0
  112. package/system/dist/{wal-maintenance-vQHsOLGg.mjs → wal-maintenance-jrhYTCn2.mjs} +0 -0
  113. package/system/package.json +1 -1
@@ -803,7 +803,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
803
803
  return EventCategory;
804
804
  }({});
805
805
  //#endregion
806
- //#region ../types/dist/device-type-D1fH5kaC.mjs
806
+ //#region ../types/dist/device-type-DxCT0krO.mjs
807
807
  /**
808
808
  import { errMsg } from '@camstack/types'
809
809
  * Extract a human-readable message from an unknown error value.
@@ -965,6 +965,13 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
965
965
  * filters that want "all devices with on-motion behaviour".
966
966
  */
967
967
  DeviceFeature["MotionTrigger"] = "motion-trigger";
968
+ /**
969
+ * Device can be run for a chosen time and then stopped. Mirrors the
970
+ * `timed-run` wrapper cap — the cap is bound by the core-blocks addon, not by
971
+ * a driver, so the flag is derived from the device's bindings
972
+ * (`featuresOfBoundCaps`). Gates the quick-run control in the viewer.
973
+ */
974
+ DeviceFeature["TimedRun"] = "timed-run";
968
975
  /** Light supports rgb-triplet color via `color` cap. */
969
976
  DeviceFeature["LightColorRgb"] = "light-color-rgb";
970
977
  /** Light supports HSV color via `color` cap. */
@@ -1076,6 +1083,15 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1076
1083
  return DeviceFeature;
1077
1084
  }({});
1078
1085
  /**
1086
+ * The features a device carries because a capability is bound on it: a bound cap
1087
+ * whose name IS a `DeviceFeature` value. One rule for a device whose cap set
1088
+ * is not decided by one driver (a composed device, a wrapper cap) — a feature
1089
+ * is never listed twice, once as a cap and once as a table of names.
1090
+ */
1091
+ function featuresOfBoundCaps(capNames) {
1092
+ return Object.values(DeviceFeature).filter((feature) => capNames.includes(feature));
1093
+ }
1094
+ /**
1079
1095
  * Semantic role a device plays within its parent. Populated by driver
1080
1096
  * addons when creating accessory devices (Reolink siren/floodlight/
1081
1097
  * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
@@ -1188,7 +1204,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1188
1204
  return DeviceRole;
1189
1205
  }({});
1190
1206
  //#endregion
1191
- //#region ../types/dist/sleep-D4UJY10i.mjs
1207
+ //#region ../types/dist/sleep-7El4r5Bl.mjs
1192
1208
  /**
1193
1209
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1194
1210
  * window to float samples (D455).
@@ -3748,7 +3764,7 @@ function boundOf(list) {
3748
3764
  * Base class for CamStack addons. Eliminates settings boilerplate:
3749
3765
  *
3750
3766
  * - Typed `config` property with automatic resolution from store + defaults
3751
- * - `getGlobalSettings()` / `updateGlobalSettings()` auto-implemented
3767
+ * - the scoped settings API (`clusterSettings` / `nodeSettings` / `deviceDefaults`) auto-implemented
3752
3768
  * - `getAddonSettings()` / `updateAddonSettings()` auto-implemented
3753
3769
  * - `getDeviceSettings()` / `updateDeviceSettings()` auto-implemented
3754
3770
  * - `ctx` accessor for the AddonContext (no manual `this.ctxRef` storage)
@@ -3758,7 +3774,7 @@ function boundOf(list) {
3758
3774
  * Subclasses override:
3759
3775
  * - `onInitialize()` — addon-specific init logic, return ProviderRegistration[]
3760
3776
  * - `onShutdown()` — cleanup
3761
- * - `globalSettingsSchema()` / `deviceSettingsSchema()` — UI schemas
3777
+ * - `clusterSettingsSchema()` / `nodeSettingsSchema()` / `deviceSettingsSchema()` — UI schemas
3762
3778
  *
3763
3779
  * @example
3764
3780
  * ```ts
@@ -3772,7 +3788,7 @@ function boundOf(list) {
3772
3788
  * super({ maxRetries: 3, endpoint: 'http://localhost' })
3773
3789
  * }
3774
3790
  *
3775
- * protected globalSettingsSchema() {
3791
+ * protected clusterSettingsSchema() {
3776
3792
  * return this.schema({
3777
3793
  * sections: [{
3778
3794
  * id: 'main', title: 'Settings',
@@ -3815,7 +3831,7 @@ var BaseAddon = class {
3815
3831
  defaults;
3816
3832
  /**
3817
3833
  * Hidden-state paths that hold secrets (D787) — values the addon writes
3818
- * itself (`updateGlobalSettings`, `state()`) that no form field declares.
3834
+ * itself (`state()`, the scoped writers) that no form field declares.
3819
3835
  * Stored in the keychain exactly like a `password` field. Syntax:
3820
3836
  * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
3821
3837
  * (`key[<id field>]` addresses array items by id, never by index).
@@ -3825,7 +3841,7 @@ var BaseAddon = class {
3825
3841
  /**
3826
3842
  * D986 M4: the scoped schemas this addon declared, resolved once per capability
3827
3843
  * (`loadScopedSchemas`) so the sync readers (`perNodeKeys`, the secret tree, the restart check)
3828
- * see them. Empty until loaded: the readers then fall back to {@link globalSettingsSchema}.
3844
+ * see them. Empty until loaded.
3829
3845
  */
3830
3846
  _scopedByCap = /* @__PURE__ */ new Map();
3831
3847
  _nodeKeysByCap = /* @__PURE__ */ new Map();
@@ -4011,7 +4027,7 @@ var BaseAddon = class {
4011
4027
  /** Addon-specific cleanup. Override if needed. */
4012
4028
  async onShutdown() {}
4013
4029
  /**
4014
- * Called after config is resolved during updateGlobalSettings/updateAddonSettings.
4030
+ * Called after config is resolved during a settings write.
4015
4031
  * Override to react to config changes (e.g. restart a sampler, reconnect a service).
4016
4032
  * Not called during initialize() — use onInitialize() for initial setup.
4017
4033
  */
@@ -4040,82 +4056,12 @@ var BaseAddon = class {
4040
4056
  scopedSettingsCapabilities() {
4041
4057
  return [];
4042
4058
  }
4043
- /** Override to provide global-level settings UI schema. */
4044
- globalSettingsSchema(_cap) {
4045
- return null;
4046
- }
4047
4059
  /** Override to provide device-level settings UI schema. */
4048
4060
  deviceSettingsSchema() {
4049
4061
  return null;
4050
4062
  }
4051
4063
  /**
4052
- * INTEGRATION-LEVEL SETTINGS — declare which of this addon's global sections
4053
- * ARE the configuration of its integration.
4054
- *
4055
- * Return the `ConfigSection.id`s, from {@link globalSettingsSchema}, that an
4056
- * operator should find on the addon's integration page (System →
4057
- * Integrations → <name>) rather than only in the cluster-wide list of every
4058
- * addon. Empty (the default) means the addon has no integration-level
4059
- * settings and no such surface is offered — this is opt-in, because whether
4060
- * an addon's configuration IS its integration's configuration depends on the
4061
- * nature of the integration.
4062
- *
4063
- * WHAT THIS IS NOT. It is not a scope. The selected sections keep living in
4064
- * the ONE global schema, in the ONE addon store, written by the ONE
4065
- * `updateGlobalSettings` path. There is deliberately no
4066
- * `updateIntegrationSettings`: a second write path is how a surface acquires
4067
- * a second store key, and this repo has shipped that twice (`btmPath@hub`,
4068
- * D266). Selecting sections cannot introduce a key that selecting cannot.
4069
- *
4070
- * WHY IT IS A LIST OF SECTION IDS AND NOT A MARKER ON THE SECTION.
4071
- * `ConfigFieldBase` used to carry `scope?: 'device' | 'global'` and it was
4072
- * removed with the reason recorded at
4073
- * `packages/types/src/interfaces/config-ui.ts:249` — *"a field's scope is
4074
- * determined by WHICH schema it lives in, not by a field-level marker."* A
4075
- * marker sprinkled across sections also has to borrow a field that already
4076
- * means something else; borrowing `section.tab` put the literal word
4077
- * "integration" into an operator-facing tab bar, because `tab` means "how to
4078
- * GROUP this visually" and cannot also mean "where this lives" (D269
4079
- * supersedes D268). One declaration, in one place, next to the schema whose
4080
- * ids it names.
4081
- */
4082
- integrationSettingSections() {
4083
- return [];
4084
- }
4085
- async getGlobalSettings(overlay, cap, nodeId) {
4086
- await this.loadScopedSchemas(cap);
4087
- const schema = this.globalSettingsSchema(cap) ?? this.scopedFormSchema(cap);
4088
- if (!schema) return { sections: [] };
4089
- const projected = await this.readRawProjectedStore(nodeId, cap);
4090
- return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
4091
- }
4092
- /**
4093
- * The integration-level view of this addon's settings: exactly the sections
4094
- * named by {@link integrationSettingSections}, hydrated from the SAME store
4095
- * `getGlobalSettings` reads, and narrowed to cluster-scoped fields.
4096
- *
4097
- * Returns `null` when the addon declared nothing — an addon that opts out has
4098
- * no integration settings surface at all, rather than an empty one that reads
4099
- * as a failed load.
4100
- *
4101
- * Three properties hold BY CONSTRUCTION, which is why they are here in core
4102
- * and not in whichever UI happens to render this:
4103
- *
4104
- * 1. **One key.** The payload is a SUBSET of the global schema, so a field
4105
- * shown here is the same field, with the same bare key, that the addon's
4106
- * own page shows. There is no integration-specific writer — callers save
4107
- * through `updateGlobalSettings` — so a second store key is unreachable,
4108
- * not merely discouraged.
4109
- * 2. **No node scope.** `perNode: true` fields are DROPPED. Their store key
4110
- * is `<key>@<nodeId>` and an integration is not a node; whichever node
4111
- * such a field silently picked would be a wrong answer for the operator
4112
- * who opened the page (D266).
4113
- * 3. **No silent typo.** A declared id that names no section throws. The
4114
- * alternative — skip it — turns a rename into a surface that quietly
4115
- * empties, which looks exactly like an addon with nothing to configure.
4116
- */
4117
- /**
4118
- * 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.
4119
4065
  *
4120
4066
  * Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
4121
4067
  * needs its connection fields, the default integration the addon's own sections. It is the
@@ -4326,32 +4272,15 @@ var BaseAddon = class {
4326
4272
  */
4327
4273
  async getIntegrationFormSchema(instance, nodeId) {
4328
4274
  const scoped = await this.integrationFormSchema(instance);
4329
- if (scoped === null) return this.getGlobalSettings(void 0, void 0, nodeId);
4275
+ if (scoped === null) return this.scopedForm(nodeId);
4330
4276
  return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
4331
4277
  }
4332
- async getIntegrationSettings(nodeId) {
4333
- const declared = this.integrationSettingSections();
4334
- if (declared.length === 0) return null;
4335
- const schema = this.globalSettingsSchema();
4336
- if (!schema) throw new Error(`${this.constructor.name}: integrationSettingSections() names [${declared.join(", ")}] but globalSettingsSchema() returns null.`);
4337
- const byId = new Map(schema.sections.map((section) => [section.id, section]));
4338
- const sections = [];
4339
- for (const id of declared) {
4340
- const section = byId.get(id);
4341
- if (!section) throw new Error(`${this.constructor.name}: integrationSettingSections() names unknown section "${id}". Known sections: [${[...byId.keys()].join(", ")}].`);
4342
- const fields = dropPerNodeFields(section.fields);
4343
- if (fields.length === 0) continue;
4344
- sections.push({
4345
- ...section,
4346
- fields
4347
- });
4348
- }
4349
- if (sections.length === 0) return null;
4350
- const projected = await this.readRawProjectedStore(nodeId);
4351
- return hydrateSchema({
4352
- ...schema,
4353
- sections
4354
- }, 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 });
4355
4284
  }
4356
4285
  /**
4357
4286
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -4360,8 +4289,8 @@ var BaseAddon = class {
4360
4289
  * bare fallback), all `@`-scoped and stray bare per-node keys are dropped.
4361
4290
  * A no-op passthrough when the schema declares no `perNode` field.
4362
4291
  *
4363
- * This is the sanctioned way for a `getGlobalSettings` OVERRIDE that needs
4364
- * the store for custom option logic (option narrowing, value snapping) to
4292
+ * This is the sanctioned way for an addon that needs
4293
+ * the store for custom logic (option narrowing, value snapping) to
4365
4294
  * read it per-node — never `ctx.settings.readAddonStore()` directly.
4366
4295
  * `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
4367
4296
  *
@@ -4413,7 +4342,7 @@ var BaseAddon = class {
4413
4342
  }
4414
4343
  /**
4415
4344
  * Whether ONE global key of this addon's store was written, read three-way
4416
- * (D651). For a question a hydrated view cannot answer: `getGlobalSettings`
4345
+ * (D651). For a question a hydrated view cannot answer: a hydrated form
4417
4346
  * reports `value ?? default`, so "the operator chose the default" and "nobody
4418
4347
  * chose" look the same, and a failed read looks like both. A `perNode` key is
4419
4348
  * not supported here: its stored name is scoped.
@@ -4447,7 +4376,7 @@ var BaseAddon = class {
4447
4376
  }
4448
4377
  /**
4449
4378
  * The OPERATOR's write — a settings form or an admin API call, dispatched by
4450
- * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
4379
+ * the kernel. The one in-process write of the addon blob that is not a scoped write; a secret
4451
4380
  * the operator sends is stored as sent even when it equals a pre-keychain
4452
4381
  * inline value: the operator re-entering a password is a change, an addon
4453
4382
  * writing back what it read is not (D787).
@@ -4460,9 +4389,6 @@ var BaseAddon = class {
4460
4389
  this._operatorWriteDepth--;
4461
4390
  }
4462
4391
  }
4463
- async updateGlobalSettings(patch, nodeId) {
4464
- await this.applyGlobalPatch(patch, nodeId);
4465
- }
4466
4392
  /**
4467
4393
  * REMOVE stored secrets — their keychain values and their markers (D787).
4468
4394
  *
@@ -4505,8 +4431,7 @@ var BaseAddon = class {
4505
4431
  await this.resolveConfig();
4506
4432
  await this.onConfigChanged();
4507
4433
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
4508
- const legacy = this.globalSettingsSchema();
4509
- 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));
4510
4435
  return true;
4511
4436
  }
4512
4437
  /**
@@ -4544,10 +4469,7 @@ var BaseAddon = class {
4544
4469
  this._nodeKeysByCap = /* @__PURE__ */ new Map();
4545
4470
  this._addonSecretTree = null;
4546
4471
  }
4547
- /**
4548
- * The form the settings API serves while an addon declares no {@link globalSettingsSchema}: the
4549
- * sections of its scoped schemas, so dropping the old hook does not blank the form.
4550
- */
4472
+ /** The form of an addon's scoped schemas: their sections, each shown once. */
4551
4473
  scopedFormSchema(cap) {
4552
4474
  const byId = /* @__PURE__ */ new Map();
4553
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);
@@ -4559,8 +4481,7 @@ var BaseAddon = class {
4559
4481
  return [...this._scopedByCap.values()].flat();
4560
4482
  }
4561
4483
  /**
4562
- * The field keys that are stored per node: every field of a {@link nodeSettingsSchema}, plus
4563
- * 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
4564
4485
  * per `cap` argument and memoized (schemas are static declarations). Empty set ⇒ every
4565
4486
  * per-node code path is bypassed and the settings API behaves like the node-agnostic one.
4566
4487
  * Call {@link loadScopedSchemas} first (the async seams do).
@@ -4569,8 +4490,7 @@ var BaseAddon = class {
4569
4490
  const cacheKey = cap ?? "";
4570
4491
  const cached = this._nodeKeysByCap.get(cacheKey);
4571
4492
  if (cached) return cached;
4572
- const legacy = this.globalSettingsSchema(cap);
4573
- const keys = new Set(legacy ? legacy.sections.flatMap((section) => collectPerNodeFieldKeys(section.fields)) : []);
4493
+ const keys = /* @__PURE__ */ new Set();
4574
4494
  for (const { scope, schema } of this.loadedScopedSchemas(cap)) {
4575
4495
  if (scope !== "node") continue;
4576
4496
  for (const section of schema.sections) for (const key of collectValueFieldKeys(section.fields)) keys.add(key);
@@ -4788,8 +4708,6 @@ var BaseAddon = class {
4788
4708
  }
4789
4709
  declaredKeySet() {
4790
4710
  const keys = new Set(Object.keys(this.defaults));
4791
- const schema = this.globalSettingsSchema();
4792
- if (schema) for (const section of schema.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
4793
4711
  for (const { schema: scoped } of this.loadedScopedSchemas()) for (const section of scoped.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
4794
4712
  for (const key of this._declaredStateKeys) keys.add(key);
4795
4713
  for (const path of this.secretStatePaths) {
@@ -4887,7 +4805,7 @@ var BaseAddon = class {
4887
4805
  /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
4888
4806
  addonSecretTree() {
4889
4807
  if (this._addonSecretTree === null) {
4890
- const tree = new Map(secretTreeFromSchema(this.globalSettingsSchema()));
4808
+ const tree = /* @__PURE__ */ new Map();
4891
4809
  for (const { schema } of this.loadedScopedSchemas()) for (const [key, node] of secretTreeFromSchema(schema)) tree.set(key, node);
4892
4810
  this._addonSecretTree = mergeSecretStatePaths(tree, this.secretStatePaths);
4893
4811
  }
@@ -5099,47 +5017,6 @@ function classifyStoreError(err) {
5099
5017
  if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
5100
5018
  return "permanent";
5101
5019
  }
5102
- /**
5103
- * Collect the keys of every field marked `perNode: true`, recursing into
5104
- * layout containers (`group` fields and `sub-tabs` tabs) the same way
5105
- * `hydrateSchema` does. Valueless structural fields (separator/info/…)
5106
- * don't declare `perNode` and are excluded by the `in` narrowing.
5107
- */
5108
- /**
5109
- * The same fields with every `perNode: true` one removed, recursing into layout
5110
- * containers exactly as {@link collectPerNodeFieldKeys} does. A container left
5111
- * with no child is dropped rather than rendered empty.
5112
- *
5113
- * Used by `getIntegrationSettings`: an integration is not a node, so a field
5114
- * whose store key is `<key>@<nodeId>` has no node to belong to there.
5115
- */
5116
- function dropPerNodeFields(fields) {
5117
- const kept = [];
5118
- for (const field of fields) {
5119
- if (field.type === "group") {
5120
- const inner = dropPerNodeFields(field.fields);
5121
- if (inner.length > 0) kept.push({
5122
- ...field,
5123
- fields: inner
5124
- });
5125
- continue;
5126
- }
5127
- if (field.type === "sub-tabs") {
5128
- const tabs = field.tabs.map((tab) => ({
5129
- ...tab,
5130
- fields: dropPerNodeFields(tab.fields)
5131
- })).filter((tab) => tab.fields.length > 0);
5132
- if (tabs.length > 0) kept.push({
5133
- ...field,
5134
- tabs
5135
- });
5136
- continue;
5137
- }
5138
- if ("perNode" in field && field.perNode === true) continue;
5139
- kept.push(field);
5140
- }
5141
- return kept;
5142
- }
5143
5020
  /** The keys of the value-holding fields, recursing into layout containers. */
5144
5021
  function collectValueFieldKeys(fields) {
5145
5022
  const collected = [];
@@ -5172,21 +5049,6 @@ function collectFieldKeys(fields) {
5172
5049
  }
5173
5050
  return collected;
5174
5051
  }
5175
- function collectPerNodeFieldKeys(fields) {
5176
- const collected = [];
5177
- for (const field of fields) {
5178
- if (field.type === "group") {
5179
- collected.push(...collectPerNodeFieldKeys(field.fields));
5180
- continue;
5181
- }
5182
- if (field.type === "sub-tabs") {
5183
- for (const tab of field.tabs) collected.push(...collectPerNodeFieldKeys(tab.fields));
5184
- continue;
5185
- }
5186
- if ("perNode" in field && field.perNode === true) collected.push(field.key);
5187
- }
5188
- return collected;
5189
- }
5190
5052
  /**
5191
5053
  * Normalize an `ICamstackAddon.initialize()` return value into the
5192
5054
  * `AddonInitResult` envelope. Arrays are wrapped into `{ providers }`;
@@ -9130,7 +8992,7 @@ function sleep(ms) {
9130
8992
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
9131
8993
  }
9132
8994
  //#endregion
9133
- //#region ../types/dist/composition-BmBHuDTQ.mjs
8995
+ //#region ../types/dist/composition-Bx0JvKUU.mjs
9134
8996
  var AUDIO_ENCODER_BY_CODEC = {
9135
8997
  opus: "libopus",
9136
8998
  aac: "aac",
@@ -11831,6 +11693,396 @@ var NodeColorIdSchema = zod.z.enum([
11831
11693
  "node-h"
11832
11694
  ]);
11833
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
11834
12086
  //#region ../types/dist/index.mjs
11835
12087
  var SMTP_INBOUND_DEFAULT_PORT = 2525;
11836
12088
  var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
@@ -41827,10 +42079,15 @@ var ExpressionLiteralBindingSchema = zod.z.object({
41827
42079
  ])
41828
42080
  });
41829
42081
  /** Read ANY device's status field, addressed by its re-sync-stable `stableId` —
41830
- * 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. */
41831
42087
  var ExpressionGlobalBindingSchema = zod.z.object({
41832
42088
  kind: zod.z.literal("global"),
41833
42089
  sourceStableId: zod.z.string(),
42090
+ addonId: zod.z.string().optional(),
41834
42091
  cap: zod.z.string(),
41835
42092
  fieldPath: zod.z.string()
41836
42093
  });
@@ -42105,394 +42362,6 @@ function extractSourceInfoFromMetadata(metadata) {
42105
42362
  return parsed.data;
42106
42363
  }
42107
42364
  /**
42108
- * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
42109
- * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
42110
- * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
42111
- * decimals). K derives from `°C = K − 273.15`.
42112
- */
42113
- var UNIT_TABLE = {
42114
- "°C": {
42115
- dimension: "temperature",
42116
- factor: 1,
42117
- offset: 0
42118
- },
42119
- "°F": {
42120
- dimension: "temperature",
42121
- factor: 5 / 9,
42122
- offset: -160 / 9
42123
- },
42124
- K: {
42125
- dimension: "temperature",
42126
- factor: 1,
42127
- offset: -273.15
42128
- },
42129
- hPa: {
42130
- dimension: "pressure",
42131
- factor: 1,
42132
- offset: 0
42133
- },
42134
- kPa: {
42135
- dimension: "pressure",
42136
- factor: 10,
42137
- offset: 0
42138
- },
42139
- Pa: {
42140
- dimension: "pressure",
42141
- factor: .01,
42142
- offset: 0
42143
- },
42144
- mbar: {
42145
- dimension: "pressure",
42146
- factor: 1,
42147
- offset: 0
42148
- },
42149
- bar: {
42150
- dimension: "pressure",
42151
- factor: 1e3,
42152
- offset: 0
42153
- },
42154
- inHg: {
42155
- dimension: "pressure",
42156
- factor: 33.8639,
42157
- offset: 0
42158
- },
42159
- mmHg: {
42160
- dimension: "pressure",
42161
- factor: 1.33322,
42162
- offset: 0
42163
- },
42164
- psi: {
42165
- dimension: "pressure",
42166
- factor: 68.9476,
42167
- offset: 0
42168
- },
42169
- "m/s": {
42170
- dimension: "speed",
42171
- factor: 1,
42172
- offset: 0
42173
- },
42174
- "km/h": {
42175
- dimension: "speed",
42176
- factor: 1 / 3.6,
42177
- offset: 0
42178
- },
42179
- mph: {
42180
- dimension: "speed",
42181
- factor: .44704,
42182
- offset: 0
42183
- },
42184
- kn: {
42185
- dimension: "speed",
42186
- factor: .514444,
42187
- offset: 0
42188
- },
42189
- "mm/h": {
42190
- dimension: "precipitation-rate",
42191
- factor: 1,
42192
- offset: 0
42193
- },
42194
- "in/h": {
42195
- dimension: "precipitation-rate",
42196
- factor: 25.4,
42197
- offset: 0
42198
- },
42199
- m: {
42200
- dimension: "length",
42201
- factor: 1,
42202
- offset: 0
42203
- },
42204
- mm: {
42205
- dimension: "length",
42206
- factor: .001,
42207
- offset: 0
42208
- },
42209
- cm: {
42210
- dimension: "length",
42211
- factor: .01,
42212
- offset: 0
42213
- },
42214
- km: {
42215
- dimension: "length",
42216
- factor: 1e3,
42217
- offset: 0
42218
- },
42219
- in: {
42220
- dimension: "length",
42221
- factor: .0254,
42222
- offset: 0
42223
- },
42224
- ft: {
42225
- dimension: "length",
42226
- factor: .3048,
42227
- offset: 0
42228
- },
42229
- mi: {
42230
- dimension: "length",
42231
- factor: 1609.344,
42232
- offset: 0
42233
- },
42234
- "m²": {
42235
- dimension: "area",
42236
- factor: 1,
42237
- offset: 0
42238
- },
42239
- lx: {
42240
- dimension: "illuminance",
42241
- factor: 1,
42242
- offset: 0
42243
- },
42244
- "W/m²": {
42245
- dimension: "irradiance",
42246
- factor: 1,
42247
- offset: 0
42248
- },
42249
- W: {
42250
- dimension: "power",
42251
- factor: 1,
42252
- offset: 0
42253
- },
42254
- kW: {
42255
- dimension: "power",
42256
- factor: 1e3,
42257
- offset: 0
42258
- },
42259
- VA: {
42260
- dimension: "apparent-power",
42261
- factor: 1,
42262
- offset: 0
42263
- },
42264
- Wh: {
42265
- dimension: "energy",
42266
- factor: 1,
42267
- offset: 0
42268
- },
42269
- kWh: {
42270
- dimension: "energy",
42271
- factor: 1e3,
42272
- offset: 0
42273
- },
42274
- MWh: {
42275
- dimension: "energy",
42276
- factor: 1e6,
42277
- offset: 0
42278
- },
42279
- V: {
42280
- dimension: "voltage",
42281
- factor: 1,
42282
- offset: 0
42283
- },
42284
- mV: {
42285
- dimension: "voltage",
42286
- factor: .001,
42287
- offset: 0
42288
- },
42289
- A: {
42290
- dimension: "current",
42291
- factor: 1,
42292
- offset: 0
42293
- },
42294
- mA: {
42295
- dimension: "current",
42296
- factor: .001,
42297
- offset: 0
42298
- },
42299
- ppm: {
42300
- dimension: "concentration-volume",
42301
- factor: 1,
42302
- offset: 0
42303
- },
42304
- ppb: {
42305
- dimension: "concentration-volume",
42306
- factor: .001,
42307
- offset: 0
42308
- },
42309
- "µg/m³": {
42310
- dimension: "concentration-mass",
42311
- factor: 1,
42312
- offset: 0
42313
- },
42314
- "mg/m³": {
42315
- dimension: "concentration-mass",
42316
- factor: 1e3,
42317
- offset: 0
42318
- },
42319
- kg: {
42320
- dimension: "mass",
42321
- factor: 1,
42322
- offset: 0
42323
- },
42324
- g: {
42325
- dimension: "mass",
42326
- factor: .001,
42327
- offset: 0
42328
- },
42329
- lb: {
42330
- dimension: "mass",
42331
- factor: .453592,
42332
- offset: 0
42333
- },
42334
- oz: {
42335
- dimension: "mass",
42336
- factor: .0283495,
42337
- offset: 0
42338
- },
42339
- "%": {
42340
- dimension: "percentage",
42341
- factor: 1,
42342
- offset: 0
42343
- },
42344
- L: {
42345
- dimension: "volume",
42346
- factor: 1,
42347
- offset: 0
42348
- },
42349
- mL: {
42350
- dimension: "volume",
42351
- factor: .001,
42352
- offset: 0
42353
- },
42354
- gal: {
42355
- dimension: "volume",
42356
- factor: 3.785411784,
42357
- offset: 0
42358
- },
42359
- s: {
42360
- dimension: "duration",
42361
- factor: 1,
42362
- offset: 0
42363
- },
42364
- ms: {
42365
- dimension: "duration",
42366
- factor: .001,
42367
- offset: 0
42368
- },
42369
- min: {
42370
- dimension: "duration",
42371
- factor: 60,
42372
- offset: 0
42373
- },
42374
- h: {
42375
- dimension: "duration",
42376
- factor: 3600,
42377
- offset: 0
42378
- },
42379
- d: {
42380
- dimension: "duration",
42381
- factor: 86400,
42382
- offset: 0
42383
- },
42384
- B: {
42385
- dimension: "information",
42386
- factor: 1,
42387
- offset: 0
42388
- },
42389
- KiB: {
42390
- dimension: "information",
42391
- factor: 1024,
42392
- offset: 0
42393
- },
42394
- MiB: {
42395
- dimension: "information",
42396
- factor: 1024 ** 2,
42397
- offset: 0
42398
- },
42399
- GiB: {
42400
- dimension: "information",
42401
- factor: 1024 ** 3,
42402
- offset: 0
42403
- },
42404
- TiB: {
42405
- dimension: "information",
42406
- factor: 1024 ** 4,
42407
- offset: 0
42408
- },
42409
- kB: {
42410
- dimension: "information",
42411
- factor: 1e3,
42412
- offset: 0
42413
- },
42414
- MB: {
42415
- dimension: "information",
42416
- factor: 1e6,
42417
- offset: 0
42418
- },
42419
- GB: {
42420
- dimension: "information",
42421
- factor: 1e9,
42422
- offset: 0
42423
- },
42424
- "°": {
42425
- dimension: "angle",
42426
- factor: 1,
42427
- offset: 0
42428
- },
42429
- dBFS: {
42430
- dimension: "sound-level",
42431
- factor: 1,
42432
- offset: 0
42433
- },
42434
- dBm: {
42435
- dimension: "signal-level",
42436
- factor: 1,
42437
- offset: 0
42438
- },
42439
- mired: {
42440
- dimension: "colour-temperature",
42441
- factor: 1,
42442
- offset: 0
42443
- },
42444
- kbps: {
42445
- dimension: "bitrate",
42446
- factor: 1,
42447
- offset: 0
42448
- },
42449
- Mbps: {
42450
- dimension: "bitrate",
42451
- factor: 1e3,
42452
- offset: 0
42453
- },
42454
- fps: {
42455
- dimension: "rate",
42456
- factor: 1,
42457
- offset: 0
42458
- }
42459
- };
42460
- /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
42461
- function specFor(unit) {
42462
- return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
42463
- }
42464
- /** The dimension a unit belongs to, or `undefined` for an unknown unit. */
42465
- function unitDimension(unit) {
42466
- return specFor(unit)?.dimension;
42467
- }
42468
- /** Value in `spec`'s unit → its dimension's canonical unit. */
42469
- function toCanonical(value, spec) {
42470
- return value * spec.factor + spec.offset;
42471
- }
42472
- /** Canonical-unit value → the unit described by `spec`. */
42473
- function fromCanonical(canonical, spec) {
42474
- return (canonical - spec.offset) / spec.factor;
42475
- }
42476
- /**
42477
- * Graceful variant for the render path: returns the converted value, or
42478
- * `undefined` when the conversion is refused (unknown unit / cross-dimension).
42479
- * Never throws — a render caller falls back to the raw value + source unit.
42480
- */
42481
- function tryConvertUnit(value, from, to) {
42482
- if (from === to) return value;
42483
- const fromSpec = specFor(from);
42484
- if (!fromSpec) return void 0;
42485
- const toSpec = specFor(to);
42486
- if (!toSpec) return void 0;
42487
- if (fromSpec.dimension !== toSpec.dimension) return void 0;
42488
- return fromCanonical(toCanonical(value, fromSpec), toSpec);
42489
- }
42490
- function unitsForDimension(dimension) {
42491
- const out = [];
42492
- for (const [unit, spec] of Object.entries(UNIT_TABLE)) if (spec.dimension === dimension) out.push(unit);
42493
- return out;
42494
- }
42495
- /**
42496
42365
  * A number a person types for a physical quantity — the input side of the
42497
42366
  * value + unit contract (D972).
42498
42367
  *
@@ -43789,6 +43658,31 @@ describe$1(STATIONARY_DESCRIPTIONS);
43789
43658
  * ones a short-circuit never reached) with a stable path and a human reason, so
43790
43659
  * the editor can paint each block.
43791
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
+ }
43792
43686
  /** The cap whose runtime-state slice IS the occupancy snapshot, parked objects included. */
43793
43687
  var ZONE_ANALYTICS_CAP = "zone-analytics";
43794
43688
  function collectInto(cond, out) {
@@ -43818,7 +43712,8 @@ function collectInto(cond, out) {
43818
43712
  for (const binding of Object.values(cond.bindings)) if (binding.kind === "global") out.push({
43819
43713
  kind: "stable",
43820
43714
  stableId: binding.sourceStableId,
43821
- cap: binding.cap
43715
+ cap: binding.cap,
43716
+ ...binding.addonId !== void 0 ? { addonId: binding.addonId } : {}
43822
43717
  });
43823
43718
  return;
43824
43719
  default: return;
@@ -43831,7 +43726,7 @@ function collectWhenMirrorSources(cond) {
43831
43726
  collectInto(cond, all);
43832
43727
  const seen = /* @__PURE__ */ new Set();
43833
43728
  return all.filter((s) => {
43834
- 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}`;
43835
43730
  if (seen.has(key)) return false;
43836
43731
  seen.add(key);
43837
43732
  return true;
@@ -43868,15 +43763,19 @@ var ConditionMirror = class {
43868
43763
  this.slices.set(key, slice);
43869
43764
  }
43870
43765
  isStableTarget(deviceId, cap) {
43871
- 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;
43872
43767
  return false;
43873
43768
  }
43874
43769
  read(deviceId, cap, fieldPath) {
43875
43770
  const slice = this.slices.get(sliceKey(deviceId, cap));
43876
43771
  return slice === void 0 ? void 0 : pick$1(slice, fieldPath);
43877
43772
  }
43878
- readStable(stableId, cap, fieldPath) {
43879
- const deviceId = this.stableIds.get(stableId);
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));
43880
43779
  return deviceId === void 0 ? void 0 : this.read(deviceId, cap, fieldPath);
43881
43780
  }
43882
43781
  /** Fill / reconcile. A read that fails or answers nothing keeps the old value. */
@@ -43888,7 +43787,7 @@ var ConditionMirror = class {
43888
43787
  } catch {}
43889
43788
  const targets = /* @__PURE__ */ new Map();
43890
43789
  for (const s of this.sources) {
43891
- 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));
43892
43791
  if (deviceId === void 0) {
43893
43792
  kept += 1;
43894
43793
  continue;
@@ -44093,7 +43992,7 @@ function evalNode(cond, path, reader, now, out, state) {
44093
43992
  values[alias] = toExpressionValue(binding.value) ?? null;
44094
43993
  continue;
44095
43994
  }
44096
- 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;
44097
43996
  if (raw === void 0) {
44098
43997
  out.push({
44099
43998
  path,
@@ -45769,20 +45668,6 @@ var addonSettingsCapability = {
45769
45668
  mode: "singleton",
45770
45669
  nodeIdMode: "data",
45771
45670
  methods: {
45772
- getGlobalSettings: method(zod.z.object({
45773
- addonId: zod.z.string(),
45774
- nodeId: zod.z.string().optional(),
45775
- overlay: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
45776
- cap: zod.z.string().optional()
45777
- }), SettingsSchemaWithValuesSchema.nullable()),
45778
- updateGlobalSettings: method(zod.z.object({
45779
- addonId: zod.z.string(),
45780
- nodeId: zod.z.string().optional(),
45781
- patch: SettingsPatchSchema
45782
- }), SettingsUpdateResultSchema, {
45783
- kind: "mutation",
45784
- auth: "admin"
45785
- }),
45786
45671
  getScopedSettings: method(zod.z.object({
45787
45672
  addonId: zod.z.string(),
45788
45673
  cap: zod.z.string(),
@@ -45809,10 +45694,6 @@ var addonSettingsCapability = {
45809
45694
  scope: ScopedSettingsScopeSchema,
45810
45695
  nodeId: zod.z.string().optional()
45811
45696
  }), zod.z.record(zod.z.string(), zod.z.unknown()).nullable()),
45812
- getIntegrationSettings: method(zod.z.object({
45813
- addonId: zod.z.string(),
45814
- nodeId: zod.z.string().optional()
45815
- }), SettingsSchemaWithValuesSchema.nullable()),
45816
45697
  getIntegrationFormSchema: method(zod.z.object({
45817
45698
  addonId: zod.z.string(),
45818
45699
  nodeId: zod.z.string().optional(),
@@ -47793,7 +47674,7 @@ var BackupDestinationInfoSchema = zod.z.object({
47793
47674
  id: zod.z.string(),
47794
47675
  /**
47795
47676
  * Manifest id of the owning addon. The Settings button on the
47796
- * destination card opens that addon's `globalSettingsSchema` panel.
47677
+ * destination card opens that addon's scoped settings panel.
47797
47678
  */
47798
47679
  addonId: zod.z.string(),
47799
47680
  /** Operator-toggled enable flag from the destination-policy table. */
@@ -57271,6 +57152,92 @@ var deviceExportCapability = {
57271
57152
  })
57272
57153
  }
57273
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
+ }
57274
57241
  /**
57275
57242
  * A SITE ZONE — a named part of the property that several locations belong to.
57276
57243
  *
@@ -57768,6 +57735,12 @@ var DeviceInfoSchema = zod.z.object({
57768
57735
  addonId: zod.z.string(),
57769
57736
  type: zod.z.enum(DeviceType),
57770
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(),
57771
57744
  /** Operator-organisational location label. `null` when unset. */
57772
57745
  location: zod.z.string().nullable(),
57773
57746
  /** Soft-disabled flag. */
@@ -58163,6 +58136,30 @@ var deviceManagerCapability = {
58163
58136
  kind: "mutation",
58164
58137
  auth: "admin"
58165
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
+ }),
58166
58163
  /** Update the operator-organisational location label. `null`
58167
58164
  * clears it. */
58168
58165
  setLocation: method(zod.z.object({
@@ -65600,7 +65597,7 @@ var localNetworkCapability = {
65600
65597
  resetAllowlistToBestMatch: method(zod.z.void(), AllowedAddressesSchema, { kind: "mutation" }),
65601
65598
  /**
65602
65599
  * Live TLS material for the Network → Local access certificate card.
65603
- * LAN HTTP / hostname are addon settings (`globalSettingsSchema`), not
65600
+ * LAN HTTP / hostname are scoped settings (the cap's own form), not
65604
65601
  * a second store — this query is status, not configuration.
65605
65602
  */
65606
65603
  getTlsStatus: method(zod.z.void(), TlsStatusSchema),
@@ -80302,7 +80299,7 @@ var pipelineOrchestratorCapability = {
80302
80299
  /**
80303
80300
  * The operator's STORED model choice for one cluster-scoped step (D651).
80304
80301
  * Read three-way from this addon's own store, only once its boot has
80305
- * settled. Unlike `addonSettings.getGlobalSettings`, it never answers a
80302
+ * settled. Unlike `addonSettings.getScopedSettings`, it never answers a
80306
80303
  * default as though someone chose it.
80307
80304
  */
80308
80305
  getClusterModelChoice: method(zod.z.object({ stepId: zod.z.string() }), ClusterModelChoiceSchema),
@@ -96561,13 +96558,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
96561
96558
  access: "view",
96562
96559
  role: "admin"
96563
96560
  },
96564
- "addonSettings.getGlobalSettings": {
96565
- capName: "addon-settings",
96566
- capScope: "system",
96567
- addonId: null,
96568
- access: "view",
96569
- role: "admin"
96570
- },
96571
96561
  "addonSettings.getIntegrationFormSchema": {
96572
96562
  capName: "addon-settings",
96573
96563
  capScope: "system",
@@ -96575,13 +96565,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
96575
96565
  access: "view",
96576
96566
  role: "admin"
96577
96567
  },
96578
- "addonSettings.getIntegrationSettings": {
96579
- capName: "addon-settings",
96580
- capScope: "system",
96581
- addonId: null,
96582
- access: "view",
96583
- role: "admin"
96584
- },
96585
96568
  "addonSettings.getScopedSettings": {
96586
96569
  capName: "addon-settings",
96587
96570
  capScope: "system",
@@ -96617,13 +96600,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
96617
96600
  access: "create",
96618
96601
  role: "admin"
96619
96602
  },
96620
- "addonSettings.updateGlobalSettings": {
96621
- capName: "addon-settings",
96622
- capScope: "system",
96623
- addonId: null,
96624
- access: "create",
96625
- role: "admin"
96626
- },
96627
96603
  "addonSettings.updateScopedSettings": {
96628
96604
  capName: "addon-settings",
96629
96605
  capScope: "system",
@@ -98794,6 +98770,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
98794
98770
  access: "create",
98795
98771
  role: "admin"
98796
98772
  },
98773
+ "deviceManager.setAlias": {
98774
+ capName: "device-manager",
98775
+ capScope: "system",
98776
+ addonId: null,
98777
+ access: "create",
98778
+ role: "admin"
98779
+ },
98797
98780
  "deviceManager.setChildLayout": {
98798
98781
  capName: "device-manager",
98799
98782
  capScope: "system",
@@ -106535,6 +106518,7 @@ function offered(received) {
106535
106518
  };
106536
106519
  }
106537
106520
  offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
106521
+ zod.z.string().min(1).max(4096);
106538
106522
  /**
106539
106523
  * Runtime list of cap names with status. Used by the settings
106540
106524
  * aggregator to enumerate caps whose `status` should be polled +
@@ -107308,6 +107292,11 @@ Object.freeze({
107308
107292
  form: "single",
107309
107293
  optional: false
107310
107294
  }],
107295
+ "deviceManager.setAlias": [{
107296
+ name: "deviceId",
107297
+ form: "single",
107298
+ optional: false
107299
+ }],
107311
107300
  "deviceManager.setChildLayout": [{
107312
107301
  name: "deviceId",
107313
107302
  form: "single",
@@ -112994,6 +112983,12 @@ Object.defineProperty(exports, "catalogueIssues", {
112994
112983
  return catalogueIssues;
112995
112984
  }
112996
112985
  });
112986
+ Object.defineProperty(exports, "checkDeviceAlias", {
112987
+ enumerable: true,
112988
+ get: function() {
112989
+ return checkDeviceAlias;
112990
+ }
112991
+ });
112997
112992
  Object.defineProperty(exports, "checkRoleAddress", {
112998
112993
  enumerable: true,
112999
112994
  get: function() {
@@ -113444,6 +113439,12 @@ Object.defineProperty(exports, "featureForwards", {
113444
113439
  return featureForwards;
113445
113440
  }
113446
113441
  });
113442
+ Object.defineProperty(exports, "featuresOfBoundCaps", {
113443
+ enumerable: true,
113444
+ get: function() {
113445
+ return featuresOfBoundCaps;
113446
+ }
113447
+ });
113447
113448
  Object.defineProperty(exports, "filesystemBrowseCapability", {
113448
113449
  enumerable: true,
113449
113450
  get: function() {
@@ -113480,6 +113481,12 @@ Object.defineProperty(exports, "gbToBytes", {
113480
113481
  return gbToBytes;
113481
113482
  }
113482
113483
  });
113484
+ Object.defineProperty(exports, "generateDeviceAlias", {
113485
+ enumerable: true,
113486
+ get: function() {
113487
+ return generateDeviceAlias;
113488
+ }
113489
+ });
113483
113490
  Object.defineProperty(exports, "getDebugInterest", {
113484
113491
  enumerable: true,
113485
113492
  get: function() {
@@ -114350,6 +114357,12 @@ Object.defineProperty(exports, "splitTranslationRef", {
114350
114357
  return splitTranslationRef;
114351
114358
  }
114352
114359
  });
114360
+ Object.defineProperty(exports, "stableIdMapOf", {
114361
+ enumerable: true,
114362
+ get: function() {
114363
+ return stableIdMapOf;
114364
+ }
114365
+ });
114353
114366
  Object.defineProperty(exports, "statisticCadenceMs", {
114354
114367
  enumerable: true,
114355
114368
  get: function() {