@camstack/addon-provider-hikvision 1.2.184 → 1.2.186

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/addon.js +1595 -1759
  3. package/dist/addon.mjs +1595 -1759
  4. package/package.json +2 -2
package/dist/addon.js CHANGED
@@ -32,7 +32,7 @@ require("node:zlib");
32
32
  let node_net = require("node:net");
33
33
  let node_http = require("node:http");
34
34
  let node_https = require("node:https");
35
- //#region ../types/dist/event-category-BmPm98n0.mjs
35
+ //#region ../types/dist/event-category-78tcBemo.mjs
36
36
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
37
37
  EventCategory["SystemBoot"] = "system.boot";
38
38
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -153,6 +153,23 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
153
153
  */
154
154
  EventCategory["AddonLoadRecovered"] = "addon.load-recovered";
155
155
  /**
156
+ * An addon is RUNNING although its installed package is below what the
157
+ * running server requires (`camstack.requires.addons` of the server, or the
158
+ * addon's own `requires.server`). Raised once per streak by the unsupported-
159
+ * addon tracker, on the hub and on agents; AlertCenter turns it into one
160
+ * operator alert per node and package. The addon is never held back for it.
161
+ *
162
+ * Payload: `{ packageName, addonId, nodeId, installedVersion, requiredMinimum, serverVersion, unmet }`.
163
+ */
164
+ EventCategory["AddonUnsupportedVersion"] = "addon.unsupported-version";
165
+ /**
166
+ * The package of an {@link AddonUnsupportedVersion} alert reached a supported
167
+ * version, or is no longer installed on the node. AlertCenter dismisses the matching alert.
168
+ *
169
+ * Payload: `{ packageName, addonId, nodeId }`.
170
+ */
171
+ EventCategory["AddonUnsupportedResolved"] = "addon.unsupported-resolved";
172
+ /**
156
173
  * Monitor scheduled the next retry for a failed addon. Transient —
157
174
  * surfaced to the UI for live-updating the "next retry in Ns"
158
175
  * countdown on the Addons page row, NOT persisted as an alert.
@@ -263,7 +280,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
263
280
  EventCategory["ProcessRestarted"] = "process.restarted";
264
281
  /**
265
282
  * The SET of storage locations changed — one was created, edited, enabled,
266
- * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
283
+ * disabled or deleted through the location instances or the forced-delete action.
267
284
  *
268
285
  * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
269
286
  * it must also converge on its own periodic path, because a dropped event
@@ -818,7 +835,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
818
835
  return EventCategory;
819
836
  }({});
820
837
  //#endregion
821
- //#region ../types/dist/device-type-D1fH5kaC.mjs
838
+ //#region ../types/dist/device-type-DxCT0krO.mjs
822
839
  /**
823
840
  import { errMsg } from '@camstack/types'
824
841
  * Extract a human-readable message from an unknown error value.
@@ -980,6 +997,13 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
980
997
  * filters that want "all devices with on-motion behaviour".
981
998
  */
982
999
  DeviceFeature["MotionTrigger"] = "motion-trigger";
1000
+ /**
1001
+ * Device can be run for a chosen time and then stopped. Mirrors the
1002
+ * `timed-run` wrapper cap — the cap is bound by the core-blocks addon, not by
1003
+ * a driver, so the flag is derived from the device's bindings
1004
+ * (`featuresOfBoundCaps`). Gates the quick-run control in the viewer.
1005
+ */
1006
+ DeviceFeature["TimedRun"] = "timed-run";
983
1007
  /** Light supports rgb-triplet color via `color` cap. */
984
1008
  DeviceFeature["LightColorRgb"] = "light-color-rgb";
985
1009
  /** Light supports HSV color via `color` cap. */
