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