@camstack/addon-export-google 0.1.130 → 0.1.131

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.
@@ -881,7 +881,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
881
881
  return EventCategory;
882
882
  }({});
883
883
  //#endregion
884
- //#region ../types/dist/device-type-D1fH5kaC.mjs
884
+ //#region ../types/dist/device-type-DxCT0krO.mjs
885
885
  /**
886
886
  import { errMsg } from '@camstack/types'
887
887
  * Extract a human-readable message from an unknown error value.
@@ -1043,6 +1043,13 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1043
1043
  * filters that want "all devices with on-motion behaviour".
1044
1044
  */
1045
1045
  DeviceFeature["MotionTrigger"] = "motion-trigger";
1046
+ /**
1047
+ * Device can be run for a chosen time and then stopped. Mirrors the
1048
+ * `timed-run` wrapper cap — the cap is bound by the core-blocks addon, not by
1049
+ * a driver, so the flag is derived from the device's bindings
1050
+ * (`featuresOfBoundCaps`). Gates the quick-run control in the viewer.
1051
+ */
1052
+ DeviceFeature["TimedRun"] = "timed-run";
1046
1053
  /** Light supports rgb-triplet color via `color` cap. */
1047
1054
  DeviceFeature["LightColorRgb"] = "light-color-rgb";
1048
1055
  /** Light supports HSV color via `color` cap. */