@@ -6014,7 +6038,7 @@ var ZodIssueCode = {
6014
6038
  var ZodFirstPartyTypeKind;
6015
6039
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6016
6040
  //#endregion
6017
- //#region ../types/dist/sleep-CmjWurK5.mjs
6041
+ //#region ../types/dist/sleep-CGPZyzB5.mjs
6018
6042
  /**
6019
6043
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6020
6044
  * window to float samples (D455).
@@ -6378,6 +6402,59 @@ Object.fromEntries([
6378
6402
  function isValuelessField(field) {
6379
6403
  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";
6380
6404
  }
6405
+ /**
6406
+ * Base collector: flatten a hydrated `ConfigUISchemaWithValues` into
6407
+ * `key → { value, default }`, recursing through `group` and `sub-tabs`
6408
+ * layout fields. Keeping `value` and `default` SEPARATE (rather than
6409
+ * pre-resolving) lets callers both read the effective value AND detect
6410
+ * overrides (`value` differs from `default`). Structural over `unknown`;
6411
+ * malformed input yields an empty map, never throws.
6412
+ */
6413
+ function collectHydratedFieldEntries(schema) {
6414
+ const out = /* @__PURE__ */ new Map();
6415
+ if (typeof schema !== "object" || schema === null) return out;
6416
+ const sections = schema.sections;
6417
+ if (!Array.isArray(sections)) return out;
6418
+ for (const section of sections) if (typeof section === "object" && section !== null) collectFieldEntriesInto(section.fields, out);
6419
+ return out;
6420
+ }
6421
+ /** Recursive field walker for {@link collectHydratedFieldEntries}. */
6422
+ function collectFieldEntriesInto(fields, into) {
6423
+ if (!Array.isArray(fields)) return;
6424
+ for (const field of fields) {
6425
+ if (typeof field !== "object" || field === null) continue;
6426
+ const type = field.type;
6427
+ if (type === "group") {
6428
+ collectFieldEntriesInto(field.fields, into);
6429
+ continue;
6430
+ }
6431
+ if (type === "sub-tabs") {
6432
+ const tabs = field.tabs;
6433
+ if (Array.isArray(tabs)) {
6434
+ for (const tab of tabs) if (typeof tab === "object" && tab !== null) collectFieldEntriesInto(tab.fields, into);
6435
+ }
6436
+ continue;
6437
+ }
6438
+ const key = field.key;
6439
+ if (typeof key !== "string" || key.length === 0) continue;
6440
+ if (!("value" in field)) continue;
6441
+ into.set(key, {
6442
+ value: field.value,
6443
+ default: field.default
6444
+ });
6445
+ }
6446
+ }
6447
+ /**
6448
+ * Flatten a hydrated settings payload into `key → EFFECTIVE value`
6449
+ * (`value ?? default`). The read-side inverse of `hydrateSchema` for the
6450
+ * common "just give me the resolved values" case. Built on
6451
+ * {@link collectHydratedFieldEntries}.
6452
+ */
6453
+ function collectHydratedFieldValues(schema) {
6454
+ const out = /* @__PURE__ */ new Map();
6455
+ for (const [key, entry] of collectHydratedFieldEntries(schema)) out.set(key, entry.value ?? entry.default);
6456
+ return out;
6457
+ }
6381
6458
  function hydrateSchema(schema, values, options = {}) {
6382
6459
  return {
6383
6460
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
@@ -6809,10 +6886,33 @@ function defaultIntegrationDepsOver(api) {
6809
6886
  };
6810
6887
  }
6811
6888
  var PREFIX = "records/";
6889
+ /**
6890
+ * Cross-realm brand. An addon bundles its own copy of this module (D15) while
6891
+ * `ctx.records` is the HOST's door, so an error thrown by the host is an
6892
+ * instance of the host's classes, not of the addon's. The brand plus the code
6893
+ * make `instanceof` answer by identity of the failure, not of the copy.
6894
+ */
6895
+ var RECORDS_ERROR_BRAND = Symbol.for("camstack.records-error");
6896
+ function carriesBrand(value) {
6897
+ return typeof value === "object" && value !== null && Reflect.get(value, RECORDS_ERROR_BRAND) === true;
6898
+ }
6812
6899
  /** The base of every records failure. `detail` is the human part of the message. */
6813
6900
  var RecordsError = class extends Error {
6901
+ /** The code a subclass stands for; the base stands for every code. */
6902
+ static code = void 0;
6903
+ /**
6904
+ * `instanceof` across copies of this module: any branded error is a
6905
+ * `RecordsError`, and is an instance of a subclass only when its code is the
6906
+ * subclass's code. Same-copy answers are unchanged.
6907
+ */
6908
+ static [Symbol.hasInstance](value) {
6909
+ if (Function.prototype[Symbol.hasInstance].call(this, value)) return true;
6910
+ if (!carriesBrand(value)) return false;
6911
+ return this.code === void 0 || value.code === this.code;
6912
+ }
6814
6913
  code;
6815
6914
  detail;
6915
+ [RECORDS_ERROR_BRAND] = true;
6816
6916
  constructor(code, detail) {
6817
6917
  super(`${PREFIX}${code}: ${detail}`);
6818
6918
  this.name = "RecordsError";
@@ -6821,29 +6921,33 @@ var RecordsError = class extends Error {
6821
6921
  }
6822
6922
  };
6823
6923
  /** A write guarded by `ifRev` found another revision (or an existing row for `ifRev: 0`). */
6824
- var RevConflictError = class extends RecordsError {
6924
+ var RevConflictError = class RevConflictError extends RecordsError {
6925
+ static code = "rev-conflict";
6825
6926
  constructor(detail) {
6826
- super("rev-conflict", detail);
6927
+ super(RevConflictError.code, detail);
6827
6928
  this.name = "RevConflictError";
6828
6929
  }
6829
6930
  };
6830
6931
  /** The keychain could not store or serve a value: explicit, never an empty string. */
6831
- var RecordSecretUnavailableError = class extends RecordsError {
6932
+ var RecordSecretUnavailableError = class RecordSecretUnavailableError extends RecordsError {
6933
+ static code = "secret-unavailable";
6832
6934
  constructor(detail) {
6833
- super("secret-unavailable", detail);
6935
+ super(RecordSecretUnavailableError.code, detail);
6834
6936
  this.name = "RecordSecretUnavailableError";
6835
6937
  }
6836
6938
  };
6837
- var InvalidRecordError = class extends RecordsError {
6939
+ var InvalidRecordError = class InvalidRecordError extends RecordsError {
6940
+ static code = "invalid-record";
6838
6941
  constructor(detail) {
6839
- super("invalid-record", detail);
6942
+ super(InvalidRecordError.code, detail);
6840
6943
  this.name = "InvalidRecordError";
6841
6944
  }
6842
6945
  };
6843
6946
  /** A kind declaration the engine refuses (non-additive change, bad shape, wrong file). */
6844
- var DeclarationRefusedError = class extends RecordsError {
6947
+ var DeclarationRefusedError = class DeclarationRefusedError extends RecordsError {
6948
+ static code = "declaration-refused";
6845
6949
  constructor(detail) {
6846
- super("declaration-refused", detail);
6950
+ super(DeclarationRefusedError.code, detail);
6847
6951
  this.name = "DeclarationRefusedError";
6848
6952
  }
6849
6953
  };
@@ -7245,6 +7349,7 @@ var RecordIntegrationInstances = class {
7245
7349
  this.secretKeys = topLevelSecretKeys(kind.declaration.secretPaths);
7246
7350
  this.secretMaps = secretMapKeys(kind.declaration.secretPaths);
7247
7351
  this.nameField = kind.declaration.entry?.nameField ?? "name";
7352
+ if (hooks.kindOf === void 0 && hooks.description.kinds.length !== 1) throw new Error(`record kind '${kind.name}': describe().kinds has ${hooks.description.kinds.length} entries, so kindOf is required to say which one an instance is`);
7248
7353
  }
7249
7354
  /**
7250
7355
  * One instance read for the addon's own runtime; null when absent. When the keychain is
@@ -7286,10 +7391,21 @@ var RecordIntegrationInstances = class {
7286
7391
  }
7287
7392
  return out;
7288
7393
  }
7394
+ /** The kind an instance body is of: the provider's `kindOf`, else its one declared kind. */
7395
+ kindOfBody(body) {
7396
+ if (this.hooks.kindOf !== void 0) {
7397
+ const id = this.hooks.kindOf(body);
7398
+ if (!this.hooks.description.kinds.some((declared) => declared.id === id)) throw new Error(`record kind '${this.kind.name}': kindOf returned '${id}', which describe().kinds does not declare (D1013)`);
7399
+ return id;
7400
+ }
7401
+ const only = this.hooks.description.kinds[0];
7402
+ if (only === void 0) throw new Error(`record kind '${this.kind.name}' declares no kinds`);
7403
+ return only.id;
7404
+ }
7289
7405
  viewOf(record) {
7290
7406
  const shown = secretViewsOf(this.records.owner, this.kind.name, record.id, this.kind.declaration, record.data);
7291
7407
  const rawName = record.data[this.nameField];
7292
- const kind = this.hooks.kindOf?.(record.data);
7408
+ const kind = this.kindOfBody(record.data);
7293
7409
  const health = this.hooks.health?.(record.data, record.id);
7294
7410
  return {
7295
7411
  id: record.id,
@@ -7297,7 +7413,7 @@ var RecordIntegrationInstances = class {
7297
7413
  configured: this.hooks.configured(record.data),
7298
7414
  enabled: isInstanceEnabled(record.data),
7299
7415
  formValues: shown,
7300
- ...kind !== void 0 ? { kind } : {},
7416
+ kind,
7301
7417
  ...health?.status !== void 0 ? { status: health.status } : {},
7302
7418
  ...health?.lastCheckedAt !== void 0 ? { lastCheckedAt: health.lastCheckedAt } : {}
7303
7419
  };
@@ -7330,17 +7446,35 @@ var RecordIntegrationInstances = class {
7330
7446
  ...kind !== void 0 ? { kind } : {}
7331
7447
  });
7332
7448
  if (minted === void 0) throw new Error("createInstance needs an id: this provider does not mint one");
7449
+ const initial = this.hooks.initialBody(name, kind);
7450
+ const patch = this.patchOf(values ?? {});
7451
+ if (Object.keys(patch).length > 0) Object.assign(patch, await this.hooks.validateWrite?.({
7452
+ kind,
7453
+ body: {
7454
+ ...initial,
7455
+ ...patch
7456
+ }
7457
+ }));
7333
7458
  await this.handle.put({
7334
7459
  id: minted,
7335
- data: this.hooks.initialBody(name, kind)
7460
+ data: initial
7336
7461
  }, { ifRev: 0 });
7337
- const patch = this.patchOf(values ?? {});
7338
7462
  if (Object.keys(patch).length > 0) await this.handle.patch(minted, patch);
7339
7463
  await this.hooks.onChanged?.(minted, "created");
7340
7464
  return { id: minted };
7341
7465
  };
7342
7466
  updateInstance = async ({ id, name, values }) => {
7343
7467
  const patch = this.patchOf(values);
7468
+ if (this.hooks.validateWrite !== void 0 && Object.keys(patch).length > 0) {
7469
+ const stored = await this.handle.get(id);
7470
+ if (stored !== null) Object.assign(patch, await this.hooks.validateWrite({
7471
+ kind: void 0,
7472
+ body: {
7473
+ ...stored.data,
7474
+ ...patch
7475
+ }
7476
+ }));
7477
+ }
7344
7478
  if (name !== void 0) patch[this.nameField] = name;
7345
7479
  await this.handle.patch(id, patch);
7346
7480
  await this.hooks.onChanged?.(id, "updated");
@@ -7651,6 +7785,21 @@ var SCOPED_SETTINGS_SCOPES = [
7651
7785
  "device-defaults",
7652
7786
  "node"
7653
7787
  ];
7788
+ /** The one refusal of a key a scope did not declare. */
7789
+ function assertDeclaredKeys(keys, declared) {
7790
+ const undeclared = keys.filter((key) => !declared.has(key));
7791
+ if (undeclared.length > 0) throw new Error(`scoped settings: [${undeclared.join(", ")}] not declared for this scope (declared: [${[...declared].join(", ")}])`);
7792
+ }
7793
+ /** Build the handle over an addon's scoped read, write and unset. */
7794
+ function createScopedSettings(deps) {
7795
+ return {
7796
+ async get() {
7797
+ return deps.schema.parse(await deps.read());
7798
+ },
7799
+ patch: (patch) => deps.write(Object.fromEntries(Object.entries(patch))),
7800
+ unset: (keys) => deps.unset(keys)
7801
+ };
7802
+ }
7654
7803
  /** A write to a secret path could not be stored in the keychain, so it was refused. */
7655
7804
  var KeychainWriteRefusedError = class extends Error {
7656
7805
  fieldPath;
@@ -8226,7 +8375,16 @@ function createHandle(raw, opts) {
8226
8375
  return blob;
8227
8376
  }
8228
8377
  },
8229
- writeAddonStore: writeAddon
8378
+ writeAddonStore: writeAddon,
8379
+ removeClearedKeys: (keys) => serialize("addon", async () => {
8380
+ const stored = await readStoredAddonBlob(raw);
8381
+ index.seen("addon", stored);
8382
+ const removable = keys.filter((key) => collectSecretMarkerRefs(stored[key]).length === 0);
8383
+ if (removable.length === 0) return;
8384
+ const patch = Object.fromEntries(removable.map((key) => [key, void 0]));
8385
+ await raw.writeAddonStore(patch);
8386
+ index.wrote("addon", patch);
8387
+ })
8230
8388
  };
8231
8389
  }
8232
8390
  /** The context the addon sees, plus the private raw view and write outcome. */
@@ -8356,7 +8514,7 @@ function boundOf(list) {
8356
8514
  * Base class for CamStack addons. Eliminates settings boilerplate:
8357
8515
  *
8358
8516
  * - Typed `config` property with automatic resolution from store + defaults
8359
- * - `getGlobalSettings()` / `updateGlobalSettings()` auto-implemented
8517
+ * - the scoped settings API (`clusterSettings` / `nodeSettings` / `deviceDefaults`) auto-implemented
8360
8518
  * - `getAddonSettings()` / `updateAddonSettings()` auto-implemented
8361
8519
  * - `getDeviceSettings()` / `updateDeviceSettings()` auto-implemented
8362
8520
  * - `ctx` accessor for the AddonContext (no manual `this.ctxRef` storage)
@@ -8366,7 +8524,7 @@ function boundOf(list) {
8366
8524
  * Subclasses override:
8367
8525
  * - `onInitialize()` — addon-specific init logic, return ProviderRegistration[]
8368
8526
  * - `onShutdown()` — cleanup
8369
- * - `globalSettingsSchema()` / `deviceSettingsSchema()` — UI schemas
8527
+ * - `clusterSettingsSchema()` / `nodeSettingsSchema()` / `deviceSettingsSchema()` — UI schemas
8370
8528
  *
8371
8529
  * @example
8372
8530
  * ```ts
@@ -8380,7 +8538,7 @@ function boundOf(list) {
8380
8538
  * super({ maxRetries: 3, endpoint: 'http://localhost' })
8381
8539
  * }
8382
8540
  *
8383
- * protected globalSettingsSchema() {
8541
+ * protected clusterSettingsSchema() {
8384
8542
  * return this.schema({
8385
8543
  * sections: [{
8386
8544
  * id: 'main', title: 'Settings',
@@ -8423,7 +8581,7 @@ var BaseAddon = class {
8423
8581
  defaults;
8424
8582
  /**
8425
8583
  * Hidden-state paths that hold secrets (D787) — values the addon writes
8426
- * itself (`updateGlobalSettings`, `state()`) that no form field declares.
8584
+ * itself (`state()`, the scoped writers) that no form field declares.
8427
8585
  * Stored in the keychain exactly like a `password` field. Syntax:
8428
8586
  * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
8429
8587
  * (`key[<id field>]` addresses array items by id, never by index).
@@ -8433,7 +8591,7 @@ var BaseAddon = class {
8433
8591
  /**
8434
8592
  * D986 M4: the scoped schemas this addon declared, resolved once per capability
8435
8593
  * (`loadScopedSchemas`) so the sync readers (`perNodeKeys`, the secret tree, the restart check)
8436
- * see them. Empty until loaded: the readers then fall back to {@link globalSettingsSchema}.
8594
+ * see them. Empty until loaded.
8437
8595
  */
8438
8596
  _scopedByCap = /* @__PURE__ */ new Map();
8439
8597
  _nodeKeysByCap = /* @__PURE__ */ new Map();
@@ -8619,7 +8777,7 @@ var BaseAddon = class {
8619
8777
  /** Addon-specific cleanup. Override if needed. */
8620
8778
  async onShutdown() {}
8621
8779
  /**
8622
- * Called after config is resolved during updateGlobalSettings/updateAddonSettings.
8780
+ * Called after config is resolved during a settings write.
8623
8781
  * Override to react to config changes (e.g. restart a sampler, reconnect a service).
8624
8782
  * Not called during initialize() — use onInitialize() for initial setup.
8625
8783
  */
@@ -8648,82 +8806,12 @@ var BaseAddon = class {
8648
8806
  scopedSettingsCapabilities() {
8649
8807
  return [];
8650
8808
  }
8651
- /** Override to provide global-level settings UI schema. */
8652
- globalSettingsSchema(_cap) {
8653
- return null;
8654
- }
8655
8809
  /** Override to provide device-level settings UI schema. */
8656
8810
  deviceSettingsSchema() {
8657
8811
  return null;
8658
8812
  }
8659
8813
  /**
8660
- * INTEGRATION-LEVEL SETTINGS — declare which of this addon's global sections
8661
- * ARE the configuration of its integration.
8662
- *
8663
- * Return the `ConfigSection.id`s, from {@link globalSettingsSchema}, that an
8664
- * operator should find on the addon's integration page (System →
8665
- * Integrations → <name>) rather than only in the cluster-wide list of every
8666
- * addon. Empty (the default) means the addon has no integration-level
8667
- * settings and no such surface is offered — this is opt-in, because whether
8668
- * an addon's configuration IS its integration's configuration depends on the
8669
- * nature of the integration.
8670
- *
8671
- * WHAT THIS IS NOT. It is not a scope. The selected sections keep living in
8672
- * the ONE global schema, in the ONE addon store, written by the ONE
8673
- * `updateGlobalSettings` path. There is deliberately no
8674
- * `updateIntegrationSettings`: a second write path is how a surface acquires
8675
- * a second store key, and this repo has shipped that twice (`btmPath@hub`,
8676
- * D266). Selecting sections cannot introduce a key that selecting cannot.
8677
- *
8678
- * WHY IT IS A LIST OF SECTION IDS AND NOT A MARKER ON THE SECTION.
8679
- * `ConfigFieldBase` used to carry `scope?: 'device' | 'global'` and it was
8680
- * removed with the reason recorded at
8681
- * `packages/types/src/interfaces/config-ui.ts:249` — *"a field's scope is
8682
- * determined by WHICH schema it lives in, not by a field-level marker."* A
8683
- * marker sprinkled across sections also has to borrow a field that already
8684
- * means something else; borrowing `section.tab` put the literal word
8685
- * "integration" into an operator-facing tab bar, because `tab` means "how to
8686
- * GROUP this visually" and cannot also mean "where this lives" (D269
8687
- * supersedes D268). One declaration, in one place, next to the schema whose
8688
- * ids it names.
8689
- */
8690
- integrationSettingSections() {
8691
- return [];
8692
- }
8693
- async getGlobalSettings(overlay, cap, nodeId) {
8694
- await this.loadScopedSchemas(cap);
8695
- const schema = this.globalSettingsSchema(cap) ?? this.scopedFormSchema(cap);
8696
- if (!schema) return { sections: [] };
8697
- const projected = await this.readRawProjectedStore(nodeId, cap);
8698
- return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
8699
- }
8700
- /**
8701
- * The integration-level view of this addon's settings: exactly the sections
8702
- * named by {@link integrationSettingSections}, hydrated from the SAME store
8703
- * `getGlobalSettings` reads, and narrowed to cluster-scoped fields.
8704
- *
8705
- * Returns `null` when the addon declared nothing — an addon that opts out has
8706
- * no integration settings surface at all, rather than an empty one that reads
8707
- * as a failed load.
8708
- *
8709
- * Three properties hold BY CONSTRUCTION, which is why they are here in core
8710
- * and not in whichever UI happens to render this:
8711
- *
8712
- * 1. **One key.** The payload is a SUBSET of the global schema, so a field
8713
- * shown here is the same field, with the same bare key, that the addon's
8714
- * own page shows. There is no integration-specific writer — callers save
8715
- * through `updateGlobalSettings` — so a second store key is unreachable,
8716
- * not merely discouraged.
8717
- * 2. **No node scope.** `perNode: true` fields are DROPPED. Their store key
8718
- * is `<key>@<nodeId>` and an integration is not a node; whichever node
8719
- * such a field silently picked would be a wrong answer for the operator
8720
- * who opened the page (D266).
8721
- * 3. **No silent typo.** A declared id that names no section throws. The
8722
- * alternative — skip it — turns a rename into a surface that quietly
8723
- * empties, which looks exactly like an addon with nothing to configure.
8724
- */
8725
- /**
8726
- * The form schema of ONE integration instance, or `null` to use {@link globalSettingsSchema}.
8814
+ * The form schema of ONE integration instance, or `null` to use the scoped form.
8727
8815
  *
8728
8816
  * Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
8729
8817
  * needs its connection fields, the default integration the addon's own sections. It is the
@@ -8771,37 +8859,178 @@ var BaseAddon = class {
8771
8859
  }
8772
8860
  }
8773
8861
  /**
8862
+ * Hook: values layered over the stored ones when the FORM of one scope is served
8863
+ * ({@link getScopedSettings}) — a preview that derives dependent options without writing.
8864
+ * Never applied to {@link ScopedSettings.get} or to a write. `null` ⇒ no overlay.
8865
+ */
8866
+ async scopedSettingsOverlay(_scope, _cap, _nodeId) {
8867
+ return null;
8868
+ }
8869
+ /**
8870
+ * Hook: a write of one scope changed stored values (not called when the store reports no change,
8871
+ * e.g. the write-back of a stored secret). `keys` are the bare field keys of the write, node keys included.
8872
+ */
8873
+ async onScopedSettingsChanged(_scope, _cap, _keys) {}
8874
+ /** Typed handle over the CLUSTER settings `cap` declares (`clusterSettingsSchema`). */
8875
+ clusterSettings(cap, schema) {
8876
+ return this.scopedHandle("cluster", cap, schema);
8877
+ }
8878
+ /** Typed handle over the fleet defaults of the per-device settings `cap` declares. */
8879
+ deviceDefaults(cap, schema) {
8880
+ return this.scopedHandle("device-defaults", cap, schema);
8881
+ }
8882
+ /**
8883
+ * Typed handle over the settings `cap` owns PER NODE. `nodeId` omitted ⇒ the local node. A node
8884
+ * with no row yields the schema defaults — never a bare-key fallback.
8885
+ */
8886
+ nodeSettings(cap, schema, nodeId) {
8887
+ return this.scopedHandle("node", cap, schema, nodeId);
8888
+ }
8889
+ /**
8890
+ * {@link state} for a value that is kept per node: stored under `<key>@<nodeId>`, and the
8891
+ * settings store carries `nodeId` in the row data (D986 §1), so a forgotten node's rows go in one
8892
+ * central delete. `nodeId` omitted ⇒ the local node.
8893
+ */
8894
+ nodeState(key, schema, fallback, nodeId) {
8895
+ this._declaredStateKeys.add(key);
8896
+ return createDurableState({
8897
+ key: nodeScopedKey(key, nodeId ?? this._ctx?.kernel?.localNodeId ?? ""),
8898
+ schema,
8899
+ fallback,
8900
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
8901
+ write: async (patch) => {
8902
+ await this._ctx?.settings?.writeAddonStore(patch);
8903
+ },
8904
+ onParseError: (k, e) => this._ctx?.logger?.warn?.(`durable-state: stored "${k}" failed validation — using fallback`, { meta: {
8905
+ addonId: this._ctx?.id,
8906
+ key: k,
8907
+ error: String(e)
8908
+ } })
8909
+ });
8910
+ }
8911
+ /** The loaded schema `cap` declares for `scope`, or `null`. */
8912
+ async declaredScopedSchema(scope, cap) {
8913
+ await this.loadScopedSchemas(cap);
8914
+ return this.loadedScopedSchemas(cap).find((entry) => entry.scope === scope)?.schema ?? null;
8915
+ }
8916
+ async requireScopedSchema(scope, cap) {
8917
+ const schema = await this.declaredScopedSchema(scope, cap);
8918
+ if (schema === null) throw new Error(`${this.constructor.name}: cap "${cap}" declares no ${scope} settings`);
8919
+ return schema;
8920
+ }
8921
+ scopedKeys(schema) {
8922
+ return new Set(schema.sections.flatMap((section) => collectValueFieldKeys(section.fields)));
8923
+ }
8924
+ /** `store` narrowed to the keys `schema` declares. */
8925
+ narrowToScope(store, schema) {
8926
+ const keys = this.scopedKeys(schema);
8927
+ return Object.fromEntries(Object.entries(store).filter(([key]) => keys.has(key)));
8928
+ }
8929
+ scopedHandle(scope, cap, schema, nodeId) {
8930
+ return createScopedSettings({
8931
+ schema,
8932
+ read: async () => {
8933
+ const declared = await this.requireScopedSchema(scope, cap);
8934
+ const stored = this.narrowToScope(await this.resolveGlobalStore(nodeId, cap), declared);
8935
+ const effective = collectHydratedFieldValues(hydrateSchema(declared, stored));
8936
+ return {
8937
+ ...Object.fromEntries([...effective].filter(([, value]) => value !== void 0)),
8938
+ ...stored
8939
+ };
8940
+ },
8941
+ write: (patch) => this.writeScoped(scope, cap, patch, nodeId),
8942
+ unset: (keys) => this.unsetScoped(scope, cap, keys, nodeId)
8943
+ });
8944
+ }
8945
+ /** The one write path of the scoped API: declared keys only, then the global patch. */
8946
+ async writeScoped(scope, cap, patch, nodeId) {
8947
+ assertDeclaredKeys(Object.keys(patch), this.scopedKeys(await this.requireScopedSchema(scope, cap)));
8948
+ if (await this.applyGlobalPatch(patch, scope === "node" ? nodeId : void 0, cap)) await this.onScopedSettingsChanged(scope, cap, Object.keys(patch));
8949
+ }
8950
+ /**
8951
+ * Remove declared keys of one scope. A secret goes through {@link clearSecrets} — its keychain
8952
+ * value is released exactly as there — and the emptied row is then removed; every other key is
8953
+ * removed by an `undefined` patch (which a secret transform would read as "keep").
8954
+ */
8955
+ async unsetScoped(scope, cap, keys, nodeId) {
8956
+ assertDeclaredKeys(keys, this.scopedKeys(await this.requireScopedSchema(scope, cap)));
8957
+ const target = scope === "node" ? nodeId : void 0;
8958
+ const tree = this.addonSecretTree();
8959
+ const secretKeys = keys.filter((key) => tree.has(key));
8960
+ const plainKeys = keys.filter((key) => !tree.has(key));
8961
+ let changed = false;
8962
+ if (plainKeys.length > 0) {
8963
+ const patch = Object.fromEntries(plainKeys.map((key) => [key, void 0]));
8964
+ changed = await this.applyGlobalPatch(patch, target, cap) || changed;
8965
+ }
8966
+ if (secretKeys.length > 0) {
8967
+ await this.clearSecretKeys(secretKeys, target, cap);
8968
+ const node = normalizeNodeId(target ?? this._ctx?.kernel?.localNodeId);
8969
+ const rows = secretKeys.map((key) => scope === "node" ? nodeScopedKey(key, node) : key);
8970
+ if (this._secretSettings !== null) await this._secretSettings.removeClearedKeys(rows);
8971
+ else await this._ctx?.settings?.writeAddonStore(Object.fromEntries(rows.map((row) => [row, void 0])));
8972
+ changed = true;
8973
+ }
8974
+ if (changed) await this.onScopedSettingsChanged(scope, cap, [...keys]);
8975
+ }
8976
+ /**
8977
+ * The hydrated form of one scope of one capability's settings (any
8978
+ * {@link scopedSettingsOverlay} applied), or `null` when the capability declares nothing there.
8979
+ */
8980
+ async getScopedSettings(scope, cap, nodeId) {
8981
+ const schema = await this.declaredScopedSchema(scope, cap);
8982
+ if (schema === null) return null;
8983
+ const stored = this.narrowToScope(await this.readRawProjectedStore(nodeId, cap), schema);
8984
+ const overlay = await this.scopedSettingsOverlay(scope, cap, nodeId);
8985
+ return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(stored, overlay) : stored, { inlineSecretsAsViews: true });
8986
+ }
8987
+ /**
8988
+ * The scoped schemas this addon serves: one entry per loaded (capability, scope), capabilities
8989
+ * in declaration order, scopes in {@link SCOPED_SETTINGS_SCOPES} order. `[]` when it declares
8990
+ * nothing.
8991
+ */
8992
+ async listScopedSettings() {
8993
+ await this.loadScopedSchemas();
8994
+ return [...this._scopedByCap].flatMap(([cap, entries]) => entries.map((entry) => ({
8995
+ cap,
8996
+ scope: entry.scope,
8997
+ sectionIds: entry.schema.sections.map((section) => section.id)
8998
+ })));
8999
+ }
9000
+ /** The OPERATOR's write of declared keys of one scope (D787 secret semantics). */
9001
+ async updateScopedSettings(scope, cap, patch, nodeId) {
9002
+ this._operatorWriteDepth++;
9003
+ try {
9004
+ await this.writeScoped(scope, cap, patch, nodeId);
9005
+ } finally {
9006
+ this._operatorWriteDepth--;
9007
+ }
9008
+ }
9009
+ /**
9010
+ * The effective values (`stored ?? default`) of one scope, a secret as its `set` view — never
9011
+ * its value. `null` when the capability declares nothing for the scope.
9012
+ */
9013
+ async readScopedValues(scope, cap, nodeId) {
9014
+ const schema = await this.declaredScopedSchema(scope, cap);
9015
+ if (schema === null) return null;
9016
+ const form = hydrateSchema(schema, this.narrowToScope(await this.readRawProjectedStore(nodeId, cap), schema), { inlineSecretsAsViews: true });
9017
+ return Object.fromEntries([...collectHydratedFieldValues(form)].filter(([, value]) => value !== void 0));
9018
+ }
9019
+ /**
8774
9020
  * What the create wizard and the integration edit page render for one instance: the addon's
8775
9021
  * per-instance schema when it declares one, else its global schema (what they always showed).
8776
9022
  */
8777
9023
  async getIntegrationFormSchema(instance, nodeId) {
8778
9024
  const scoped = await this.integrationFormSchema(instance);
8779
- if (scoped === null) return this.getGlobalSettings(void 0, void 0, nodeId);
9025
+ if (scoped === null) return this.scopedForm(nodeId);
8780
9026
  return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
8781
9027
  }
8782
- async getIntegrationSettings(nodeId) {
8783
- const declared = this.integrationSettingSections();
8784
- if (declared.length === 0) return null;
8785
- const schema = this.globalSettingsSchema();
8786
- if (!schema) throw new Error(`${this.constructor.name}: integrationSettingSections() names [${declared.join(", ")}] but globalSettingsSchema() returns null.`);
8787
- const byId = new Map(schema.sections.map((section) => [section.id, section]));
8788
- const sections = [];
8789
- for (const id of declared) {
8790
- const section = byId.get(id);
8791
- if (!section) throw new Error(`${this.constructor.name}: integrationSettingSections() names unknown section "${id}". Known sections: [${[...byId.keys()].join(", ")}].`);
8792
- const fields = dropPerNodeFields(section.fields);
8793
- if (fields.length === 0) continue;
8794
- sections.push({
8795
- ...section,
8796
- fields
8797
- });
8798
- }
8799
- if (sections.length === 0) return null;
8800
- const projected = await this.readRawProjectedStore(nodeId);
8801
- return hydrateSchema({
8802
- ...schema,
8803
- sections
8804
- }, projected, { inlineSecretsAsViews: true });
9028
+ /** The form of the scoped schemas this addon declared, hydrated from its store. */
9029
+ async scopedForm(nodeId) {
9030
+ await this.loadScopedSchemas();
9031
+ const schema = this.scopedFormSchema();
9032
+ if (!schema) return { sections: [] };
9033
+ return hydrateSchema(schema, await this.readRawProjectedStore(nodeId), { inlineSecretsAsViews: true });
8805
9034
  }
8806
9035
  /**
8807
9036
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -8810,8 +9039,8 @@ var BaseAddon = class {
8810
9039
  * bare fallback), all `@`-scoped and stray bare per-node keys are dropped.
8811
9040
  * A no-op passthrough when the schema declares no `perNode` field.
8812
9041
  *
8813
- * This is the sanctioned way for a `getGlobalSettings` OVERRIDE that needs
8814
- * the store for custom option logic (option narrowing, value snapping) to
9042
+ * This is the sanctioned way for an addon that needs
9043
+ * the store for custom logic (option narrowing, value snapping) to
8815
9044
  * read it per-node — never `ctx.settings.readAddonStore()` directly.
8816
9045
  * `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
8817
9046
  *
@@ -8863,7 +9092,7 @@ var BaseAddon = class {
8863
9092
  }
8864
9093
  /**
8865
9094
  * Whether ONE global key of this addon's store was written, read three-way
8866
- * (D651). For a question a hydrated view cannot answer: `getGlobalSettings`
9095
+ * (D651). For a question a hydrated view cannot answer: a hydrated form
8867
9096
  * reports `value ?? default`, so "the operator chose the default" and "nobody
8868
9097
  * chose" look the same, and a failed read looks like both. A `perNode` key is
8869
9098
  * not supported here: its stored name is scoped.
@@ -8897,7 +9126,7 @@ var BaseAddon = class {
8897
9126
  }
8898
9127
  /**
8899
9128
  * The OPERATOR's write — a settings form or an admin API call, dispatched by
8900
- * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
9129
+ * the kernel. The one in-process write of the addon blob that is not a scoped write; a secret
8901
9130
  * the operator sends is stored as sent even when it equals a pre-keychain
8902
9131
  * inline value: the operator re-entering a password is a change, an addon
8903
9132
  * writing back what it read is not (D787).
@@ -8910,9 +9139,6 @@ var BaseAddon = class {
8910
9139
  this._operatorWriteDepth--;
8911
9140
  }
8912
9141
  }
8913
- async updateGlobalSettings(patch, nodeId) {
8914
- await this.applyGlobalPatch(patch, nodeId);
8915
- }
8916
9142
  /**
8917
9143
  * REMOVE stored secrets — their keychain values and their markers (D787).
8918
9144
  *
@@ -8922,6 +9148,9 @@ var BaseAddon = class {
8922
9148
  * a keychain (an older kernel) it writes `''`, as such code always did.
8923
9149
  */
8924
9150
  async clearSecrets(keys, nodeId) {
9151
+ await this.clearSecretKeys(keys, nodeId);
9152
+ }
9153
+ async clearSecretKeys(keys, nodeId, cap) {
8925
9154
  const tree = this.addonSecretTree();
8926
9155
  const keychain = this._ctx?.secrets !== void 0;
8927
9156
  const stored = keychain ? await this.readAddonStoreWithRetry() : {};
@@ -8934,25 +9163,26 @@ var BaseAddon = class {
8934
9163
  const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
8935
9164
  patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
8936
9165
  }
8937
- await this.applyGlobalPatch(patch, nodeId);
9166
+ await this.applyGlobalPatch(patch, nodeId, cap);
8938
9167
  }
8939
- async applyGlobalPatch(barePatch, nodeId) {
8940
- await this.loadScopedSchemas();
8941
- const keys = this.perNodeKeys();
9168
+ /** Resolves `true` when the write changed stored values. */
9169
+ async applyGlobalPatch(barePatch, nodeId, cap) {
9170
+ await this.loadScopedSchemas(cap);
9171
+ const keys = this.perNodeKeys(cap);
8942
9172
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
8943
9173
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
8944
9174
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
8945
9175
  const handle = this._secretSettings;
8946
9176
  if (handle !== null) {
8947
9177
  const { changed } = await handle.writeAddonStore(scoped);
8948
- if (!changed) return;
9178
+ if (!changed) return false;
8949
9179
  } else await this._ctx?.settings?.writeAddonStore(scoped);
8950
- if (target !== localNode) return;
9180
+ if (target !== localNode) return true;
8951
9181
  await this.resolveConfig();
8952
9182
  await this.onConfigChanged();
8953
9183
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
8954
- const legacy = this.globalSettingsSchema();
8955
- this.maybeAutoRestart(Object.keys(barePatch), [...legacy === null ? [] : [legacy], ...this.loadedScopedSchemas().map((entry) => entry.schema)]);
9184
+ this.maybeAutoRestart(Object.keys(barePatch), this.loadedScopedSchemas().map((entry) => entry.schema));
9185
+ return true;
8956
9186
  }
8957
9187
  /**
8958
9188
  * The set of field keys the global settings schema declares `perNode: true`
@@ -8989,10 +9219,7 @@ var BaseAddon = class {
8989
9219
  this._nodeKeysByCap = /* @__PURE__ */ new Map();
8990
9220
  this._addonSecretTree = null;
8991
9221
  }
8992
- /**
8993
- * The form the settings API serves while an addon declares no {@link globalSettingsSchema}: the
8994
- * sections of its scoped schemas, so dropping the old hook does not blank the form.
8995
- */
9222
+ /** The form of an addon's scoped schemas: their sections, each shown once. */
8996
9223
  scopedFormSchema(cap) {
8997
9224
  const byId = /* @__PURE__ */ new Map();
8998
9225
  for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
@@ -9004,8 +9231,7 @@ var BaseAddon = class {
9004
9231
  return [...this._scopedByCap.values()].flat();
9005
9232
  }
9006
9233
  /**
9007
- * The field keys that are stored per node: every field of a {@link nodeSettingsSchema}, plus
9008
- * the fields the legacy {@link globalSettingsSchema} still marks `perNode: true`. Derived once
9234
+ * The field keys that are stored per node: every field of a {@link nodeSettingsSchema}. Derived once
9009
9235
  * per `cap` argument and memoized (schemas are static declarations). Empty set ⇒ every
9010
9236
  * per-node code path is bypassed and the settings API behaves like the node-agnostic one.
9011
9237
  * Call {@link loadScopedSchemas} first (the async seams do).
@@ -9014,8 +9240,7 @@ var BaseAddon = class {
9014
9240
  const cacheKey = cap ?? "";
9015
9241
  const cached = this._nodeKeysByCap.get(cacheKey);
9016
9242
  if (cached) return cached;
9017
- const legacy = this.globalSettingsSchema(cap);
9018
- const keys = new Set(legacy ? legacy.sections.flatMap((section) => collectPerNodeFieldKeys(section.fields)) : []);
9243
+ const keys = /* @__PURE__ */ new Set();
9019
9244
  for (const { scope, schema } of this.loadedScopedSchemas(cap)) {
9020
9245
  if (scope !== "node") continue;
9021
9246
  for (const section of schema.sections) for (const key of collectValueFieldKeys(section.fields)) keys.add(key);
@@ -9233,8 +9458,6 @@ var BaseAddon = class {
9233
9458
  }
9234
9459
  declaredKeySet() {
9235
9460
  const keys = new Set(Object.keys(this.defaults));
9236
- const schema = this.globalSettingsSchema();
9237
- if (schema) for (const section of schema.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
9238
9461
  for (const { schema: scoped } of this.loadedScopedSchemas()) for (const section of scoped.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
9239
9462
  for (const key of this._declaredStateKeys) keys.add(key);
9240
9463
  for (const path of this.secretStatePaths) {
@@ -9332,7 +9555,7 @@ var BaseAddon = class {
9332
9555
  /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
9333
9556
  addonSecretTree() {
9334
9557
  if (this._addonSecretTree === null) {
9335
- const tree = new Map(secretTreeFromSchema(this.globalSettingsSchema()));
9558
+ const tree = /* @__PURE__ */ new Map();
9336
9559
  for (const { schema } of this.loadedScopedSchemas()) for (const [key, node] of secretTreeFromSchema(schema)) tree.set(key, node);
9337
9560
  this._addonSecretTree = mergeSecretStatePaths(tree, this.secretStatePaths);
9338
9561
  }
@@ -9544,47 +9767,6 @@ function classifyStoreError(err) {
9544
9767
  if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
9545
9768
  return "permanent";
9546
9769
  }
9547
- /**
9548
- * Collect the keys of every field marked `perNode: true`, recursing into
9549
- * layout containers (`group` fields and `sub-tabs` tabs) the same way
9550
- * `hydrateSchema` does. Valueless structural fields (separator/info/…)
9551
- * don't declare `perNode` and are excluded by the `in` narrowing.
9552
- */
9553
- /**
9554
- * The same fields with every `perNode: true` one removed, recursing into layout
9555
- * containers exactly as {@link collectPerNodeFieldKeys} does. A container left
9556
- * with no child is dropped rather than rendered empty.
9557
- *
9558
- * Used by `getIntegrationSettings`: an integration is not a node, so a field
9559
- * whose store key is `<key>@<nodeId>` has no node to belong to there.
9560
- */
9561
- function dropPerNodeFields(fields) {
9562
- const kept = [];
9563
- for (const field of fields) {
9564
- if (field.type === "group") {
9565
- const inner = dropPerNodeFields(field.fields);
9566
- if (inner.length > 0) kept.push({
9567
- ...field,
9568
- fields: inner
9569
- });
9570
- continue;
9571
- }
9572
- if (field.type === "sub-tabs") {
9573
- const tabs = field.tabs.map((tab) => ({
9574
- ...tab,
9575
- fields: dropPerNodeFields(tab.fields)
9576
- })).filter((tab) => tab.fields.length > 0);
9577
- if (tabs.length > 0) kept.push({
9578
- ...field,
9579
- tabs
9580
- });
9581
- continue;
9582
- }
9583
- if ("perNode" in field && field.perNode === true) continue;
9584
- kept.push(field);
9585
- }
9586
- return kept;
9587
- }
9588
9770
  /** The keys of the value-holding fields, recursing into layout containers. */
9589
9771
  function collectValueFieldKeys(fields) {
9590
9772
  const collected = [];
@@ -9617,21 +9799,6 @@ function collectFieldKeys(fields) {
9617
9799
  }
9618
9800
  return collected;
9619
9801
  }
9620
- function collectPerNodeFieldKeys(fields) {
9621
- const collected = [];
9622
- for (const field of fields) {
9623
- if (field.type === "group") {
9624
- collected.push(...collectPerNodeFieldKeys(field.fields));
9625
- continue;
9626
- }
9627
- if (field.type === "sub-tabs") {
9628
- for (const tab of field.tabs) collected.push(...collectPerNodeFieldKeys(tab.fields));
9629
- continue;
9630
- }
9631
- if ("perNode" in field && field.perNode === true) collected.push(field.key);
9632
- }
9633
- return collected;
9634
- }
9635
9802
  /**
9636
9803
  * Normalize an `ICamstackAddon.initialize()` return value into the
9637
9804
  * `AddonInitResult` envelope. Arrays are wrapped into `{ providers }`;
@@ -9647,30 +9814,98 @@ function normalizeAddonInitResult(result) {
9647
9814
  if (Array.isArray(result)) return { providers: result };
9648
9815
  return result;
9649
9816
  }
9817
+ object({
9818
+ field: string().min(1),
9819
+ on: literal("advance")
9820
+ });
9650
9821
  /**
9651
- * The share-view scope kinds a share-link token can carry. The hub mints
9652
- * and validates them (`ShareViewGrantSchema` builds its
9653
- * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
9822
+ * Output schema shared by the contribution + live methods.
9823
+ *
9824
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
9825
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
9826
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
9827
+ * (using `z.unknown()` here collapses unrelated router branches to
9828
+ * `unknown` when the generator re-inlines the huge AppRouter type).
9829
+ *
9830
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
9831
+ * extensions the caller adds (showWhen, displayScale, …) without
9832
+ * rebuilding every time a new field kind is introduced.
9654
9833
  */
9655
- var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
9656
- /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
9657
- var PeerBytesTicketSchema = object({
9658
- /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
9659
- url: string().min(1),
9660
- /**
9661
- * The HOST node this URL means something on — the hub or a named agent,
9662
- * never a runner. {@link AddonPeerBytes.open} compares it to its own and
9663
- * refuses `cross-node` by name when they differ, without dialling.
9664
- */
9665
- hostNodeId: string().min(1),
9666
- expiresAtMs: number().int().nonnegative(),
9667
- /**
9668
- * What the producer DECLARED the body to be, when it knows — `null` when it
9669
- * does not. Never `0` for unknown (D393): a consumer sizing a bound off this
9670
- * must be able to tell "the producer did not say" from "the body is empty".
9671
- */
9672
- declaredBytes: number().int().nonnegative().nullable()
9834
+ var ContributionSectionSchema = object({
9835
+ id: string(),
9836
+ title: string(),
9837
+ description: string().optional(),
9838
+ style: _enum(["card", "accordion"]).optional(),
9839
+ defaultCollapsed: boolean().optional(),
9840
+ columns: union([
9841
+ literal(1),
9842
+ literal(2),
9843
+ literal(3),
9844
+ literal(4)
9845
+ ]).optional(),
9846
+ tab: string().optional(),
9847
+ location: _enum([
9848
+ "settings",
9849
+ "top-tab",
9850
+ "hero"
9851
+ ]).optional(),
9852
+ order: number().optional(),
9853
+ fields: array(any())
9673
9854
  });
9855
+ object({
9856
+ tabs: array(object({
9857
+ id: string(),
9858
+ label: string(),
9859
+ icon: string(),
9860
+ order: number().optional()
9861
+ })).optional(),
9862
+ sections: array(ContributionSectionSchema)
9863
+ }).nullable();
9864
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
9865
+ deviceId: number(),
9866
+ patch: record(string(), unknown())
9867
+ }), object({ success: literal(true) });
9868
+ object({ deviceId: number() }), unknown().nullable();
9869
+ function method(input, output, options) {
9870
+ return {
9871
+ input,
9872
+ output,
9873
+ kind: options?.kind ?? "query",
9874
+ ...options?.auth !== void 0 ? { auth: options.auth } : {},
9875
+ ...options?.access !== void 0 ? { access: options.access } : {},
9876
+ ...options?.role !== void 0 ? { role: options.role } : {},
9877
+ ...options?.caller !== void 0 ? { caller: options.caller } : {},
9878
+ timeoutMs: options?.timeoutMs
9879
+ };
9880
+ }
9881
+ /**
9882
+ * A wrapper/system-only method: served exclusively by the cap's system-level
9883
+ * provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
9884
+ * driver natives don't stub out a wrapper concern (e.g. a cross-device cache
9885
+ * overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
9886
+ */
9887
+ function systemMethod(input, output, options) {
9888
+ return {
9889
+ ...method(input, output, options),
9890
+ systemOnly: true
9891
+ };
9892
+ }
9893
+ /**
9894
+ * A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
9895
+ * on `InferProvider`. The `providerOptional: true` literal is what
9896
+ * `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
9897
+ * for when this is the honest answer and when it is a soft stub.
9898
+ */
9899
+ function optionalMethod(input, output, options) {
9900
+ return {
9901
+ ...method(input, output, options),
9902
+ providerOptional: true
9903
+ };
9904
+ }
9905
+ /** Shorthand to define an event schema */
9906
+ function event(data) {
9907
+ return { data };
9908
+ }
9674
9909
  function defOf(schema) {
9675
9910
  const zodBag = Reflect.get(schema, "_zod");
9676
9911
  if (typeof zodBag !== "object" || zodBag === null) return {};
@@ -9927,98 +10162,30 @@ function defineEntryKind(name, spec) {
9927
10162
  if (defined === void 0) throw new DeclarationRefusedError(`entry kind "${name}" was not built`);
9928
10163
  return defined;
9929
10164
  }
9930
- object({
9931
- field: string().min(1),
9932
- on: literal("advance")
9933
- });
9934
10165
  /**
9935
- * Output schema shared by the contribution + live methods.
9936
- *
9937
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
9938
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
9939
- * concrete-but-lenient Zod object keeps tRPC output inference happy
9940
- * (using `z.unknown()` here collapses unrelated router branches to
9941
- * `unknown` when the generator re-inlines the huge AppRouter type).
9942
- *
9943
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
9944
- * extensions the caller adds (showWhen, displayScale, …) without
9945
- * rebuilding every time a new field kind is introduced.
10166
+ * The share-view scope kinds a share-link token can carry. The hub mints
10167
+ * and validates them (`ShareViewGrantSchema` builds its
10168
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
9946
10169
  */
9947
- var ContributionSectionSchema = object({
9948
- id: string(),
9949
- title: string(),
9950
- description: string().optional(),
9951
- style: _enum(["card", "accordion"]).optional(),
9952
- defaultCollapsed: boolean().optional(),
9953
- columns: union([
9954
- literal(1),
9955
- literal(2),
9956
- literal(3),
9957
- literal(4)
9958
- ]).optional(),
9959
- tab: string().optional(),
9960
- location: _enum([
9961
- "settings",
9962
- "top-tab",
9963
- "hero"
9964
- ]).optional(),
9965
- order: number().optional(),
9966
- fields: array(any())
10170
+ var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
10171
+ /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
10172
+ var PeerBytesTicketSchema = object({
10173
+ /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
10174
+ url: string().min(1),
10175
+ /**
10176
+ * The HOST node this URL means something on — the hub or a named agent,
10177
+ * never a runner. {@link AddonPeerBytes.open} compares it to its own and
10178
+ * refuses `cross-node` by name when they differ, without dialling.
10179
+ */
10180
+ hostNodeId: string().min(1),
10181
+ expiresAtMs: number().int().nonnegative(),
10182
+ /**
10183
+ * What the producer DECLARED the body to be, when it knows — `null` when it
10184
+ * does not. Never `0` for unknown (D393): a consumer sizing a bound off this
10185
+ * must be able to tell "the producer did not say" from "the body is empty".
10186
+ */
10187
+ declaredBytes: number().int().nonnegative().nullable()
9967
10188
  });
9968
- object({
9969
- tabs: array(object({
9970
- id: string(),
9971
- label: string(),
9972
- icon: string(),
9973
- order: number().optional()
9974
- })).optional(),
9975
- sections: array(ContributionSectionSchema)
9976
- }).nullable();
9977
- object({ deviceId: number() }), object({ deviceId: number() }), object({
9978
- deviceId: number(),
9979
- patch: record(string(), unknown())
9980
- }), object({ success: literal(true) });
9981
- object({ deviceId: number() }), unknown().nullable();
9982
- function method(input, output, options) {
9983
- return {
9984
- input,
9985
- output,
9986
- kind: options?.kind ?? "query",
9987
- ...options?.auth !== void 0 ? { auth: options.auth } : {},
9988
- ...options?.access !== void 0 ? { access: options.access } : {},
9989
- ...options?.role !== void 0 ? { role: options.role } : {},
9990
- ...options?.caller !== void 0 ? { caller: options.caller } : {},
9991
- timeoutMs: options?.timeoutMs
9992
- };
9993
- }
9994
- /**
9995
- * A wrapper/system-only method: served exclusively by the cap's system-level
9996
- * provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
9997
- * driver natives don't stub out a wrapper concern (e.g. a cross-device cache
9998
- * overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
9999
- */
10000
- function systemMethod(input, output, options) {
10001
- return {
10002
- ...method(input, output, options),
10003
- systemOnly: true
10004
- };
10005
- }
10006
- /**
10007
- * A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
10008
- * on `InferProvider`. The `providerOptional: true` literal is what
10009
- * `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
10010
- * for when this is the honest answer and when it is a soft stub.
10011
- */
10012
- function optionalMethod(input, output, options) {
10013
- return {
10014
- ...method(input, output, options),
10015
- providerOptional: true
10016
- };
10017
- }
10018
- /** Shorthand to define an event schema */
10019
- function event(data) {
10020
- return { data };
10021
- }
10022
10189
  var READING_QUANTITIES = [
10023
10190
  "temperature",
10024
10191
  "pressure",
@@ -10609,7 +10776,6 @@ var CAP_NAMES = Object.freeze([
10609
10776
  "climate-control",
10610
10777
  "color",
10611
10778
  "composer",
10612
- "connection-test",
10613
10779
  "connectivity",
10614
10780
  "consumables",
10615
10781
  "contact",
@@ -10699,7 +10865,6 @@ var CAP_NAMES = Object.freeze([
10699
10865
  "notifier",
10700
10866
  "numeric-sensor",
10701
10867
  "oauth-integration",
10702
- "oidc-connections",
10703
10868
  "osd",
10704
10869
  "osd-manager",
10705
10870
  "pet-feeder",
@@ -12406,13 +12571,25 @@ Object.freeze({
12406
12571
  "path": "temperature",
12407
12572
  "valueType": "number"
12408
12573
  }],
12409
- "timed-run": [{
12410
- "path": "activeUntil",
12411
- "valueType": "number"
12412
- }, {
12413
- "path": "requestedBy",
12414
- "valueType": "string"
12415
- }],
12574
+ "timed-run": [
12575
+ {
12576
+ "path": "activeUntil",
12577
+ "valueType": "number"
12578
+ },
12579
+ {
12580
+ "path": "requestedBy",
12581
+ "valueType": "string"
12582
+ },
12583
+ {
12584
+ "path": "quickRun.duration",
12585
+ "valueType": "number"
12586
+ },
12587
+ {
12588
+ "path": "quickRun.unit",
12589
+ "valueType": "enum",
12590
+ "enumValues": ["s", "min"]
12591
+ }
12592
+ ],
12416
12593
  "update": [
12417
12594
  {
12418
12595
  "path": "currentVersion",
@@ -12591,8 +12768,7 @@ Object.freeze({
12591
12768
  "device-provider": { "reloadDevice": 18e4 },
12592
12769
  "llm": {
12593
12770
  "generate": 6e5,
12594
- "generateVision": 6e5,
12595
- "testProfile": 6e5
12771
+ "generateVision": 6e5
12596
12772
  },
12597
12773
  "llm-runtime": {
12598
12774
  "complete": 6e5,
@@ -12629,8 +12805,7 @@ Object.freeze({
12629
12805
  "offerArtifact": 3e5,
12630
12806
  "readResult": 3e5,
12631
12807
  "submitJob": 18e5,
12632
- "uploadDataset": 72e5,
12633
- "validateCredentials": 3e4
12808
+ "uploadDataset": 72e5
12634
12809
  }
12635
12810
  });
12636
12811
  object({
@@ -12652,7 +12827,7 @@ function userError(code, params, englishFallback) {
12652
12827
  return new CamstackError(code, params, englishFallback);
12653
12828
  }
12654
12829
  //#endregion
12655
- //#region ../types/dist/composition-BmBHuDTQ.mjs
12830
+ //#region ../types/dist/composition-Bx0JvKUU.mjs
12656
12831
  /**
12657
12832
  * The ffmpeg build every CamStack node downloads, per platform and arch.
12658
12833
  *
@@ -13814,6 +13989,387 @@ var NodeColorIdSchema = _enum([
13814
13989
  "node-h"
13815
13990
  ]);
13816
13991
  //#endregion
13992
+ //#region ../types/dist/convert-BAzH15HU.mjs
13993
+ /**
13994
+ * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
13995
+ * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
13996
+ * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
13997
+ * decimals). K derives from `°C = K − 273.15`.
13998
+ */
13999
+ var UNIT_TABLE = {
14000
+ "°C": {
14001
+ dimension: "temperature",
14002
+ factor: 1,
14003
+ offset: 0
14004
+ },
14005
+ "°F": {
14006
+ dimension: "temperature",
14007
+ factor: 5 / 9,
14008
+ offset: -160 / 9
14009
+ },
14010
+ K: {
14011
+ dimension: "temperature",
14012
+ factor: 1,
14013
+ offset: -273.15
14014
+ },
14015
+ hPa: {
14016
+ dimension: "pressure",
14017
+ factor: 1,
14018
+ offset: 0
14019
+ },
14020
+ kPa: {
14021
+ dimension: "pressure",
14022
+ factor: 10,
14023
+ offset: 0
14024
+ },
14025
+ Pa: {
14026
+ dimension: "pressure",
14027
+ factor: .01,
14028
+ offset: 0
14029
+ },
14030
+ mbar: {
14031
+ dimension: "pressure",
14032
+ factor: 1,
14033
+ offset: 0
14034
+ },
14035
+ bar: {
14036
+ dimension: "pressure",
14037
+ factor: 1e3,
14038
+ offset: 0
14039
+ },
14040
+ inHg: {
14041
+ dimension: "pressure",
14042
+ factor: 33.8639,
14043
+ offset: 0
14044
+ },
14045
+ mmHg: {
14046
+ dimension: "pressure",
14047
+ factor: 1.33322,
14048
+ offset: 0
14049
+ },
14050
+ psi: {
14051
+ dimension: "pressure",
14052
+ factor: 68.9476,
14053
+ offset: 0
14054
+ },
14055
+ "m/s": {
14056
+ dimension: "speed",
14057
+ factor: 1,
14058
+ offset: 0
14059
+ },
14060
+ "km/h": {
14061
+ dimension: "speed",
14062
+ factor: 1 / 3.6,
14063
+ offset: 0
14064
+ },
14065
+ mph: {
14066
+ dimension: "speed",
14067
+ factor: .44704,
14068
+ offset: 0
14069
+ },
14070
+ kn: {
14071
+ dimension: "speed",
14072
+ factor: .514444,
14073
+ offset: 0
14074
+ },
14075
+ "mm/h": {
14076
+ dimension: "precipitation-rate",
14077
+ factor: 1,
14078
+ offset: 0
14079
+ },
14080
+ "in/h": {
14081
+ dimension: "precipitation-rate",
14082
+ factor: 25.4,
14083
+ offset: 0
14084
+ },
14085
+ m: {
14086
+ dimension: "length",
14087
+ factor: 1,
14088
+ offset: 0
14089
+ },
14090
+ mm: {
14091
+ dimension: "length",
14092
+ factor: .001,
14093
+ offset: 0
14094
+ },
14095
+ cm: {
14096
+ dimension: "length",
14097
+ factor: .01,
14098
+ offset: 0
14099
+ },
14100
+ km: {
14101
+ dimension: "length",
14102
+ factor: 1e3,
14103
+ offset: 0
14104
+ },
14105
+ in: {
14106
+ dimension: "length",
14107
+ factor: .0254,
14108
+ offset: 0
14109
+ },
14110
+ ft: {
14111
+ dimension: "length",
14112
+ factor: .3048,
14113
+ offset: 0
14114
+ },
14115
+ mi: {
14116
+ dimension: "length",
14117
+ factor: 1609.344,
14118
+ offset: 0
14119
+ },
14120
+ "m²": {
14121
+ dimension: "area",
14122
+ factor: 1,
14123
+ offset: 0
14124
+ },
14125
+ lx: {
14126
+ dimension: "illuminance",
14127
+ factor: 1,
14128
+ offset: 0
14129
+ },
14130
+ "W/m²": {
14131
+ dimension: "irradiance",
14132
+ factor: 1,
14133
+ offset: 0
14134
+ },
14135
+ W: {
14136
+ dimension: "power",
14137
+ factor: 1,
14138
+ offset: 0
14139
+ },
14140
+ kW: {
14141
+ dimension: "power",
14142
+ factor: 1e3,
14143
+ offset: 0
14144
+ },
14145
+ VA: {
14146
+ dimension: "apparent-power",
14147
+ factor: 1,
14148
+ offset: 0
14149
+ },
14150
+ Wh: {
14151
+ dimension: "energy",
14152
+ factor: 1,
14153
+ offset: 0
14154
+ },
14155
+ kWh: {
14156
+ dimension: "energy",
14157
+ factor: 1e3,
14158
+ offset: 0
14159
+ },
14160
+ MWh: {
14161
+ dimension: "energy",
14162
+ factor: 1e6,
14163
+ offset: 0
14164
+ },
14165
+ V: {
14166
+ dimension: "voltage",
14167
+ factor: 1,
14168
+ offset: 0
14169
+ },
14170
+ mV: {
14171
+ dimension: "voltage",
14172
+ factor: .001,
14173
+ offset: 0
14174
+ },
14175
+ A: {
14176
+ dimension: "current",
14177
+ factor: 1,
14178
+ offset: 0
14179
+ },
14180
+ mA: {
14181
+ dimension: "current",
14182
+ factor: .001,
14183
+ offset: 0
14184
+ },
14185
+ ppm: {
14186
+ dimension: "concentration-volume",
14187
+ factor: 1,
14188
+ offset: 0
14189
+ },
14190
+ ppb: {
14191
+ dimension: "concentration-volume",
14192
+ factor: .001,
14193
+ offset: 0
14194
+ },
14195
+ "µg/m³": {
14196
+ dimension: "concentration-mass",
14197
+ factor: 1,
14198
+ offset: 0
14199
+ },
14200
+ "mg/m³": {
14201
+ dimension: "concentration-mass",
14202
+ factor: 1e3,
14203
+ offset: 0
14204
+ },
14205
+ kg: {
14206
+ dimension: "mass",
14207
+ factor: 1,
14208
+ offset: 0
14209
+ },
14210
+ g: {
14211
+ dimension: "mass",
14212
+ factor: .001,
14213
+ offset: 0
14214
+ },
14215
+ lb: {
14216
+ dimension: "mass",
14217
+ factor: .453592,
14218
+ offset: 0
14219
+ },
14220
+ oz: {
14221
+ dimension: "mass",
14222
+ factor: .0283495,
14223
+ offset: 0
14224
+ },
14225
+ "%": {
14226
+ dimension: "percentage",
14227
+ factor: 1,
14228
+ offset: 0
14229
+ },
14230
+ L: {
14231
+ dimension: "volume",
14232
+ factor: 1,
14233
+ offset: 0
14234
+ },
14235
+ mL: {
14236
+ dimension: "volume",
14237
+ factor: .001,
14238
+ offset: 0
14239
+ },
14240
+ gal: {
14241
+ dimension: "volume",
14242
+ factor: 3.785411784,
14243
+ offset: 0
14244
+ },
14245
+ s: {
14246
+ dimension: "duration",
14247
+ factor: 1,
14248
+ offset: 0
14249
+ },
14250
+ ms: {
14251
+ dimension: "duration",
14252
+ factor: .001,
14253
+ offset: 0
14254
+ },
14255
+ min: {
14256
+ dimension: "duration",
14257
+ factor: 60,
14258
+ offset: 0
14259
+ },
14260
+ h: {
14261
+ dimension: "duration",
14262
+ factor: 3600,
14263
+ offset: 0
14264
+ },
14265
+ d: {
14266
+ dimension: "duration",
14267
+ factor: 86400,
14268
+ offset: 0
14269
+ },
14270
+ B: {
14271
+ dimension: "information",
14272
+ factor: 1,
14273
+ offset: 0
14274
+ },
14275
+ KiB: {
14276
+ dimension: "information",
14277
+ factor: 1024,
14278
+ offset: 0
14279
+ },
14280
+ MiB: {
14281
+ dimension: "information",
14282
+ factor: 1024 ** 2,
14283
+ offset: 0
14284
+ },
14285
+ GiB: {
14286
+ dimension: "information",
14287
+ factor: 1024 ** 3,
14288
+ offset: 0
14289
+ },
14290
+ TiB: {
14291
+ dimension: "information",
14292
+ factor: 1024 ** 4,
14293
+ offset: 0
14294
+ },
14295
+ kB: {
14296
+ dimension: "information",
14297
+ factor: 1e3,
14298
+ offset: 0
14299
+ },
14300
+ MB: {
14301
+ dimension: "information",
14302
+ factor: 1e6,
14303
+ offset: 0
14304
+ },
14305
+ GB: {
14306
+ dimension: "information",
14307
+ factor: 1e9,
14308
+ offset: 0
14309
+ },
14310
+ "°": {
14311
+ dimension: "angle",
14312
+ factor: 1,
14313
+ offset: 0
14314
+ },
14315
+ dBFS: {
14316
+ dimension: "sound-level",
14317
+ factor: 1,
14318
+ offset: 0
14319
+ },
14320
+ dBm: {
14321
+ dimension: "signal-level",
14322
+ factor: 1,
14323
+ offset: 0
14324
+ },
14325
+ mired: {
14326
+ dimension: "colour-temperature",
14327
+ factor: 1,
14328
+ offset: 0
14329
+ },
14330
+ kbps: {
14331
+ dimension: "bitrate",
14332
+ factor: 1,
14333
+ offset: 0
14334
+ },
14335
+ Mbps: {
14336
+ dimension: "bitrate",
14337
+ factor: 1e3,
14338
+ offset: 0
14339
+ },
14340
+ fps: {
14341
+ dimension: "rate",
14342
+ factor: 1,
14343
+ offset: 0
14344
+ }
14345
+ };
14346
+ /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
14347
+ function specFor(unit) {
14348
+ return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
14349
+ }
14350
+ /** Value in `spec`'s unit → its dimension's canonical unit. */
14351
+ function toCanonical(value, spec) {
14352
+ return value * spec.factor + spec.offset;
14353
+ }
14354
+ /** Canonical-unit value → the unit described by `spec`. */
14355
+ function fromCanonical(canonical, spec) {
14356
+ return (canonical - spec.offset) / spec.factor;
14357
+ }
14358
+ /**
14359
+ * Graceful variant for the render path: returns the converted value, or
14360
+ * `undefined` when the conversion is refused (unknown unit / cross-dimension).
14361
+ * Never throws — a render caller falls back to the raw value + source unit.
14362
+ */
14363
+ function tryConvertUnit(value, from, to) {
14364
+ if (from === to) return value;
14365
+ const fromSpec = specFor(from);
14366
+ if (!fromSpec) return void 0;
14367
+ const toSpec = specFor(to);
14368
+ if (!toSpec) return void 0;
14369
+ if (fromSpec.dimension !== toSpec.dimension) return void 0;
14370
+ return fromCanonical(toCanonical(value, fromSpec), toSpec);
14371
+ }
14372
+ //#endregion
13817
14373
  //#region ../types/dist/index.mjs
13818
14374
  var SMTP_INBOUND_DEFAULT_PORT = 2525;
13819
14375
  var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
@@ -13999,6 +14555,414 @@ var IntegrationInstanceRefSchema = object({
13999
14555
  ]),
14000
14556
  candidateStableId: string().optional()
14001
14557
  });
14558
+ /**
14559
+ * notification-output — canonical, capability-gated notification delivery.
14560
+ *
14561
+ * Apprise-derived model (see
14562
+ * `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
14563
+ * callers emit ONE canonical `Notification`; each provider declares a
14564
+ * per-kind capability descriptor (`TargetKind`), and the pure degrade
14565
+ * engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
14566
+ * message to what the kind supports — callers never special-case a service.
14567
+ *
14568
+ * DESIGN DECISIONS (locked):
14569
+ * - A target is an INSTANCE of this function cap (epic #440, step 6): the
14570
+ * providers serve their targets as `integration-instances` records, one
14571
+ * record kind per target kind, and the admin lists, adds, edits, switches
14572
+ * and deletes them through that cap. This cap keeps what an instance cannot
14573
+ * say: the kind catalogue (`listTargetKinds`: capabilities, delivery
14574
+ * parameters, brand icon), dispatch (`send`, `testTarget`) and the form
14575
+ * helpers (`discoverTargets`, `probeTargetConfig`).
14576
+ * - `listTargetKinds` / `discoverTargets` return arrays → the generated
14577
+ * cap-mount auto-`concatCollection`-fans them across every registered
14578
+ * provider so one catalog is routable. `send` / `testTarget` /
14579
+ * `probeTargetConfig` route to ONE provider by the `addonId` the generated
14580
+ * collection router extracts from the call input.
14581
+ * - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
14582
+ * transformer) + UDS MsgPack both round-trip typed arrays — already used by
14583
+ * `storage` / `storage-provider` / `recording` caps over the same path. No
14584
+ * base64 fallback needed.
14585
+ *
14586
+ * TODO (deferred, closed-set change — separate decision): add
14587
+ * `providerKind: 'notify'` so notification providers surface on the unified
14588
+ * admin "Integrations" page.
14589
+ */
14590
+ /**
14591
+ * Zentik-derived typed-media enum — the superset across every kind. Each
14592
+ * adapter picks what it supports and the degrade engine filters the rest.
14593
+ */
14594
+ var AttachmentMediaTypeSchema = _enum([
14595
+ "image",
14596
+ "video",
14597
+ "gif",
14598
+ "audio",
14599
+ "icon"
14600
+ ]);
14601
+ /**
14602
+ * A single attachment. Exactly one of `url` (remote source, most adapters
14603
+ * prefer this) or `bytes` (inline source; required for Pushover-style
14604
+ * bytes-only kinds) MUST be present — the degrade engine expresses a
14605
+ * url→bytes fetch as a `needsFetch` directive the adapter executes.
14606
+ */
14607
+ var AttachmentSchema = object({
14608
+ mediaType: AttachmentMediaTypeSchema,
14609
+ url: string().optional(),
14610
+ bytes: _instanceof(Uint8Array).optional(),
14611
+ mime: string().optional(),
14612
+ name: string().optional()
14613
+ }).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
14614
+ var NotificationFormatSchema = _enum([
14615
+ "text",
14616
+ "markdown",
14617
+ "html"
14618
+ ]);
14619
+ /**
14620
+ * The CLOSED icon vocabulary an action button may use.
14621
+ *
14622
+ * A closed set, not a free string, and that is the whole point: an arbitrary
14623
+ * icon name is one that ntfy renders, zentik silently drops, and nobody
14624
+ * notices — the same class of gap as a zone vocabulary nothing produced
14625
+ * ([D35](../../../docs/decisions/adr-0035.md)). Every adapter maps this set or
14626
+ * declares `actionIcons: false` and the degrade engine strips the field.
14627
+ *
14628
+ * Named by INTENT, never by glyph. "check" would tie the vocabulary to one
14629
+ * renderer's icon set; "acknowledge" survives an adapter that draws it
14630
+ * differently.
14631
+ *
14632
+ * ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
14633
+ *
14634
+ * These names are for US. **No adapter may forward one verbatim.** Each maps
14635
+ * the whole set onto its own renderer's vocabulary through a
14636
+ * `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
14637
+ * fallback, so adding a member here fails every adapter's build until someone
14638
+ * decides its glyph, which is the only place that decision can be made
14639
+ * honestly.
14640
+ *
14641
+ * This paragraph is the bug. Zentik declared `actionIcons: true` and passed
14642
+ * `disarm` straight through; iOS feeds that string to
14643
+ * `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
14644
+ * and every snooze and alarm button arrived BLANK. A pass-through is not a
14645
+ * mapping, and "the field is documented" is not "the value renders".
14646
+ *
14647
+ * Adding a member is TRAIN-BOUND. The enum lives in the published
14648
+ * `@camstack/server` closure and the cap seam validates against the HUB's copy,
14649
+ * so an addon that emits a token the running hub does not know does not lose an
14650
+ * icon — its whole `send` fails Zod validation and the notification never
14651
+ * arrives. Never emit a new token from an addon before the train carrying it.
14652
+ */
14653
+ var NotificationActionIconSchema = _enum([
14654
+ "acknowledge",
14655
+ "dismiss",
14656
+ "silence",
14657
+ "snooze",
14658
+ "view",
14659
+ "play",
14660
+ "open",
14661
+ "close",
14662
+ "lock",
14663
+ "unlock",
14664
+ "arm",
14665
+ "arm-home",
14666
+ "arm-away",
14667
+ "arm-night",
14668
+ "disarm",
14669
+ "light",
14670
+ "alert",
14671
+ "camera"
14672
+ ]);
14673
+ /** A single tap-through action button. */
14674
+ var NotificationActionSchema = object({
14675
+ id: string(),
14676
+ label: string(),
14677
+ url: string().optional(),
14678
+ /** Dropped by the degrade engine for a kind with `caps.actionIcons: false`. */
14679
+ icon: NotificationActionIconSchema.optional(),
14680
+ /**
14681
+ * Renders in a warning style where the notifier supports it.
14682
+ *
14683
+ * A HINT, never a gate. The callback's authority is its token and nothing
14684
+ * else — see `notification-center/action-token.ts` for what that does and
14685
+ * does not buy.
14686
+ */
14687
+ destructive: boolean().optional(),
14688
+ /**
14689
+ * How the tap should REACH the url.
14690
+ *
14691
+ * `navigate` (absent, and every button authored before this field) opens it:
14692
+ * the phone leaves the notification and shows whatever the callback returns.
14693
+ * That is right for a button whose answer the operator wants to read.
14694
+ *
14695
+ * `background` fires it as a POST and stays put. It exists for the buttons
14696
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
14697
+ * an answer to the notification, and being thrown into a browser tab to
14698
+ * confirm it costs more attention than the notification did. A backend that
14699
+ * cannot do a background call renders it as an ordinary link (the adapters
14700
+ * fall back rather than dropping the button), so this is a preference, never
14701
+ * a requirement.
14702
+ */
14703
+ mode: _enum(["navigate", "background"]).optional()
14704
+ });
14705
+ /** A delivery parameter value: what a notifier declared it takes. */
14706
+ var DeliveryParamValueSchema = union([
14707
+ string(),
14708
+ number(),
14709
+ boolean()
14710
+ ]);
14711
+ /**
14712
+ * One extra delivery parameter a notifier KIND declares (D938). A rule that
14713
+ * addresses a target of that kind may set it; a kind that declares nothing is
14714
+ * never handed one. The admin UI derives its control from this descriptor —
14715
+ * no editor knows a service by name.
14716
+ *
14717
+ * Optional fields are `.optional()`, never `.default()` (a Zod default does not
14718
+ * run on the addon cap path).
14719
+ */
14720
+ var DeliveryParamSchema = object({
14721
+ key: string().min(1),
14722
+ label: string(),
14723
+ /** i18n key of the label, resolved by the declaring addon's namespace. */
14724
+ labelKey: string().optional(),
14725
+ type: _enum([
14726
+ "enum",
14727
+ "number",
14728
+ "boolean",
14729
+ "string"
14730
+ ]),
14731
+ /** `enum` only: the closed set of accepted values. */
14732
+ options: array(object({
14733
+ value: string(),
14734
+ label: string()
14735
+ })).optional(),
14736
+ /** `number` only. */
14737
+ min: number().optional(),
14738
+ max: number().optional(),
14739
+ /** What the notifier does when the rule sets nothing; shown as the placeholder. */
14740
+ default: DeliveryParamValueSchema.optional()
14741
+ });
14742
+ /**
14743
+ * The canonical notification. `body` is the only hard field (Apprise model).
14744
+ * `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
14745
+ * NOT a fixed severity enum — each kind declares its own `caps.levels` and
14746
+ * the adapter maps this ordinal onto its native level. `level?` is an
14747
+ * optional kind-native level id (`emergency`, `silent`, …) that overrides
14748
+ * `priority` for that one target.
14749
+ */
14750
+ var NotificationSchema = object({
14751
+ body: string(),
14752
+ title: string().optional(),
14753
+ format: NotificationFormatSchema.default("text"),
14754
+ priority: number().int().min(1).max(5).default(3),
14755
+ level: string().optional(),
14756
+ attachments: array(AttachmentSchema).optional(),
14757
+ clickUrl: string().optional(),
14758
+ actions: array(NotificationActionSchema).optional(),
14759
+ sound: string().optional(),
14760
+ ttl: number().optional(),
14761
+ tag: string().optional(),
14762
+ deviceId: number().optional(),
14763
+ eventId: string().optional(),
14764
+ metadata: record(string(), unknown()).optional(),
14765
+ /**
14766
+ * Values for the parameters the target's kind DECLARES in
14767
+ * {@link TargetKindSchema} `deliveryParams`. Already validated against the
14768
+ * declaration by the sender; a notifier reads only the keys it declared.
14769
+ */
14770
+ delivery: record(string(), DeliveryParamValueSchema).optional()
14771
+ });
14772
+ /** One declared native severity/priority level for a kind. */
14773
+ var TargetKindLevelSchema = object({
14774
+ id: string(),
14775
+ label: string(),
14776
+ /** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
14777
+ ordinal: number().int().min(1).max(5).nullable(),
14778
+ flags: object({
14779
+ critical: boolean().optional(),
14780
+ silent: boolean().optional(),
14781
+ noPush: boolean().optional()
14782
+ }).optional(),
14783
+ /** e.g. Pushover `emergency` requires `retry` / `expire`. */
14784
+ requires: array(string()).optional(),
14785
+ description: string().optional()
14786
+ });
14787
+ /** The full capability block consulted before dispatch. */
14788
+ var TargetKindCapsSchema = object({
14789
+ attachments: object({
14790
+ mediaTypes: array(AttachmentMediaTypeSchema),
14791
+ mode: _enum([
14792
+ "url",
14793
+ "bytes",
14794
+ "both"
14795
+ ]),
14796
+ max: number().int().nonnegative(),
14797
+ maxBytes: number().int().positive().optional()
14798
+ }),
14799
+ /** Max action buttons (0 = none). */
14800
+ actions: number().int().nonnegative(),
14801
+ /**
14802
+ * Whether this kind renders a per-action ICON.
14803
+ *
14804
+ * `.optional()`, deliberately NOT `.default(false)`: a Zod default does not
14805
+ * run on the addon cap path — three production failures in one day taught
14806
+ * this repo that once. Absent is read as false by the degrade engine, which
14807
+ * is the safe direction: an icon that is not rendered costs nothing, an icon
14808
+ * assumed and dropped costs the operator's trust in the field.
14809
+ */
14810
+ actionIcons: boolean().optional(),
14811
+ levels: array(TargetKindLevelSchema),
14812
+ format: array(NotificationFormatSchema),
14813
+ clickUrl: boolean(),
14814
+ sound: boolean(),
14815
+ ttl: boolean(),
14816
+ bodyMaxLen: number().int().positive()
14817
+ });
14818
+ /**
14819
+ * `configSchema` is a `ConfigUISchema` tree passed through to the admin
14820
+ * FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
14821
+ * `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
14822
+ * the union is large and not meant for runtime validation here; the exported
14823
+ * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
14824
+ */
14825
+ var ConfigSchemaPassthrough$3 = unknown();
14826
+ var TargetKindSchema = object({
14827
+ kind: string(),
14828
+ label: string(),
14829
+ icon: string(),
14830
+ /** Stamped by each provider so the concat-fanned catalog stays routable. */
14831
+ addonId: string(),
14832
+ /**
14833
+ * URL of the kind's bundled BRAND icon, served by the providing addon over
14834
+ * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
14835
+ * when the addon bundles no icon for that kind — the client then falls back
14836
+ * to a neutral glyph rather than rendering the raw `icon` NAME as text.
14837
+ *
14838
+ * Root-relative on purpose: it resolves against whatever origin serves a web
14839
+ * client, and a native client joins it onto its own hub base.
14840
+ *
14841
+ * DECLARED here deliberately. It used to travel as an undeclared passthrough
14842
+ * field that survived only because the runtime cap-router forwards provider
14843
+ * output verbatim — so every consumer had to re-declare it by hand to stop
14844
+ * its own Zod parse from stripping it, and the whole arrangement would have
14845
+ * broken silently the moment output validation was tightened anywhere.
14846
+ */
14847
+ iconUrl: string().optional(),
14848
+ /**
14849
+ * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
14850
+ *
14851
+ * The server knows this and therefore says it, because the client cannot
14852
+ * safely guess: a React-Native client renders SVG and raster through two
14853
+ * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
14854
+ * not decode SVG on iOS/Android), so without this it silently fell back to a
14855
+ * placeholder glyph for every vector icon while the web build looked fine.
14856
+ *
14857
+ * Absent when {@link iconUrl} is absent, or for a legacy provider that has
14858
+ * not been updated — a client that cannot determine the type should prefer
14859
+ * its raster path, which is the safe default for an unknown image.
14860
+ */
14861
+ iconMediaType: string().optional(),
14862
+ configSchema: ConfigSchemaPassthrough$3,
14863
+ /**
14864
+ * The config keys that decide WHERE this kind's secrets are sent (server,
14865
+ * base URL, instance, chat, recipient). A save that changes any of them
14866
+ * while leaving a secret redacted is refused by the provider (D634), so an
14867
+ * editor uses this to ask for the secret on exactly those edits instead of
14868
+ * on every edit.
14869
+ *
14870
+ * Optional: absent from a provider that holds no secret (the Home Assistant
14871
+ * kinds) and from a provider older than this field — an editor that finds
14872
+ * it absent must assume ANY edit may need the secret.
14873
+ */
14874
+ destinationKeys: array(string()).optional(),
14875
+ supportsDiscovery: boolean(),
14876
+ /**
14877
+ * Extra delivery parameters a rule may set for a target of this kind (D938).
14878
+ * Absent = none; the rule editor then offers nothing.
14879
+ */
14880
+ deliveryParams: array(DeliveryParamSchema).optional(),
14881
+ caps: TargetKindCapsSchema
14882
+ });
14883
+ /**
14884
+ * A target as a provider's own code sees it (the notification-center bridge, the
14885
+ * send path): the flat record body split into the name, the switch and the
14886
+ * kind's fields. `config` holds secrets; a reader that serves it to a client
14887
+ * REDACTS secret fields (a presence marker only) — never round-trip a stored
14888
+ * secret to the UI.
14889
+ */
14890
+ var TargetSchema = object({
14891
+ id: string(),
14892
+ name: string(),
14893
+ kind: string(),
14894
+ addonId: string(),
14895
+ enabled: boolean(),
14896
+ config: record(string(), unknown())
14897
+ });
14898
+ /** A discovery-surfaced candidate (config is partial + non-secret). */
14899
+ var DiscoveredTargetSchema = object({
14900
+ kind: string(),
14901
+ suggestedName: string(),
14902
+ config: record(string(), unknown())
14903
+ });
14904
+ /** The degrade engine's report — what was resolved / dropped / degraded. */
14905
+ var RenderedAsSchema = object({
14906
+ level: string(),
14907
+ format: NotificationFormatSchema,
14908
+ attachmentsSent: number().int().nonnegative(),
14909
+ actionsSent: number().int().nonnegative(),
14910
+ truncated: boolean(),
14911
+ dropped: array(string())
14912
+ });
14913
+ var SendResultSchema = object({
14914
+ success: boolean(),
14915
+ error: string().optional(),
14916
+ renderedAs: RenderedAsSchema.optional()
14917
+ });
14918
+ /** Same shape as SendResult — kept as a distinct name for the test panel. */
14919
+ var TestResultSchema = SendResultSchema;
14920
+ /**
14921
+ * Pre-save credential probe against a partial (unsaved) target config.
14922
+ * `resolvedUrl` never includes secrets (token stripped from path).
14923
+ */
14924
+ var ProbeTargetConfigResultSchema = object({
14925
+ ok: boolean(),
14926
+ resolvedUrl: string(),
14927
+ httpStatus: number().int().optional(),
14928
+ stateInstance: string().optional(),
14929
+ error: string().optional()
14930
+ });
14931
+ method(object({}), array(TargetKindSchema)), method(object({
14932
+ kind: string(),
14933
+ config: record(string(), unknown()).optional(),
14934
+ /**
14935
+ * When editing / duplicating, the blank password field never round-trips
14936
+ * the stored token. Pass the source target id so the provider can restore
14937
+ * secrets server-side before dialling.
14938
+ */
14939
+ targetId: string().optional()
14940
+ }), array(DiscoveredTargetSchema), { auth: "admin" }), method(object({
14941
+ kind: string(),
14942
+ config: record(string(), unknown()),
14943
+ /** See `discoverTargets.targetId` — restore stored secrets for a blank password. */
14944
+ targetId: string().optional()
14945
+ }), ProbeTargetConfigResultSchema, {
14946
+ kind: "mutation",
14947
+ auth: "admin"
14948
+ }), method(object({
14949
+ targetId: string(),
14950
+ notification: NotificationSchema
14951
+ }), SendResultSchema, {
14952
+ kind: "mutation",
14953
+ auth: "admin"
14954
+ }), method(object({
14955
+ targetId: string(),
14956
+ sample: NotificationSchema.optional()
14957
+ }), TestResultSchema, {
14958
+ kind: "mutation",
14959
+ auth: "admin"
14960
+ });
14961
+ looseObject({
14962
+ name: string().min(1),
14963
+ enabled: boolean().optional()
14964
+ });
14965
+ TargetSchema.omit({ id: true });
14002
14966
  var EncodeProfileSchema = object({
14003
14967
  video: object({
14004
14968
  codec: _enum([
@@ -22849,7 +23813,6 @@ var SYSTEM_CAP_VOCABULARY = {
22849
23813
  "calendar-source": system(INTERNAL),
22850
23814
  calendars: system("calendars feed schedules and conditions, not device actions"),
22851
23815
  composer: system("device composition — an authoring tool, not an action"),
22852
- "connection-test": system(INTERNAL),
22853
23816
  "core-blocks": system(INTERNAL),
22854
23817
  "custom-model-registry": system(ML),
22855
23818
  "data-store-provider": system(INTERNAL),
@@ -22894,7 +23857,6 @@ var SYSTEM_CAP_VOCABULARY = {
22894
23857
  "notification-output": system("notification delivery — reached through notifier devices and rules"),
22895
23858
  "notification-rules": system("notification rules — authored on their own page"),
22896
23859
  "oauth-integration": system(IDENTITY),
22897
- "oidc-connections": system(IDENTITY),
22898
23860
  "osd-manager": system(PIPELINE),
22899
23861
  "pipeline-executor": system(PIPELINE),
22900
23862
  "pipeline-orchestrator": system(PIPELINE),
@@ -42915,6 +43877,7 @@ var ExpressionBindingSourceSchema = union([
42915
43877
  object({
42916
43878
  kind: literal("global"),
42917
43879
  sourceStableId: string(),
43880
+ addonId: string().optional(),
42918
43881
  cap: string(),
42919
43882
  fieldPath: string()
42920
43883
  })
@@ -43041,385 +44004,6 @@ function extractSourceInfoFromMetadata(metadata) {
43041
44004
  return parsed.data;
43042
44005
  }
43043
44006
  /**
43044
- * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
43045
- * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
43046
- * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
43047
- * decimals). K derives from `°C = K − 273.15`.
43048
- */
43049
- var UNIT_TABLE = {
43050
- "°C": {
43051
- dimension: "temperature",
43052
- factor: 1,
43053
- offset: 0
43054
- },
43055
- "°F": {
43056
- dimension: "temperature",
43057
- factor: 5 / 9,
43058
- offset: -160 / 9
43059
- },
43060
- K: {
43061
- dimension: "temperature",
43062
- factor: 1,
43063
- offset: -273.15
43064
- },
43065
- hPa: {
43066
- dimension: "pressure",
43067
- factor: 1,
43068
- offset: 0
43069
- },
43070
- kPa: {
43071
- dimension: "pressure",
43072
- factor: 10,
43073
- offset: 0
43074
- },
43075
- Pa: {
43076
- dimension: "pressure",
43077
- factor: .01,
43078
- offset: 0
43079
- },
43080
- mbar: {
43081
- dimension: "pressure",
43082
- factor: 1,
43083
- offset: 0
43084
- },
43085
- bar: {
43086
- dimension: "pressure",
43087
- factor: 1e3,
43088
- offset: 0
43089
- },
43090
- inHg: {
43091
- dimension: "pressure",
43092
- factor: 33.8639,
43093
- offset: 0
43094
- },
43095
- mmHg: {
43096
- dimension: "pressure",
43097
- factor: 1.33322,
43098
- offset: 0
43099
- },
43100
- psi: {
43101
- dimension: "pressure",
43102
- factor: 68.9476,
43103
- offset: 0
43104
- },
43105
- "m/s": {
43106
- dimension: "speed",
43107
- factor: 1,
43108
- offset: 0
43109
- },
43110
- "km/h": {
43111
- dimension: "speed",
43112
- factor: 1 / 3.6,
43113
- offset: 0
43114
- },
43115
- mph: {
43116
- dimension: "speed",
43117
- factor: .44704,
43118
- offset: 0
43119
- },
43120
- kn: {
43121
- dimension: "speed",
43122
- factor: .514444,
43123
- offset: 0
43124
- },
43125
- "mm/h": {
43126
- dimension: "precipitation-rate",
43127
- factor: 1,
43128
- offset: 0
43129
- },
43130
- "in/h": {
43131
- dimension: "precipitation-rate",
43132
- factor: 25.4,
43133
- offset: 0
43134
- },
43135
- m: {
43136
- dimension: "length",
43137
- factor: 1,
43138
- offset: 0
43139
- },
43140
- mm: {
43141
- dimension: "length",
43142
- factor: .001,
43143
- offset: 0
43144
- },
43145
- cm: {
43146
- dimension: "length",
43147
- factor: .01,
43148
- offset: 0
43149
- },
43150
- km: {
43151
- dimension: "length",
43152
- factor: 1e3,
43153
- offset: 0
43154
- },
43155
- in: {
43156
- dimension: "length",
43157
- factor: .0254,
43158
- offset: 0
43159
- },
43160
- ft: {
43161
- dimension: "length",
43162
- factor: .3048,
43163
- offset: 0
43164
- },
43165
- mi: {
43166
- dimension: "length",
43167
- factor: 1609.344,
43168
- offset: 0
43169
- },
43170
- "m²": {
43171
- dimension: "area",
43172
- factor: 1,
43173
- offset: 0
43174
- },
43175
- lx: {
43176
- dimension: "illuminance",
43177
- factor: 1,
43178
- offset: 0
43179
- },
43180
- "W/m²": {
43181
- dimension: "irradiance",
43182
- factor: 1,
43183
- offset: 0
43184
- },
43185
- W: {
43186
- dimension: "power",
43187
- factor: 1,
43188
- offset: 0
43189
- },
43190
- kW: {
43191
- dimension: "power",
43192
- factor: 1e3,
43193
- offset: 0
43194
- },
43195
- VA: {
43196
- dimension: "apparent-power",
43197
- factor: 1,
43198
- offset: 0
43199
- },
43200
- Wh: {
43201
- dimension: "energy",
43202
- factor: 1,
43203
- offset: 0
43204
- },
43205
- kWh: {
43206
- dimension: "energy",
43207
- factor: 1e3,
43208
- offset: 0
43209
- },
43210
- MWh: {
43211
- dimension: "energy",
43212
- factor: 1e6,
43213
- offset: 0
43214
- },
43215
- V: {
43216
- dimension: "voltage",
43217
- factor: 1,
43218
- offset: 0
43219
- },
43220
- mV: {
43221
- dimension: "voltage",
43222
- factor: .001,
43223
- offset: 0
43224
- },
43225
- A: {
43226
- dimension: "current",
43227
- factor: 1,
43228
- offset: 0
43229
- },
43230
- mA: {
43231
- dimension: "current",
43232
- factor: .001,
43233
- offset: 0
43234
- },
43235
- ppm: {
43236
- dimension: "concentration-volume",
43237
- factor: 1,
43238
- offset: 0
43239
- },
43240
- ppb: {
43241
- dimension: "concentration-volume",
43242
- factor: .001,
43243
- offset: 0
43244
- },
43245
- "µg/m³": {
43246
- dimension: "concentration-mass",
43247
- factor: 1,
43248
- offset: 0
43249
- },
43250
- "mg/m³": {
43251
- dimension: "concentration-mass",
43252
- factor: 1e3,
43253
- offset: 0
43254
- },
43255
- kg: {
43256
- dimension: "mass",
43257
- factor: 1,
43258
- offset: 0
43259
- },
43260
- g: {
43261
- dimension: "mass",
43262
- factor: .001,
43263
- offset: 0
43264
- },
43265
- lb: {
43266
- dimension: "mass",
43267
- factor: .453592,
43268
- offset: 0
43269
- },
43270
- oz: {
43271
- dimension: "mass",
43272
- factor: .0283495,
43273
- offset: 0
43274
- },
43275
- "%": {
43276
- dimension: "percentage",
43277
- factor: 1,
43278
- offset: 0
43279
- },
43280
- L: {
43281
- dimension: "volume",
43282
- factor: 1,
43283
- offset: 0
43284
- },
43285
- mL: {
43286
- dimension: "volume",
43287
- factor: .001,
43288
- offset: 0
43289
- },
43290
- gal: {
43291
- dimension: "volume",
43292
- factor: 3.785411784,
43293
- offset: 0
43294
- },
43295
- s: {
43296
- dimension: "duration",
43297
- factor: 1,
43298
- offset: 0
43299
- },
43300
- ms: {
43301
- dimension: "duration",
43302
- factor: .001,
43303
- offset: 0
43304
- },
43305
- min: {
43306
- dimension: "duration",
43307
- factor: 60,
43308
- offset: 0
43309
- },
43310
- h: {
43311
- dimension: "duration",
43312
- factor: 3600,
43313
- offset: 0
43314
- },
43315
- d: {
43316
- dimension: "duration",
43317
- factor: 86400,
43318
- offset: 0
43319
- },
43320
- B: {
43321
- dimension: "information",
43322
- factor: 1,
43323
- offset: 0
43324
- },
43325
- KiB: {
43326
- dimension: "information",
43327
- factor: 1024,
43328
- offset: 0
43329
- },
43330
- MiB: {
43331
- dimension: "information",
43332
- factor: 1024 ** 2,
43333
- offset: 0
43334
- },
43335
- GiB: {
43336
- dimension: "information",
43337
- factor: 1024 ** 3,
43338
- offset: 0
43339
- },
43340
- TiB: {
43341
- dimension: "information",
43342
- factor: 1024 ** 4,
43343
- offset: 0
43344
- },
43345
- kB: {
43346
- dimension: "information",
43347
- factor: 1e3,
43348
- offset: 0
43349
- },
43350
- MB: {
43351
- dimension: "information",
43352
- factor: 1e6,
43353
- offset: 0
43354
- },
43355
- GB: {
43356
- dimension: "information",
43357
- factor: 1e9,
43358
- offset: 0
43359
- },
43360
- "°": {
43361
- dimension: "angle",
43362
- factor: 1,
43363
- offset: 0
43364
- },
43365
- dBFS: {
43366
- dimension: "sound-level",
43367
- factor: 1,
43368
- offset: 0
43369
- },
43370
- dBm: {
43371
- dimension: "signal-level",
43372
- factor: 1,
43373
- offset: 0
43374
- },
43375
- mired: {
43376
- dimension: "colour-temperature",
43377
- factor: 1,
43378
- offset: 0
43379
- },
43380
- kbps: {
43381
- dimension: "bitrate",
43382
- factor: 1,
43383
- offset: 0
43384
- },
43385
- Mbps: {
43386
- dimension: "bitrate",
43387
- factor: 1e3,
43388
- offset: 0
43389
- },
43390
- fps: {
43391
- dimension: "rate",
43392
- factor: 1,
43393
- offset: 0
43394
- }
43395
- };
43396
- /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
43397
- function specFor(unit) {
43398
- return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
43399
- }
43400
- /** Value in `spec`'s unit → its dimension's canonical unit. */
43401
- function toCanonical(value, spec) {
43402
- return value * spec.factor + spec.offset;
43403
- }
43404
- /** Canonical-unit value → the unit described by `spec`. */
43405
- function fromCanonical(canonical, spec) {
43406
- return (canonical - spec.offset) / spec.factor;
43407
- }
43408
- /**
43409
- * Graceful variant for the render path: returns the converted value, or
43410
- * `undefined` when the conversion is refused (unknown unit / cross-dimension).
43411
- * Never throws — a render caller falls back to the raw value + source unit.
43412
- */
43413
- function tryConvertUnit(value, from, to) {
43414
- if (from === to) return value;
43415
- const fromSpec = specFor(from);
43416
- if (!fromSpec) return void 0;
43417
- const toSpec = specFor(to);
43418
- if (!toSpec) return void 0;
43419
- if (fromSpec.dimension !== toSpec.dimension) return void 0;
43420
- return fromCanonical(toCanonical(value, fromSpec), toSpec);
43421
- }
43422
- /**
43423
44007
  * A number a person types for a physical quantity — the input side of the
43424
44008
  * value + unit contract (D972).
43425
44009
  *
@@ -44826,427 +45410,6 @@ var UnitWarningSchema = object({
44826
45410
  assumedUnit: string(),
44827
45411
  message: string()
44828
45412
  });
44829
- /**
44830
- * notification-output — canonical, capability-gated notification delivery.
44831
- *
44832
- * Apprise-derived model (see
44833
- * `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
44834
- * callers emit ONE canonical `Notification`; each provider declares a
44835
- * per-kind capability descriptor (`TargetKind`), and the pure degrade
44836
- * engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
44837
- * message to what the kind supports — callers never special-case a service.
44838
- *
44839
- * DESIGN DECISIONS (locked):
44840
- * - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
44841
- * `setTargetEnabled`), each provider persisting via the `settings-store`
44842
- * cap. Rationale: the admin UI needs one uniform surface across the
44843
- * notifiers addon AND the HA addon; the addon-`globalSettingsSchema`-array
44844
- * alternative would fork the UI per addon and cannot host the
44845
- * discovery→adopt flow.
44846
- * - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
44847
- * the generated cap-mount auto-`concatCollection`-fans them across every
44848
- * registered provider (notifiers addon + HA addon) so one catalog is
44849
- * routable. `send` / `testTarget` / CRUD route to ONE provider by the
44850
- * `addonId` the generated collection router extracts from the call input.
44851
- * - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
44852
- * transformer) + UDS MsgPack both round-trip typed arrays — already used by
44853
- * `storage` / `storage-provider` / `recording` caps over the same path. No
44854
- * base64 fallback needed.
44855
- *
44856
- * TODO (deferred, closed-set change — separate decision): add
44857
- * `providerKind: 'notify'` so notification providers surface on the unified
44858
- * admin "Integrations" page.
44859
- */
44860
- /**
44861
- * Zentik-derived typed-media enum — the superset across every kind. Each
44862
- * adapter picks what it supports and the degrade engine filters the rest.
44863
- */
44864
- var AttachmentMediaTypeSchema = _enum([
44865
- "image",
44866
- "video",
44867
- "gif",
44868
- "audio",
44869
- "icon"
44870
- ]);
44871
- /**
44872
- * A single attachment. Exactly one of `url` (remote source, most adapters
44873
- * prefer this) or `bytes` (inline source; required for Pushover-style
44874
- * bytes-only kinds) MUST be present — the degrade engine expresses a
44875
- * url→bytes fetch as a `needsFetch` directive the adapter executes.
44876
- */
44877
- var AttachmentSchema = object({
44878
- mediaType: AttachmentMediaTypeSchema,
44879
- url: string().optional(),
44880
- bytes: _instanceof(Uint8Array).optional(),
44881
- mime: string().optional(),
44882
- name: string().optional()
44883
- }).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
44884
- var NotificationFormatSchema = _enum([
44885
- "text",
44886
- "markdown",
44887
- "html"
44888
- ]);
44889
- /**
44890
- * The CLOSED icon vocabulary an action button may use.
44891
- *
44892
- * A closed set, not a free string, and that is the whole point: an arbitrary
44893
- * icon name is one that ntfy renders, zentik silently drops, and nobody
44894
- * notices — the same class of gap as a zone vocabulary nothing produced
44895
- * ([D35](../../../docs/decisions/adr-0035.md)). Every adapter maps this set or
44896
- * declares `actionIcons: false` and the degrade engine strips the field.
44897
- *
44898
- * Named by INTENT, never by glyph. "check" would tie the vocabulary to one
44899
- * renderer's icon set; "acknowledge" survives an adapter that draws it
44900
- * differently.
44901
- *
44902
- * ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
44903
- *
44904
- * These names are for US. **No adapter may forward one verbatim.** Each maps
44905
- * the whole set onto its own renderer's vocabulary through a
44906
- * `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
44907
- * fallback, so adding a member here fails every adapter's build until someone
44908
- * decides its glyph, which is the only place that decision can be made
44909
- * honestly.
44910
- *
44911
- * This paragraph is the bug. Zentik declared `actionIcons: true` and passed
44912
- * `disarm` straight through; iOS feeds that string to
44913
- * `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
44914
- * and every snooze and alarm button arrived BLANK. A pass-through is not a
44915
- * mapping, and "the field is documented" is not "the value renders".
44916
- *
44917
- * Adding a member is TRAIN-BOUND. The enum lives in the published
44918
- * `@camstack/server` closure and the cap seam validates against the HUB's copy,
44919
- * so an addon that emits a token the running hub does not know does not lose an
44920
- * icon — its whole `send` fails Zod validation and the notification never
44921
- * arrives. Never emit a new token from an addon before the train carrying it.
44922
- */
44923
- var NotificationActionIconSchema = _enum([
44924
- "acknowledge",
44925
- "dismiss",
44926
- "silence",
44927
- "snooze",
44928
- "view",
44929
- "play",
44930
- "open",
44931
- "close",
44932
- "lock",
44933
- "unlock",
44934
- "arm",
44935
- "arm-home",
44936
- "arm-away",
44937
- "arm-night",
44938
- "disarm",
44939
- "light",
44940
- "alert",
44941
- "camera"
44942
- ]);
44943
- /** A single tap-through action button. */
44944
- var NotificationActionSchema = object({
44945
- id: string(),
44946
- label: string(),
44947
- url: string().optional(),
44948
- /** Dropped by the degrade engine for a kind with `caps.actionIcons: false`. */
44949
- icon: NotificationActionIconSchema.optional(),
44950
- /**
44951
- * Renders in a warning style where the notifier supports it.
44952
- *
44953
- * A HINT, never a gate. The callback's authority is its token and nothing
44954
- * else — see `notification-center/action-token.ts` for what that does and
44955
- * does not buy.
44956
- */
44957
- destructive: boolean().optional(),
44958
- /**
44959
- * How the tap should REACH the url.
44960
- *
44961
- * `navigate` (absent, and every button authored before this field) opens it:
44962
- * the phone leaves the notification and shows whatever the callback returns.
44963
- * That is right for a button whose answer the operator wants to read.
44964
- *
44965
- * `background` fires it as a POST and stays put. It exists for the buttons
44966
- * whose whole point is not to interrupt — "silence this for 30 minutes" is
44967
- * an answer to the notification, and being thrown into a browser tab to
44968
- * confirm it costs more attention than the notification did. A backend that
44969
- * cannot do a background call renders it as an ordinary link (the adapters
44970
- * fall back rather than dropping the button), so this is a preference, never
44971
- * a requirement.
44972
- */
44973
- mode: _enum(["navigate", "background"]).optional()
44974
- });
44975
- /** A delivery parameter value: what a notifier declared it takes. */
44976
- var DeliveryParamValueSchema = union([
44977
- string(),
44978
- number(),
44979
- boolean()
44980
- ]);
44981
- /**
44982
- * One extra delivery parameter a notifier KIND declares (D938). A rule that
44983
- * addresses a target of that kind may set it; a kind that declares nothing is
44984
- * never handed one. The admin UI derives its control from this descriptor —
44985
- * no editor knows a service by name.
44986
- *
44987
- * Optional fields are `.optional()`, never `.default()` (a Zod default does not
44988
- * run on the addon cap path).
44989
- */
44990
- var DeliveryParamSchema = object({
44991
- key: string().min(1),
44992
- label: string(),
44993
- /** i18n key of the label, resolved by the declaring addon's namespace. */
44994
- labelKey: string().optional(),
44995
- type: _enum([
44996
- "enum",
44997
- "number",
44998
- "boolean",
44999
- "string"
45000
- ]),
45001
- /** `enum` only: the closed set of accepted values. */
45002
- options: array(object({
45003
- value: string(),
45004
- label: string()
45005
- })).optional(),
45006
- /** `number` only. */
45007
- min: number().optional(),
45008
- max: number().optional(),
45009
- /** What the notifier does when the rule sets nothing; shown as the placeholder. */
45010
- default: DeliveryParamValueSchema.optional()
45011
- });
45012
- /**
45013
- * The canonical notification. `body` is the only hard field (Apprise model).
45014
- * `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
45015
- * NOT a fixed severity enum — each kind declares its own `caps.levels` and
45016
- * the adapter maps this ordinal onto its native level. `level?` is an
45017
- * optional kind-native level id (`emergency`, `silent`, …) that overrides
45018
- * `priority` for that one target.
45019
- */
45020
- var NotificationSchema = object({
45021
- body: string(),
45022
- title: string().optional(),
45023
- format: NotificationFormatSchema.default("text"),
45024
- priority: number().int().min(1).max(5).default(3),
45025
- level: string().optional(),
45026
- attachments: array(AttachmentSchema).optional(),
45027
- clickUrl: string().optional(),
45028
- actions: array(NotificationActionSchema).optional(),
45029
- sound: string().optional(),
45030
- ttl: number().optional(),
45031
- tag: string().optional(),
45032
- deviceId: number().optional(),
45033
- eventId: string().optional(),
45034
- metadata: record(string(), unknown()).optional(),
45035
- /**
45036
- * Values for the parameters the target's kind DECLARES in
45037
- * {@link TargetKindSchema} `deliveryParams`. Already validated against the
45038
- * declaration by the sender; a notifier reads only the keys it declared.
45039
- */
45040
- delivery: record(string(), DeliveryParamValueSchema).optional()
45041
- });
45042
- /** One declared native severity/priority level for a kind. */
45043
- var TargetKindLevelSchema = object({
45044
- id: string(),
45045
- label: string(),
45046
- /** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
45047
- ordinal: number().int().min(1).max(5).nullable(),
45048
- flags: object({
45049
- critical: boolean().optional(),
45050
- silent: boolean().optional(),
45051
- noPush: boolean().optional()
45052
- }).optional(),
45053
- /** e.g. Pushover `emergency` requires `retry` / `expire`. */
45054
- requires: array(string()).optional(),
45055
- description: string().optional()
45056
- });
45057
- /** The full capability block consulted before dispatch. */
45058
- var TargetKindCapsSchema = object({
45059
- attachments: object({
45060
- mediaTypes: array(AttachmentMediaTypeSchema),
45061
- mode: _enum([
45062
- "url",
45063
- "bytes",
45064
- "both"
45065
- ]),
45066
- max: number().int().nonnegative(),
45067
- maxBytes: number().int().positive().optional()
45068
- }),
45069
- /** Max action buttons (0 = none). */
45070
- actions: number().int().nonnegative(),
45071
- /**
45072
- * Whether this kind renders a per-action ICON.
45073
- *
45074
- * `.optional()`, deliberately NOT `.default(false)`: a Zod default does not
45075
- * run on the addon cap path — three production failures in one day taught
45076
- * this repo that once. Absent is read as false by the degrade engine, which
45077
- * is the safe direction: an icon that is not rendered costs nothing, an icon
45078
- * assumed and dropped costs the operator's trust in the field.
45079
- */
45080
- actionIcons: boolean().optional(),
45081
- levels: array(TargetKindLevelSchema),
45082
- format: array(NotificationFormatSchema),
45083
- clickUrl: boolean(),
45084
- sound: boolean(),
45085
- ttl: boolean(),
45086
- bodyMaxLen: number().int().positive()
45087
- });
45088
- /**
45089
- * `configSchema` is a `ConfigUISchema` tree passed through to the admin
45090
- * FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
45091
- * `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
45092
- * the union is large and not meant for runtime validation here; the exported
45093
- * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
45094
- */
45095
- var ConfigSchemaPassthrough$4 = unknown();
45096
- var TargetKindSchema = object({
45097
- kind: string(),
45098
- label: string(),
45099
- icon: string(),
45100
- /** Stamped by each provider so the concat-fanned catalog stays routable. */
45101
- addonId: string(),
45102
- /**
45103
- * URL of the kind's bundled BRAND icon, served by the providing addon over
45104
- * its own `addon-routes` surface (`/addon/<addonId>/icons/<kind>`). Absent
45105
- * when the addon bundles no icon for that kind — the client then falls back
45106
- * to a neutral glyph rather than rendering the raw `icon` NAME as text.
45107
- *
45108
- * Root-relative on purpose: it resolves against whatever origin serves a web
45109
- * client, and a native client joins it onto its own hub base.
45110
- *
45111
- * DECLARED here deliberately. It used to travel as an undeclared passthrough
45112
- * field that survived only because the runtime cap-router forwards provider
45113
- * output verbatim — so every consumer had to re-declare it by hand to stop
45114
- * its own Zod parse from stripping it, and the whole arrangement would have
45115
- * broken silently the moment output validation was tightened anywhere.
45116
- */
45117
- iconUrl: string().optional(),
45118
- /**
45119
- * Media type of {@link iconUrl} (`image/svg+xml`, `image/png`, …).
45120
- *
45121
- * The server knows this and therefore says it, because the client cannot
45122
- * safely guess: a React-Native client renders SVG and raster through two
45123
- * DIFFERENT components (`react-native-svg` vs `expo-image` — expo-image does
45124
- * not decode SVG on iOS/Android), so without this it silently fell back to a
45125
- * placeholder glyph for every vector icon while the web build looked fine.
45126
- *
45127
- * Absent when {@link iconUrl} is absent, or for a legacy provider that has
45128
- * not been updated — a client that cannot determine the type should prefer
45129
- * its raster path, which is the safe default for an unknown image.
45130
- */
45131
- iconMediaType: string().optional(),
45132
- configSchema: ConfigSchemaPassthrough$4,
45133
- /**
45134
- * The config keys that decide WHERE this kind's secrets are sent (server,
45135
- * base URL, instance, chat, recipient). A save that changes any of them
45136
- * while leaving a secret redacted is refused by the provider (D634), so an
45137
- * editor uses this to ask for the secret on exactly those edits instead of
45138
- * on every edit.
45139
- *
45140
- * Optional: absent from a provider that holds no secret (the Home Assistant
45141
- * kinds) and from a provider older than this field — an editor that finds
45142
- * it absent must assume ANY edit may need the secret.
45143
- */
45144
- destinationKeys: array(string()).optional(),
45145
- supportsDiscovery: boolean(),
45146
- /**
45147
- * Extra delivery parameters a rule may set for a target of this kind (D938).
45148
- * Absent = none; the rule editor then offers nothing.
45149
- */
45150
- deliveryParams: array(DeliveryParamSchema).optional(),
45151
- caps: TargetKindCapsSchema
45152
- });
45153
- /**
45154
- * A persisted target. `config` holds secrets; providers REDACT secret fields
45155
- * (return a presence marker only) when serving `listTargets` — never
45156
- * round-trip a stored secret to the UI.
45157
- */
45158
- var TargetSchema = object({
45159
- id: string(),
45160
- name: string(),
45161
- kind: string(),
45162
- addonId: string(),
45163
- enabled: boolean(),
45164
- config: record(string(), unknown())
45165
- });
45166
- /** A discovery-surfaced candidate (config is partial + non-secret). */
45167
- var DiscoveredTargetSchema = object({
45168
- kind: string(),
45169
- suggestedName: string(),
45170
- config: record(string(), unknown())
45171
- });
45172
- /** The degrade engine's report — what was resolved / dropped / degraded. */
45173
- var RenderedAsSchema = object({
45174
- level: string(),
45175
- format: NotificationFormatSchema,
45176
- attachmentsSent: number().int().nonnegative(),
45177
- actionsSent: number().int().nonnegative(),
45178
- truncated: boolean(),
45179
- dropped: array(string())
45180
- });
45181
- var SendResultSchema = object({
45182
- success: boolean(),
45183
- error: string().optional(),
45184
- renderedAs: RenderedAsSchema.optional()
45185
- });
45186
- /** Same shape as SendResult — kept as a distinct name for the test panel. */
45187
- var TestResultSchema = SendResultSchema;
45188
- /**
45189
- * Pre-save credential probe against a partial (unsaved) target config.
45190
- * `resolvedUrl` never includes secrets (token stripped from path).
45191
- */
45192
- var ProbeTargetConfigResultSchema = object({
45193
- ok: boolean(),
45194
- resolvedUrl: string(),
45195
- httpStatus: number().int().optional(),
45196
- stateInstance: string().optional(),
45197
- error: string().optional()
45198
- });
45199
- method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSchema), { auth: "admin" }), method(object({ targetId: string() }), TargetSchema, { auth: "admin" }), method(object({
45200
- kind: string(),
45201
- config: record(string(), unknown()).optional(),
45202
- /**
45203
- * When editing / duplicating, the blank password field never round-trips
45204
- * the stored token. Pass the source target id so the provider can restore
45205
- * secrets server-side before dialling (same merge as upsert).
45206
- */
45207
- targetId: string().optional()
45208
- }), array(DiscoveredTargetSchema), { auth: "admin" }), method(object({
45209
- kind: string(),
45210
- config: record(string(), unknown()),
45211
- /** See `discoverTargets.targetId` — restore stored secrets for a blank password. */
45212
- targetId: string().optional()
45213
- }), ProbeTargetConfigResultSchema, {
45214
- kind: "mutation",
45215
- auth: "admin"
45216
- }), method(object({
45217
- targetId: string(),
45218
- notification: NotificationSchema
45219
- }), SendResultSchema, {
45220
- kind: "mutation",
45221
- auth: "admin"
45222
- }), method(object({
45223
- targetId: string(),
45224
- sample: NotificationSchema.optional()
45225
- }), TestResultSchema, {
45226
- kind: "mutation",
45227
- auth: "admin"
45228
- }), method(object({
45229
- target: TargetSchema,
45230
- /**
45231
- * Duplicate flow: create a NEW target id while copying secrets from an
45232
- * existing row. The UI never holds the stored token; blank / redacted
45233
- * password fields are restored from this source (D634 still applies if
45234
- * destinations diverge without a re-typed secret).
45235
- */
45236
- cloneSecretsFrom: string().optional()
45237
- }), TargetSchema, {
45238
- kind: "mutation",
45239
- auth: "admin"
45240
- }), method(object({ targetId: string() }), _void(), {
45241
- kind: "mutation",
45242
- auth: "admin"
45243
- }), method(object({
45244
- targetId: string(),
45245
- enabled: boolean()
45246
- }), _void(), {
45247
- kind: "mutation",
45248
- auth: "admin"
45249
- });
45250
45413
  _enum([
45251
45414
  "automation",
45252
45415
  "action",
@@ -45517,15 +45680,28 @@ var SettingsSchemaWithValuesSchema = object({
45517
45680
  });
45518
45681
  /** Patch object — keys are field names, values are the new field values. */
45519
45682
  var SettingsPatchSchema = record(string(), unknown());
45683
+ /** The scope of a scoped-settings call (D986): where the capability declared the values. */
45684
+ var ScopedSettingsScopeSchema = _enum(SCOPED_SETTINGS_SCOPES);
45685
+ /** One scoped schema an addon serves: its capability, scope and section ids. */
45686
+ var ScopedSettingsDeclarationSchema = object({
45687
+ cap: string(),
45688
+ scope: ScopedSettingsScopeSchema,
45689
+ sectionIds: array(string())
45690
+ });
45520
45691
  /** Standard success response for update operations. */
45521
45692
  var SettingsUpdateResultSchema = object({ success: literal(true) });
45522
45693
  method(object({
45523
45694
  addonId: string(),
45524
- nodeId: string().optional(),
45525
- overlay: record(string(), unknown()).optional(),
45526
- cap: string().optional()
45695
+ cap: string(),
45696
+ scope: ScopedSettingsScopeSchema,
45697
+ nodeId: string().optional()
45527
45698
  }), SettingsSchemaWithValuesSchema.nullable()), method(object({
45528
45699
  addonId: string(),
45700
+ nodeId: string().optional()
45701
+ }), array(ScopedSettingsDeclarationSchema).nullable()), method(object({
45702
+ addonId: string(),
45703
+ cap: string(),
45704
+ scope: ScopedSettingsScopeSchema,
45529
45705
  nodeId: string().optional(),
45530
45706
  patch: SettingsPatchSchema
45531
45707
  }), SettingsUpdateResultSchema, {
@@ -45533,8 +45709,10 @@ method(object({
45533
45709
  auth: "admin"
45534
45710
  }), method(object({
45535
45711
  addonId: string(),
45712
+ cap: string(),
45713
+ scope: ScopedSettingsScopeSchema,
45536
45714
  nodeId: string().optional()
45537
- }), SettingsSchemaWithValuesSchema.nullable()), method(object({
45715
+ }), record(string(), unknown()).nullable()), method(object({
45538
45716
  addonId: string(),
45539
45717
  nodeId: string().optional(),
45540
45718
  instance: IntegrationInstanceRefSchema
@@ -47097,7 +47275,7 @@ var BackupDestinationInfoSchema = object({
47097
47275
  id: string(),
47098
47276
  /**
47099
47277
  * Manifest id of the owning addon. The Settings button on the
47100
- * destination card opens that addon's `globalSettingsSchema` panel.
47278
+ * destination card opens that addon's scoped settings panel.
47101
47279
  */
47102
47280
  addonId: string(),
47103
47281
  /** Operator-toggled enable flag from the destination-policy table. */
@@ -49786,37 +49964,6 @@ method(object({
49786
49964
  kind: "mutation",
49787
49965
  auth: "admin"
49788
49966
  }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
49789
- var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
49790
- object({
49791
- outcome: literal("validated"),
49792
- /** Round-trip of the sign-in, when the provider measured it. */
49793
- latencyMs: number().nonnegative().optional(),
49794
- /** Optional human detail worth showing next to the tick
49795
- * ("3 devices visible on this account"). */
49796
- detail: string().optional()
49797
- }).strict(),
49798
- object({
49799
- outcome: literal("rejected"),
49800
- error: string()
49801
- }).strict(),
49802
- object({
49803
- outcome: literal("inconclusive"),
49804
- error: string()
49805
- }).strict()
49806
- ]);
49807
- var ConnectionTestInputSchema = object({
49808
- /** Candidate integration settings, exactly as the create form collected them. */
49809
- settings: record(string(), unknown()) });
49810
- /**
49811
- * What the provider's test actually DOES, so the UI can say it in words before
49812
- * the operator presses the button ("Signs in to the Dreo cloud"). Purely
49813
- * descriptive — it never changes routing.
49814
- */
49815
- var ConnectionTestDescriptorSchema = object({ label: string() });
49816
- method(ConnectionTestInputSchema, ConnectionTestOutcomeSchema, {
49817
- kind: "mutation",
49818
- auth: "admin"
49819
- }), method(_void(), ConnectionTestDescriptorSchema, { auth: "admin" });
49820
49967
  /**
49821
49968
  * Upstream-system connectivity sensor — distinct from `device-status`,
49822
49969
  * which is the kernel-managed online/offline flag for the device's
@@ -50542,7 +50689,7 @@ var mediaPlayerCapability = {
50542
50689
  isMuted: { kind: "boolean" }
50543
50690
  } }
50544
50691
  };
50545
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater;
50692
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.MediaPlayer;
50546
50693
  var NUMBER = {
50547
50694
  kind: "fixed",
50548
50695
  result: ["number"]
@@ -52564,6 +52711,7 @@ method(InstancePinSchema, DeviceExportStatusSchema), method(_void(), array(Expor
52564
52711
  kind: "mutation",
52565
52712
  auth: "admin"
52566
52713
  });
52714
+ var DeviceAliasSchema = string().max(64).regex(/^[a-z][a-z0-9_]*$/);
52567
52715
  /**
52568
52716
  * A SITE ZONE — a named part of the property that several locations belong to.
52569
52717
  *
@@ -53050,6 +53198,12 @@ var DeviceInfoSchema = object({
53050
53198
  addonId: string(),
53051
53199
  type: _enum(DeviceType),
53052
53200
  name: string(),
53201
+ /** The name a value template uses for this device (`{{ stufa_veranda.temperature }}`),
53202
+ * entity_id style. Generated once from the name at first registration, unique
53203
+ * cluster-wide, editable through `setAlias`, NOT changed by a rename (D1021).
53204
+ * Optional: a record produced by an older build omits it until the boot
53205
+ * backfill has run. */
53206
+ alias: DeviceAliasSchema.optional(),
53053
53207
  /** Operator-organisational location label. `null` when unset. */
53054
53208
  location: string().nullable(),
53055
53209
  /** Soft-disabled flag. */
@@ -53369,6 +53523,25 @@ method(object({
53369
53523
  }), _void(), {
53370
53524
  kind: "mutation",
53371
53525
  auth: "admin"
53526
+ }), method(object({
53527
+ deviceId: number(),
53528
+ alias: string()
53529
+ }), discriminatedUnion("ok", [object({
53530
+ ok: literal(true),
53531
+ alias: DeviceAliasSchema
53532
+ }), object({
53533
+ ok: literal(false),
53534
+ reason: _enum([
53535
+ "empty",
53536
+ "too-long",
53537
+ "grammar",
53538
+ "reserved",
53539
+ "taken"
53540
+ ]),
53541
+ takenBy: number().optional()
53542
+ })]), {
53543
+ kind: "mutation",
53544
+ auth: "admin"
53372
53545
  }), method(object({
53373
53546
  deviceId: number(),
53374
53547
  location: string().nullable()
@@ -56993,10 +57166,9 @@ var AvailableIntegrationTypeSchema = object({
56993
57166
  * locations" checkbox. Provider-declared in the addon manifest. */
56994
57167
  supportsLocationImport: boolean(),
56995
57168
  /**
56996
- * True when this integration DECLARES a pre-creation test (the
56997
- * `connection-test` cap, or a broker whose settings it stores). Drives the
56998
- * Test button: an integration that cannot be tested must say so up front
56999
- * rather than offering a button that always answers the same nonsense.
57169
+ * True when this integration's instances declare a Test (`integration-instances.describe().canTest`,
57170
+ * D1016). An integration that cannot be tested must say so up front rather than offering a
57171
+ * button that always answers the same nonsense.
57000
57172
  */
57001
57173
  canTest: boolean(),
57002
57174
  existingInstances: array(object({
@@ -57050,7 +57222,9 @@ var CreateIntegrationInputSchema = object({
57050
57222
  info: record(string(), unknown()).optional(),
57051
57223
  /** `stableId` of the discovery candidate the form was seeded from (D984). */
57052
57224
  originStableId: string().optional(),
57053
- settings: record(string(), unknown()).optional()
57225
+ settings: record(string(), unknown()).optional(),
57226
+ /** The instance kind being created, for a provider with several; omitted = its only testable kind. */
57227
+ kind: string().min(1).optional()
57054
57228
  });
57055
57229
  var UpdateIntegrationInputSchema = object({
57056
57230
  id: string(),
@@ -57076,13 +57250,7 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
57076
57250
  }), method(object({ id: string() }), DeleteIntegrationResultSchema, {
57077
57251
  kind: "mutation",
57078
57252
  auth: "admin"
57079
- }), method(_void(), array(AvailableIntegrationTypeSchema), { auth: "admin" }), method(object({
57080
- addonId: string(),
57081
- settings: record(string(), unknown())
57082
- }), TestConnectionResultSchema, {
57083
- kind: "mutation",
57084
- auth: "admin"
57085
- });
57253
+ }), method(_void(), array(AvailableIntegrationTypeSchema), { auth: "admin" });
57086
57254
  /**
57087
57255
  * `integration-instances` - the connection of an addon that holds ONE or SEVERAL
57088
57256
  * (an account, a relay, a destination) as typed records (D985, D986). The addon's
@@ -57102,7 +57270,7 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
57102
57270
  * or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
57103
57271
  * clears it.
57104
57272
  */
57105
- var ConfigSchemaPassthrough$3 = custom();
57273
+ var ConfigSchemaPassthrough$2 = custom();
57106
57274
  var IntegrationInstanceIdSchema = string().min(1);
57107
57275
  var IntegrationInstanceModeSchema = _enum(["single", "multiple"]);
57108
57276
  /**
@@ -57148,7 +57316,16 @@ var IntegrationInstanceKindSchema = object({
57148
57316
  /** Relative hub path to start an interactive account link of an instance of this kind. */
57149
57317
  connectPath: string().min(1).optional(),
57150
57318
  /** Relative hub path to disconnect that account. */
57151
- disconnectPath: string().min(1).optional()
57319
+ disconnectPath: string().min(1).optional(),
57320
+ /**
57321
+ * Parts of the edit dialog the flat form cannot draw (a node picker, a model source), named by a
57322
+ * GENERIC widget id the client maps to a component; a client that knows none of them shows none.
57323
+ * `connection` widgets write connection values, `model` widgets own the model choice.
57324
+ */
57325
+ widgets: array(object({
57326
+ id: string().min(1),
57327
+ placement: _enum(["connection", "model"])
57328
+ })).optional()
57152
57329
  });
57153
57330
  /**
57154
57331
  * How devices of an instance are found. `none`: the operator adds them by hand; `lan`: the addon
@@ -57189,10 +57366,11 @@ var IntegrationInstanceDescriptionSchema = object({
57189
57366
  /** True when `testInstance` really probes the remote. */
57190
57367
  canTest: boolean(),
57191
57368
  /**
57192
- * The kinds an instance can be of. Absent or one entry: nothing to choose; more than one: the
57193
- * Add flow asks which first and sends it as `createInstance.kind`.
57369
+ * The kinds an instance can be of (D1013 rule 1), each naming its `functionCap`. One entry:
57370
+ * nothing to choose; more than one: the Add flow asks which first and sends it as
57371
+ * `createInstance.kind`. Never empty: every instance belongs to exactly one kind.
57194
57372
  */
57195
- kinds: array(IntegrationInstanceKindSchema).optional(),
57373
+ kinds: array(IntegrationInstanceKindSchema).min(1),
57196
57374
  /**
57197
57375
  * The provider accepts `createInstance.id` for an id that once existed (an adopted id, because
57198
57376
  * devices carry it). The UI then offers "restore under its old id" on Add. Absent means no.
@@ -57228,8 +57406,8 @@ var IntegrationInstanceSchema = object({
57228
57406
  * the body is the one store, `setInstanceEnabled` the one writer (epic #440, step 3).
57229
57407
  */
57230
57408
  enabled: boolean().optional(),
57231
- /** The kind of this instance (one of `describe().kinds[].id`), when the provider has kinds. */
57232
- kind: string().optional(),
57409
+ /** The kind of this instance: exactly one of `describe().kinds[].id` (D1013 rule 2). */
57410
+ kind: string().min(1),
57233
57411
  /** Values for the instance form; a secret is a `SecretFieldView`, never text. */
57234
57412
  formValues: record(string(), unknown()),
57235
57413
  status: IntegrationInstanceStatusSchema.optional(),
@@ -57253,7 +57431,7 @@ var integrationInstancesCapability = {
57253
57431
  id: IntegrationInstanceIdSchema.nullable(),
57254
57432
  /** The kind of the create form (`id: null`) of a provider with several. */
57255
57433
  kind: string().min(1).optional()
57256
- }), ConfigSchemaPassthrough$3, { auth: "admin" }),
57434
+ }), ConfigSchemaPassthrough$2, { auth: "admin" }),
57257
57435
  listInstances: method(_void(), array(IntegrationInstanceSchema).readonly(), { auth: "admin" }),
57258
57436
  getInstance: method(object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }),
57259
57437
  /**
@@ -58355,12 +58533,12 @@ var LlmModelInfoSchema = object({
58355
58533
  });
58356
58534
  /**
58357
58535
  * The provider-specific part of a profile, validated by the provider that owns
58358
- * the kind (`upsertProfile` refuses what it does not accept). A field its
58536
+ * the kind (saving an instance refuses what it does not accept). A field its
58359
58537
  * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
58360
58538
  * keychain, never in the row, and reads back as the redaction marker.
58361
58539
  */
58362
58540
  var LlmProviderConfigSchema = record(string(), unknown());
58363
- var LlmProfileSchema = object({
58541
+ object({
58364
58542
  id: string(),
58365
58543
  name: string(),
58366
58544
  /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
@@ -58454,8 +58632,8 @@ var LlmProviderWidgetSchema = object({
58454
58632
  /** ConfigUISchema tree passed through untyped on the wire (the
58455
58633
  * notification-output `ConfigSchemaPassthrough` precedent at
58456
58634
  * notification-output.cap.ts:151); the exported TS type re-tightens it. */
58457
- var ConfigSchemaPassthrough$2 = unknown();
58458
- var LlmProfileKindDescriptorSchema = object({
58635
+ var ConfigSchemaPassthrough$1 = unknown();
58636
+ object({
58459
58637
  kind: LlmProfileKindSchema,
58460
58638
  label: string(),
58461
58639
  /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
@@ -58463,9 +58641,9 @@ var LlmProfileKindDescriptorSchema = object({
58463
58641
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
58464
58642
  addonId: string(),
58465
58643
  /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
58466
- connectionSchema: ConfigSchemaPassthrough$2,
58644
+ connectionSchema: ConfigSchemaPassthrough$1,
58467
58645
  /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
58468
- advancedSchema: ConfigSchemaPassthrough$2.optional(),
58646
+ advancedSchema: ConfigSchemaPassthrough$1.optional(),
58469
58647
  /** The kind's defaults; a model from `listModels` may override any of them. */
58470
58648
  features: LlmModelFeaturesSchema,
58471
58649
  /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
@@ -58594,20 +58772,7 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
58594
58772
  }), method(object({
58595
58773
  addonId: string().optional(),
58596
58774
  requestId: string()
58597
- }), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
58598
- kind: "mutation",
58599
- auth: "admin"
58600
- }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
58601
- kind: "mutation",
58602
- auth: "admin"
58603
- }), method(ProfileRefInputSchema, _void(), {
58604
- kind: "mutation",
58605
- auth: "admin"
58606
- }), method(ProfileRefInputSchema, LlmGenerateResultSchema, {
58607
- kind: "mutation",
58608
- auth: "admin",
58609
- timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
58610
- }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
58775
+ }), _void(), { kind: "mutation" }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
58611
58776
  kind: "mutation",
58612
58777
  auth: "admin"
58613
58778
  }), method(object({}), array(LlmDefaultSchema)), method(object({
@@ -59670,20 +59835,7 @@ method(_void(), MeshStatusSchema), method(object({
59670
59835
  /** Optional hostname override the host should advertise once joined. */
59671
59836
  hostname: string().optional() }), object({
59672
59837
  /** Authentication URL the operator should open in a browser. */
59673
- loginUrl: string() }), { kind: "mutation" }), method(_void(), object({ left: literal(true) }), { kind: "mutation" }), method(_void(), object({ loggedOut: literal(true) }), { kind: "mutation" }), method(_void(), object({ peers: array(MeshPeerSchema).readonly() })), method(object({
59674
- /** Optional auth key — when provided, probes the key validity
59675
- * against the provider's API. Omit when already joined to
59676
- * just ping the daemon. */
59677
- authKey: string().optional() }), object({
59678
- ok: boolean(),
59679
- /** Provider-side identifier resolved by the probe (tailnet
59680
- * name for Tailscale, network id for ZeroTier, etc.). */
59681
- tenant: string().optional(),
59682
- /** Daemon binary version, when reachable. */
59683
- daemonVersion: string().optional(),
59684
- /** Human-readable error when `ok: false`. */
59685
- error: string().optional()
59686
- }), { kind: "mutation" });
59838
+ loginUrl: string() }), { kind: "mutation" }), method(_void(), object({ left: literal(true) }), { kind: "mutation" }), method(_void(), object({ loggedOut: literal(true) }), { kind: "mutation" }), method(_void(), object({ peers: array(MeshPeerSchema).readonly() }));
59687
59839
  /**
59688
59840
  * A monotonic total between resets (D944). Energy uses `power-meter.energy`
59689
59841
  * so dashboards keep one series; every other instantaneous reading lands here.
@@ -65825,13 +65977,6 @@ var AddBrokerInputSchema = object({
65825
65977
  });
65826
65978
  var AddBrokerResultSchema = object({ id: string() });
65827
65979
  var IdInputSchema = object({ id: string() });
65828
- var TestResultSchema$1 = discriminatedUnion("ok", [object({
65829
- ok: literal(true),
65830
- latencyMs: number()
65831
- }), object({
65832
- ok: literal(false),
65833
- error: string()
65834
- })]);
65835
65980
  var StartEmbeddedInputSchema = object({
65836
65981
  port: number().int().min(1).max(65535).default(1883),
65837
65982
  /** Allow anonymous connect (no username/password). Default: false. */
@@ -65854,9 +65999,6 @@ method(_void(), array(BrokerInfoSchema)), method(IdInputSchema, BrokerConnection
65854
65999
  }), method(IdInputSchema, _void(), {
65855
66000
  kind: "mutation",
65856
66001
  auth: "admin"
65857
- }), method(IdInputSchema, TestResultSchema$1, {
65858
- kind: "mutation",
65859
- auth: "admin"
65860
66002
  }), method(StartEmbeddedInputSchema, StartEmbeddedResultSchema, {
65861
66003
  kind: "mutation",
65862
66004
  auth: "admin"
@@ -67520,6 +67662,11 @@ var NcScheduleSchema = object({
67520
67662
  * as a STATE SUMMARY at the end of each window of `schedule`.
67521
67663
  */
67522
67664
  var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
67665
+ _enum([
67666
+ "activation",
67667
+ "deactivation",
67668
+ "schedule"
67669
+ ]);
67523
67670
  /**
67524
67671
  * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
67525
67672
  * every section; `section` = one notification per section with something to
@@ -67536,11 +67683,26 @@ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
67536
67683
  * midnight crossing); the send time is each window's END. Refused on the
67537
67684
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
67538
67685
  */
67539
- var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
67540
- mode: literal("summary"),
67541
- schedule: NcScheduleSchema,
67542
- split: NcStateSummarySplitSchema.optional()
67543
- })]);
67686
+ var NcSystemEventDeliverySchema = discriminatedUnion("mode", [
67687
+ object({ mode: literal("instant") }),
67688
+ object({
67689
+ mode: literal("summary"),
67690
+ schedule: NcScheduleSchema,
67691
+ split: NcStateSummarySplitSchema.optional()
67692
+ }),
67693
+ object({
67694
+ mode: literal("modes"),
67695
+ /** The bad edge, and every kind that has a single edge. */
67696
+ onActivation: boolean(),
67697
+ /** The recovery edges of the classes of the selected kinds (derived, never stored per kind). */
67698
+ onDeactivation: boolean(),
67699
+ /** A state summary at the end of each window; absent = no summary. */
67700
+ onSchedule: object({
67701
+ schedule: NcScheduleSchema,
67702
+ grouping: NcStateSummarySplitSchema
67703
+ }).optional()
67704
+ })
67705
+ ]);
67544
67706
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
67545
67707
  var NcPlateMatcherSchema = object({
67546
67708
  /**
@@ -69900,61 +70062,6 @@ var OauthIntegrationDescriptorSchema = object({
69900
70062
  });
69901
70063
  method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
69902
70064
  /**
69903
- * `oidc-connections` — CRUD for IdP rows under `auth-oidc` (D828 sibling).
69904
- *
69905
- * One hub-only singleton (`auth-oidc`). The Settings UI is a DataTable +
69906
- * ItemFormDialog; there is no `editable-array` in `globalSettingsSchema`.
69907
- * Operator-chosen `id` is the URL slug (`/addon/auth-oidc/<id>/…`) and is
69908
- * immutable after create.
69909
- */
69910
- var ConfigSchemaPassthrough$1 = unknown();
69911
- var OidcConnectionSchema = object({
69912
- id: string().min(1),
69913
- displayName: string(),
69914
- icon: string(),
69915
- issuerUrl: string(),
69916
- clientId: string(),
69917
- /** Client id + secret present — never the secret value. */
69918
- configured: boolean(),
69919
- /**
69920
- * Values for the connection form schema. `clientSecret` is a keychain
69921
- * {@link SecretFieldView} or `null` / `''`, never plaintext (D789).
69922
- */
69923
- formValues: record(string(), unknown()).optional()
69924
- });
69925
- /**
69926
- * Patch one connection. Omitted or empty `clientSecret` keeps the stored
69927
- * secret (D787). `{ $secretClear: true }` clears it. `id` is never renamed.
69928
- */
69929
- var OidcConnectionUpdateInputSchema = object({
69930
- id: string().min(1),
69931
- displayName: string().min(1),
69932
- icon: string().optional(),
69933
- issuerUrl: string().optional(),
69934
- clientId: string().optional(),
69935
- clientSecret: union([string(), object({ $secretClear: literal(true) })]).optional(),
69936
- redirectUri: string().optional(),
69937
- scopes: string().optional(),
69938
- usernameClaim: _enum([
69939
- "preferred_username",
69940
- "email",
69941
- "sub"
69942
- ]).optional()
69943
- });
69944
- method(object({}), ConfigSchemaPassthrough$1, { auth: "admin" }), method(object({}), array(OidcConnectionSchema).readonly(), { auth: "admin" }), method(object({
69945
- id: string().min(1).regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "id must be a lowercase slug"),
69946
- displayName: string().min(1)
69947
- }), object({ id: string() }), {
69948
- kind: "mutation",
69949
- auth: "admin"
69950
- }), method(OidcConnectionUpdateInputSchema, object({ ok: literal(true) }), {
69951
- kind: "mutation",
69952
- auth: "admin"
69953
- }), method(object({ id: string().min(1) }), object({ ok: literal(true) }), {
69954
- kind: "mutation",
69955
- auth: "admin"
69956
- });
69957
- /**
69958
70065
  * Generic on-screen-display (video overlay) cap. Each camera exposes
69959
70066
  * a firmware-defined list of overlays (channel name, timestamp,
69960
70067
  * watermark, logo, …); the cap models them as a homogeneous array of
@@ -76275,6 +76382,16 @@ var RemoteLayoutComponentSchema = object({
76275
76382
  method(object({}), array(RemoteLayoutComponentSchema), { auth: "protected" });
76276
76383
  var RUNNING_POWER_START_DELAY_MS = 3e4;
76277
76384
  var RUNNING_POWER_STOP_DELAY_MS = 18e4;
76385
+ /**
76386
+ * Per-type overrides of the dwell defaults. A media player draws power the
76387
+ * moment it is on and stops drawing the moment it is off, so it needs neither
76388
+ * a long dwell nor a second sample. A type absent here keeps the global values.
76389
+ */
76390
+ var RUNNING_POWER_DEFAULTS_BY_TYPE = { [DeviceType.MediaPlayer]: {
76391
+ startDwellMs: 1e4,
76392
+ stopDwellMs: 1e4,
76393
+ minSamples: 1
76394
+ } };
76278
76395
  var RunningStateSourceSchema = _enum(["native", "assigned"]);
76279
76396
  var RunningStateStatusSchema = object({
76280
76397
  /** null = unknown — never coerced to false (D393). */
@@ -76292,93 +76409,27 @@ var RunningFlipEventDataSchema = object({
76292
76409
  phase: string().nullable()
76293
76410
  });
76294
76411
  var RUNNING_DEVICE_TYPES = Object.values(DeviceType);
76295
- /** Generic Customize target for the running boolean (D936). */
76296
- var runningCustomize = {
76297
- version: 1,
76298
- overridable: [{
76299
- path: "running",
76300
- by: "running"
76301
- }],
76302
- targets: [{
76303
- id: "running",
76304
- cardinality: "scalar",
76305
- vocabulary: {
76306
- cap: "running-state",
76307
- stateField: "running"
76308
- },
76309
- deviceTypes: [
76310
- DeviceType.Washer,
76311
- DeviceType.Dryer,
76312
- DeviceType.Dishwasher,
76313
- DeviceType.Vacuum,
76314
- DeviceType.LawnMower,
76315
- DeviceType.MediaPlayer,
76316
- DeviceType.WaterHeater,
76317
- DeviceType.Humidifier,
76318
- DeviceType.Fan,
76319
- DeviceType.Climate,
76320
- DeviceType.Thermostat,
76321
- DeviceType.PetFeeder,
76322
- DeviceType.Heater
76323
- ],
76324
- apply: "add",
76325
- path: "running",
76326
- sources: [
76327
- {
76328
- kind: "switch",
76329
- transforms: [{ kind: "identity" }]
76330
- },
76331
- {
76332
- kind: "binary",
76333
- transforms: [{ kind: "identity" }, { kind: "invert" }]
76334
- },
76335
- {
76336
- kind: "numeric",
76337
- requiredUnit: "W",
76338
- transforms: [{
76339
- kind: "threshold",
76340
- comparisons: ["gte", "lte"],
76341
- comparison: "gte",
76342
- defaultThreshold: 5,
76343
- defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
76344
- defaultStopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
76345
- thresholdUnit: "W"
76346
- }]
76347
- }
76348
- ],
76349
- companions: [
76350
- {
76351
- kind: "constant",
76352
- path: "source",
76353
- value: "assigned",
76354
- when: "always"
76355
- },
76356
- {
76357
- kind: "constant",
76358
- path: "phase",
76359
- value: null,
76360
- when: "add"
76361
- },
76362
- {
76363
- kind: "clock",
76364
- path: "lastFetchedAt",
76365
- when: "always"
76366
- },
76367
- {
76368
- kind: "transition-time",
76369
- path: "since",
76370
- sourceChangedAt: "prefer"
76371
- }
76372
- ],
76373
- sourceReport: {
76374
- status: "assignment-status",
76375
- runtimeField: "source",
76376
- nativeValue: "native",
76377
- assignedValue: "assigned"
76378
- },
76379
- advancedExpression: true
76380
- }]
76381
- };
76412
+ /**
76413
+ * Customize offers "running" only where a job makes sense (D933): a cycle,
76414
+ * a clean, a mow, playback, or another appliance that is on and working.
76415
+ * The cap itself stays on every type — a camera can still report running
76416
+ * natively; it just has no card.
76417
+ */
76418
+ var RUNNING_CUSTOMIZE_DEVICE_TYPES = [
76419
+ DeviceType.Washer,
76420
+ DeviceType.Dryer,
76421
+ DeviceType.Dishwasher,
76422
+ DeviceType.Vacuum,
76423
+ DeviceType.LawnMower,
76424
+ DeviceType.MediaPlayer,
76425
+ DeviceType.WaterHeater,
76426
+ DeviceType.Humidifier,
76427
+ DeviceType.Fan,
76428
+ DeviceType.Climate,
76429
+ DeviceType.Thermostat,
76430
+ DeviceType.PetFeeder,
76431
+ DeviceType.Heater
76432
+ ];
76382
76433
  var runningStateCapability = {
76383
76434
  name: "running-state",
76384
76435
  scope: "device",
@@ -76398,7 +76449,79 @@ var runningStateCapability = {
76398
76449
  durability: "restored",
76399
76450
  history: { fields: { running: { kind: "boolean" } } },
76400
76451
  volatileStateFields: ["lastFetchedAt"],
76401
- customize: runningCustomize
76452
+ customize: {
76453
+ version: 1,
76454
+ overridable: [{
76455
+ path: "running",
76456
+ by: "running"
76457
+ }],
76458
+ targets: [{
76459
+ id: "running",
76460
+ cardinality: "scalar",
76461
+ vocabulary: {
76462
+ cap: "running-state",
76463
+ stateField: "running"
76464
+ },
76465
+ deviceTypes: RUNNING_CUSTOMIZE_DEVICE_TYPES,
76466
+ apply: "add",
76467
+ path: "running",
76468
+ sources: [
76469
+ {
76470
+ kind: "switch",
76471
+ transforms: [{ kind: "identity" }]
76472
+ },
76473
+ {
76474
+ kind: "binary",
76475
+ transforms: [{ kind: "identity" }, { kind: "invert" }]
76476
+ },
76477
+ {
76478
+ kind: "numeric",
76479
+ requiredUnit: "W",
76480
+ transforms: [{
76481
+ kind: "threshold",
76482
+ comparisons: ["gte", "lte"],
76483
+ comparison: "gte",
76484
+ defaultThreshold: 5,
76485
+ defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
76486
+ defaultStopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
76487
+ deviceTypeDefaults: RUNNING_POWER_DEFAULTS_BY_TYPE,
76488
+ thresholdUnit: "W"
76489
+ }]
76490
+ }
76491
+ ],
76492
+ companions: [
76493
+ {
76494
+ kind: "constant",
76495
+ path: "source",
76496
+ value: "assigned",
76497
+ when: "always"
76498
+ },
76499
+ {
76500
+ kind: "constant",
76501
+ path: "phase",
76502
+ value: null,
76503
+ when: "add"
76504
+ },
76505
+ {
76506
+ kind: "clock",
76507
+ path: "lastFetchedAt",
76508
+ when: "always"
76509
+ },
76510
+ {
76511
+ kind: "transition-time",
76512
+ path: "since",
76513
+ sourceChangedAt: "prefer"
76514
+ }
76515
+ ],
76516
+ sourceReport: {
76517
+ status: "assignment-status",
76518
+ runtimeField: "source",
76519
+ nativeValue: "native",
76520
+ assignedValue: "assigned"
76521
+ },
76522
+ advancedExpression: true
76523
+ }]
76524
+ }
76402
76525
  };
76403
76526
  /**
76404
76527
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -77746,21 +77869,6 @@ method(object({
77746
77869
  */
77747
77870
  ttlSec: union([number().int().positive(), literal("never")]).optional()
77748
77871
  }), object({ token: string() }), { auth: "admin" }), method(object({ token: string() }), SsoBridgeClaimsSchema.nullable(), { auth: "admin" });
77749
- var ProviderListEntrySchema = discriminatedUnion("shouldSaveDiskSpace", [object({
77750
- providerId: string().min(1),
77751
- displayName: string().min(1),
77752
- configSchema: unknown(),
77753
- nodeLocal: boolean(),
77754
- shouldSaveDiskSpace: literal(true),
77755
- minFreePercent: number().min(0).max(100)
77756
- }), object({
77757
- providerId: string().min(1),
77758
- displayName: string().min(1),
77759
- configSchema: unknown(),
77760
- nodeLocal: boolean(),
77761
- shouldSaveDiskSpace: literal(false),
77762
- minFreePercent: literal(null)
77763
- })]);
77764
77872
  method(object({
77765
77873
  location: StorageLocationRefSchema,
77766
77874
  relativePath: string()
@@ -77822,42 +77930,7 @@ method(object({
77822
77930
  }), _instanceof(Uint8Array), { auth: "admin" }), method(object({ downloadId: string() }), _void(), {
77823
77931
  kind: "mutation",
77824
77932
  auth: "admin"
77825
- }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
77826
- createdAt: true,
77827
- updatedAt: true
77828
- }), StorageLocationSchema, {
77829
- kind: "mutation",
77830
- auth: "admin"
77831
- }), method(object({
77832
- id: string(),
77833
- force: boolean().optional()
77834
- }), _void(), {
77835
- kind: "mutation",
77836
- auth: "admin"
77837
- }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
77838
- ok: boolean(),
77839
- error: string().optional()
77840
- }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
77841
- providerId: string(),
77842
- /**
77843
- * The location this config is an UNSAVED edit of, when there is one.
77844
- *
77845
- * `listLocations` replaces every declared secret with the redaction
77846
- * sentinel, so the edit modal's form state holds the sentinel for any
77847
- * credential the operator did not retype — and posting that here
77848
- * without a way to resolve it makes the provider try to authenticate
77849
- * as `__camstack_redacted__` and report the operator's own working
77850
- * password as wrong. Given this id, the orchestrator restores each
77851
- * sentinel from the stored config (same rule as `upsertLocation`)
77852
- * before dispatching. Omitted by the "Add location" wizard, where
77853
- * every value was typed just now and nothing is stored yet.
77854
- */
77855
- locationId: string().optional(),
77856
- config: record(string(), unknown())
77857
- }), object({
77858
- ok: boolean(),
77859
- error: string().optional()
77860
- }), { auth: "admin" });
77933
+ }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(_void(), array(StorageDrainProgressSchema).readonly());
77861
77934
  /** One table of the settings database. */
77862
77935
  var StorageTableSchema = object({
77863
77936
  /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
@@ -79379,7 +79452,7 @@ var TerminalInstanceInfoSchema = object({
79379
79452
  /**
79380
79453
  * False while the node the instance is bound to is not in the cluster
79381
79454
  * topology (forgotten, renamed, re-paired). The instance is kept; the
79382
- * operator re-points it with `updateInstance({ targetNodeId })`.
79455
+ * operator re-points it on the Terminal page.
79383
79456
  */
79384
79457
  nodeInCluster: boolean(),
79385
79458
  profileId: string(),
@@ -79417,41 +79490,7 @@ var TerminalOutputBatchSchema = object({
79417
79490
  snapshot: string().optional(),
79418
79491
  events: array(TerminalOutputEventSchema).readonly()
79419
79492
  });
79420
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
79421
- targetNodeId: string().min(1),
79422
- profileId: string().min(1),
79423
- name: string().trim().min(1).max(160).optional(),
79424
- executable: string().max(1024).optional(),
79425
- args: array(string().max(2048)).max(64).optional(),
79426
- cwd: string().max(1024).optional(),
79427
- environment: array(string().max(4096)).max(64).optional(),
79428
- profileSettings: ProfileSettingsBagSchema.optional()
79429
- }), TerminalInstanceInfoSchema, {
79430
- kind: "mutation",
79431
- auth: "admin"
79432
- }), method(object({
79433
- instanceId: string().min(1),
79434
- /** Re-point the instance to another node; the profile must exist there. */
79435
- targetNodeId: string().min(1).max(256).optional(),
79436
- name: string().trim().min(1).max(160).optional(),
79437
- executable: string().max(1024).optional(),
79438
- args: array(string().max(2048)).max(64).optional(),
79439
- cwd: string().max(1024).optional(),
79440
- environment: array(string().max(4096)).max(64).optional(),
79441
- profileSettings: ProfileSettingsBagSchema.optional()
79442
- }), TerminalInstanceInfoSchema, {
79443
- kind: "mutation",
79444
- auth: "admin"
79445
- }), method(object({ instanceId: string().min(1) }), _void(), {
79446
- kind: "mutation",
79447
- auth: "admin"
79448
- }), method(object({
79449
- instanceId: string().min(1),
79450
- enabled: boolean()
79451
- }), TerminalInstanceInfoSchema, {
79452
- kind: "mutation",
79453
- auth: "admin"
79454
- }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
79493
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
79455
79494
  stableId: string().min(1),
79456
79495
  name: string().trim().min(1).max(160).optional()
79457
79496
  }), TerminalInstanceInfoSchema, {
@@ -79520,6 +79559,11 @@ var TimedRunUnitSchema = _enum(["s", "min"]);
79520
79559
  _enum(["switch", "pet-fountain"]);
79521
79560
  DeviceType.Heater, DeviceType.PetFountain;
79522
79561
  var TIMED_RUN_DEVICE_TYPES = [DeviceType.Heater, DeviceType.PetFountain];
79562
+ /** One duration, as the one-tap run asks for it. */
79563
+ var TimedRunQuickRunSchema = object({
79564
+ duration: number().positive().finite(),
79565
+ unit: TimedRunUnitSchema
79566
+ });
79523
79567
  /** Why a request was not carried out. Typed, so a caller can say it in words. */
79524
79568
  var TimedRunRefusalSchema = _enum([
79525
79569
  "unsupported-device",
@@ -79540,8 +79584,23 @@ var TimedRunStatusSchema = object({
79540
79584
  activeUntil: number().nullable(),
79541
79585
  /** Who asked for the run (a user id or an addon id); `null` when nothing is armed or it did not say. */
79542
79586
  requestedBy: string().nullable(),
79587
+ /**
79588
+ * The one-tap run of THIS device: what a "Run" button on any surface starts. `null` when
79589
+ * the device is gone or its type has no timed run; a status from before this field
79590
+ * existed has none, and a surface falls back to the type's default.
79591
+ */
79592
+ quickRun: TimedRunQuickRunSchema.nullable(),
79543
79593
  lastFetchedAt: number()
79544
79594
  });
79595
+ /** What the settings form needs: the unit, the bounds and the type's default. */
79596
+ var TimedRunOptionsSchema = object({
79597
+ unit: TimedRunUnitSchema,
79598
+ /** The longest run, in `unit`. */
79599
+ maxDuration: number(),
79600
+ defaultDuration: number()
79601
+ });
79602
+ /** The one-tap run duration, in the type's unit; `null` returns to the type's default. */
79603
+ var TimedRunSettingsPatchSchema = object({ quickRunDuration: number().positive().finite().nullable().optional() });
79545
79604
  var timedRunCapability = {
79546
79605
  name: "timed-run",
79547
79606
  scope: "device",
@@ -79549,7 +79608,24 @@ var timedRunCapability = {
79549
79608
  kind: "wrapper",
79550
79609
  defaultActive: true,
79551
79610
  deviceTypes: TIMED_RUN_DEVICE_TYPES,
79611
+ deviceConfig: { ui: {
79612
+ kind: "derived-form",
79613
+ builderId: "timed-run",
79614
+ tab: "general"
79615
+ } },
79552
79616
  methods: {
79617
+ getOptions: method(object({ deviceId: number().int() }), TimedRunOptionsSchema),
79618
+ /**
79619
+ * The one-tap run of this device. A duration above the type's maximum is
79620
+ * REFUSED (thrown), like `runFor`: the maximum is a safety bound.
79621
+ */
79622
+ setSettings: method(object({
79623
+ deviceId: number().int(),
79624
+ settings: TimedRunSettingsPatchSchema
79625
+ }), _void(), {
79626
+ kind: "mutation",
79627
+ auth: "admin"
79628
+ }),
79553
79629
  /**
79554
79630
  * Turn the device on and arm its off. A run already armed is replaced (the
79555
79631
  * new deadline wins). Refuses with a typed reason above the type's maximum.
@@ -79673,7 +79749,7 @@ var TrainingProviderTypeSchema = object({
79673
79749
  label: string(),
79674
79750
  /** Path under the addon package (e.g. `assets/training-modal/icon.svg`). */
79675
79751
  iconAsset: string(),
79676
- /** Owning `training-provider` addon — collection selector for createEntry. */
79752
+ /** Owning `training-provider` addon. */
79677
79753
  addonId: string(),
79678
79754
  /**
79679
79755
  * Fields for one entry of this type (credentials + defaults). Absent on a
@@ -79718,36 +79794,6 @@ var TrainingProviderDescriptorSchema = object({
79718
79794
  */
79719
79795
  formValues: record(string(), unknown()).optional()
79720
79796
  });
79721
- /**
79722
- * Patch one entry's name, credentials and defaults. Pin with owning `{ addonId }`.
79723
- * An omitted or empty `tokenSecret` means KEEP the stored secret (D787).
79724
- * `{ $secretClear: true }` clears it.
79725
- */
79726
- var TrainingProviderUpdateEntryInputSchema = object({
79727
- entryId: string().min(1),
79728
- name: string().min(1),
79729
- tokenId: string().optional(),
79730
- tokenSecret: union([string(), object({ $secretClear: literal(true) })]).optional(),
79731
- environment: string().optional(),
79732
- gpuType: string().optional(),
79733
- region: string().optional(),
79734
- costCapUsd: number().nonnegative().optional(),
79735
- maxRuntimeSec: number().int().positive().optional(),
79736
- failedDatasetGraceHours: number().nonnegative().optional()
79737
- });
79738
- var TrainingCredentialCheckSchema = object({
79739
- ok: boolean(),
79740
- /** Workspace / account name, when the provider says. */
79741
- account: string().optional(),
79742
- reason: _enum([
79743
- "missing",
79744
- "invalid",
79745
- "forbidden",
79746
- "network",
79747
- "quota"
79748
- ]).optional(),
79749
- detail: string().optional()
79750
- });
79751
79797
  var ProviderJobStateSchema = _enum([
79752
79798
  "pending",
79753
79799
  "starting",
@@ -79795,22 +79841,6 @@ var TrainingLogLineSchema = object({
79795
79841
  text: string()
79796
79842
  });
79797
79843
  method(object({}), array(TrainingProviderDescriptorSchema).readonly(), { auth: "admin" }), method(object({}), array(TrainingProviderTypeSchema).readonly(), { auth: "admin" }), method(object({}), array(TrainingProviderEntrySchema).readonly(), { auth: "admin" }), method(object({
79798
- typeId: string().min(1),
79799
- name: string().min(1)
79800
- }), object({ entryId: string() }), {
79801
- kind: "mutation",
79802
- auth: "admin"
79803
- }), method(object({ entryId: string().min(1) }), object({ ok: literal(true) }), {
79804
- kind: "mutation",
79805
- auth: "admin"
79806
- }), method(TrainingProviderUpdateEntryInputSchema, object({ ok: literal(true) }), {
79807
- kind: "mutation",
79808
- auth: "admin"
79809
- }), method(object({ entryId: string().min(1) }), TrainingCredentialCheckSchema, {
79810
- kind: "mutation",
79811
- auth: "admin",
79812
- timeoutMs: 3e4
79813
- }), method(object({
79814
79844
  entryId: string().min(1),
79815
79845
  gpuType: string(),
79816
79846
  region: string(),
@@ -84914,21 +84944,28 @@ Object.freeze({
84914
84944
  access: "view",
84915
84945
  role: "admin"
84916
84946
  },
84917
- "addonSettings.getGlobalSettings": {
84947
+ "addonSettings.getIntegrationFormSchema": {
84918
84948
  capName: "addon-settings",
84919
84949
  capScope: "system",
84920
84950
  addonId: null,
84921
84951
  access: "view",
84922
84952
  role: "admin"
84923
84953
  },
84924
- "addonSettings.getIntegrationFormSchema": {
84954
+ "addonSettings.getScopedSettings": {
84925
84955
  capName: "addon-settings",
84926
84956
  capScope: "system",
84927
84957
  addonId: null,
84928
84958
  access: "view",
84929
84959
  role: "admin"
84930
84960
  },
84931
- "addonSettings.getIntegrationSettings": {
84961
+ "addonSettings.listScopedSettings": {
84962
+ capName: "addon-settings",
84963
+ capScope: "system",
84964
+ addonId: null,
84965
+ access: "view",
84966
+ role: "admin"
84967
+ },
84968
+ "addonSettings.readScopedValues": {
84932
84969
  capName: "addon-settings",
84933
84970
  capScope: "system",
84934
84971
  addonId: null,
@@ -84949,7 +84986,7 @@ Object.freeze({
84949
84986
  access: "create",
84950
84987
  role: "admin"
84951
84988
  },
84952
- "addonSettings.updateGlobalSettings": {
84989
+ "addonSettings.updateScopedSettings": {
84953
84990
  capName: "addon-settings",
84954
84991
  capScope: "system",
84955
84992
  addonId: null,
@@ -85789,20 +85826,6 @@ Object.freeze({
85789
85826
  access: "view",
85790
85827
  role: "admin"
85791
85828
  },
85792
- "connectionTest.describeTest": {
85793
- capName: "connection-test",
85794
- capScope: "system",
85795
- addonId: null,
85796
- access: "view",
85797
- role: "admin"
85798
- },
85799
- "connectionTest.testSettings": {
85800
- capName: "connection-test",
85801
- capScope: "system",
85802
- addonId: null,
85803
- access: "create",
85804
- role: "admin"
85805
- },
85806
85829
  "connectivity.getStatus": {
85807
85830
  capName: "connectivity",
85808
85831
  capScope: "device",
@@ -87133,6 +87156,13 @@ Object.freeze({
87133
87156
  access: "create",
87134
87157
  role: "admin"
87135
87158
  },
87159
+ "deviceManager.setAlias": {
87160
+ capName: "device-manager",
87161
+ capScope: "system",
87162
+ addonId: null,
87163
+ access: "create",
87164
+ role: "admin"
87165
+ },
87136
87166
  "deviceManager.setChildLayout": {
87137
87167
  capName: "device-manager",
87138
87168
  capScope: "system",
@@ -88169,13 +88199,6 @@ Object.freeze({
88169
88199
  access: "view",
88170
88200
  role: "admin"
88171
88201
  },
88172
- "integrations.testConnection": {
88173
- capName: "integrations",
88174
- capScope: "system",
88175
- addonId: null,
88176
- access: "create",
88177
- role: "admin"
88178
- },
88179
88202
  "integrations.update": {
88180
88203
  capName: "integrations",
88181
88204
  capScope: "system",
@@ -88428,13 +88451,6 @@ Object.freeze({
88428
88451
  access: "delete",
88429
88452
  role: "admin"
88430
88453
  },
88431
- "llm.deleteProfile": {
88432
- capName: "llm",
88433
- capScope: "system",
88434
- addonId: null,
88435
- access: "delete",
88436
- role: "admin"
88437
- },
88438
88454
  "llm.generate": {
88439
88455
  capName: "llm",
88440
88456
  capScope: "system",
@@ -88498,20 +88514,6 @@ Object.freeze({
88498
88514
  access: "view",
88499
88515
  role: "admin"
88500
88516
  },
88501
- "llm.listProfileKinds": {
88502
- capName: "llm",
88503
- capScope: "system",
88504
- addonId: null,
88505
- access: "view",
88506
- role: "admin"
88507
- },
88508
- "llm.listProfiles": {
88509
- capName: "llm",
88510
- capScope: "system",
88511
- addonId: null,
88512
- access: "view",
88513
- role: "admin"
88514
- },
88515
88517
  "llm.listRuntimeNodes": {
88516
88518
  capName: "llm",
88517
88519
  capScope: "system",
@@ -88519,13 +88521,6 @@ Object.freeze({
88519
88521
  access: "view",
88520
88522
  role: "admin"
88521
88523
  },
88522
- "llm.migrateRawSecrets": {
88523
- capName: "llm",
88524
- capScope: "system",
88525
- addonId: null,
88526
- access: "create",
88527
- role: "admin"
88528
- },
88529
88524
  "llm.resolveModelRef": {
88530
88525
  capName: "llm",
88531
88526
  capScope: "system",
@@ -88554,20 +88549,6 @@ Object.freeze({
88554
88549
  access: "create",
88555
88550
  role: "admin"
88556
88551
  },
88557
- "llm.testProfile": {
88558
- capName: "llm",
88559
- capScope: "system",
88560
- addonId: null,
88561
- access: "create",
88562
- role: "admin"
88563
- },
88564
- "llm.upsertProfile": {
88565
- capName: "llm",
88566
- capScope: "system",
88567
- addonId: null,
88568
- access: "create",
88569
- role: "admin"
88570
- },
88571
88552
  "llmRuntime.appleAvailability": {
88572
88553
  capName: "llm-runtime",
88573
88554
  capScope: "system",
@@ -89072,13 +89053,6 @@ Object.freeze({
89072
89053
  access: "create",
89073
89054
  role: "admin"
89074
89055
  },
89075
- "meshNetwork.testConnection": {
89076
- capName: "mesh-network",
89077
- capScope: "system",
89078
- addonId: null,
89079
- access: "create",
89080
- role: "admin"
89081
- },
89082
89056
  "meter.getStatus": {
89083
89057
  capName: "meter",
89084
89058
  capScope: "device",
@@ -89408,13 +89382,6 @@ Object.freeze({
89408
89382
  access: "create",
89409
89383
  role: "admin"
89410
89384
  },
89411
- "mqttBroker.testConnection": {
89412
- capName: "mqtt-broker",
89413
- capScope: "system",
89414
- addonId: null,
89415
- access: "create",
89416
- role: "admin"
89417
- },
89418
89385
  "nativeObjectDetection.getOptions": {
89419
89386
  capName: "native-object-detection",
89420
89387
  capScope: "device",
@@ -89744,13 +89711,6 @@ Object.freeze({
89744
89711
  access: "create",
89745
89712
  role: "admin"
89746
89713
  },
89747
- "notificationOutput.deleteTarget": {
89748
- capName: "notification-output",
89749
- capScope: "system",
89750
- addonId: null,
89751
- access: "delete",
89752
- role: "admin"
89753
- },
89754
89714
  "notificationOutput.discoverTargets": {
89755
89715
  capName: "notification-output",
89756
89716
  capScope: "system",
@@ -89758,13 +89718,6 @@ Object.freeze({
89758
89718
  access: "view",
89759
89719
  role: "admin"
89760
89720
  },
89761
- "notificationOutput.getTarget": {
89762
- capName: "notification-output",
89763
- capScope: "system",
89764
- addonId: null,
89765
- access: "view",
89766
- role: "admin"
89767
- },
89768
89721
  "notificationOutput.listTargetKinds": {
89769
89722
  capName: "notification-output",
89770
89723
  capScope: "system",
@@ -89772,13 +89725,6 @@ Object.freeze({
89772
89725
  access: "view",
89773
89726
  role: "admin"
89774
89727
  },
89775
- "notificationOutput.listTargets": {
89776
- capName: "notification-output",
89777
- capScope: "system",
89778
- addonId: null,
89779
- access: "view",
89780
- role: "admin"
89781
- },
89782
89728
  "notificationOutput.probeTargetConfig": {
89783
89729
  capName: "notification-output",
89784
89730
  capScope: "system",
@@ -89793,13 +89739,6 @@ Object.freeze({
89793
89739
  access: "create",
89794
89740
  role: "admin"
89795
89741
  },
89796
- "notificationOutput.setTargetEnabled": {
89797
- capName: "notification-output",
89798
- capScope: "system",
89799
- addonId: null,
89800
- access: "create",
89801
- role: "admin"
89802
- },
89803
89742
  "notificationOutput.testTarget": {
89804
89743
  capName: "notification-output",
89805
89744
  capScope: "system",
@@ -89807,13 +89746,6 @@ Object.freeze({
89807
89746
  access: "create",
89808
89747
  role: "admin"
89809
89748
  },
89810
- "notificationOutput.upsertTarget": {
89811
- capName: "notification-output",
89812
- capScope: "system",
89813
- addonId: null,
89814
- access: "create",
89815
- role: "admin"
89816
- },
89817
89749
  "notificationRules.activateAlarmProfile": {
89818
89750
  capName: "notification-rules",
89819
89751
  capScope: "system",
@@ -90073,41 +90005,6 @@ Object.freeze({
90073
90005
  access: "view",
90074
90006
  role: "admin"
90075
90007
  },
90076
- "oidcConnections.connectionFormSchema": {
90077
- capName: "oidc-connections",
90078
- capScope: "system",
90079
- addonId: null,
90080
- access: "view",
90081
- role: "admin"
90082
- },
90083
- "oidcConnections.createConnection": {
90084
- capName: "oidc-connections",
90085
- capScope: "system",
90086
- addonId: null,
90087
- access: "create",
90088
- role: "admin"
90089
- },
90090
- "oidcConnections.deleteConnection": {
90091
- capName: "oidc-connections",
90092
- capScope: "system",
90093
- addonId: null,
90094
- access: "delete",
90095
- role: "admin"
90096
- },
90097
- "oidcConnections.listConnections": {
90098
- capName: "oidc-connections",
90099
- capScope: "system",
90100
- addonId: null,
90101
- access: "view",
90102
- role: "admin"
90103
- },
90104
- "oidcConnections.updateConnection": {
90105
- capName: "oidc-connections",
90106
- capScope: "system",
90107
- addonId: null,
90108
- access: "create",
90109
- role: "admin"
90110
- },
90111
90008
  "osd.getStatus": {
90112
90009
  capName: "osd",
90113
90010
  capScope: "device",
@@ -93139,13 +93036,6 @@ Object.freeze({
93139
93036
  access: "delete",
93140
93037
  role: "admin"
93141
93038
  },
93142
- "storage.deleteLocation": {
93143
- capName: "storage",
93144
- capScope: "system",
93145
- addonId: null,
93146
- access: "delete",
93147
- role: "admin"
93148
- },
93149
93039
  "storage.endDownload": {
93150
93040
  capName: "storage",
93151
93041
  capScope: "system",
@@ -93202,13 +93092,6 @@ Object.freeze({
93202
93092
  access: "view",
93203
93093
  role: "admin"
93204
93094
  },
93205
- "storage.listProviders": {
93206
- capName: "storage",
93207
- capScope: "system",
93208
- addonId: null,
93209
- access: "view",
93210
- role: "admin"
93211
- },
93212
93095
  "storage.read": {
93213
93096
  capName: "storage",
93214
93097
  capScope: "system",
@@ -93230,27 +93113,6 @@ Object.freeze({
93230
93113
  access: "view",
93231
93114
  role: "admin"
93232
93115
  },
93233
- "storage.testConfig": {
93234
- capName: "storage",
93235
- capScope: "system",
93236
- addonId: null,
93237
- access: "view",
93238
- role: "admin"
93239
- },
93240
- "storage.testLocation": {
93241
- capName: "storage",
93242
- capScope: "system",
93243
- addonId: null,
93244
- access: "view",
93245
- role: "admin"
93246
- },
93247
- "storage.upsertLocation": {
93248
- capName: "storage",
93249
- capScope: "system",
93250
- addonId: null,
93251
- access: "create",
93252
- role: "admin"
93253
- },
93254
93116
  "storage.write": {
93255
93117
  capName: "storage",
93256
93118
  capScope: "system",
@@ -94028,27 +93890,6 @@ Object.freeze({
94028
93890
  access: "create",
94029
93891
  role: "admin"
94030
93892
  },
94031
- "terminalSession.createInstance": {
94032
- capName: "terminal-session",
94033
- capScope: "system",
94034
- addonId: null,
94035
- access: "create",
94036
- role: "admin"
94037
- },
94038
- "terminalSession.deleteInstance": {
94039
- capName: "terminal-session",
94040
- capScope: "system",
94041
- addonId: null,
94042
- access: "delete",
94043
- role: "admin"
94044
- },
94045
- "terminalSession.listInstances": {
94046
- capName: "terminal-session",
94047
- capScope: "system",
94048
- addonId: null,
94049
- access: "view",
94050
- role: "admin"
94051
- },
94052
93893
  "terminalSession.listLegacyCameras": {
94053
93894
  capName: "terminal-session",
94054
93895
  capScope: "system",
@@ -94091,20 +93932,6 @@ Object.freeze({
94091
93932
  access: "create",
94092
93933
  role: "admin"
94093
93934
  },
94094
- "terminalSession.setInstanceEnabled": {
94095
- capName: "terminal-session",
94096
- capScope: "system",
94097
- addonId: null,
94098
- access: "create",
94099
- role: "admin"
94100
- },
94101
- "terminalSession.updateInstance": {
94102
- capName: "terminal-session",
94103
- capScope: "system",
94104
- addonId: null,
94105
- access: "create",
94106
- role: "admin"
94107
- },
94108
93935
  "terminalSession.writeInput": {
94109
93936
  capName: "terminal-session",
94110
93937
  capScope: "system",
@@ -94119,6 +93946,13 @@ Object.freeze({
94119
93946
  access: "create",
94120
93947
  role: "viewer"
94121
93948
  },
93949
+ "timedRun.getOptions": {
93950
+ capName: "timed-run",
93951
+ capScope: "device",
93952
+ addonId: null,
93953
+ access: "view",
93954
+ role: "viewer"
93955
+ },
94122
93956
  "timedRun.getStatus": {
94123
93957
  capName: "timed-run",
94124
93958
  capScope: "device",
@@ -94133,6 +93967,13 @@ Object.freeze({
94133
93967
  access: "create",
94134
93968
  role: "viewer"
94135
93969
  },
93970
+ "timedRun.setSettings": {
93971
+ capName: "timed-run",
93972
+ capScope: "device",
93973
+ addonId: null,
93974
+ access: "create",
93975
+ role: "admin"
93976
+ },
94136
93977
  "toast.onToast": {
94137
93978
  capName: "toast",
94138
93979
  capScope: "system",
@@ -94245,20 +94086,6 @@ Object.freeze({
94245
94086
  access: "create",
94246
94087
  role: "admin"
94247
94088
  },
94248
- "trainingProvider.createEntry": {
94249
- capName: "training-provider",
94250
- capScope: "system",
94251
- addonId: null,
94252
- access: "create",
94253
- role: "admin"
94254
- },
94255
- "trainingProvider.deleteEntry": {
94256
- capName: "training-provider",
94257
- capScope: "system",
94258
- addonId: null,
94259
- access: "delete",
94260
- role: "admin"
94261
- },
94262
94089
  "trainingProvider.describe": {
94263
94090
  capName: "training-provider",
94264
94091
  capScope: "system",
@@ -94329,13 +94156,6 @@ Object.freeze({
94329
94156
  access: "create",
94330
94157
  role: "admin"
94331
94158
  },
94332
- "trainingProvider.updateEntry": {
94333
- capName: "training-provider",
94334
- capScope: "system",
94335
- addonId: null,
94336
- access: "create",
94337
- role: "admin"
94338
- },
94339
94159
  "trainingProvider.uploadDataset": {
94340
94160
  capName: "training-provider",
94341
94161
  capScope: "system",
@@ -94343,13 +94163,6 @@ Object.freeze({
94343
94163
  access: "create",
94344
94164
  role: "admin"
94345
94165
  },
94346
- "trainingProvider.validateCredentials": {
94347
- capName: "training-provider",
94348
- capScope: "system",
94349
- addonId: null,
94350
- access: "create",
94351
- role: "admin"
94352
- },
94353
94166
  "turnProvider.getTurnServers": {
94354
94167
  capName: "turn-provider",
94355
94168
  capScope: "system",
@@ -95309,6 +95122,7 @@ function createRuntimeStateBridge(params) {
95309
95122
  getStatus
95310
95123
  };
95311
95124
  }
95125
+ string().min(1).max(4096);
95312
95126
  Object.freeze({
95313
95127
  "accessories.getStatus": [{
95314
95128
  name: "deviceId",
@@ -95992,6 +95806,11 @@ Object.freeze({
95992
95806
  form: "single",
95993
95807
  optional: false
95994
95808
  }],
95809
+ "deviceManager.setAlias": [{
95810
+ name: "deviceId",
95811
+ form: "single",
95812
+ optional: false
95813
+ }],
95995
95814
  "deviceManager.setChildLayout": [{
95996
95815
  name: "deviceId",
95997
95816
  form: "single",
@@ -98056,6 +97875,11 @@ Object.freeze({
98056
97875
  form: "single",
98057
97876
  optional: false
98058
97877
  }],
97878
+ "timedRun.getOptions": [{
97879
+ name: "deviceId",
97880
+ form: "single",
97881
+ optional: false
97882
+ }],
98059
97883
  "timedRun.getStatus": [{
98060
97884
  name: "deviceId",
98061
97885
  form: "single",
@@ -98066,6 +97890,11 @@ Object.freeze({
98066
97890
  form: "single",
98067
97891
  optional: false
98068
97892
  }],
97893
+ "timedRun.setSettings": [{
97894
+ name: "deviceId",
97895
+ form: "single",
97896
+ optional: false
97897
+ }],
98069
97898
  "update.getStatus": [{
98070
97899
  name: "deviceId",
98071
97900
  form: "single",
@@ -98928,6 +98757,7 @@ var STATE_SUMMARY_VARS = [
98928
98757
  [...RULE_TEXT],
98929
98758
  [...RULE_TEXT],
98930
98759
  [...RULE_TEXT],
98760
+ [...RULE_TEXT],
98931
98761
  [...RULE_BODY_ONLY],
98932
98762
  [...RULE_TEXT],
98933
98763
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
@@ -113223,7 +113053,13 @@ function buildHikvisionInstances(records) {
113223
113053
  },
113224
113054
  instanceMode: "single",
113225
113055
  kind: "connection",
113226
- canTest: false
113056
+ canTest: false,
113057
+ kinds: [{
113058
+ id: "connection",
113059
+ label: "Hikvision",
113060
+ functionCap: "device-provider",
113061
+ role: "devices"
113062
+ }]
113227
113063
  },
113228
113064
  formSchema: () => ({ sections: [] }),
113229
113065
  initialBody: (name) => ({ name }),