@@ -6077,7 +6084,7 @@ var ZodIssueCode = {
6077
6084
  var ZodFirstPartyTypeKind;
6078
6085
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6079
6086
  //#endregion
6080
- //#region ../types/dist/sleep-AEnTN3b4.mjs
6087
+ //#region ../types/dist/sleep-7El4r5Bl.mjs
6081
6088
  /**
6082
6089
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6083
6090
  * window to float samples (D455).
@@ -6441,6 +6448,59 @@ Object.fromEntries([
6441
6448
  function isValuelessField(field) {
6442
6449
  return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button" || field.type === "account-sign-in" || field.type === "secret-presence";
6443
6450
  }
6451
+ /**
6452
+ * Base collector: flatten a hydrated `ConfigUISchemaWithValues` into
6453
+ * `key → { value, default }`, recursing through `group` and `sub-tabs`
6454
+ * layout fields. Keeping `value` and `default` SEPARATE (rather than
6455
+ * pre-resolving) lets callers both read the effective value AND detect
6456
+ * overrides (`value` differs from `default`). Structural over `unknown`;
6457
+ * malformed input yields an empty map, never throws.
6458
+ */
6459
+ function collectHydratedFieldEntries(schema) {
6460
+ const out = /* @__PURE__ */ new Map();
6461
+ if (typeof schema !== "object" || schema === null) return out;
6462
+ const sections = schema.sections;
6463
+ if (!Array.isArray(sections)) return out;
6464
+ for (const section of sections) if (typeof section === "object" && section !== null) collectFieldEntriesInto(section.fields, out);
6465
+ return out;
6466
+ }
6467
+ /** Recursive field walker for {@link collectHydratedFieldEntries}. */
6468
+ function collectFieldEntriesInto(fields, into) {
6469
+ if (!Array.isArray(fields)) return;
6470
+ for (const field of fields) {
6471
+ if (typeof field !== "object" || field === null) continue;
6472
+ const type = field.type;
6473
+ if (type === "group") {
6474
+ collectFieldEntriesInto(field.fields, into);
6475
+ continue;
6476
+ }
6477
+ if (type === "sub-tabs") {
6478
+ const tabs = field.tabs;
6479
+ if (Array.isArray(tabs)) {
6480
+ for (const tab of tabs) if (typeof tab === "object" && tab !== null) collectFieldEntriesInto(tab.fields, into);
6481
+ }
6482
+ continue;
6483
+ }
6484
+ const key = field.key;
6485
+ if (typeof key !== "string" || key.length === 0) continue;
6486
+ if (!("value" in field)) continue;
6487
+ into.set(key, {
6488
+ value: field.value,
6489
+ default: field.default
6490
+ });
6491
+ }
6492
+ }
6493
+ /**
6494
+ * Flatten a hydrated settings payload into `key → EFFECTIVE value`
6495
+ * (`value ?? default`). The read-side inverse of `hydrateSchema` for the
6496
+ * common "just give me the resolved values" case. Built on
6497
+ * {@link collectHydratedFieldEntries}.
6498
+ */
6499
+ function collectHydratedFieldValues(schema) {
6500
+ const out = /* @__PURE__ */ new Map();
6501
+ for (const [key, entry] of collectHydratedFieldEntries(schema)) out.set(key, entry.value ?? entry.default);
6502
+ return out;
6503
+ }
6444
6504
  function hydrateSchema(schema, values, options = {}) {
6445
6505
  return {
6446
6506
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
@@ -7664,6 +7724,21 @@ var SCOPED_SETTINGS_SCOPES = [
7664
7724
  "device-defaults",
7665
7725
  "node"
7666
7726
  ];
7727
+ /** The one refusal of a key a scope did not declare. */
7728
+ function assertDeclaredKeys(keys, declared) {
7729
+ const undeclared = keys.filter((key) => !declared.has(key));
7730
+ if (undeclared.length > 0) throw new Error(`scoped settings: [${undeclared.join(", ")}] not declared for this scope (declared: [${[...declared].join(", ")}])`);
7731
+ }
7732
+ /** Build the handle over an addon's scoped read, write and unset. */
7733
+ function createScopedSettings(deps) {
7734
+ return {
7735
+ async get() {
7736
+ return deps.schema.parse(await deps.read());
7737
+ },
7738
+ patch: (patch) => deps.write(Object.fromEntries(Object.entries(patch))),
7739
+ unset: (keys) => deps.unset(keys)
7740
+ };
7741
+ }
7667
7742
  /** A write to a secret path could not be stored in the keychain, so it was refused. */
7668
7743
  var KeychainWriteRefusedError = class extends Error {
7669
7744
  fieldPath;
@@ -8239,7 +8314,16 @@ function createHandle(raw, opts) {
8239
8314
  return blob;
8240
8315
  }
8241
8316
  },
8242
- writeAddonStore: writeAddon
8317
+ writeAddonStore: writeAddon,
8318
+ removeClearedKeys: (keys) => serialize("addon", async () => {
8319
+ const stored = await readStoredAddonBlob(raw);
8320
+ index.seen("addon", stored);
8321
+ const removable = keys.filter((key) => collectSecretMarkerRefs(stored[key]).length === 0);
8322
+ if (removable.length === 0) return;
8323
+ const patch = Object.fromEntries(removable.map((key) => [key, void 0]));
8324
+ await raw.writeAddonStore(patch);
8325
+ index.wrote("addon", patch);
8326
+ })
8243
8327
  };
8244
8328
  }
8245
8329
  /** The context the addon sees, plus the private raw view and write outcome. */
@@ -8369,7 +8453,7 @@ function boundOf(list) {
8369
8453
  * Base class for CamStack addons. Eliminates settings boilerplate:
8370
8454
  *
8371
8455
  * - Typed `config` property with automatic resolution from store + defaults
8372
- * - `getGlobalSettings()` / `updateGlobalSettings()` auto-implemented
8456
+ * - the scoped settings API (`clusterSettings` / `nodeSettings` / `deviceDefaults`) auto-implemented
8373
8457
  * - `getAddonSettings()` / `updateAddonSettings()` auto-implemented
8374
8458
  * - `getDeviceSettings()` / `updateDeviceSettings()` auto-implemented
8375
8459
  * - `ctx` accessor for the AddonContext (no manual `this.ctxRef` storage)
@@ -8379,7 +8463,7 @@ function boundOf(list) {
8379
8463
  * Subclasses override:
8380
8464
  * - `onInitialize()` — addon-specific init logic, return ProviderRegistration[]
8381
8465
  * - `onShutdown()` — cleanup
8382
- * - `globalSettingsSchema()` / `deviceSettingsSchema()` — UI schemas
8466
+ * - `clusterSettingsSchema()` / `nodeSettingsSchema()` / `deviceSettingsSchema()` — UI schemas
8383
8467
  *
8384
8468
  * @example
8385
8469
  * ```ts
@@ -8393,7 +8477,7 @@ function boundOf(list) {
8393
8477
  * super({ maxRetries: 3, endpoint: 'http://localhost' })
8394
8478
  * }
8395
8479
  *
8396
- * protected globalSettingsSchema() {
8480
+ * protected clusterSettingsSchema() {
8397
8481
  * return this.schema({
8398
8482
  * sections: [{
8399
8483
  * id: 'main', title: 'Settings',
@@ -8436,7 +8520,7 @@ var BaseAddon = class {
8436
8520
  defaults;
8437
8521
  /**
8438
8522
  * Hidden-state paths that hold secrets (D787) — values the addon writes
8439
- * itself (`updateGlobalSettings`, `state()`) that no form field declares.
8523
+ * itself (`state()`, the scoped writers) that no form field declares.
8440
8524
  * Stored in the keychain exactly like a `password` field. Syntax:
8441
8525
  * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
8442
8526
  * (`key[<id field>]` addresses array items by id, never by index).
@@ -8446,7 +8530,7 @@ var BaseAddon = class {
8446
8530
  /**
8447
8531
  * D986 M4: the scoped schemas this addon declared, resolved once per capability
8448
8532
  * (`loadScopedSchemas`) so the sync readers (`perNodeKeys`, the secret tree, the restart check)
8449
- * see them. Empty until loaded: the readers then fall back to {@link globalSettingsSchema}.
8533
+ * see them. Empty until loaded.
8450
8534
  */
8451
8535
  _scopedByCap = /* @__PURE__ */ new Map();
8452
8536
  _nodeKeysByCap = /* @__PURE__ */ new Map();
@@ -8632,7 +8716,7 @@ var BaseAddon = class {
8632
8716
  /** Addon-specific cleanup. Override if needed. */
8633
8717
  async onShutdown() {}
8634
8718
  /**
8635
- * Called after config is resolved during updateGlobalSettings/updateAddonSettings.
8719
+ * Called after config is resolved during a settings write.
8636
8720
  * Override to react to config changes (e.g. restart a sampler, reconnect a service).
8637
8721
  * Not called during initialize() — use onInitialize() for initial setup.
8638
8722
  */
@@ -8661,82 +8745,12 @@ var BaseAddon = class {
8661
8745
  scopedSettingsCapabilities() {
8662
8746
  return [];
8663
8747
  }
8664
- /** Override to provide global-level settings UI schema. */
8665
- globalSettingsSchema(_cap) {
8666
- return null;
8667
- }
8668
8748
  /** Override to provide device-level settings UI schema. */
8669
8749
  deviceSettingsSchema() {
8670
8750
  return null;
8671
8751
  }
8672
8752
  /**
8673
- * INTEGRATION-LEVEL SETTINGS — declare which of this addon's global sections
8674
- * ARE the configuration of its integration.
8675
- *
8676
- * Return the `ConfigSection.id`s, from {@link globalSettingsSchema}, that an
8677
- * operator should find on the addon's integration page (System →
8678
- * Integrations → <name>) rather than only in the cluster-wide list of every
8679
- * addon. Empty (the default) means the addon has no integration-level
8680
- * settings and no such surface is offered — this is opt-in, because whether
8681
- * an addon's configuration IS its integration's configuration depends on the
8682
- * nature of the integration.
8683
- *
8684
- * WHAT THIS IS NOT. It is not a scope. The selected sections keep living in
8685
- * the ONE global schema, in the ONE addon store, written by the ONE
8686
- * `updateGlobalSettings` path. There is deliberately no
8687
- * `updateIntegrationSettings`: a second write path is how a surface acquires
8688
- * a second store key, and this repo has shipped that twice (`btmPath@hub`,
8689
- * D266). Selecting sections cannot introduce a key that selecting cannot.
8690
- *
8691
- * WHY IT IS A LIST OF SECTION IDS AND NOT A MARKER ON THE SECTION.
8692
- * `ConfigFieldBase` used to carry `scope?: 'device' | 'global'` and it was
8693
- * removed with the reason recorded at
8694
- * `packages/types/src/interfaces/config-ui.ts:249` — *"a field's scope is
8695
- * determined by WHICH schema it lives in, not by a field-level marker."* A
8696
- * marker sprinkled across sections also has to borrow a field that already
8697
- * means something else; borrowing `section.tab` put the literal word
8698
- * "integration" into an operator-facing tab bar, because `tab` means "how to
8699
- * GROUP this visually" and cannot also mean "where this lives" (D269
8700
- * supersedes D268). One declaration, in one place, next to the schema whose
8701
- * ids it names.
8702
- */
8703
- integrationSettingSections() {
8704
- return [];
8705
- }
8706
- async getGlobalSettings(overlay, cap, nodeId) {
8707
- await this.loadScopedSchemas(cap);
8708
- const schema = this.globalSettingsSchema(cap) ?? this.scopedFormSchema(cap);
8709
- if (!schema) return { sections: [] };
8710
- const projected = await this.readRawProjectedStore(nodeId, cap);
8711
- return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
8712
- }
8713
- /**
8714
- * The integration-level view of this addon's settings: exactly the sections
8715
- * named by {@link integrationSettingSections}, hydrated from the SAME store
8716
- * `getGlobalSettings` reads, and narrowed to cluster-scoped fields.
8717
- *
8718
- * Returns `null` when the addon declared nothing — an addon that opts out has
8719
- * no integration settings surface at all, rather than an empty one that reads
8720
- * as a failed load.
8721
- *
8722
- * Three properties hold BY CONSTRUCTION, which is why they are here in core
8723
- * and not in whichever UI happens to render this:
8724
- *
8725
- * 1. **One key.** The payload is a SUBSET of the global schema, so a field
8726
- * shown here is the same field, with the same bare key, that the addon's
8727
- * own page shows. There is no integration-specific writer — callers save
8728
- * through `updateGlobalSettings` — so a second store key is unreachable,
8729
- * not merely discouraged.
8730
- * 2. **No node scope.** `perNode: true` fields are DROPPED. Their store key
8731
- * is `<key>@<nodeId>` and an integration is not a node; whichever node
8732
- * such a field silently picked would be a wrong answer for the operator
8733
- * who opened the page (D266).
8734
- * 3. **No silent typo.** A declared id that names no section throws. The
8735
- * alternative — skip it — turns a rename into a surface that quietly
8736
- * empties, which looks exactly like an addon with nothing to configure.
8737
- */
8738
- /**
8739
- * The form schema of ONE integration instance, or `null` to use {@link globalSettingsSchema}.
8753
+ * The form schema of ONE integration instance, or `null` to use the scoped form.
8740
8754
  *
8741
8755
  * Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
8742
8756
  * needs its connection fields, the default integration the addon's own sections. It is the
@@ -8784,37 +8798,178 @@ var BaseAddon = class {
8784
8798
  }
8785
8799
  }
8786
8800
  /**
8801
+ * Hook: values layered over the stored ones when the FORM of one scope is served
8802
+ * ({@link getScopedSettings}) — a preview that derives dependent options without writing.
8803
+ * Never applied to {@link ScopedSettings.get} or to a write. `null` ⇒ no overlay.
8804
+ */
8805
+ async scopedSettingsOverlay(_scope, _cap, _nodeId) {
8806
+ return null;
8807
+ }
8808
+ /**
8809
+ * Hook: a write of one scope changed stored values (not called when the store reports no change,
8810
+ * e.g. the write-back of a stored secret). `keys` are the bare field keys of the write, node keys included.
8811
+ */
8812
+ async onScopedSettingsChanged(_scope, _cap, _keys) {}
8813
+ /** Typed handle over the CLUSTER settings `cap` declares (`clusterSettingsSchema`). */
8814
+ clusterSettings(cap, schema) {
8815
+ return this.scopedHandle("cluster", cap, schema);
8816
+ }
8817
+ /** Typed handle over the fleet defaults of the per-device settings `cap` declares. */
8818
+ deviceDefaults(cap, schema) {
8819
+ return this.scopedHandle("device-defaults", cap, schema);
8820
+ }
8821
+ /**
8822
+ * Typed handle over the settings `cap` owns PER NODE. `nodeId` omitted ⇒ the local node. A node
8823
+ * with no row yields the schema defaults — never a bare-key fallback.
8824
+ */
8825
+ nodeSettings(cap, schema, nodeId) {
8826
+ return this.scopedHandle("node", cap, schema, nodeId);
8827
+ }
8828
+ /**
8829
+ * {@link state} for a value that is kept per node: stored under `<key>@<nodeId>`, and the
8830
+ * settings store carries `nodeId` in the row data (D986 §1), so a forgotten node's rows go in one
8831
+ * central delete. `nodeId` omitted ⇒ the local node.
8832
+ */
8833
+ nodeState(key, schema, fallback, nodeId) {
8834
+ this._declaredStateKeys.add(key);
8835
+ return createDurableState({
8836
+ key: nodeScopedKey(key, nodeId ?? this._ctx?.kernel?.localNodeId ?? ""),
8837
+ schema,
8838
+ fallback,
8839
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
8840
+ write: async (patch) => {
8841
+ await this._ctx?.settings?.writeAddonStore(patch);
8842
+ },
8843
+ onParseError: (k, e) => this._ctx?.logger?.warn?.(`durable-state: stored "${k}" failed validation — using fallback`, { meta: {
8844
+ addonId: this._ctx?.id,
8845
+ key: k,
8846
+ error: String(e)
8847
+ } })
8848
+ });
8849
+ }
8850
+ /** The loaded schema `cap` declares for `scope`, or `null`. */
8851
+ async declaredScopedSchema(scope, cap) {
8852
+ await this.loadScopedSchemas(cap);
8853
+ return this.loadedScopedSchemas(cap).find((entry) => entry.scope === scope)?.schema ?? null;
8854
+ }
8855
+ async requireScopedSchema(scope, cap) {
8856
+ const schema = await this.declaredScopedSchema(scope, cap);
8857
+ if (schema === null) throw new Error(`${this.constructor.name}: cap "${cap}" declares no ${scope} settings`);
8858
+ return schema;
8859
+ }
8860
+ scopedKeys(schema) {
8861
+ return new Set(schema.sections.flatMap((section) => collectValueFieldKeys(section.fields)));
8862
+ }
8863
+ /** `store` narrowed to the keys `schema` declares. */
8864
+ narrowToScope(store, schema) {
8865
+ const keys = this.scopedKeys(schema);
8866
+ return Object.fromEntries(Object.entries(store).filter(([key]) => keys.has(key)));
8867
+ }
8868
+ scopedHandle(scope, cap, schema, nodeId) {
8869
+ return createScopedSettings({
8870
+ schema,
8871
+ read: async () => {
8872
+ const declared = await this.requireScopedSchema(scope, cap);
8873
+ const stored = this.narrowToScope(await this.resolveGlobalStore(nodeId, cap), declared);
8874
+ const effective = collectHydratedFieldValues(hydrateSchema(declared, stored));
8875
+ return {
8876
+ ...Object.fromEntries([...effective].filter(([, value]) => value !== void 0)),
8877
+ ...stored
8878
+ };
8879
+ },
8880
+ write: (patch) => this.writeScoped(scope, cap, patch, nodeId),
8881
+ unset: (keys) => this.unsetScoped(scope, cap, keys, nodeId)
8882
+ });
8883
+ }
8884
+ /** The one write path of the scoped API: declared keys only, then the global patch. */
8885
+ async writeScoped(scope, cap, patch, nodeId) {
8886
+ assertDeclaredKeys(Object.keys(patch), this.scopedKeys(await this.requireScopedSchema(scope, cap)));
8887
+ if (await this.applyGlobalPatch(patch, scope === "node" ? nodeId : void 0, cap)) await this.onScopedSettingsChanged(scope, cap, Object.keys(patch));
8888
+ }
8889
+ /**
8890
+ * Remove declared keys of one scope. A secret goes through {@link clearSecrets} — its keychain
8891
+ * value is released exactly as there — and the emptied row is then removed; every other key is
8892
+ * removed by an `undefined` patch (which a secret transform would read as "keep").
8893
+ */
8894
+ async unsetScoped(scope, cap, keys, nodeId) {
8895
+ assertDeclaredKeys(keys, this.scopedKeys(await this.requireScopedSchema(scope, cap)));
8896
+ const target = scope === "node" ? nodeId : void 0;
8897
+ const tree = this.addonSecretTree();
8898
+ const secretKeys = keys.filter((key) => tree.has(key));
8899
+ const plainKeys = keys.filter((key) => !tree.has(key));
8900
+ let changed = false;
8901
+ if (plainKeys.length > 0) {
8902
+ const patch = Object.fromEntries(plainKeys.map((key) => [key, void 0]));
8903
+ changed = await this.applyGlobalPatch(patch, target, cap) || changed;
8904
+ }
8905
+ if (secretKeys.length > 0) {
8906
+ await this.clearSecretKeys(secretKeys, target, cap);
8907
+ const node = normalizeNodeId(target ?? this._ctx?.kernel?.localNodeId);
8908
+ const rows = secretKeys.map((key) => scope === "node" ? nodeScopedKey(key, node) : key);
8909
+ if (this._secretSettings !== null) await this._secretSettings.removeClearedKeys(rows);
8910
+ else await this._ctx?.settings?.writeAddonStore(Object.fromEntries(rows.map((row) => [row, void 0])));
8911
+ changed = true;
8912
+ }
8913
+ if (changed) await this.onScopedSettingsChanged(scope, cap, [...keys]);
8914
+ }
8915
+ /**
8916
+ * The hydrated form of one scope of one capability's settings (any
8917
+ * {@link scopedSettingsOverlay} applied), or `null` when the capability declares nothing there.
8918
+ */
8919
+ async getScopedSettings(scope, cap, nodeId) {
8920
+ const schema = await this.declaredScopedSchema(scope, cap);
8921
+ if (schema === null) return null;
8922
+ const stored = this.narrowToScope(await this.readRawProjectedStore(nodeId, cap), schema);
8923
+ const overlay = await this.scopedSettingsOverlay(scope, cap, nodeId);
8924
+ return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(stored, overlay) : stored, { inlineSecretsAsViews: true });
8925
+ }
8926
+ /**
8927
+ * The scoped schemas this addon serves: one entry per loaded (capability, scope), capabilities
8928
+ * in declaration order, scopes in {@link SCOPED_SETTINGS_SCOPES} order. `[]` when it declares
8929
+ * nothing.
8930
+ */
8931
+ async listScopedSettings() {
8932
+ await this.loadScopedSchemas();
8933
+ return [...this._scopedByCap].flatMap(([cap, entries]) => entries.map((entry) => ({
8934
+ cap,
8935
+ scope: entry.scope,
8936
+ sectionIds: entry.schema.sections.map((section) => section.id)
8937
+ })));
8938
+ }
8939
+ /** The OPERATOR's write of declared keys of one scope (D787 secret semantics). */
8940
+ async updateScopedSettings(scope, cap, patch, nodeId) {
8941
+ this._operatorWriteDepth++;
8942
+ try {
8943
+ await this.writeScoped(scope, cap, patch, nodeId);
8944
+ } finally {
8945
+ this._operatorWriteDepth--;
8946
+ }
8947
+ }
8948
+ /**
8949
+ * The effective values (`stored ?? default`) of one scope, a secret as its `set` view — never
8950
+ * its value. `null` when the capability declares nothing for the scope.
8951
+ */
8952
+ async readScopedValues(scope, cap, nodeId) {
8953
+ const schema = await this.declaredScopedSchema(scope, cap);
8954
+ if (schema === null) return null;
8955
+ const form = hydrateSchema(schema, this.narrowToScope(await this.readRawProjectedStore(nodeId, cap), schema), { inlineSecretsAsViews: true });
8956
+ return Object.fromEntries([...collectHydratedFieldValues(form)].filter(([, value]) => value !== void 0));
8957
+ }
8958
+ /**
8787
8959
  * What the create wizard and the integration edit page render for one instance: the addon's
8788
8960
  * per-instance schema when it declares one, else its global schema (what they always showed).
8789
8961
  */
8790
8962
  async getIntegrationFormSchema(instance, nodeId) {
8791
8963
  const scoped = await this.integrationFormSchema(instance);
8792
- if (scoped === null) return this.getGlobalSettings(void 0, void 0, nodeId);
8964
+ if (scoped === null) return this.scopedForm(nodeId);
8793
8965
  return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
8794
8966
  }
8795
- async getIntegrationSettings(nodeId) {
8796
- const declared = this.integrationSettingSections();
8797
- if (declared.length === 0) return null;
8798
- const schema = this.globalSettingsSchema();
8799
- if (!schema) throw new Error(`${this.constructor.name}: integrationSettingSections() names [${declared.join(", ")}] but globalSettingsSchema() returns null.`);
8800
- const byId = new Map(schema.sections.map((section) => [section.id, section]));
8801
- const sections = [];
8802
- for (const id of declared) {
8803
- const section = byId.get(id);
8804
- if (!section) throw new Error(`${this.constructor.name}: integrationSettingSections() names unknown section "${id}". Known sections: [${[...byId.keys()].join(", ")}].`);
8805
- const fields = dropPerNodeFields(section.fields);
8806
- if (fields.length === 0) continue;
8807
- sections.push({
8808
- ...section,
8809
- fields
8810
- });
8811
- }
8812
- if (sections.length === 0) return null;
8813
- const projected = await this.readRawProjectedStore(nodeId);
8814
- return hydrateSchema({
8815
- ...schema,
8816
- sections
8817
- }, projected, { inlineSecretsAsViews: true });
8967
+ /** The form of the scoped schemas this addon declared, hydrated from its store. */
8968
+ async scopedForm(nodeId) {
8969
+ await this.loadScopedSchemas();
8970
+ const schema = this.scopedFormSchema();
8971
+ if (!schema) return { sections: [] };
8972
+ return hydrateSchema(schema, await this.readRawProjectedStore(nodeId), { inlineSecretsAsViews: true });
8818
8973
  }
8819
8974
  /**
8820
8975
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -8823,8 +8978,8 @@ var BaseAddon = class {
8823
8978
  * bare fallback), all `@`-scoped and stray bare per-node keys are dropped.
8824
8979
  * A no-op passthrough when the schema declares no `perNode` field.
8825
8980
  *
8826
- * This is the sanctioned way for a `getGlobalSettings` OVERRIDE that needs
8827
- * the store for custom option logic (option narrowing, value snapping) to
8981
+ * This is the sanctioned way for an addon that needs
8982
+ * the store for custom logic (option narrowing, value snapping) to
8828
8983
  * read it per-node — never `ctx.settings.readAddonStore()` directly.
8829
8984
  * `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
8830
8985
  *
@@ -8876,7 +9031,7 @@ var BaseAddon = class {
8876
9031
  }
8877
9032
  /**
8878
9033
  * Whether ONE global key of this addon's store was written, read three-way
8879
- * (D651). For a question a hydrated view cannot answer: `getGlobalSettings`
9034
+ * (D651). For a question a hydrated view cannot answer: a hydrated form
8880
9035
  * reports `value ?? default`, so "the operator chose the default" and "nobody
8881
9036
  * chose" look the same, and a failed read looks like both. A `perNode` key is
8882
9037
  * not supported here: its stored name is scoped.
@@ -8910,7 +9065,7 @@ var BaseAddon = class {
8910
9065
  }
8911
9066
  /**
8912
9067
  * The OPERATOR's write — a settings form or an admin API call, dispatched by
8913
- * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
9068
+ * the kernel. The one in-process write of the addon blob that is not a scoped write; a secret
8914
9069
  * the operator sends is stored as sent even when it equals a pre-keychain
8915
9070
  * inline value: the operator re-entering a password is a change, an addon
8916
9071
  * writing back what it read is not (D787).
@@ -8923,9 +9078,6 @@ var BaseAddon = class {
8923
9078
  this._operatorWriteDepth--;
8924
9079
  }
8925
9080
  }
8926
- async updateGlobalSettings(patch, nodeId) {
8927
- await this.applyGlobalPatch(patch, nodeId);
8928
- }
8929
9081
  /**
8930
9082
  * REMOVE stored secrets — their keychain values and their markers (D787).
8931
9083
  *
@@ -8935,6 +9087,9 @@ var BaseAddon = class {
8935
9087
  * a keychain (an older kernel) it writes `''`, as such code always did.
8936
9088
  */
8937
9089
  async clearSecrets(keys, nodeId) {
9090
+ await this.clearSecretKeys(keys, nodeId);
9091
+ }
9092
+ async clearSecretKeys(keys, nodeId, cap) {
8938
9093
  const tree = this.addonSecretTree();
8939
9094
  const keychain = this._ctx?.secrets !== void 0;
8940
9095
  const stored = keychain ? await this.readAddonStoreWithRetry() : {};
@@ -8947,25 +9102,26 @@ var BaseAddon = class {
8947
9102
  const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
8948
9103
  patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
8949
9104
  }
8950
- await this.applyGlobalPatch(patch, nodeId);
9105
+ await this.applyGlobalPatch(patch, nodeId, cap);
8951
9106
  }
8952
- async applyGlobalPatch(barePatch, nodeId) {
8953
- await this.loadScopedSchemas();
8954
- const keys = this.perNodeKeys();
9107
+ /** Resolves `true` when the write changed stored values. */
9108
+ async applyGlobalPatch(barePatch, nodeId, cap) {
9109
+ await this.loadScopedSchemas(cap);
9110
+ const keys = this.perNodeKeys(cap);
8955
9111
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
8956
9112
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
8957
9113
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
8958
9114
  const handle = this._secretSettings;
8959
9115
  if (handle !== null) {
8960
9116
  const { changed } = await handle.writeAddonStore(scoped);
8961
- if (!changed) return;
9117
+ if (!changed) return false;
8962
9118
  } else await this._ctx?.settings?.writeAddonStore(scoped);
8963
- if (target !== localNode) return;
9119
+ if (target !== localNode) return true;
8964
9120
  await this.resolveConfig();
8965
9121
  await this.onConfigChanged();
8966
9122
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
8967
- const legacy = this.globalSettingsSchema();
8968
- this.maybeAutoRestart(Object.keys(barePatch), [...legacy === null ? [] : [legacy], ...this.loadedScopedSchemas().map((entry) => entry.schema)]);
9123
+ this.maybeAutoRestart(Object.keys(barePatch), this.loadedScopedSchemas().map((entry) => entry.schema));
9124
+ return true;
8969
9125
  }
8970
9126
  /**
8971
9127
  * The set of field keys the global settings schema declares `perNode: true`
@@ -9002,10 +9158,7 @@ var BaseAddon = class {
9002
9158
  this._nodeKeysByCap = /* @__PURE__ */ new Map();
9003
9159
  this._addonSecretTree = null;
9004
9160
  }
9005
- /**
9006
- * The form the settings API serves while an addon declares no {@link globalSettingsSchema}: the
9007
- * sections of its scoped schemas, so dropping the old hook does not blank the form.
9008
- */
9161
+ /** The form of an addon's scoped schemas: their sections, each shown once. */
9009
9162
  scopedFormSchema(cap) {
9010
9163
  const byId = /* @__PURE__ */ new Map();
9011
9164
  for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
@@ -9017,8 +9170,7 @@ var BaseAddon = class {
9017
9170
  return [...this._scopedByCap.values()].flat();
9018
9171
  }
9019
9172
  /**
9020
- * The field keys that are stored per node: every field of a {@link nodeSettingsSchema}, plus
9021
- * the fields the legacy {@link globalSettingsSchema} still marks `perNode: true`. Derived once
9173
+ * The field keys that are stored per node: every field of a {@link nodeSettingsSchema}. Derived once
9022
9174
  * per `cap` argument and memoized (schemas are static declarations). Empty set ⇒ every
9023
9175
  * per-node code path is bypassed and the settings API behaves like the node-agnostic one.
9024
9176
  * Call {@link loadScopedSchemas} first (the async seams do).
@@ -9027,8 +9179,7 @@ var BaseAddon = class {
9027
9179
  const cacheKey = cap ?? "";
9028
9180
  const cached = this._nodeKeysByCap.get(cacheKey);
9029
9181
  if (cached) return cached;
9030
- const legacy = this.globalSettingsSchema(cap);
9031
- const keys = new Set(legacy ? legacy.sections.flatMap((section) => collectPerNodeFieldKeys(section.fields)) : []);
9182
+ const keys = /* @__PURE__ */ new Set();
9032
9183
  for (const { scope, schema } of this.loadedScopedSchemas(cap)) {
9033
9184
  if (scope !== "node") continue;
9034
9185
  for (const section of schema.sections) for (const key of collectValueFieldKeys(section.fields)) keys.add(key);
@@ -9246,8 +9397,6 @@ var BaseAddon = class {
9246
9397
  }
9247
9398
  declaredKeySet() {
9248
9399
  const keys = new Set(Object.keys(this.defaults));
9249
- const schema = this.globalSettingsSchema();
9250
- if (schema) for (const section of schema.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
9251
9400
  for (const { schema: scoped } of this.loadedScopedSchemas()) for (const section of scoped.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
9252
9401
  for (const key of this._declaredStateKeys) keys.add(key);
9253
9402
  for (const path of this.secretStatePaths) {
@@ -9345,7 +9494,7 @@ var BaseAddon = class {
9345
9494
  /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
9346
9495
  addonSecretTree() {
9347
9496
  if (this._addonSecretTree === null) {
9348
- const tree = new Map(secretTreeFromSchema(this.globalSettingsSchema()));
9497
+ const tree = /* @__PURE__ */ new Map();
9349
9498
  for (const { schema } of this.loadedScopedSchemas()) for (const [key, node] of secretTreeFromSchema(schema)) tree.set(key, node);
9350
9499
  this._addonSecretTree = mergeSecretStatePaths(tree, this.secretStatePaths);
9351
9500
  }
@@ -9557,47 +9706,6 @@ function classifyStoreError(err) {
9557
9706
  if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
9558
9707
  return "permanent";
9559
9708
  }
9560
- /**
9561
- * Collect the keys of every field marked `perNode: true`, recursing into
9562
- * layout containers (`group` fields and `sub-tabs` tabs) the same way
9563
- * `hydrateSchema` does. Valueless structural fields (separator/info/…)
9564
- * don't declare `perNode` and are excluded by the `in` narrowing.
9565
- */
9566
- /**
9567
- * The same fields with every `perNode: true` one removed, recursing into layout
9568
- * containers exactly as {@link collectPerNodeFieldKeys} does. A container left
9569
- * with no child is dropped rather than rendered empty.
9570
- *
9571
- * Used by `getIntegrationSettings`: an integration is not a node, so a field
9572
- * whose store key is `<key>@<nodeId>` has no node to belong to there.
9573
- */
9574
- function dropPerNodeFields(fields) {
9575
- const kept = [];
9576
- for (const field of fields) {
9577
- if (field.type === "group") {
9578
- const inner = dropPerNodeFields(field.fields);
9579
- if (inner.length > 0) kept.push({
9580
- ...field,
9581
- fields: inner
9582
- });
9583
- continue;
9584
- }
9585
- if (field.type === "sub-tabs") {
9586
- const tabs = field.tabs.map((tab) => ({
9587
- ...tab,
9588
- fields: dropPerNodeFields(tab.fields)
9589
- })).filter((tab) => tab.fields.length > 0);
9590
- if (tabs.length > 0) kept.push({
9591
- ...field,
9592
- tabs
9593
- });
9594
- continue;
9595
- }
9596
- if ("perNode" in field && field.perNode === true) continue;
9597
- kept.push(field);
9598
- }
9599
- return kept;
9600
- }
9601
9709
  /** The keys of the value-holding fields, recursing into layout containers. */
9602
9710
  function collectValueFieldKeys(fields) {
9603
9711
  const collected = [];
@@ -9630,21 +9738,6 @@ function collectFieldKeys(fields) {
9630
9738
  }
9631
9739
  return collected;
9632
9740
  }
9633
- function collectPerNodeFieldKeys(fields) {
9634
- const collected = [];
9635
- for (const field of fields) {
9636
- if (field.type === "group") {
9637
- collected.push(...collectPerNodeFieldKeys(field.fields));
9638
- continue;
9639
- }
9640
- if (field.type === "sub-tabs") {
9641
- for (const tab of field.tabs) collected.push(...collectPerNodeFieldKeys(tab.fields));
9642
- continue;
9643
- }
9644
- if ("perNode" in field && field.perNode === true) collected.push(field.key);
9645
- }
9646
- return collected;
9647
- }
9648
9741
  /**
9649
9742
  * Normalize an `ICamstackAddon.initialize()` return value into the
9650
9743
  * `AddonInitResult` envelope. Arrays are wrapped into `{ providers }`;
@@ -12386,13 +12479,25 @@ Object.freeze({
12386
12479
  "path": "temperature",
12387
12480
  "valueType": "number"
12388
12481
  }],
12389
- "timed-run": [{
12390
- "path": "activeUntil",
12391
- "valueType": "number"
12392
- }, {
12393
- "path": "requestedBy",
12394
- "valueType": "string"
12395
- }],
12482
+ "timed-run": [
12483
+ {
12484
+ "path": "activeUntil",
12485
+ "valueType": "number"
12486
+ },
12487
+ {
12488
+ "path": "requestedBy",
12489
+ "valueType": "string"
12490
+ },
12491
+ {
12492
+ "path": "quickRun.duration",
12493
+ "valueType": "number"
12494
+ },
12495
+ {
12496
+ "path": "quickRun.unit",
12497
+ "valueType": "enum",
12498
+ "enumValues": ["s", "min"]
12499
+ }
12500
+ ],
12396
12501
  "update": [
12397
12502
  {
12398
12503
  "path": "currentVersion",
@@ -12616,7 +12721,7 @@ object({
12616
12721
  params: record(string(), union([string(), number()])).optional()
12617
12722
  });
12618
12723
  //#endregion
12619
- //#region ../types/dist/composition-BmBHuDTQ.mjs
12724
+ //#region ../types/dist/composition-Bx0JvKUU.mjs
12620
12725
  /**
12621
12726
  * The ffmpeg build every CamStack node downloads, per platform and arch.
12622
12727
  *
@@ -13778,6 +13883,387 @@ var NodeColorIdSchema = _enum([
13778
13883
  "node-h"
13779
13884
  ]);
13780
13885
  //#endregion
13886
+ //#region ../types/dist/convert-BAzH15HU.mjs
13887
+ /**
13888
+ * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
13889
+ * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
13890
+ * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
13891
+ * decimals). K derives from `°C = K − 273.15`.
13892
+ */
13893
+ var UNIT_TABLE = {
13894
+ "°C": {
13895
+ dimension: "temperature",
13896
+ factor: 1,
13897
+ offset: 0
13898
+ },
13899
+ "°F": {
13900
+ dimension: "temperature",
13901
+ factor: 5 / 9,
13902
+ offset: -160 / 9
13903
+ },
13904
+ K: {
13905
+ dimension: "temperature",
13906
+ factor: 1,
13907
+ offset: -273.15
13908
+ },
13909
+ hPa: {
13910
+ dimension: "pressure",
13911
+ factor: 1,
13912
+ offset: 0
13913
+ },
13914
+ kPa: {
13915
+ dimension: "pressure",
13916
+ factor: 10,
13917
+ offset: 0
13918
+ },
13919
+ Pa: {
13920
+ dimension: "pressure",
13921
+ factor: .01,
13922
+ offset: 0
13923
+ },
13924
+ mbar: {
13925
+ dimension: "pressure",
13926
+ factor: 1,
13927
+ offset: 0
13928
+ },
13929
+ bar: {
13930
+ dimension: "pressure",
13931
+ factor: 1e3,
13932
+ offset: 0
13933
+ },
13934
+ inHg: {
13935
+ dimension: "pressure",
13936
+ factor: 33.8639,
13937
+ offset: 0
13938
+ },
13939
+ mmHg: {
13940
+ dimension: "pressure",
13941
+ factor: 1.33322,
13942
+ offset: 0
13943
+ },
13944
+ psi: {
13945
+ dimension: "pressure",
13946
+ factor: 68.9476,
13947
+ offset: 0
13948
+ },
13949
+ "m/s": {
13950
+ dimension: "speed",
13951
+ factor: 1,
13952
+ offset: 0
13953
+ },
13954
+ "km/h": {
13955
+ dimension: "speed",
13956
+ factor: 1 / 3.6,
13957
+ offset: 0
13958
+ },
13959
+ mph: {
13960
+ dimension: "speed",
13961
+ factor: .44704,
13962
+ offset: 0
13963
+ },
13964
+ kn: {
13965
+ dimension: "speed",
13966
+ factor: .514444,
13967
+ offset: 0
13968
+ },
13969
+ "mm/h": {
13970
+ dimension: "precipitation-rate",
13971
+ factor: 1,
13972
+ offset: 0
13973
+ },
13974
+ "in/h": {
13975
+ dimension: "precipitation-rate",
13976
+ factor: 25.4,
13977
+ offset: 0
13978
+ },
13979
+ m: {
13980
+ dimension: "length",
13981
+ factor: 1,
13982
+ offset: 0
13983
+ },
13984
+ mm: {
13985
+ dimension: "length",
13986
+ factor: .001,
13987
+ offset: 0
13988
+ },
13989
+ cm: {
13990
+ dimension: "length",
13991
+ factor: .01,
13992
+ offset: 0
13993
+ },
13994
+ km: {
13995
+ dimension: "length",
13996
+ factor: 1e3,
13997
+ offset: 0
13998
+ },
13999
+ in: {
14000
+ dimension: "length",
14001
+ factor: .0254,
14002
+ offset: 0
14003
+ },
14004
+ ft: {
14005
+ dimension: "length",
14006
+ factor: .3048,
14007
+ offset: 0
14008
+ },
14009
+ mi: {
14010
+ dimension: "length",
14011
+ factor: 1609.344,
14012
+ offset: 0
14013
+ },
14014
+ "m²": {
14015
+ dimension: "area",
14016
+ factor: 1,
14017
+ offset: 0
14018
+ },
14019
+ lx: {
14020
+ dimension: "illuminance",
14021
+ factor: 1,
14022
+ offset: 0
14023
+ },
14024
+ "W/m²": {
14025
+ dimension: "irradiance",
14026
+ factor: 1,
14027
+ offset: 0
14028
+ },
14029
+ W: {
14030
+ dimension: "power",
14031
+ factor: 1,
14032
+ offset: 0
14033
+ },
14034
+ kW: {
14035
+ dimension: "power",
14036
+ factor: 1e3,
14037
+ offset: 0
14038
+ },
14039
+ VA: {
14040
+ dimension: "apparent-power",
14041
+ factor: 1,
14042
+ offset: 0
14043
+ },
14044
+ Wh: {
14045
+ dimension: "energy",
14046
+ factor: 1,
14047
+ offset: 0
14048
+ },
14049
+ kWh: {
14050
+ dimension: "energy",
14051
+ factor: 1e3,
14052
+ offset: 0
14053
+ },
14054
+ MWh: {
14055
+ dimension: "energy",
14056
+ factor: 1e6,
14057
+ offset: 0
14058
+ },
14059
+ V: {
14060
+ dimension: "voltage",
14061
+ factor: 1,
14062
+ offset: 0
14063
+ },
14064
+ mV: {
14065
+ dimension: "voltage",
14066
+ factor: .001,
14067
+ offset: 0
14068
+ },
14069
+ A: {
14070
+ dimension: "current",
14071
+ factor: 1,
14072
+ offset: 0
14073
+ },
14074
+ mA: {
14075
+ dimension: "current",
14076
+ factor: .001,
14077
+ offset: 0
14078
+ },
14079
+ ppm: {
14080
+ dimension: "concentration-volume",
14081
+ factor: 1,
14082
+ offset: 0
14083
+ },
14084
+ ppb: {
14085
+ dimension: "concentration-volume",
14086
+ factor: .001,
14087
+ offset: 0
14088
+ },
14089
+ "µg/m³": {
14090
+ dimension: "concentration-mass",
14091
+ factor: 1,
14092
+ offset: 0
14093
+ },
14094
+ "mg/m³": {
14095
+ dimension: "concentration-mass",
14096
+ factor: 1e3,
14097
+ offset: 0
14098
+ },
14099
+ kg: {
14100
+ dimension: "mass",
14101
+ factor: 1,
14102
+ offset: 0
14103
+ },
14104
+ g: {
14105
+ dimension: "mass",
14106
+ factor: .001,
14107
+ offset: 0
14108
+ },
14109
+ lb: {
14110
+ dimension: "mass",
14111
+ factor: .453592,
14112
+ offset: 0
14113
+ },
14114
+ oz: {
14115
+ dimension: "mass",
14116
+ factor: .0283495,
14117
+ offset: 0
14118
+ },
14119
+ "%": {
14120
+ dimension: "percentage",
14121
+ factor: 1,
14122
+ offset: 0
14123
+ },
14124
+ L: {
14125
+ dimension: "volume",
14126
+ factor: 1,
14127
+ offset: 0
14128
+ },
14129
+ mL: {
14130
+ dimension: "volume",
14131
+ factor: .001,
14132
+ offset: 0
14133
+ },
14134
+ gal: {
14135
+ dimension: "volume",
14136
+ factor: 3.785411784,
14137
+ offset: 0
14138
+ },
14139
+ s: {
14140
+ dimension: "duration",
14141
+ factor: 1,
14142
+ offset: 0
14143
+ },
14144
+ ms: {
14145
+ dimension: "duration",
14146
+ factor: .001,
14147
+ offset: 0
14148
+ },
14149
+ min: {
14150
+ dimension: "duration",
14151
+ factor: 60,
14152
+ offset: 0
14153
+ },
14154
+ h: {
14155
+ dimension: "duration",
14156
+ factor: 3600,
14157
+ offset: 0
14158
+ },
14159
+ d: {
14160
+ dimension: "duration",
14161
+ factor: 86400,
14162
+ offset: 0
14163
+ },
14164
+ B: {
14165
+ dimension: "information",
14166
+ factor: 1,
14167
+ offset: 0
14168
+ },
14169
+ KiB: {
14170
+ dimension: "information",
14171
+ factor: 1024,
14172
+ offset: 0
14173
+ },
14174
+ MiB: {
14175
+ dimension: "information",
14176
+ factor: 1024 ** 2,
14177
+ offset: 0
14178
+ },
14179
+ GiB: {
14180
+ dimension: "information",
14181
+ factor: 1024 ** 3,
14182
+ offset: 0
14183
+ },
14184
+ TiB: {
14185
+ dimension: "information",
14186
+ factor: 1024 ** 4,
14187
+ offset: 0
14188
+ },
14189
+ kB: {
14190
+ dimension: "information",
14191
+ factor: 1e3,
14192
+ offset: 0
14193
+ },
14194
+ MB: {
14195
+ dimension: "information",
14196
+ factor: 1e6,
14197
+ offset: 0
14198
+ },
14199
+ GB: {
14200
+ dimension: "information",
14201
+ factor: 1e9,
14202
+ offset: 0
14203
+ },
14204
+ "°": {
14205
+ dimension: "angle",
14206
+ factor: 1,
14207
+ offset: 0
14208
+ },
14209
+ dBFS: {
14210
+ dimension: "sound-level",
14211
+ factor: 1,
14212
+ offset: 0
14213
+ },
14214
+ dBm: {
14215
+ dimension: "signal-level",
14216
+ factor: 1,
14217
+ offset: 0
14218
+ },
14219
+ mired: {
14220
+ dimension: "colour-temperature",
14221
+ factor: 1,
14222
+ offset: 0
14223
+ },
14224
+ kbps: {
14225
+ dimension: "bitrate",
14226
+ factor: 1,
14227
+ offset: 0
14228
+ },
14229
+ Mbps: {
14230
+ dimension: "bitrate",
14231
+ factor: 1e3,
14232
+ offset: 0
14233
+ },
14234
+ fps: {
14235
+ dimension: "rate",
14236
+ factor: 1,
14237
+ offset: 0
14238
+ }
14239
+ };
14240
+ /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
14241
+ function specFor(unit) {
14242
+ return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
14243
+ }
14244
+ /** Value in `spec`'s unit → its dimension's canonical unit. */
14245
+ function toCanonical(value, spec) {
14246
+ return value * spec.factor + spec.offset;
14247
+ }
14248
+ /** Canonical-unit value → the unit described by `spec`. */
14249
+ function fromCanonical(canonical, spec) {
14250
+ return (canonical - spec.offset) / spec.factor;
14251
+ }
14252
+ /**
14253
+ * Graceful variant for the render path: returns the converted value, or
14254
+ * `undefined` when the conversion is refused (unknown unit / cross-dimension).
14255
+ * Never throws — a render caller falls back to the raw value + source unit.
14256
+ */
14257
+ function tryConvertUnit(value, from, to) {
14258
+ if (from === to) return value;
14259
+ const fromSpec = specFor(from);
14260
+ if (!fromSpec) return void 0;
14261
+ const toSpec = specFor(to);
14262
+ if (!toSpec) return void 0;
14263
+ if (fromSpec.dimension !== toSpec.dimension) return void 0;
14264
+ return fromCanonical(toCanonical(value, fromSpec), toSpec);
14265
+ }
14266
+ //#endregion
13781
14267
  //#region ../types/dist/index.mjs
13782
14268
  var SMTP_INBOUND_DEFAULT_PORT = 2525;
13783
14269
  var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
@@ -42776,6 +43262,7 @@ var ExpressionBindingSourceSchema = union([
42776
43262
  object({
42777
43263
  kind: literal("global"),
42778
43264
  sourceStableId: string(),
43265
+ addonId: string().optional(),
42779
43266
  cap: string(),
42780
43267
  fieldPath: string()
42781
43268
  })
@@ -42842,385 +43329,6 @@ var SourceInfoSchema = object({
42842
43329
  raw: record(string(), unknown()).optional()
42843
43330
  });
42844
43331
  /**
42845
- * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
42846
- * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
42847
- * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
42848
- * decimals). K derives from `°C = K − 273.15`.
42849
- */
42850
- var UNIT_TABLE = {
42851
- "°C": {
42852
- dimension: "temperature",
42853
- factor: 1,
42854
- offset: 0
42855
- },
42856
- "°F": {
42857
- dimension: "temperature",
42858
- factor: 5 / 9,
42859
- offset: -160 / 9
42860
- },
42861
- K: {
42862
- dimension: "temperature",
42863
- factor: 1,
42864
- offset: -273.15
42865
- },
42866
- hPa: {
42867
- dimension: "pressure",
42868
- factor: 1,
42869
- offset: 0
42870
- },
42871
- kPa: {
42872
- dimension: "pressure",
42873
- factor: 10,
42874
- offset: 0
42875
- },
42876
- Pa: {
42877
- dimension: "pressure",
42878
- factor: .01,
42879
- offset: 0
42880
- },
42881
- mbar: {
42882
- dimension: "pressure",
42883
- factor: 1,
42884
- offset: 0
42885
- },
42886
- bar: {
42887
- dimension: "pressure",
42888
- factor: 1e3,
42889
- offset: 0
42890
- },
42891
- inHg: {
42892
- dimension: "pressure",
42893
- factor: 33.8639,
42894
- offset: 0
42895
- },
42896
- mmHg: {
42897
- dimension: "pressure",
42898
- factor: 1.33322,
42899
- offset: 0
42900
- },
42901
- psi: {
42902
- dimension: "pressure",
42903
- factor: 68.9476,
42904
- offset: 0
42905
- },
42906
- "m/s": {
42907
- dimension: "speed",
42908
- factor: 1,
42909
- offset: 0
42910
- },
42911
- "km/h": {
42912
- dimension: "speed",
42913
- factor: 1 / 3.6,
42914
- offset: 0
42915
- },
42916
- mph: {
42917
- dimension: "speed",
42918
- factor: .44704,
42919
- offset: 0
42920
- },
42921
- kn: {
42922
- dimension: "speed",
42923
- factor: .514444,
42924
- offset: 0
42925
- },
42926
- "mm/h": {
42927
- dimension: "precipitation-rate",
42928
- factor: 1,
42929
- offset: 0
42930
- },
42931
- "in/h": {
42932
- dimension: "precipitation-rate",
42933
- factor: 25.4,
42934
- offset: 0
42935
- },
42936
- m: {
42937
- dimension: "length",
42938
- factor: 1,
42939
- offset: 0
42940
- },
42941
- mm: {
42942
- dimension: "length",
42943
- factor: .001,
42944
- offset: 0
42945
- },
42946
- cm: {
42947
- dimension: "length",
42948
- factor: .01,
42949
- offset: 0
42950
- },
42951
- km: {
42952
- dimension: "length",
42953
- factor: 1e3,
42954
- offset: 0
42955
- },
42956
- in: {
42957
- dimension: "length",
42958
- factor: .0254,
42959
- offset: 0
42960
- },
42961
- ft: {
42962
- dimension: "length",
42963
- factor: .3048,
42964
- offset: 0
42965
- },
42966
- mi: {
42967
- dimension: "length",
42968
- factor: 1609.344,
42969
- offset: 0
42970
- },
42971
- "m²": {
42972
- dimension: "area",
42973
- factor: 1,
42974
- offset: 0
42975
- },
42976
- lx: {
42977
- dimension: "illuminance",
42978
- factor: 1,
42979
- offset: 0
42980
- },
42981
- "W/m²": {
42982
- dimension: "irradiance",
42983
- factor: 1,
42984
- offset: 0
42985
- },
42986
- W: {
42987
- dimension: "power",
42988
- factor: 1,
42989
- offset: 0
42990
- },
42991
- kW: {
42992
- dimension: "power",
42993
- factor: 1e3,
42994
- offset: 0
42995
- },
42996
- VA: {
42997
- dimension: "apparent-power",
42998
- factor: 1,
42999
- offset: 0
43000
- },
43001
- Wh: {
43002
- dimension: "energy",
43003
- factor: 1,
43004
- offset: 0
43005
- },
43006
- kWh: {
43007
- dimension: "energy",
43008
- factor: 1e3,
43009
- offset: 0
43010
- },
43011
- MWh: {
43012
- dimension: "energy",
43013
- factor: 1e6,
43014
- offset: 0
43015
- },
43016
- V: {
43017
- dimension: "voltage",
43018
- factor: 1,
43019
- offset: 0
43020
- },
43021
- mV: {
43022
- dimension: "voltage",
43023
- factor: .001,
43024
- offset: 0
43025
- },
43026
- A: {
43027
- dimension: "current",
43028
- factor: 1,
43029
- offset: 0
43030
- },
43031
- mA: {
43032
- dimension: "current",
43033
- factor: .001,
43034
- offset: 0
43035
- },
43036
- ppm: {
43037
- dimension: "concentration-volume",
43038
- factor: 1,
43039
- offset: 0
43040
- },
43041
- ppb: {
43042
- dimension: "concentration-volume",
43043
- factor: .001,
43044
- offset: 0
43045
- },
43046
- "µg/m³": {
43047
- dimension: "concentration-mass",
43048
- factor: 1,
43049
- offset: 0
43050
- },
43051
- "mg/m³": {
43052
- dimension: "concentration-mass",
43053
- factor: 1e3,
43054
- offset: 0
43055
- },
43056
- kg: {
43057
- dimension: "mass",
43058
- factor: 1,
43059
- offset: 0
43060
- },
43061
- g: {
43062
- dimension: "mass",
43063
- factor: .001,
43064
- offset: 0
43065
- },
43066
- lb: {
43067
- dimension: "mass",
43068
- factor: .453592,
43069
- offset: 0
43070
- },
43071
- oz: {
43072
- dimension: "mass",
43073
- factor: .0283495,
43074
- offset: 0
43075
- },
43076
- "%": {
43077
- dimension: "percentage",
43078
- factor: 1,
43079
- offset: 0
43080
- },
43081
- L: {
43082
- dimension: "volume",
43083
- factor: 1,
43084
- offset: 0
43085
- },
43086
- mL: {
43087
- dimension: "volume",
43088
- factor: .001,
43089
- offset: 0
43090
- },
43091
- gal: {
43092
- dimension: "volume",
43093
- factor: 3.785411784,
43094
- offset: 0
43095
- },
43096
- s: {
43097
- dimension: "duration",
43098
- factor: 1,
43099
- offset: 0
43100
- },
43101
- ms: {
43102
- dimension: "duration",
43103
- factor: .001,
43104
- offset: 0
43105
- },
43106
- min: {
43107
- dimension: "duration",
43108
- factor: 60,
43109
- offset: 0
43110
- },
43111
- h: {
43112
- dimension: "duration",
43113
- factor: 3600,
43114
- offset: 0
43115
- },
43116
- d: {
43117
- dimension: "duration",
43118
- factor: 86400,
43119
- offset: 0
43120
- },
43121
- B: {
43122
- dimension: "information",
43123
- factor: 1,
43124
- offset: 0
43125
- },
43126
- KiB: {
43127
- dimension: "information",
43128
- factor: 1024,
43129
- offset: 0
43130
- },
43131
- MiB: {
43132
- dimension: "information",
43133
- factor: 1024 ** 2,
43134
- offset: 0
43135
- },
43136
- GiB: {
43137
- dimension: "information",
43138
- factor: 1024 ** 3,
43139
- offset: 0
43140
- },
43141
- TiB: {
43142
- dimension: "information",
43143
- factor: 1024 ** 4,
43144
- offset: 0
43145
- },
43146
- kB: {
43147
- dimension: "information",
43148
- factor: 1e3,
43149
- offset: 0
43150
- },
43151
- MB: {
43152
- dimension: "information",
43153
- factor: 1e6,
43154
- offset: 0
43155
- },
43156
- GB: {
43157
- dimension: "information",
43158
- factor: 1e9,
43159
- offset: 0
43160
- },
43161
- "°": {
43162
- dimension: "angle",
43163
- factor: 1,
43164
- offset: 0
43165
- },
43166
- dBFS: {
43167
- dimension: "sound-level",
43168
- factor: 1,
43169
- offset: 0
43170
- },
43171
- dBm: {
43172
- dimension: "signal-level",
43173
- factor: 1,
43174
- offset: 0
43175
- },
43176
- mired: {
43177
- dimension: "colour-temperature",
43178
- factor: 1,
43179
- offset: 0
43180
- },
43181
- kbps: {
43182
- dimension: "bitrate",
43183
- factor: 1,
43184
- offset: 0
43185
- },
43186
- Mbps: {
43187
- dimension: "bitrate",
43188
- factor: 1e3,
43189
- offset: 0
43190
- },
43191
- fps: {
43192
- dimension: "rate",
43193
- factor: 1,
43194
- offset: 0
43195
- }
43196
- };
43197
- /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
43198
- function specFor(unit) {
43199
- return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
43200
- }
43201
- /** Value in `spec`'s unit → its dimension's canonical unit. */
43202
- function toCanonical(value, spec) {
43203
- return value * spec.factor + spec.offset;
43204
- }
43205
- /** Canonical-unit value → the unit described by `spec`. */
43206
- function fromCanonical(canonical, spec) {
43207
- return (canonical - spec.offset) / spec.factor;
43208
- }
43209
- /**
43210
- * Graceful variant for the render path: returns the converted value, or
43211
- * `undefined` when the conversion is refused (unknown unit / cross-dimension).
43212
- * Never throws — a render caller falls back to the raw value + source unit.
43213
- */
43214
- function tryConvertUnit(value, from, to) {
43215
- if (from === to) return value;
43216
- const fromSpec = specFor(from);
43217
- if (!fromSpec) return void 0;
43218
- const toSpec = specFor(to);
43219
- if (!toSpec) return void 0;
43220
- if (fromSpec.dimension !== toSpec.dimension) return void 0;
43221
- return fromCanonical(toCanonical(value, fromSpec), toSpec);
43222
- }
43223
- /**
43224
43332
  * A number a person types for a physical quantity — the input side of the
43225
43333
  * value + unit contract (D972).
43226
43334
  *
@@ -44999,15 +45107,28 @@ var SettingsSchemaWithValuesSchema = object({
44999
45107
  });
45000
45108
  /** Patch object — keys are field names, values are the new field values. */
45001
45109
  var SettingsPatchSchema = record(string(), unknown());
45110
+ /** The scope of a scoped-settings call (D986): where the capability declared the values. */
45111
+ var ScopedSettingsScopeSchema = _enum(SCOPED_SETTINGS_SCOPES);
45112
+ /** One scoped schema an addon serves: its capability, scope and section ids. */
45113
+ var ScopedSettingsDeclarationSchema = object({
45114
+ cap: string(),
45115
+ scope: ScopedSettingsScopeSchema,
45116
+ sectionIds: array(string())
45117
+ });
45002
45118
  /** Standard success response for update operations. */
45003
45119
  var SettingsUpdateResultSchema = object({ success: literal(true) });
45004
45120
  method(object({
45005
45121
  addonId: string(),
45006
- nodeId: string().optional(),
45007
- overlay: record(string(), unknown()).optional(),
45008
- cap: string().optional()
45122
+ cap: string(),
45123
+ scope: ScopedSettingsScopeSchema,
45124
+ nodeId: string().optional()
45009
45125
  }), SettingsSchemaWithValuesSchema.nullable()), method(object({
45010
45126
  addonId: string(),
45127
+ nodeId: string().optional()
45128
+ }), array(ScopedSettingsDeclarationSchema).nullable()), method(object({
45129
+ addonId: string(),
45130
+ cap: string(),
45131
+ scope: ScopedSettingsScopeSchema,
45011
45132
  nodeId: string().optional(),
45012
45133
  patch: SettingsPatchSchema
45013
45134
  }), SettingsUpdateResultSchema, {
@@ -45015,8 +45136,10 @@ method(object({
45015
45136
  auth: "admin"
45016
45137
  }), method(object({
45017
45138
  addonId: string(),
45139
+ cap: string(),
45140
+ scope: ScopedSettingsScopeSchema,
45018
45141
  nodeId: string().optional()
45019
- }), SettingsSchemaWithValuesSchema.nullable()), method(object({
45142
+ }), record(string(), unknown()).nullable()), method(object({
45020
45143
  addonId: string(),
45021
45144
  nodeId: string().optional(),
45022
45145
  instance: IntegrationInstanceRefSchema
@@ -46356,7 +46479,7 @@ var BackupDestinationInfoSchema = object({
46356
46479
  id: string(),
46357
46480
  /**
46358
46481
  * Manifest id of the owning addon. The Settings button on the
46359
- * destination card opens that addon's `globalSettingsSchema` panel.
46482
+ * destination card opens that addon's scoped settings panel.
46360
46483
  */
46361
46484
  addonId: string(),
46362
46485
  /** Operator-toggled enable flag from the destination-policy table. */
@@ -50859,6 +50982,7 @@ var deviceExportCapability = {
50859
50982
  })
50860
50983
  }
50861
50984
  };
50985
+ var DeviceAliasSchema = string().max(64).regex(/^[a-z][a-z0-9_]*$/);
50862
50986
  /**
50863
50987
  * A SITE ZONE — a named part of the property that several locations belong to.
50864
50988
  *
@@ -51252,6 +51376,12 @@ var DeviceInfoSchema = object({
51252
51376
  addonId: string(),
51253
51377
  type: _enum(DeviceType),
51254
51378
  name: string(),
51379
+ /** The name a value template uses for this device (`{{ stufa_veranda.temperature }}`),
51380
+ * entity_id style. Generated once from the name at first registration, unique
51381
+ * cluster-wide, editable through `setAlias`, NOT changed by a rename (D1021).
51382
+ * Optional: a record produced by an older build omits it until the boot
51383
+ * backfill has run. */
51384
+ alias: DeviceAliasSchema.optional(),
51255
51385
  /** Operator-organisational location label. `null` when unset. */
51256
51386
  location: string().nullable(),
51257
51387
  /** Soft-disabled flag. */
@@ -51571,6 +51701,25 @@ method(object({
51571
51701
  }), _void(), {
51572
51702
  kind: "mutation",
51573
51703
  auth: "admin"
51704
+ }), method(object({
51705
+ deviceId: number(),
51706
+ alias: string()
51707
+ }), discriminatedUnion("ok", [object({
51708
+ ok: literal(true),
51709
+ alias: DeviceAliasSchema
51710
+ }), object({
51711
+ ok: literal(false),
51712
+ reason: _enum([
51713
+ "empty",
51714
+ "too-long",
51715
+ "grammar",
51716
+ "reserved",
51717
+ "taken"
51718
+ ]),
51719
+ takenBy: number().optional()
51720
+ })]), {
51721
+ kind: "mutation",
51722
+ auth: "admin"
51574
51723
  }), method(object({
51575
51724
  deviceId: number(),
51576
51725
  location: string().nullable()
@@ -64302,6 +64451,11 @@ var NcScheduleSchema = object({
64302
64451
  * as a STATE SUMMARY at the end of each window of `schedule`.
64303
64452
  */
64304
64453
  var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
64454
+ _enum([
64455
+ "activation",
64456
+ "deactivation",
64457
+ "schedule"
64458
+ ]);
64305
64459
  /**
64306
64460
  * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
64307
64461
  * every section; `section` = one notification per section with something to
@@ -64318,11 +64472,26 @@ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
64318
64472
  * midnight crossing); the send time is each window's END. Refused on the
64319
64473
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
64320
64474
  */
64321
- var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
64322
- mode: literal("summary"),
64323
- schedule: NcScheduleSchema,
64324
- split: NcStateSummarySplitSchema.optional()
64325
- })]);
64475
+ var NcSystemEventDeliverySchema = discriminatedUnion("mode", [
64476
+ object({ mode: literal("instant") }),
64477
+ object({
64478
+ mode: literal("summary"),
64479
+ schedule: NcScheduleSchema,
64480
+ split: NcStateSummarySplitSchema.optional()
64481
+ }),
64482
+ object({
64483
+ mode: literal("modes"),
64484
+ /** The bad edge, and every kind that has a single edge. */
64485
+ onActivation: boolean(),
64486
+ /** The recovery edges of the classes of the selected kinds (derived, never stored per kind). */
64487
+ onDeactivation: boolean(),
64488
+ /** A state summary at the end of each window; absent = no summary. */
64489
+ onSchedule: object({
64490
+ schedule: NcScheduleSchema,
64491
+ grouping: NcStateSummarySplitSchema
64492
+ }).optional()
64493
+ })
64494
+ ]);
64326
64495
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
64327
64496
  var NcPlateMatcherSchema = object({
64328
64497
  /**
@@ -74086,7 +74255,7 @@ var TerminalInstanceInfoSchema = object({
74086
74255
  /**
74087
74256
  * False while the node the instance is bound to is not in the cluster
74088
74257
  * topology (forgotten, renamed, re-paired). The instance is kept; the
74089
- * operator re-points it with `updateInstance({ targetNodeId })`.
74258
+ * operator re-points it on the Terminal page.
74090
74259
  */
74091
74260
  nodeInCluster: boolean(),
74092
74261
  profileId: string(),
@@ -74124,41 +74293,7 @@ var TerminalOutputBatchSchema = object({
74124
74293
  snapshot: string().optional(),
74125
74294
  events: array(TerminalOutputEventSchema).readonly()
74126
74295
  });
74127
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
74128
- targetNodeId: string().min(1),
74129
- profileId: string().min(1),
74130
- name: string().trim().min(1).max(160).optional(),
74131
- executable: string().max(1024).optional(),
74132
- args: array(string().max(2048)).max(64).optional(),
74133
- cwd: string().max(1024).optional(),
74134
- environment: array(string().max(4096)).max(64).optional(),
74135
- profileSettings: ProfileSettingsBagSchema.optional()
74136
- }), TerminalInstanceInfoSchema, {
74137
- kind: "mutation",
74138
- auth: "admin"
74139
- }), method(object({
74140
- instanceId: string().min(1),
74141
- /** Re-point the instance to another node; the profile must exist there. */
74142
- targetNodeId: string().min(1).max(256).optional(),
74143
- name: string().trim().min(1).max(160).optional(),
74144
- executable: string().max(1024).optional(),
74145
- args: array(string().max(2048)).max(64).optional(),
74146
- cwd: string().max(1024).optional(),
74147
- environment: array(string().max(4096)).max(64).optional(),
74148
- profileSettings: ProfileSettingsBagSchema.optional()
74149
- }), TerminalInstanceInfoSchema, {
74150
- kind: "mutation",
74151
- auth: "admin"
74152
- }), method(object({ instanceId: string().min(1) }), _void(), {
74153
- kind: "mutation",
74154
- auth: "admin"
74155
- }), method(object({
74156
- instanceId: string().min(1),
74157
- enabled: boolean()
74158
- }), TerminalInstanceInfoSchema, {
74159
- kind: "mutation",
74160
- auth: "admin"
74161
- }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
74296
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
74162
74297
  stableId: string().min(1),
74163
74298
  name: string().trim().min(1).max(160).optional()
74164
74299
  }), TerminalInstanceInfoSchema, {
@@ -74227,6 +74362,11 @@ var TimedRunUnitSchema = _enum(["s", "min"]);
74227
74362
  _enum(["switch", "pet-fountain"]);
74228
74363
  DeviceType.Heater, DeviceType.PetFountain;
74229
74364
  DeviceType.Heater, DeviceType.PetFountain;
74365
+ /** One duration, as the one-tap run asks for it. */
74366
+ var TimedRunQuickRunSchema = object({
74367
+ duration: number().positive().finite(),
74368
+ unit: TimedRunUnitSchema
74369
+ });
74230
74370
  /** Why a request was not carried out. Typed, so a caller can say it in words. */
74231
74371
  var TimedRunRefusalSchema = _enum([
74232
74372
  "unsupported-device",
@@ -74247,9 +74387,30 @@ object({
74247
74387
  activeUntil: number().nullable(),
74248
74388
  /** Who asked for the run (a user id or an addon id); `null` when nothing is armed or it did not say. */
74249
74389
  requestedBy: string().nullable(),
74390
+ /**
74391
+ * The one-tap run of THIS device: what a "Run" button on any surface starts. `null` when
74392
+ * the device is gone or its type has no timed run; a status from before this field
74393
+ * existed has none, and a surface falls back to the type's default.
74394
+ */
74395
+ quickRun: TimedRunQuickRunSchema.nullable(),
74250
74396
  lastFetchedAt: number()
74251
74397
  });
74252
- method(object({
74398
+ /** What the settings form needs: the unit, the bounds and the type's default. */
74399
+ var TimedRunOptionsSchema = object({
74400
+ unit: TimedRunUnitSchema,
74401
+ /** The longest run, in `unit`. */
74402
+ maxDuration: number(),
74403
+ defaultDuration: number()
74404
+ });
74405
+ /** The one-tap run duration, in the type's unit; `null` returns to the type's default. */
74406
+ var TimedRunSettingsPatchSchema = object({ quickRunDuration: number().positive().finite().nullable().optional() });
74407
+ method(object({ deviceId: number().int() }), TimedRunOptionsSchema), method(object({
74408
+ deviceId: number().int(),
74409
+ settings: TimedRunSettingsPatchSchema
74410
+ }), _void(), {
74411
+ kind: "mutation",
74412
+ auth: "admin"
74413
+ }), method(object({
74253
74414
  deviceId: number().int(),
74254
74415
  duration: number().positive().finite(),
74255
74416
  unit: TimedRunUnitSchema
@@ -76955,21 +77116,28 @@ Object.freeze({
76955
77116
  access: "view",
76956
77117
  role: "admin"
76957
77118
  },
76958
- "addonSettings.getGlobalSettings": {
77119
+ "addonSettings.getIntegrationFormSchema": {
76959
77120
  capName: "addon-settings",
76960
77121
  capScope: "system",
76961
77122
  addonId: null,
76962
77123
  access: "view",
76963
77124
  role: "admin"
76964
77125
  },
76965
- "addonSettings.getIntegrationFormSchema": {
77126
+ "addonSettings.getScopedSettings": {
77127
+ capName: "addon-settings",
77128
+ capScope: "system",
77129
+ addonId: null,
77130
+ access: "view",
77131
+ role: "admin"
77132
+ },
77133
+ "addonSettings.listScopedSettings": {
76966
77134
  capName: "addon-settings",
76967
77135
  capScope: "system",
76968
77136
  addonId: null,
76969
77137
  access: "view",
76970
77138
  role: "admin"
76971
77139
  },
76972
- "addonSettings.getIntegrationSettings": {
77140
+ "addonSettings.readScopedValues": {
76973
77141
  capName: "addon-settings",
76974
77142
  capScope: "system",
76975
77143
  addonId: null,
@@ -76990,7 +77158,7 @@ Object.freeze({
76990
77158
  access: "create",
76991
77159
  role: "admin"
76992
77160
  },
76993
- "addonSettings.updateGlobalSettings": {
77161
+ "addonSettings.updateScopedSettings": {
76994
77162
  capName: "addon-settings",
76995
77163
  capScope: "system",
76996
77164
  addonId: null,
@@ -79160,6 +79328,13 @@ Object.freeze({
79160
79328
  access: "create",
79161
79329
  role: "admin"
79162
79330
  },
79331
+ "deviceManager.setAlias": {
79332
+ capName: "device-manager",
79333
+ capScope: "system",
79334
+ addonId: null,
79335
+ access: "create",
79336
+ role: "admin"
79337
+ },
79163
79338
  "deviceManager.setChildLayout": {
79164
79339
  capName: "device-manager",
79165
79340
  capScope: "system",
@@ -85887,27 +86062,6 @@ Object.freeze({
85887
86062
  access: "create",
85888
86063
  role: "admin"
85889
86064
  },
85890
- "terminalSession.createInstance": {
85891
- capName: "terminal-session",
85892
- capScope: "system",
85893
- addonId: null,
85894
- access: "create",
85895
- role: "admin"
85896
- },
85897
- "terminalSession.deleteInstance": {
85898
- capName: "terminal-session",
85899
- capScope: "system",
85900
- addonId: null,
85901
- access: "delete",
85902
- role: "admin"
85903
- },
85904
- "terminalSession.listInstances": {
85905
- capName: "terminal-session",
85906
- capScope: "system",
85907
- addonId: null,
85908
- access: "view",
85909
- role: "admin"
85910
- },
85911
86065
  "terminalSession.listLegacyCameras": {
85912
86066
  capName: "terminal-session",
85913
86067
  capScope: "system",
@@ -85950,20 +86104,6 @@ Object.freeze({
85950
86104
  access: "create",
85951
86105
  role: "admin"
85952
86106
  },
85953
- "terminalSession.setInstanceEnabled": {
85954
- capName: "terminal-session",
85955
- capScope: "system",
85956
- addonId: null,
85957
- access: "create",
85958
- role: "admin"
85959
- },
85960
- "terminalSession.updateInstance": {
85961
- capName: "terminal-session",
85962
- capScope: "system",
85963
- addonId: null,
85964
- access: "create",
85965
- role: "admin"
85966
- },
85967
86107
  "terminalSession.writeInput": {
85968
86108
  capName: "terminal-session",
85969
86109
  capScope: "system",
@@ -85978,6 +86118,13 @@ Object.freeze({
85978
86118
  access: "create",
85979
86119
  role: "viewer"
85980
86120
  },
86121
+ "timedRun.getOptions": {
86122
+ capName: "timed-run",
86123
+ capScope: "device",
86124
+ addonId: null,
86125
+ access: "view",
86126
+ role: "viewer"
86127
+ },
85981
86128
  "timedRun.getStatus": {
85982
86129
  capName: "timed-run",
85983
86130
  capScope: "device",
@@ -85992,6 +86139,13 @@ Object.freeze({
85992
86139
  access: "create",
85993
86140
  role: "viewer"
85994
86141
  },
86142
+ "timedRun.setSettings": {
86143
+ capName: "timed-run",
86144
+ capScope: "device",
86145
+ addonId: null,
86146
+ access: "create",
86147
+ role: "admin"
86148
+ },
85995
86149
  "toast.onToast": {
85996
86150
  capName: "toast",
85997
86151
  capScope: "system",
@@ -86947,6 +87101,7 @@ function applianceExport(ecosystem, deviceType) {
86947
87101
  if (!isPlugApplianceType(deviceType)) return null;
86948
87102
  return APPLIANCE_EXPORT[ecosystem][deviceType];
86949
87103
  }
87104
+ string().min(1).max(4096);
86950
87105
  Object.freeze({
86951
87106
  "accessories.getStatus": [{
86952
87107
  name: "deviceId",
@@ -87630,6 +87785,11 @@ Object.freeze({
87630
87785
  form: "single",
87631
87786
  optional: false
87632
87787
  }],
87788
+ "deviceManager.setAlias": [{
87789
+ name: "deviceId",
87790
+ form: "single",
87791
+ optional: false
87792
+ }],
87633
87793
  "deviceManager.setChildLayout": [{
87634
87794
  name: "deviceId",
87635
87795
  form: "single",
@@ -89694,6 +89854,11 @@ Object.freeze({
89694
89854
  form: "single",
89695
89855
  optional: false
89696
89856
  }],
89857
+ "timedRun.getOptions": [{
89858
+ name: "deviceId",
89859
+ form: "single",
89860
+ optional: false
89861
+ }],
89697
89862
  "timedRun.getStatus": [{
89698
89863
  name: "deviceId",
89699
89864
  form: "single",
@@ -89704,6 +89869,11 @@ Object.freeze({
89704
89869
  form: "single",
89705
89870
  optional: false
89706
89871
  }],
89872
+ "timedRun.setSettings": [{
89873
+ name: "deviceId",
89874
+ form: "single",
89875
+ optional: false
89876
+ }],
89707
89877
  "update.getStatus": [{
89708
89878
  name: "deviceId",
89709
89879
  form: "single",
@@ -90566,6 +90736,7 @@ var STATE_SUMMARY_VARS = [
90566
90736
  [...RULE_TEXT],
90567
90737
  [...RULE_TEXT],
90568
90738
  [...RULE_TEXT],
90739
+ [...RULE_TEXT],
90569
90740
  [...RULE_BODY_ONLY],
90570
90741
  [...RULE_TEXT],
90571
90742
  ([...RULE_TEXT], [...DEVICE_EVENTS]),