@camstack/addon-provider-velux 0.2.127 → 0.2.129

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 (3) hide show
  1. package/dist/addon.js +1627 -134
  2. package/dist/addon.mjs +1627 -134
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-C4hVnRo8.mjs
2
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -63,6 +63,33 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
63
63
  * consumes this category and maps it to the `addon-crash-loop` kind.
64
64
  */
65
65
  EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
66
+ /**
67
+ * A runner whose addon refused to start with a typed reason (D877) - parked
68
+ * in `refused`, never counted by the crash breaker, retried on operator
69
+ * action. One event per refusal.
70
+ */
71
+ EventCategory["AddonRunnerRefused"] = "addon.runner-refused";
72
+ /**
73
+ * A runner settled on a state (D877): `running` (READY), `crashed`, `failed` or
74
+ * `refused`. In-process telemetry for the boot check (re-evaluate while any
75
+ * runner is still pending) and the alert centre (close a recovered runner).
76
+ */
77
+ EventCategory["ProcessStateChanged"] = "process.state-changed";
78
+ /**
79
+ * The node's one-shot runner boot check (D877): planned runners against the
80
+ * process service, `degraded` when any is failed, refused or missing. The
81
+ * alert centre turns it into one critical alert.
82
+ */
83
+ EventCategory["SystemRunnerCheck"] = "system.runner-check";
84
+ /**
85
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
86
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
87
+ * centre sends no notification of its own: Notification Center turns this
88
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
89
+ * system-event kinds, and reconciles from the alerts store because a bus
90
+ * event may be dropped (D8, D11).
91
+ */
92
+ EventCategory["AlertEpisode"] = "alert.episode";
66
93
  EventCategory["AddonError"] = "addon.error";
67
94
  EventCategory["AddonPageReady"] = "addon.page-ready";
68
95
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5387,7 +5414,7 @@ var ZodIssueCode = {
5387
5414
  var ZodFirstPartyTypeKind;
5388
5415
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5389
5416
  //#endregion
5390
- //#region ../types/dist/sleep-DRqxtc0C.mjs
5417
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5391
5418
  /**
5392
5419
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5393
5420
  * window to float samples (D455).
@@ -5504,7 +5531,7 @@ function isKeychainStoredField(field) {
5504
5531
  var SECRET_CLEAR = { $secretClear: true };
5505
5532
  /** The `'***'` token D634 redaction writes for non-admins. */
5506
5533
  var LEGACY_DEVICE_REDACTION = "***";
5507
- function isRecord$2(value) {
5534
+ function isRecord$5(value) {
5508
5535
  return typeof value === "object" && value !== null && !Array.isArray(value);
5509
5536
  }
5510
5537
  function makeSecretMarker(ref) {
@@ -5515,12 +5542,12 @@ function makeSecretMarker(ref) {
5515
5542
  }
5516
5543
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5517
5544
  function isSecretMarker(value) {
5518
- if (!isRecord$2(value)) return false;
5545
+ if (!isRecord$5(value)) return false;
5519
5546
  const ref = value["$secret"];
5520
5547
  return typeof ref === "string" && ref.length > 0;
5521
5548
  }
5522
5549
  function isSecretClear(value) {
5523
- return isRecord$2(value) && value["$secretClear"] === true;
5550
+ return isRecord$5(value) && value["$secretClear"] === true;
5524
5551
  }
5525
5552
  /**
5526
5553
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6130,7 +6157,7 @@ var KeychainWriteRefusedError = class extends Error {
6130
6157
  }
6131
6158
  };
6132
6159
  var KEEP = { kind: "keep" };
6133
- function isRecord$1(value) {
6160
+ function isRecord$4(value) {
6134
6161
  return typeof value === "object" && value !== null && !Array.isArray(value);
6135
6162
  }
6136
6163
  function defaultMintId() {
@@ -6143,7 +6170,7 @@ function collectSecretMarkerRefs(value, out = []) {
6143
6170
  return out;
6144
6171
  }
6145
6172
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6146
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6173
+ else if (isRecord$4(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6147
6174
  return out;
6148
6175
  }
6149
6176
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6198,7 +6225,7 @@ function rowId(row, idKey) {
6198
6225
  return null;
6199
6226
  }
6200
6227
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6201
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6228
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$4) : [];
6202
6229
  if (!Array.isArray(incoming)) {
6203
6230
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6204
6231
  return {
@@ -6214,7 +6241,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6214
6241
  const kept = /* @__PURE__ */ new Set();
6215
6242
  const rows = [];
6216
6243
  for (const row of incoming) {
6217
- if (!isRecord$1(row)) {
6244
+ if (!isRecord$4(row)) {
6218
6245
  rows.push(row);
6219
6246
  continue;
6220
6247
  }
@@ -6239,7 +6266,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6239
6266
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6240
6267
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6241
6268
  case "object": {
6242
- if (!isRecord$1(incoming)) {
6269
+ if (!isRecord$4(incoming)) {
6243
6270
  if (incoming === void 0) return KEEP;
6244
6271
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6245
6272
  return {
@@ -6247,7 +6274,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6247
6274
  value: incoming
6248
6275
  };
6249
6276
  }
6250
- const storedObj = isRecord$1(stored) ? stored : {};
6277
+ const storedObj = isRecord$4(stored) ? stored : {};
6251
6278
  return {
6252
6279
  kind: "value",
6253
6280
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6370,7 +6397,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6370
6397
  value: items
6371
6398
  };
6372
6399
  }
6373
- if (isRecord$1(v)) {
6400
+ if (isRecord$4(v)) {
6374
6401
  const out = {};
6375
6402
  for (const [k, child] of Object.entries(v)) {
6376
6403
  const s = substitute(child);
@@ -6402,7 +6429,7 @@ var SecretOverwriteRefusedError = class extends Error {
6402
6429
  this.name = "SecretOverwriteRefusedError";
6403
6430
  }
6404
6431
  };
6405
- function isRecord(value) {
6432
+ function isRecord$3(value) {
6406
6433
  return typeof value === "object" && value !== null && !Array.isArray(value);
6407
6434
  }
6408
6435
  function resolvedValue(pass, marker) {
@@ -6431,7 +6458,7 @@ function inArray(pass, incoming, stored) {
6431
6458
  return incoming.map((item, index) => {
6432
6459
  const twin = stored[index];
6433
6460
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
6434
- if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
6461
+ if (isRecord$3(item) && isRecord$3(twin)) return inArrayRow(pass, item, twin);
6435
6462
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
6436
6463
  return item;
6437
6464
  });
@@ -6442,7 +6469,7 @@ function inArrayRow(pass, incoming, stored) {
6442
6469
  const twin = stored[key];
6443
6470
  if (isSecretMarker(twin)) {
6444
6471
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
6445
- } else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
6472
+ } else if (isRecord$3(value) && isRecord$3(twin)) out[key] = inArrayRow(pass, value, twin);
6446
6473
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
6447
6474
  }
6448
6475
  return out;
@@ -6450,7 +6477,7 @@ function inArrayRow(pass, incoming, stored) {
6450
6477
  async function walk(pass, incoming, stored) {
6451
6478
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
6452
6479
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
6453
- if (!isRecord(incoming) || !isRecord(stored)) return incoming;
6480
+ if (!isRecord$3(incoming) || !isRecord$3(stored)) return incoming;
6454
6481
  const out = { ...incoming };
6455
6482
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
6456
6483
  return out;
@@ -6481,7 +6508,7 @@ async function restoreUnchangedSecrets(input) {
6481
6508
  function isJsonEqual(a, b) {
6482
6509
  if (Object.is(a, b)) return true;
6483
6510
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
6484
- if (isRecord(a) && isRecord(b)) {
6511
+ if (isRecord$3(a) && isRecord$3(b)) {
6485
6512
  const keys = Object.keys(a);
6486
6513
  if (keys.length !== Object.keys(b).length) return false;
6487
6514
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -6505,7 +6532,7 @@ function markerKeysOf(blob, owner) {
6505
6532
  }
6506
6533
  function nodeFromStored(value, owner) {
6507
6534
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
6508
- if (!isRecord(value)) return null;
6535
+ if (!isRecord$3(value)) return null;
6509
6536
  const children = /* @__PURE__ */ new Map();
6510
6537
  for (const [key, child] of Object.entries(value)) {
6511
6538
  const node = nodeFromStored(child, owner);
@@ -6638,7 +6665,6 @@ function createHandle(raw, opts) {
6638
6665
  const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
6639
6666
  const readAddonStoreResult = raw.readAddonStoreResult;
6640
6667
  const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
6641
- const readDeviceStoreBatch = raw.readDeviceStoreBatch;
6642
6668
  const overrides = {
6643
6669
  readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
6644
6670
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
@@ -6662,12 +6688,12 @@ function createHandle(raw, opts) {
6662
6688
  };
6663
6689
  } } : {},
6664
6690
  readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
6665
- ...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
6666
- const rows = await readDeviceStoreBatch.call(raw, deviceIds);
6691
+ readDeviceStoreBatch: async (deviceIds) => {
6692
+ const rows = await raw.readDeviceStoreBatch(deviceIds);
6667
6693
  const out = /* @__PURE__ */ new Map();
6668
6694
  for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
6669
6695
  return out;
6670
- } } : {},
6696
+ },
6671
6697
  writeAddonStore: async (patch) => {
6672
6698
  await writeAddon(patch);
6673
6699
  },
@@ -7294,7 +7320,7 @@ var BaseAddon = class {
7294
7320
  if (!ctx) return;
7295
7321
  const addonId = ctx.id;
7296
7322
  setImmediate(() => {
7297
- ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
7323
+ ctx.api.addons.restartAddon.mutate({ addonId }).then(() => {
7298
7324
  ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
7299
7325
  }).catch((err) => {
7300
7326
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
@@ -7494,7 +7520,7 @@ var BaseAddon = class {
7494
7520
  return this._addonSecretTree;
7495
7521
  }
7496
7522
  deviceSecretTree() {
7497
- this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7523
+ this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
7498
7524
  return this._deviceSecretTree;
7499
7525
  }
7500
7526
  /**
@@ -7570,42 +7596,135 @@ var BaseAddon = class {
7570
7596
  this[timerOf] = timer;
7571
7597
  }
7572
7598
  /**
7573
- * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
7574
- * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
7575
- * swap, or any race where the SqliteSettingsBackend is between shutdown and
7576
- * re-initialize) doesn't propagate up into `initialize()` and leave the
7599
+ * Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
7600
+ * settings-store outage doesn't propagate up into `initialize()` and leave the
7577
7601
  * addon permanently broken.
7578
7602
  *
7579
- * Retry only the two known infra fingerprints. Anything else propagates so
7580
- * real bugs surface immediately. After the budget expires we fall back to
7581
- * `{}` (defaults) — the addon's first successful patch will rehydrate.
7603
+ * Two kinds of outage, two budgets:
7604
+ * - the store's own restart fingerprints (`SqliteSettingsBackend not
7605
+ * initialized`, `provider not available`): a short budget, then the addon
7606
+ * falls back to `{}` (defaults) - its first successful patch rehydrates;
7607
+ * - a TRANSPORT failure (the hub is restarting while this runner boots:
7608
+ * `discovery deadline exceeded`, `parent could not route`, a refused or
7609
+ * timed-out connection). Since D870 a runner's settings read THROWS instead
7610
+ * of answering `{}`, so without a budget a hub restart ends in a respawn
7611
+ * loop. A long, bounded budget; only after it the error propagates - the
7612
+ * addon never runs on defaults for a store it could not ask.
7613
+ * Anything else propagates immediately so real bugs surface.
7582
7614
  */
7583
7615
  async readAddonStoreWithRetry() {
7584
7616
  const settings = this.rawSettings();
7585
7617
  if (!settings) return {};
7586
- const delaysMs = [
7587
- 150,
7588
- 350,
7589
- 600,
7590
- 900
7591
- ];
7592
7618
  let lastErr;
7593
- for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
7619
+ for (let attempt = 0;; attempt++) try {
7594
7620
  const stored = await settings.readAddonStore() ?? {};
7595
7621
  this.settingsStoreReady = true;
7596
7622
  return stored;
7597
7623
  } catch (err) {
7598
7624
  lastErr = err;
7599
- const msg = err instanceof Error ? err.message : String(err);
7600
- if (!(msg.includes("SqliteSettingsBackend not initialized") || msg.includes("provider not available"))) throw err;
7601
- if (attempt === delaysMs.length) break;
7602
- await new Promise((r) => setTimeout(r, delaysMs[attempt]));
7625
+ const kind = classifyStoreError(err);
7626
+ if (kind === "permanent") throw err;
7627
+ const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
7628
+ if (delay === void 0) {
7629
+ if (kind === "transport") throw err;
7630
+ break;
7631
+ }
7632
+ await new Promise((r) => setTimeout(r, delay));
7603
7633
  }
7604
7634
  this.settingsStoreReady = false;
7605
7635
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
7606
7636
  return {};
7607
7637
  }
7608
7638
  };
7639
+ /** The settings store's own restart fingerprints. */
7640
+ var RESTART_RETRY_DELAYS_MS = [
7641
+ 150,
7642
+ 350,
7643
+ 600,
7644
+ 900
7645
+ ];
7646
+ /** A hub restarting under a booting runner: ~100 s in total. */
7647
+ var TRANSPORT_RETRY_DELAYS_MS = [
7648
+ 150,
7649
+ 350,
7650
+ 600,
7651
+ 900,
7652
+ 2e3,
7653
+ 5e3,
7654
+ 1e4,
7655
+ 2e4,
7656
+ 3e4,
7657
+ 3e4
7658
+ ];
7659
+ var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
7660
+ /** Node / socket error codes of a connection that did not happen or broke. */
7661
+ var TRANSPORT_CODES = new Set([
7662
+ "ECONNREFUSED",
7663
+ "ECONNRESET",
7664
+ "ETIMEDOUT",
7665
+ "EPIPE",
7666
+ "EHOSTUNREACH",
7667
+ "ENETUNREACH"
7668
+ ]);
7669
+ /** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
7670
+ var UNAVAILABLE_TRPC_CODES = new Set([
7671
+ "TIMEOUT",
7672
+ "SERVICE_UNAVAILABLE",
7673
+ "BAD_GATEWAY",
7674
+ "GATEWAY_TIMEOUT"
7675
+ ]);
7676
+ /** The exact phrases OUR transport raises when it cannot reach the hub. */
7677
+ var TRANSPORT_PHRASES = [
7678
+ "discovery deadline exceeded",
7679
+ "parent could not route child unowned cap call",
7680
+ "UDS request timed out after",
7681
+ "channel closed"
7682
+ ];
7683
+ /** Moleculer error `type`s of a call that could not be served right now. */
7684
+ var MOLECULER_TRANSIENT_TYPES = new Set([
7685
+ "REQUEST_TIMEOUT",
7686
+ "SERVICE_NOT_FOUND",
7687
+ "SERVICE_NOT_AVAILABLE",
7688
+ "REQUEST_REJECTED",
7689
+ "BROKER_DISCONNECTED"
7690
+ ]);
7691
+ function stringProp(value, key) {
7692
+ if (typeof value !== "object" || value === null) return void 0;
7693
+ const found = Reflect.get(value, key);
7694
+ return typeof found === "string" ? found : void 0;
7695
+ }
7696
+ /** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
7697
+ function errorCode(err) {
7698
+ const out = {};
7699
+ const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
7700
+ const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
7701
+ const node = stringProp(err, "code") ?? stringProp(cause, "code");
7702
+ if (node !== void 0) out.node = node;
7703
+ const trpc = stringProp(data, "code");
7704
+ if (trpc !== void 0) out.trpc = trpc;
7705
+ return out;
7706
+ }
7707
+ /**
7708
+ * Is a settings read failure worth retrying, and with which budget? Only
7709
+ * EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
7710
+ * one of the exact phrases our own transport raises. A message that merely
7711
+ * contains "timed out" or "unreachable" is not evidence of anything, and
7712
+ * `settings store not wired` is a wiring bug that retrying cannot fix.
7713
+ */
7714
+ function classifyStoreError(err) {
7715
+ const message = err instanceof Error ? err.message : String(err);
7716
+ if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
7717
+ const code = errorCode(err);
7718
+ if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
7719
+ if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
7720
+ if (typeof err === "object" && err !== null) {
7721
+ if (Reflect.get(err, "retryable") === true) return "transport";
7722
+ const type = stringProp(err, "type");
7723
+ if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
7724
+ }
7725
+ if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
7726
+ return "permanent";
7727
+ }
7609
7728
  /**
7610
7729
  * Collect the keys of every field marked `perNode: true`, recursing into
7611
7730
  * layout containers (`group` fields and `sub-tabs` tabs) the same way
@@ -7695,6 +7814,156 @@ var PeerBytesTicketSchema = object({
7695
7814
  */
7696
7815
  declaredBytes: number().int().nonnegative().nullable()
7697
7816
  });
7817
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
7818
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
7819
+ var RECORD_DATABASES = ["settings", "events"];
7820
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
7821
+ var RECORD_CLASSES = [
7822
+ "config",
7823
+ "ledger",
7824
+ "audit",
7825
+ "mirror",
7826
+ "ephemeral"
7827
+ ];
7828
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
7829
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
7830
+ var RECORD_BATCH_MAX = 1e3;
7831
+ var RECORD_QUERY_MAX = 1e3;
7832
+ function defOf(schema) {
7833
+ const zodBag = Reflect.get(schema, "_zod");
7834
+ if (typeof zodBag !== "object" || zodBag === null) return {};
7835
+ const def = Reflect.get(zodBag, "def");
7836
+ if (typeof def !== "object" || def === null) return {};
7837
+ return def;
7838
+ }
7839
+ function declaredHere(schema) {
7840
+ return globalRegistry.get(schema)?.secret === true;
7841
+ }
7842
+ /** Wrapper kinds whose `innerType` is the field itself. */
7843
+ var WRAPPERS = new Set([
7844
+ "optional",
7845
+ "nullable",
7846
+ "default",
7847
+ "prefault",
7848
+ "catch",
7849
+ "readonly",
7850
+ "nonoptional"
7851
+ ]);
7852
+ /**
7853
+ * The schema layers that make up ONE field: the schema itself and every
7854
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
7855
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
7856
+ * `.transform` on `in`).
7857
+ */
7858
+ function layersOf(schema) {
7859
+ const out = [];
7860
+ const queue = [schema];
7861
+ while (queue.length > 0) {
7862
+ const s = queue.shift();
7863
+ if (!s || out.includes(s)) continue;
7864
+ out.push(s);
7865
+ const def = defOf(s);
7866
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
7867
+ if (def.type === "pipe") {
7868
+ if (def.in) queue.push(def.in);
7869
+ if (def.out) queue.push(def.out);
7870
+ }
7871
+ }
7872
+ return out;
7873
+ }
7874
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
7875
+ function isZodSecret(schema) {
7876
+ return layersOf(schema).some(declaredHere);
7877
+ }
7878
+ /**
7879
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
7880
+ * element of this array" (`connection.password`, `rows[].token`). A declared
7881
+ * object or array is reported as one path and not descended into — everything
7882
+ * under it is secret.
7883
+ */
7884
+ function collectZodSecretPaths(schema, prefix = "") {
7885
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
7886
+ const paths = [];
7887
+ for (const layer of layersOf(schema)) {
7888
+ const def = defOf(layer);
7889
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
7890
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
7891
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
7892
+ else if (def.type === "intersection") {
7893
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
7894
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
7895
+ }
7896
+ }
7897
+ return [...new Set(paths)];
7898
+ }
7899
+ /**
7900
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
7901
+ * Zod row schema that describes it, and the helper that turns the two into the
7902
+ * JSON the engine stores.
7903
+ *
7904
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
7905
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
7906
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
7907
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
7908
+ * never a field name (D879).
7909
+ */
7910
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
7911
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
7912
+ var RecordIndexSchema = object({
7913
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
7914
+ fields: array(RecordFieldPathSchema).min(1).max(4),
7915
+ unique: boolean().optional()
7916
+ }).strict();
7917
+ var RecordRetentionSchema = union([
7918
+ object({
7919
+ ttlMs: number().int().positive(),
7920
+ from: _enum(["at", "write"])
7921
+ }).strict(),
7922
+ object({
7923
+ maxRows: number().int().positive().optional(),
7924
+ maxRowsPerDevice: number().int().positive().optional()
7925
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
7926
+ object({
7927
+ owner: string().min(1),
7928
+ reason: string().min(1)
7929
+ }).strict(),
7930
+ object({ none: string().min(1) }).strict()
7931
+ ]);
7932
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
7933
+ var EntryDescriptorSchema = object({
7934
+ title: string().min(1),
7935
+ /** The record body field shown as the entry's name. */
7936
+ nameField: string().min(1),
7937
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
7938
+ fields: record(string(), unknown())
7939
+ }).strict();
7940
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
7941
+ var RecordKindDeclarationSchema = object({
7942
+ database: _enum(RECORD_DATABASES).default("settings"),
7943
+ class: _enum(RECORD_CLASSES),
7944
+ writeTrigger: string().min(1),
7945
+ device: _enum([
7946
+ "required",
7947
+ "optional",
7948
+ "none"
7949
+ ]).default("none"),
7950
+ at: _enum(["required", "none"]).default("none"),
7951
+ indexes: array(RecordIndexSchema).max(8).default([]),
7952
+ retention: RecordRetentionSchema,
7953
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
7954
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
7955
+ /** Derived from the Zod schema; never written by hand. */
7956
+ secretPaths: array(string().min(1)).default([]),
7957
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
7958
+ secretArrayKeys: record(string(), string()).default({}),
7959
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
7960
+ adoptsFrom: string().min(1).optional(),
7961
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
7962
+ transactFamily: string().min(1).optional(),
7963
+ entry: EntryDescriptorSchema.optional()
7964
+ }).strict();
7965
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
7966
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7698
7967
  /** Shared Zod schemas used across streaming capabilities. */
7699
7968
  var CamProfileSchema = _enum([
7700
7969
  "high",
@@ -8159,69 +8428,6 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
8159
8428
  kind: "mutation",
8160
8429
  auth: "admin"
8161
8430
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
8162
- function defOf(schema) {
8163
- return schema._zod?.def ?? {};
8164
- }
8165
- function declaredHere(schema) {
8166
- return globalRegistry.get(schema)?.secret === true;
8167
- }
8168
- /** Wrapper kinds whose `innerType` is the field itself. */
8169
- var WRAPPERS = new Set([
8170
- "optional",
8171
- "nullable",
8172
- "default",
8173
- "prefault",
8174
- "catch",
8175
- "readonly",
8176
- "nonoptional"
8177
- ]);
8178
- /**
8179
- * The schema layers that make up ONE field: the schema itself and every
8180
- * wrapper below it (optional / default / nullable / readonly / catch), plus
8181
- * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
8182
- * `.transform` on `in`).
8183
- */
8184
- function layersOf(schema) {
8185
- const out = [];
8186
- const queue = [schema];
8187
- while (queue.length > 0) {
8188
- const s = queue.shift();
8189
- if (!s || out.includes(s)) continue;
8190
- out.push(s);
8191
- const def = defOf(s);
8192
- if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
8193
- if (def.type === "pipe") {
8194
- if (def.in) queue.push(def.in);
8195
- if (def.out) queue.push(def.out);
8196
- }
8197
- }
8198
- return out;
8199
- }
8200
- /** True when any layer of this field declares `.meta({ secret: true })`. */
8201
- function isZodSecret(schema) {
8202
- return layersOf(schema).some(declaredHere);
8203
- }
8204
- /**
8205
- * Every declared secret path in a config schema: dotted keys, `[]` for "each
8206
- * element of this array" (`connection.password`, `rows[].token`). A declared
8207
- * object or array is reported as one path and not descended into — everything
8208
- * under it is secret.
8209
- */
8210
- function collectZodSecretPaths(schema, prefix = "") {
8211
- if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
8212
- const paths = [];
8213
- for (const layer of layersOf(schema)) {
8214
- const def = defOf(layer);
8215
- if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
8216
- else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
8217
- else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
8218
- else if (def.type === "intersection") {
8219
- if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
8220
- if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
8221
- }
8222
- }
8223
- return [...new Set(paths)];
8224
- }
8225
8431
  object({
8226
8432
  code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
8227
8433
  params: record(string(), union([string(), number()])).optional()
@@ -8241,7 +8447,7 @@ function userError(code, params, englishFallback) {
8241
8447
  return new CamstackError(code, params, englishFallback);
8242
8448
  }
8243
8449
  //#endregion
8244
- //#region ../types/dist/err-msg-DLerKiVO.mjs
8450
+ //#region ../types/dist/err-msg-BXKzRBwg.mjs
8245
8451
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
8246
8452
  DeviceType["Camera"] = "camera";
8247
8453
  DeviceType["Hub"] = "hub";
@@ -8333,6 +8539,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
8333
8539
  * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
8334
8540
  * integrations sharing the same food/desiccant/hopper surface. */
8335
8541
  DeviceType["PetFeeder"] = "pet-feeder";
8542
+ /** Built-in dishwasher — program lifecycle, door / remote-start gates,
8543
+ * salt and rinse-aid levels. Installed with the `dishwasher` cap.
8544
+ * Sources: native Bosch Home Connect, reusable by similar integrations. */
8545
+ DeviceType["Dishwasher"] = "dishwasher";
8336
8546
  return DeviceType;
8337
8547
  }({});
8338
8548
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -8510,6 +8720,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8510
8720
  /** Virtual HA toggle (input_boolean.*) — distinguishable from a
8511
8721
  * real Switch device for UI rendering / export adapters. */
8512
8722
  DeviceRole["BinaryHelper"] = "binary-helper";
8723
+ /** A smart plug: a `switch` whose source says it is an outlet (HA
8724
+ * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
8725
+ DeviceRole["Outlet"] = "outlet";
8513
8726
  /** Generic motion / occupancy / moving event source. Distinct from
8514
8727
  * the camera accessory PirSensor role: that one is a camera child;
8515
8728
  * this is a standalone HA / 3rd-party motion sensor. */
@@ -8587,7 +8800,7 @@ function errMsg(err) {
8587
8800
  return String(err);
8588
8801
  }
8589
8802
  //#endregion
8590
- //#region ../types/dist/composition-EQ9Ok0Ee.mjs
8803
+ //#region ../types/dist/composition-CB6PMT9p.mjs
8591
8804
  /**
8592
8805
  * The ffmpeg build every CamStack node downloads, per platform and arch.
8593
8806
  *
@@ -11791,11 +12004,10 @@ var ClipModelMetaSchema = object({
11791
12004
  /**
11792
12005
  * The `vector-store` index this model's vectors live in. ONE feature space
11793
12006
  * per index: two models share an index only when their vectors are ranked
11794
- * against each other, which for CLIP means never across families. MobileCLIP
11795
- * S1 and S2 share `object-clip` for history (separated by the row's
11796
- * `modelId`); any other model gets its own.
12007
+ * against each other, which for CLIP means never across families. Every
12008
+ * model gets its own.
11797
12009
  */
11798
- vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
12010
+ vectorIndex: string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
11799
12011
  /**
11800
12012
  * The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
11801
12013
  * must be unique per tokenizer: every model's siblings land in ONE flat
@@ -12974,8 +13186,20 @@ var AlertSeveritySchema = _enum([
12974
13186
  "info",
12975
13187
  "success",
12976
13188
  "warning",
12977
- "error"
13189
+ "error",
13190
+ "critical"
12978
13191
  ]);
13192
+ var AlertActionSchema = object({
13193
+ label: string(),
13194
+ href: string().optional(),
13195
+ /**
13196
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13197
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13198
+ * start) — the browser must leave the SPA with a full navigation, because
13199
+ * the SPA has no such route and would bounce to the home page.
13200
+ */
13201
+ navigation: _enum(["app", "server"]).optional()
13202
+ });
12979
13203
  var AlertStatusSchema = _enum([
12980
13204
  "active",
12981
13205
  "in-progress",
@@ -12993,6 +13217,7 @@ var AlertSchema = object({
12993
13217
  severity: AlertSeveritySchema,
12994
13218
  title: string(),
12995
13219
  message: string(),
13220
+ action: AlertActionSchema.optional(),
12996
13221
  status: AlertStatusSchema,
12997
13222
  progress: number().optional(),
12998
13223
  read: boolean(),
@@ -15528,6 +15753,41 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
15528
15753
  keyField: string()
15529
15754
  }).optional()
15530
15755
  })) });
15756
+ /**
15757
+ * The report of a one-shot "move this owner's plaintext secrets into the
15758
+ * keychain" run (D878). COUNTS only - never a value, never a ref.
15759
+ *
15760
+ * The owner runs it on its own rows, through its own write path; an operator
15761
+ * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
15762
+ * Dry run (`apply: false`) reports what WOULD move and changes nothing.
15763
+ */
15764
+ var RawSecretMigrationInputSchema = object({
15765
+ /** `false` (the default of the script) = report only. */
15766
+ apply: boolean() });
15767
+ var RawSecretMigrationReportSchema = object({
15768
+ apply: boolean(),
15769
+ /** Rows that can carry a secret (a profile, an enrolment). */
15770
+ rows: number().int(),
15771
+ /** Rows whose secret was plaintext when the run started. */
15772
+ raw: number().int(),
15773
+ /** Rows that already held a keychain marker when the run started. */
15774
+ markers: number().int(),
15775
+ /** Plaintext rows moved by THIS run (always 0 on a dry run). */
15776
+ migrated: number().int(),
15777
+ /** Plaintext rows left in place because the move or its read-back failed. */
15778
+ failed: number().int(),
15779
+ /** After the run: rows still holding plaintext. */
15780
+ remainingRaw: number().int(),
15781
+ /** After the run: markers the keychain could not resolve right now. */
15782
+ unresolvedMarkers: number().int(),
15783
+ /**
15784
+ * A second, redundant copy of the secrets' rows that the run found (and, on
15785
+ * `apply`, deleted after verifying the first). Owners with a single copy omit it.
15786
+ */
15787
+ redundantCopies: number().int().optional(),
15788
+ /** True when nothing is raw and every marker resolves. */
15789
+ verified: boolean()
15790
+ });
15531
15791
  /** Where a block runs. The operator chooses — a block driving a device on an
15532
15792
  * agent is the reason placement is not fixed to the hub. */
15533
15793
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -15754,6 +16014,9 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
15754
16014
  }), SettingsUpdateResultSchema, {
15755
16015
  kind: "mutation",
15756
16016
  auth: "admin"
16017
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
16018
+ kind: "mutation",
16019
+ auth: "admin"
15757
16020
  }), method(object({}), object({ libs: array(object({
15758
16021
  filePath: string(),
15759
16022
  content: string()
@@ -16017,6 +16280,347 @@ id: union([string(), number()]) }), {
16017
16280
  auth: "admin"
16018
16281
  });
16019
16282
  /**
16283
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16284
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16285
+ * (operator intent, D870) and device-history (numbers over time, D850).
16286
+ *
16287
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16288
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16289
+ * that with the addon id closed over). It is deliberately NOT in any input
16290
+ * schema, so a session can never supply it, and a call with no stamp is refused
16291
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16292
+ * addons go through the owner's capability.
16293
+ *
16294
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16295
+ * never `[]`. Secret fields are never on the wire: a read shows the
16296
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16297
+ * resolves itself, and a write may carry only a keychain marker bound to the
16298
+ * row's own ref.
16299
+ *
16300
+ * Internal: addons reach it through `ctx.records`, never directly.
16301
+ */
16302
+ var RecordIdSchema = string().min(1).max(256);
16303
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16304
+ var RecordBodySchema = record(string(), unknown());
16305
+ var RecordInputSchema = object({
16306
+ id: RecordIdSchema,
16307
+ /** The device this row belongs to (D865 removal, per-device reads). */
16308
+ deviceId: number().int().optional(),
16309
+ /** The domain clock, ms: observed / created / opened. */
16310
+ at: number().int().optional(),
16311
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16312
+ expiresAt: number().int().optional(),
16313
+ data: RecordBodySchema
16314
+ });
16315
+ var RecordViewSchema = object({
16316
+ id: string(),
16317
+ deviceId: number().int().nullable(),
16318
+ at: number().nullable(),
16319
+ expiresAt: number().nullable(),
16320
+ rev: number().int(),
16321
+ updatedAt: number(),
16322
+ data: RecordBodySchema
16323
+ });
16324
+ /** Declared index fields only. Anything else does not compile, by design. */
16325
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16326
+ string(),
16327
+ number(),
16328
+ boolean(),
16329
+ object({ in: array(union([
16330
+ string(),
16331
+ number(),
16332
+ boolean()
16333
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16334
+ object({
16335
+ gt: union([string(), number()]).optional(),
16336
+ gte: union([string(), number()]).optional(),
16337
+ lt: union([string(), number()]).optional(),
16338
+ lte: union([string(), number()]).optional()
16339
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16340
+ ]));
16341
+ var KindShape = { kind: RecordKindNameSchema };
16342
+ var TimeWindowShape = {
16343
+ deviceId: number().int().optional(),
16344
+ atFrom: number().optional(),
16345
+ atTo: number().optional()
16346
+ };
16347
+ var RecordQueryInputSchema = object({
16348
+ ...KindShape,
16349
+ ...TimeWindowShape,
16350
+ where: RecordWhereSchema.optional(),
16351
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16352
+ order: _enum(["at", "id"]).optional(),
16353
+ desc: boolean().optional(),
16354
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16355
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16356
+ cursor: string().min(1).optional()
16357
+ });
16358
+ var RecordQueryResultSchema = object({
16359
+ records: array(RecordViewSchema),
16360
+ nextCursor: string().nullable()
16361
+ });
16362
+ var RecordKindStateSchema = _enum([
16363
+ "created",
16364
+ "unchanged",
16365
+ "updated"
16366
+ ]);
16367
+ var DeclareKindResultSchema = object({
16368
+ kindId: number().int(),
16369
+ state: RecordKindStateSchema,
16370
+ createdIndexes: array(string()),
16371
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16372
+ adoptionPending: object({
16373
+ legacyTable: string(),
16374
+ legacyRows: number().int()
16375
+ }).nullable()
16376
+ });
16377
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16378
+ var SecretRefsList = array(string());
16379
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16380
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16381
+ kind: "mutation",
16382
+ auth: "admin"
16383
+ }), method(object({
16384
+ ...KindShape,
16385
+ id: RecordIdSchema
16386
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16387
+ ...KindShape,
16388
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16389
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16390
+ ...KindShape,
16391
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16392
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16393
+ ...KindShape,
16394
+ record: RecordInputSchema,
16395
+ /** Compare-and-set. `0` means "the row must not exist". */
16396
+ ifRev: number().int().min(0).optional()
16397
+ }), object({
16398
+ rev: number().int(),
16399
+ releasedRefs: SecretRefsList
16400
+ }), {
16401
+ kind: "mutation",
16402
+ auth: "admin"
16403
+ }), method(object({
16404
+ ...KindShape,
16405
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16406
+ }), object({
16407
+ count: number().int(),
16408
+ releasedRefs: SecretRefsList
16409
+ }), {
16410
+ kind: "mutation",
16411
+ auth: "admin"
16412
+ }), method(object({
16413
+ ...KindShape,
16414
+ id: RecordIdSchema,
16415
+ data: RecordBodySchema,
16416
+ at: number().int().nullable().optional(),
16417
+ expiresAt: number().int().nullable().optional(),
16418
+ ifRev: number().int().min(1).optional()
16419
+ }), object({
16420
+ rev: number().int(),
16421
+ releasedRefs: SecretRefsList
16422
+ }), {
16423
+ kind: "mutation",
16424
+ auth: "admin"
16425
+ }), method(object({
16426
+ ...KindShape,
16427
+ id: RecordIdSchema
16428
+ }), object({
16429
+ deleted: boolean(),
16430
+ secretRefs: SecretRefsList
16431
+ }), {
16432
+ kind: "mutation",
16433
+ auth: "admin"
16434
+ }), method(object({
16435
+ ...KindShape,
16436
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16437
+ }), object({
16438
+ deleted: number().int(),
16439
+ secretRefs: SecretRefsList
16440
+ }), {
16441
+ kind: "mutation",
16442
+ auth: "admin"
16443
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16444
+ ...KindShape,
16445
+ ...TimeWindowShape,
16446
+ where: RecordWhereSchema.optional()
16447
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16448
+ ...KindShape,
16449
+ deviceId: number().int().optional(),
16450
+ from: number(),
16451
+ to: number(),
16452
+ bucketMs: number().int().positive()
16453
+ }), object({ buckets: array(object({
16454
+ bucketStart: number(),
16455
+ count: number().int()
16456
+ })) }), { auth: "admin" }), method(object({
16457
+ ...KindShape,
16458
+ op: _enum([
16459
+ "sum",
16460
+ "min",
16461
+ "max",
16462
+ "count"
16463
+ ]),
16464
+ field: RecordFieldPathSchema.optional(),
16465
+ groupBy: RecordFieldPathSchema.optional(),
16466
+ where: RecordWhereSchema.optional()
16467
+ }), object({ rows: array(object({
16468
+ group: union([
16469
+ string(),
16470
+ number(),
16471
+ _null()
16472
+ ]),
16473
+ value: number().nullable()
16474
+ })) }), { auth: "admin" }), method(object({
16475
+ ...KindShape,
16476
+ deviceId: number().int().optional(),
16477
+ atBefore: number().optional(),
16478
+ where: RecordWhereSchema.optional()
16479
+ }), object({
16480
+ deleted: number().int(),
16481
+ secretRefs: SecretRefsList
16482
+ }), {
16483
+ kind: "mutation",
16484
+ auth: "admin"
16485
+ }), method(object({
16486
+ deviceId: number().int(),
16487
+ kinds: array(RecordKindNameSchema).optional()
16488
+ }), object({
16489
+ deleted: record(string(), number().int()),
16490
+ secretRefs: SecretRefsList
16491
+ }), {
16492
+ kind: "mutation",
16493
+ auth: "admin"
16494
+ }), method(object(KindShape), object({ id: number().int() }), {
16495
+ kind: "mutation",
16496
+ auth: "admin"
16497
+ });
16498
+ /** One table of the settings database. */
16499
+ var StorageTableSchema = object({
16500
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
16501
+ name: string(),
16502
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
16503
+ owner: string().nullable(),
16504
+ rows: number().int().nonnegative(),
16505
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
16506
+ bytes: number().int().nonnegative().nullable(),
16507
+ /** Declared by an addon since this engine process started (a running addon claims it). */
16508
+ declaredThisBoot: boolean()
16509
+ });
16510
+ /** One declared record kind (D881) as System -> Data shows it. */
16511
+ var StorageKindSchema = object({
16512
+ owner: string(),
16513
+ kind: string(),
16514
+ database: _enum(["settings", "events"]),
16515
+ class: string(),
16516
+ state: _enum([
16517
+ "declared",
16518
+ "orphaned",
16519
+ "dropped"
16520
+ ]),
16521
+ /** `null` when the caller asked for no counts (`counts: false`). */
16522
+ rows: number().int().nonnegative().nullable(),
16523
+ /** Rows x the average size of a sample; null for an empty kind. */
16524
+ bytesEstimate: number().int().nonnegative().nullable(),
16525
+ writeTrigger: string(),
16526
+ retention: RecordRetentionSchema,
16527
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16528
+ entry: boolean(),
16529
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16530
+ declaration: RecordKindDeclarationSchema
16531
+ });
16532
+ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16533
+ collection: string().min(1),
16534
+ expectRows: number().int().nonnegative()
16535
+ }), object({
16536
+ dropped: literal(true),
16537
+ rows: number().int().nonnegative()
16538
+ }), {
16539
+ kind: "mutation",
16540
+ auth: "admin"
16541
+ }), method(object({
16542
+ owner: string().min(1).optional(),
16543
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16544
+ counts: boolean().optional()
16545
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16546
+ owner: string().min(1),
16547
+ kind: RecordKindNameSchema
16548
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16549
+ owner: string().min(1),
16550
+ kind: RecordKindNameSchema,
16551
+ records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
16552
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16553
+ complete: boolean().optional()
16554
+ }).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
16555
+ kind: "mutation",
16556
+ auth: "admin"
16557
+ }), method(object({
16558
+ collection: string().min(1),
16559
+ cursor: string().optional(),
16560
+ limit: number().int().min(1).max(1e3).optional()
16561
+ }), object({
16562
+ rows: array(object({
16563
+ id: string(),
16564
+ data: record(string(), unknown())
16565
+ })),
16566
+ nextCursor: string().nullable()
16567
+ }), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
16568
+ /**
16569
+ * record-entries - the ONE admin surface for every list of user-created entries
16570
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16571
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16572
+ *
16573
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16574
+ * the entry body with `secret: true` on every credential field, so a password
16575
+ * field is derived from the schema and never from a name. `putEntry` takes the
16576
+ * redaction token for an untouched secret (the stored value is kept), a string
16577
+ * for a new one, and the clear instruction to remove one. A read never carries
16578
+ * a secret value, and a locked keychain refuses the write with
16579
+ * `records/secret-unavailable` instead of storing plaintext.
16580
+ *
16581
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
16582
+ */
16583
+ var EntryKindInfoSchema = object({
16584
+ owner: string(),
16585
+ kind: RecordKindNameSchema,
16586
+ title: string(),
16587
+ nameField: string(),
16588
+ /** JSON Schema of the body; `secret: true` marks a password field. */
16589
+ fields: record(string(), unknown()),
16590
+ secretPaths: array(string()),
16591
+ rows: number().int().nonnegative()
16592
+ });
16593
+ var EntryViewSchema = object({
16594
+ id: RecordIdSchema,
16595
+ name: string(),
16596
+ rev: number().int(),
16597
+ updatedAt: number(),
16598
+ /** Secret fields hold the redaction token. */
16599
+ data: RecordBodySchema
16600
+ });
16601
+ var EntryAddress = {
16602
+ owner: string().min(1),
16603
+ kind: RecordKindNameSchema
16604
+ };
16605
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
16606
+ ...EntryAddress,
16607
+ id: RecordIdSchema.optional(),
16608
+ data: RecordBodySchema,
16609
+ ifRev: number().int().min(1).optional()
16610
+ }), object({
16611
+ id: string(),
16612
+ rev: number().int()
16613
+ }), {
16614
+ kind: "mutation",
16615
+ auth: "admin"
16616
+ }), method(object({
16617
+ ...EntryAddress,
16618
+ id: RecordIdSchema
16619
+ }), object({ deleted: boolean() }), {
16620
+ kind: "mutation",
16621
+ auth: "admin"
16622
+ });
16623
+ /**
16020
16624
  * `keychain` — the hub's encrypted store of secret values (D787).
16021
16625
  *
16022
16626
  * Settings blobs never hold a secret: they hold a marker
@@ -16557,6 +17161,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
16557
17161
  kind: "mutation",
16558
17162
  auth: "admin",
16559
17163
  caller: "required"
17164
+ }), method(object({
17165
+ ref: string().min(1),
17166
+ value: string().min(1)
17167
+ }), object({
17168
+ ref: string(),
17169
+ version: number().int()
17170
+ }), {
17171
+ kind: "mutation",
17172
+ auth: "admin",
17173
+ caller: "required"
16560
17174
  }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
16561
17175
  deleted: array(string()).readonly(),
16562
17176
  kept: array(object({
@@ -17078,7 +17692,11 @@ var deviceDiscoveryCapability = {
17078
17692
  };
17079
17693
  /**
17080
17694
  * `device-adoption` — generic discovery + adoption surface,
17081
- * system-scoped singleton. The de-HA-ified successor to `ha-discovery`:
17695
+ * system-scoped collection (one provider per integration addon), routed
17696
+ * by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
17697
+ * pin model as `connection-test`. The admin UI keeps using
17698
+ * `deviceManager.adoption*` (which already threads `addonId`). The de-HA-ified
17699
+ * successor to `ha-discovery`:
17082
17700
  * keyed by `integrationId` (the addon resolves integrationId → broker
17083
17701
  * internally) rather than a connection-specific `brokerId`, and it
17084
17702
  * REUSES the shared `DiscoveredChildDevice` candidate type from
@@ -39331,6 +39949,9 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
39331
39949
  }), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
39332
39950
  kind: "mutation",
39333
39951
  auth: "admin"
39952
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
39953
+ kind: "mutation",
39954
+ auth: "admin"
39334
39955
  }), method(ProfileRefInputSchema, _void(), {
39335
39956
  kind: "mutation",
39336
39957
  auth: "admin"
@@ -41406,6 +42027,9 @@ var NcSystemEventKindSchema = _enum([
41406
42027
  "server-updated",
41407
42028
  "export-completed",
41408
42029
  "backup-completed",
42030
+ "alert-critical",
42031
+ "alert-error",
42032
+ "alert-critical-resolved",
41409
42033
  "camera-online",
41410
42034
  "camera-offline",
41411
42035
  "camera-disabled",
@@ -49840,6 +50464,41 @@ var ServerRollbackInfoSchema = object({
49840
50464
  atMs: number(),
49841
50465
  reason: string()
49842
50466
  });
50467
+ /**
50468
+ * The runner boot check (D877): the runners this node PLANNED (hub: one per
50469
+ * `resolveRunnerId` over its forked addons; agent: the runners its process
50470
+ * service holds, because only the hub plans) against the states the process
50471
+ * service reports. Kept in memory, recomputed by the same one-shot check after
50472
+ * every boot, served on `getServerPackageStatus`.
50473
+ *
50474
+ * `failed` is the D6 breaker's terminal state, `refused` a deterministic Init
50475
+ * refusal (an addon that said "I will not start, and here is why"), `missing` a
50476
+ * planned runner the process service has no entry for.
50477
+ */
50478
+ var RunnerRefusalSchema = object({
50479
+ runnerId: string(),
50480
+ addonIds: array(string()),
50481
+ reason: string()
50482
+ });
50483
+ var RunnerBootCheckSchema = object({
50484
+ checkedAtMs: number(),
50485
+ /** Runners planned for this node. */
50486
+ expected: number(),
50487
+ /** Planned runners whose process is `running`. */
50488
+ running: number(),
50489
+ failed: array(string()),
50490
+ refused: array(RunnerRefusalSchema),
50491
+ missing: array(string()),
50492
+ /**
50493
+ * Runners still on their way: `starting`, or `crashed` waiting on a backoff
50494
+ * respawn. The check is FINAL only when this is empty; until then nothing is
50495
+ * pushed and the verdict is re-evaluated on the next runner state change.
50496
+ * Optional for version skew (absent = settled).
50497
+ */
50498
+ pending: array(string()).optional(),
50499
+ /** True when the plan is the hub's (`missing` is then meaningful); false on an agent. */
50500
+ planKnown: boolean()
50501
+ });
49843
50502
  var ServerPackageStatusSchema = object({
49844
50503
  /** Root package name (`@camstack/server` on the hub). */
49845
50504
  packageName: string(),
@@ -49902,7 +50561,14 @@ var ServerPackageStatusSchema = object({
49902
50561
  * for version skew: an older provider's payload simply omits it, and an
49903
50562
  * absent wrapper is unknown — never `native`.
49904
50563
  */
49905
- wrapper: WrapperIdentitySchema.optional()
50564
+ wrapper: WrapperIdentitySchema.optional(),
50565
+ /**
50566
+ * What this node PLANNED to run against what its process service reports
50567
+ * (D877). Absent until the one-shot boot check has run (~60 s after boot) and
50568
+ * on a provider that predates it. Absent is "not checked yet", never "all
50569
+ * well": a consumer that needs the answer treats it as pending.
50570
+ */
50571
+ runners: RunnerBootCheckSchema.optional()
49906
50572
  });
49907
50573
  var ServerUpdateCheckResultSchema = object({
49908
50574
  packageName: string(),
@@ -49953,6 +50619,13 @@ var ServerUpdateOutcomeSchema = _enum([
49953
50619
  "refused",
49954
50620
  "failed"
49955
50621
  ]);
50622
+ /** One addon the pre-flight found the target version would refuse (D877). */
50623
+ var UpdateBlockerSchema = object({
50624
+ addonId: string(),
50625
+ reason: string(),
50626
+ /** What the operator does about it. */
50627
+ remedy: string()
50628
+ });
49956
50629
  var ServerUpdateActionResultSchema = object({
49957
50630
  accepted: boolean(),
49958
50631
  targetVersion: string().nullable(),
@@ -49970,14 +50643,27 @@ var ServerUpdateActionResultSchema = object({
49970
50643
  * The failure itself, verbatim enough to act on (the npm output for a
49971
50644
  * staging install). Non-null only for `failed`.
49972
50645
  */
49973
- error: string().nullable().optional()
50646
+ error: string().nullable().optional(),
50647
+ /**
50648
+ * The addons the target version would refuse to start on this node's live
50649
+ * store (D877), present when the pre-flight refused the update
50650
+ * (`reason: 'addon-would-refuse'`). Optional for version skew.
50651
+ */
50652
+ blockers: array(UpdateBlockerSchema).optional()
49974
50653
  });
49975
50654
  method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
49976
50655
  kind: "mutation",
49977
50656
  auth: "admin"
49978
- }), method(object({
49979
- /** Explicit target version; omitted = latest from the registry. */
49980
- version: string().optional() }), ServerUpdateActionResultSchema, {
50657
+ }), method(object({
50658
+ /** Explicit target version; omitted = latest from the registry. */
50659
+ version: string().optional(),
50660
+ /**
50661
+ * Apply even though the pre-flight (D877) found addons the target would
50662
+ * refuse to start. Off by default: those addons stay down until the
50663
+ * remedy is run, which is the incident this gate exists to prevent.
50664
+ */
50665
+ acknowledgeRefusals: boolean().optional()
50666
+ }), ServerUpdateActionResultSchema, {
49981
50667
  kind: "mutation",
49982
50668
  auth: "admin",
49983
50669
  timeoutMs: 16 * 6e4
@@ -50420,7 +51106,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
50420
51106
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
50421
51107
  kind: "mutation",
50422
51108
  auth: "admin"
50423
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51109
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51110
+ clear: boolean(),
51111
+ repointLocationId: string().optional()
51112
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
50424
51113
  kind: "mutation",
50425
51114
  auth: "admin"
50426
51115
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -52423,7 +53112,9 @@ var ManifestShapeSchema = object({
52423
53112
  var AddonProcessSchema = object({
52424
53113
  pid: number().optional(),
52425
53114
  mode: string(),
52426
- state: string()
53115
+ state: string(),
53116
+ /** Why the runner is `refused` (an addon's own words), when it is (D877). */
53117
+ reason: string().optional()
52427
53118
  });
52428
53119
  /**
52429
53120
  * Per-addon health snapshot from the kernel's AddonHealthMonitor.
@@ -53191,7 +53882,8 @@ var batteryCapability = {
53191
53882
  DeviceType.Button,
53192
53883
  DeviceType.Switch,
53193
53884
  DeviceType.PetFeeder,
53194
- DeviceType.Container
53885
+ DeviceType.Container,
53886
+ DeviceType.Thermostat
53195
53887
  ],
53196
53888
  methods: {
53197
53889
  /**
@@ -53812,6 +54504,12 @@ var ClimateControlStatusSchema = object({
53812
54504
  /** Horizontal louver swing on/off. Null when the device has no
53813
54505
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
53814
54506
  swingHorizontal: boolean().nullable(),
54507
+ /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
54508
+ minTemp: number().nullable().optional(),
54509
+ /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
54510
+ maxTemp: number().nullable().optional(),
54511
+ /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
54512
+ tempStep: number().positive().nullable().optional(),
53815
54513
  /** Ms epoch when the slice was last updated (push or command). */
53816
54514
  lastFetchedAt: number()
53817
54515
  });
@@ -54658,6 +55356,294 @@ onStatusChanged: { data: object({
54658
55356
  * whether persisting is worth a SQLite commit. */
54659
55357
  volatileStateFields: ["lastChangedAt"]
54660
55358
  };
55359
+ /**
55360
+ * Smart-dishwasher cap — program lifecycle, door / remote-start gates,
55361
+ * consumable levels (salt, rinse aid) and common program options.
55362
+ *
55363
+ * Sources: native Bosch Home Connect (`dishwasher` device type). Reusable
55364
+ * by any integration that exposes the same program / option surface.
55365
+ *
55366
+ * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55367
+ * provider refreshes the slice on an interval and eagerly after commands.
55368
+ *
55369
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
55370
+ * nullable: `null` means "not known right now" (the appliance has not said,
55371
+ * the link is down, or the description does not carry it) and is never
55372
+ * rendered or exported as `false` / `0`. `availability` says why.
55373
+ */
55374
+ var DishwasherStateSchema = _enum([
55375
+ "idle",
55376
+ "running",
55377
+ "paused",
55378
+ "finished",
55379
+ "error",
55380
+ "unavailable"
55381
+ ]);
55382
+ /**
55383
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
55384
+ * view for compact surfaces; this is what the appliance said.
55385
+ */
55386
+ var DishwasherOperationStateSchema = _enum([
55387
+ "Inactive",
55388
+ "Ready",
55389
+ "DelayedStart",
55390
+ "Run",
55391
+ "Pause",
55392
+ "ActionRequired",
55393
+ "Finished",
55394
+ "Error",
55395
+ "Aborting"
55396
+ ]);
55397
+ /**
55398
+ * Why fields may be `null`:
55399
+ * - `available` — the link is up and the description is loaded;
55400
+ * - `offline` — the local link is down (values are unknown, not last-known);
55401
+ * - `description-missing` — the link is up but the appliance's description could not
55402
+ * be loaded, so its values cannot be decoded.
55403
+ */
55404
+ var DishwasherAvailabilitySchema = _enum([
55405
+ "available",
55406
+ "offline",
55407
+ "description-missing"
55408
+ ]);
55409
+ var DishwasherConsumableLevelSchema = _enum([
55410
+ "ok",
55411
+ "low",
55412
+ "empty"
55413
+ ]);
55414
+ var DishwasherStatusSchema = object({
55415
+ availability: DishwasherAvailabilitySchema,
55416
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
55417
+ state: DishwasherStateSchema,
55418
+ /** The appliance's operation state as reported; null when not known. */
55419
+ operationState: DishwasherOperationStateSchema.nullable(),
55420
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
55421
+ program: string().nullable(),
55422
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
55423
+ selectedProgram: string().nullable(),
55424
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
55425
+ availablePrograms: array(string()),
55426
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
55427
+ remainingSeconds: number().int().nonnegative().nullable(),
55428
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
55429
+ delayedStartSeconds: number().int().nonnegative().nullable(),
55430
+ /** Cycle completion 0..100, or null when not applicable. */
55431
+ progressPercent: number().min(0).max(100).nullable(),
55432
+ /** True when the door is reported open; null when the door state is not known. */
55433
+ doorOpen: boolean().nullable(),
55434
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
55435
+ doorLocked: boolean().nullable(),
55436
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
55437
+ remoteStartAllowed: boolean().nullable(),
55438
+ /** True when the appliance accepts remote control now; null when not known. */
55439
+ remoteControlActive: boolean().nullable(),
55440
+ /** True while somebody operates the appliance at its panel; null when not reported. */
55441
+ localControlActive: boolean().nullable(),
55442
+ /** Main power / switched-on state; null when not known. */
55443
+ powerOn: boolean().nullable(),
55444
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55445
+ powerState: string().nullable(),
55446
+ saltLevel: DishwasherConsumableLevelSchema.nullable(),
55447
+ rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55448
+ /** Option states: null when the appliance does not expose the option or has not said. */
55449
+ halfLoad: boolean().nullable(),
55450
+ hygienePlus: boolean().nullable(),
55451
+ /** Extra dry option when the appliance exposes it. */
55452
+ extraDry: boolean().nullable(),
55453
+ /** Intensive zone (lower basket) when the appliance exposes it. */
55454
+ intensiveZone: boolean().nullable(),
55455
+ /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55456
+ varioSpeedPlus: boolean().nullable(),
55457
+ /** Child lock (controls disabled on the appliance); null when not known. */
55458
+ childLock: boolean().nullable(),
55459
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
55460
+ activeEvents: array(string()),
55461
+ /** Numeric error code when the appliance reports one; null otherwise. */
55462
+ errorCode: number().nullable(),
55463
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
55464
+ errorLabel: string().nullable(),
55465
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
55466
+ lastFetchedAt: number()
55467
+ });
55468
+ var DeviceIdSchema = number().int().nonnegative();
55469
+ /** A value a program option or setting can take. */
55470
+ var DishwasherValueSchema = union([
55471
+ boolean(),
55472
+ string(),
55473
+ number()
55474
+ ]);
55475
+ var DishwasherAccessSchema = _enum([
55476
+ "none",
55477
+ "read",
55478
+ "readWrite",
55479
+ "writeOnly",
55480
+ "readStatic"
55481
+ ]);
55482
+ /**
55483
+ * One option or setting the appliance declares, with the constraints its description
55484
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
55485
+ */
55486
+ var DishwasherOptionDescriptorSchema = object({
55487
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
55488
+ key: string(),
55489
+ /** Last segment of the key, for display. */
55490
+ name: string(),
55491
+ type: _enum([
55492
+ "boolean",
55493
+ "number",
55494
+ "enum",
55495
+ "string"
55496
+ ]),
55497
+ access: DishwasherAccessSchema,
55498
+ /** The appliance reports this entity as currently available. */
55499
+ available: boolean(),
55500
+ /** Unit the description declares for a number; null when it declares none. */
55501
+ unit: string().nullable(),
55502
+ min: number().nullable(),
55503
+ max: number().nullable(),
55504
+ step: number().nullable(),
55505
+ /** Allowed members of an enum; null for other types. */
55506
+ enumValues: array(string()).nullable(),
55507
+ defaultValue: DishwasherValueSchema.nullable()
55508
+ });
55509
+ var DishwasherProgramSchema = object({
55510
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
55511
+ key: string(),
55512
+ name: string(),
55513
+ /** The appliance currently offers this program. */
55514
+ available: boolean(),
55515
+ /** The options this program lists, with the program-level access / availability / default. */
55516
+ options: array(DishwasherOptionDescriptorSchema)
55517
+ });
55518
+ var DishwasherOptionsSchema = object({
55519
+ availability: DishwasherAvailabilitySchema,
55520
+ /** What the appliance can be told to do, from the commands its description declares. */
55521
+ supportsStart: boolean(),
55522
+ supportsPause: boolean(),
55523
+ supportsResume: boolean(),
55524
+ supportsStop: boolean(),
55525
+ supportsPower: boolean(),
55526
+ /** Every program the description lists, with its options. */
55527
+ programs: array(DishwasherProgramSchema),
55528
+ /** Every option and setting entity the description lists (programs reference these by key). */
55529
+ options: array(DishwasherOptionDescriptorSchema)
55530
+ });
55531
+ var dishwasherCapability = {
55532
+ name: "dishwasher",
55533
+ scope: "device",
55534
+ deviceNative: true,
55535
+ mode: "singleton",
55536
+ deviceTypes: [DeviceType.Dishwasher],
55537
+ methods: {
55538
+ /**
55539
+ * Start a program. Without `program` the selected one starts. `options` are
55540
+ * option feature keys; each is checked against the program's constraints.
55541
+ */
55542
+ start: method(object({
55543
+ deviceId: DeviceIdSchema,
55544
+ program: string().min(1).optional(),
55545
+ options: record(string(), DishwasherValueSchema).optional()
55546
+ }), _void(), {
55547
+ kind: "mutation",
55548
+ auth: "protected"
55549
+ }),
55550
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
55551
+ kind: "mutation",
55552
+ auth: "protected"
55553
+ }),
55554
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
55555
+ kind: "mutation",
55556
+ auth: "protected"
55557
+ }),
55558
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
55559
+ kind: "mutation",
55560
+ auth: "protected"
55561
+ }),
55562
+ /** Select (not start) a program; refused when the appliance does not offer it. */
55563
+ setProgram: method(object({
55564
+ deviceId: DeviceIdSchema,
55565
+ program: string().min(1)
55566
+ }), _void(), {
55567
+ kind: "mutation",
55568
+ auth: "protected"
55569
+ }),
55570
+ setPower: method(object({
55571
+ deviceId: DeviceIdSchema,
55572
+ on: boolean()
55573
+ }), _void(), {
55574
+ kind: "mutation",
55575
+ auth: "protected"
55576
+ }),
55577
+ setHalfLoad: method(object({
55578
+ deviceId: DeviceIdSchema,
55579
+ on: boolean()
55580
+ }), _void(), {
55581
+ kind: "mutation",
55582
+ auth: "protected"
55583
+ }),
55584
+ setHygienePlus: method(object({
55585
+ deviceId: DeviceIdSchema,
55586
+ on: boolean()
55587
+ }), _void(), {
55588
+ kind: "mutation",
55589
+ auth: "protected"
55590
+ }),
55591
+ setExtraDry: method(object({
55592
+ deviceId: DeviceIdSchema,
55593
+ on: boolean()
55594
+ }), _void(), {
55595
+ kind: "mutation",
55596
+ auth: "protected"
55597
+ }),
55598
+ setIntensiveZone: method(object({
55599
+ deviceId: DeviceIdSchema,
55600
+ on: boolean()
55601
+ }), _void(), {
55602
+ kind: "mutation",
55603
+ auth: "protected"
55604
+ }),
55605
+ setVarioSpeedPlus: method(object({
55606
+ deviceId: DeviceIdSchema,
55607
+ on: boolean()
55608
+ }), _void(), {
55609
+ kind: "mutation",
55610
+ auth: "protected"
55611
+ }),
55612
+ setChildLock: method(object({
55613
+ deviceId: DeviceIdSchema,
55614
+ on: boolean()
55615
+ }), _void(), {
55616
+ kind: "mutation",
55617
+ auth: "protected"
55618
+ }),
55619
+ /**
55620
+ * Write any option or setting by feature key. Refused when the description does
55621
+ * not list it, it is not writable or not available now, or the value is outside
55622
+ * its declared range / members.
55623
+ */
55624
+ setOption: method(object({
55625
+ deviceId: DeviceIdSchema,
55626
+ key: string().min(1),
55627
+ value: DishwasherValueSchema
55628
+ }), _void(), {
55629
+ kind: "mutation",
55630
+ auth: "protected"
55631
+ }),
55632
+ /** What this appliance can do, from its own description — the UI is derived from it. */
55633
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
55634
+ },
55635
+ status: {
55636
+ schema: DishwasherStatusSchema,
55637
+ kind: "poll"
55638
+ },
55639
+ runtimeState: DishwasherStatusSchema,
55640
+ durability: "session",
55641
+ history: { fields: { progressPercent: {
55642
+ kind: "gauge",
55643
+ unit: "%",
55644
+ deadband: 2
55645
+ } } }
55646
+ };
54661
55647
  var DoorbellStatusSchema = object({
54662
55648
  /** Ms epoch of the last press. null = never observed since this provider started. */
54663
55649
  lastPressedAt: number().nullable(),
@@ -55460,6 +56446,32 @@ var gasCapability = {
55460
56446
  * whether persisting is worth a SQLite commit. */
55461
56447
  volatileStateFields: ["lastChangedAt"]
55462
56448
  };
56449
+ var HeatingValveStatusSchema = object({
56450
+ /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
56451
+ position: number().min(0).max(100).nullable(),
56452
+ /** Ms epoch when the slice was last updated (push or poll). */
56453
+ lastFetchedAt: number()
56454
+ });
56455
+ var heatingValveCapability = {
56456
+ name: "heating-valve",
56457
+ scope: "device",
56458
+ deviceNative: true,
56459
+ mode: "singleton",
56460
+ deviceTypes: [DeviceType.Thermostat],
56461
+ methods: {},
56462
+ status: {
56463
+ schema: HeatingValveStatusSchema,
56464
+ kind: "push"
56465
+ },
56466
+ runtimeState: HeatingValveStatusSchema,
56467
+ durability: "session",
56468
+ history: { fields: { position: {
56469
+ kind: "gauge",
56470
+ unit: "%",
56471
+ deadband: 1
56472
+ } } },
56473
+ volatileStateFields: ["lastFetchedAt"]
56474
+ };
55463
56475
  /**
55464
56476
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
55465
56477
  * an on/off actuator with an optional target-humidity setpoint and an
@@ -56592,7 +57604,19 @@ var TlsStatusSchema = object({
56592
57604
  sans: array(string()),
56593
57605
  caCertPem: string().nullable(),
56594
57606
  reissueError: string().nullable(),
56595
- restartRequired: boolean()
57607
+ restartRequired: boolean(),
57608
+ /** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
57609
+ caMissing: boolean(),
57610
+ /** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
57611
+ localCaConstrained: boolean().nullable(),
57612
+ /** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
57613
+ caReplacedAt: string().nullable(),
57614
+ /** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
57615
+ storedUpload: object({
57616
+ leafFingerprintSha256: string(),
57617
+ validTo: string(),
57618
+ hasCa: boolean()
57619
+ }).nullable()
56596
57620
  });
56597
57621
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
56598
57622
  /**
@@ -56648,6 +57672,9 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
56648
57672
  }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
56649
57673
  kind: "mutation",
56650
57674
  auth: "admin"
57675
+ }), method(_void(), TlsStatusSchema, {
57676
+ kind: "mutation",
57677
+ auth: "admin"
56651
57678
  });
56652
57679
  var LockControlStatusSchema = object({
56653
57680
  /** Lifecycle state of the lock. `jammed` means the motor reported
@@ -63141,7 +64168,11 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
63141
64168
  kind: "mutation",
63142
64169
  auth: "admin",
63143
64170
  access: "delete"
63144
- }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(object({
64171
+ }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
64172
+ kind: "mutation",
64173
+ auth: "admin",
64174
+ access: "create"
64175
+ }), method(object({
63145
64176
  userId: string(),
63146
64177
  code: string()
63147
64178
  }), object({ valid: boolean() }), {
@@ -64861,6 +65892,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
64861
65892
  dayNight: dayNightCapability,
64862
65893
  deviceDiscovery: deviceDiscoveryCapability,
64863
65894
  deviceStatus: deviceStatusCapability,
65895
+ dishwasher: dishwasherCapability,
64864
65896
  doorbell: doorbellCapability,
64865
65897
  enumSensor: enumSensorCapability,
64866
65898
  eventEmitter: eventEmitterCapability,
@@ -64868,6 +65900,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
64868
65900
  featureProbe: featureProbeCapability,
64869
65901
  flood: floodCapability,
64870
65902
  gas: gasCapability,
65903
+ heatingValve: heatingValveCapability,
64871
65904
  humidifier: humidifierCapability,
64872
65905
  humiditySensor: humiditySensorCapability,
64873
65906
  image: imageCapability,
@@ -64953,13 +65986,14 @@ var BaseDevice = class {
64953
65986
  get state() {
64954
65987
  if (!this._stateProxyCache) {
64955
65988
  const cache = {};
64956
- const handler = { get: (_target, key) => {
65989
+ const handler = { get: (target, key) => {
64957
65990
  const k = key;
64958
- if (k in cache) return cache[k];
65991
+ const existing = Reflect.get(target, k);
65992
+ if (existing !== void 0) return existing;
64959
65993
  const cap = DEVICE_LOCAL_STATE_CAPS[k];
64960
65994
  if (!cap) return void 0;
64961
65995
  const proxy = this.sliceProxy(cap);
64962
- cache[k] = proxy;
65996
+ Reflect.set(target, k, proxy);
64963
65997
  return proxy;
64964
65998
  } };
64965
65999
  this._stateProxyCache = new Proxy(cache, handler);
@@ -65158,7 +66192,7 @@ var BaseDevice = class {
65158
66192
  async updateSourceInfo(patch) {
65159
66193
  const next = mergeSourceInfo(this.sourceInfo, patch);
65160
66194
  this._sourceInfoCache = Object.freeze({ ...next });
65161
- const action = this.ctx.api?.deviceManager?.setMetadata;
66195
+ const action = this.ctx.api.deviceManager?.setMetadata;
65162
66196
  if (action) try {
65163
66197
  await action.mutate({
65164
66198
  deviceId: this.id,
@@ -65193,7 +66227,7 @@ var BaseDevice = class {
65193
66227
  * device boot on a meta refresh.
65194
66228
  */
65195
66229
  async refreshFeatures() {
65196
- const action = this.ctx.api?.deviceManager?.registerDevice;
66230
+ const action = this.ctx.api.deviceManager?.registerDevice;
65197
66231
  if (!action) return;
65198
66232
  try {
65199
66233
  await action.mutate({
@@ -65592,6 +66626,12 @@ var BaseDeviceProvider = class extends BaseAddon {
65592
66626
  provider: this
65593
66627
  }];
65594
66628
  }
66629
+ /** Flatten `super.onInitialize()` whether it returned an array or an envelope. */
66630
+ providerRegistrationsFromSuper(result) {
66631
+ if (Array.isArray(result)) return result;
66632
+ if (result !== void 0 && result.providers !== void 0) return [...result.providers];
66633
+ return [];
66634
+ }
65595
66635
  async onShutdown() {
65596
66636
  this._restoreShuttingDown = true;
65597
66637
  this.cancelRestoreRetries();
@@ -66118,7 +67158,7 @@ var BaseDeviceProvider = class extends BaseAddon {
66118
67158
  return toDeviceSummary(device, this.addonId);
66119
67159
  }
66120
67160
  };
66121
- DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder;
67161
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher;
66122
67162
  new Set(Object.values(DeviceType));
66123
67163
  Object.freeze({
66124
67164
  "accessories.getStatus": {
@@ -67267,6 +68307,12 @@ Object.freeze({
67267
68307
  addonId: null,
67268
68308
  access: "view"
67269
68309
  },
68310
+ "coreBlocks.migrateRawSecrets": {
68311
+ capName: "core-blocks",
68312
+ capScope: "system",
68313
+ addonId: null,
68314
+ access: "create"
68315
+ },
67270
68316
  "coreBlocks.restart": {
67271
68317
  capName: "core-blocks",
67272
68318
  capScope: "system",
@@ -68533,6 +69579,96 @@ Object.freeze({
68533
69579
  addonId: null,
68534
69580
  access: "view"
68535
69581
  },
69582
+ "dishwasher.getOptions": {
69583
+ capName: "dishwasher",
69584
+ capScope: "device",
69585
+ addonId: null,
69586
+ access: "view"
69587
+ },
69588
+ "dishwasher.getStatus": {
69589
+ capName: "dishwasher",
69590
+ capScope: "device",
69591
+ addonId: null,
69592
+ access: "view"
69593
+ },
69594
+ "dishwasher.pause": {
69595
+ capName: "dishwasher",
69596
+ capScope: "device",
69597
+ addonId: null,
69598
+ access: "create"
69599
+ },
69600
+ "dishwasher.resume": {
69601
+ capName: "dishwasher",
69602
+ capScope: "device",
69603
+ addonId: null,
69604
+ access: "create"
69605
+ },
69606
+ "dishwasher.setChildLock": {
69607
+ capName: "dishwasher",
69608
+ capScope: "device",
69609
+ addonId: null,
69610
+ access: "create"
69611
+ },
69612
+ "dishwasher.setExtraDry": {
69613
+ capName: "dishwasher",
69614
+ capScope: "device",
69615
+ addonId: null,
69616
+ access: "create"
69617
+ },
69618
+ "dishwasher.setHalfLoad": {
69619
+ capName: "dishwasher",
69620
+ capScope: "device",
69621
+ addonId: null,
69622
+ access: "create"
69623
+ },
69624
+ "dishwasher.setHygienePlus": {
69625
+ capName: "dishwasher",
69626
+ capScope: "device",
69627
+ addonId: null,
69628
+ access: "create"
69629
+ },
69630
+ "dishwasher.setIntensiveZone": {
69631
+ capName: "dishwasher",
69632
+ capScope: "device",
69633
+ addonId: null,
69634
+ access: "create"
69635
+ },
69636
+ "dishwasher.setOption": {
69637
+ capName: "dishwasher",
69638
+ capScope: "device",
69639
+ addonId: null,
69640
+ access: "create"
69641
+ },
69642
+ "dishwasher.setPower": {
69643
+ capName: "dishwasher",
69644
+ capScope: "device",
69645
+ addonId: null,
69646
+ access: "create"
69647
+ },
69648
+ "dishwasher.setProgram": {
69649
+ capName: "dishwasher",
69650
+ capScope: "device",
69651
+ addonId: null,
69652
+ access: "create"
69653
+ },
69654
+ "dishwasher.setVarioSpeedPlus": {
69655
+ capName: "dishwasher",
69656
+ capScope: "device",
69657
+ addonId: null,
69658
+ access: "create"
69659
+ },
69660
+ "dishwasher.start": {
69661
+ capName: "dishwasher",
69662
+ capScope: "device",
69663
+ addonId: null,
69664
+ access: "create"
69665
+ },
69666
+ "dishwasher.stop": {
69667
+ capName: "dishwasher",
69668
+ capScope: "device",
69669
+ addonId: null,
69670
+ access: "create"
69671
+ },
68536
69672
  "doorbell.getStatus": {
68537
69673
  capName: "doorbell",
68538
69674
  capScope: "device",
@@ -68743,6 +69879,12 @@ Object.freeze({
68743
69879
  addonId: null,
68744
69880
  access: "view"
68745
69881
  },
69882
+ "heatingValve.getStatus": {
69883
+ capName: "heating-valve",
69884
+ capScope: "device",
69885
+ addonId: null,
69886
+ access: "view"
69887
+ },
68746
69888
  "humidifier.getStatus": {
68747
69889
  capName: "humidifier",
68748
69890
  capScope: "device",
@@ -68953,6 +70095,12 @@ Object.freeze({
68953
70095
  addonId: null,
68954
70096
  access: "create"
68955
70097
  },
70098
+ "keychainAdmin.importSecret": {
70099
+ capName: "keychain-admin",
70100
+ capScope: "system",
70101
+ addonId: null,
70102
+ access: "create"
70103
+ },
68956
70104
  "keychainAdmin.listAudit": {
68957
70105
  capName: "keychain-admin",
68958
70106
  capScope: "system",
@@ -69121,6 +70269,12 @@ Object.freeze({
69121
70269
  addonId: null,
69122
70270
  access: "view"
69123
70271
  },
70272
+ "llm.migrateRawSecrets": {
70273
+ capName: "llm",
70274
+ capScope: "system",
70275
+ addonId: null,
70276
+ access: "create"
70277
+ },
69124
70278
  "llm.resolveModelRef": {
69125
70279
  capName: "llm",
69126
70280
  capScope: "system",
@@ -69349,6 +70503,12 @@ Object.freeze({
69349
70503
  addonId: null,
69350
70504
  access: "create"
69351
70505
  },
70506
+ "localNetwork.useStoredUploadedCertificate": {
70507
+ capName: "local-network",
70508
+ capScope: "system",
70509
+ addonId: null,
70510
+ access: "create"
70511
+ },
69352
70512
  "lockControl.getStatus": {
69353
70513
  capName: "lock-control",
69354
70514
  capScope: "device",
@@ -72001,6 +73161,30 @@ Object.freeze({
72001
73161
  addonId: null,
72002
73162
  access: "create"
72003
73163
  },
73164
+ "recordEntries.deleteEntry": {
73165
+ capName: "record-entries",
73166
+ capScope: "system",
73167
+ addonId: null,
73168
+ access: "delete"
73169
+ },
73170
+ "recordEntries.listEntries": {
73171
+ capName: "record-entries",
73172
+ capScope: "system",
73173
+ addonId: null,
73174
+ access: "view"
73175
+ },
73176
+ "recordEntries.listEntryKinds": {
73177
+ capName: "record-entries",
73178
+ capScope: "system",
73179
+ addonId: null,
73180
+ access: "view"
73181
+ },
73182
+ "recordEntries.putEntry": {
73183
+ capName: "record-entries",
73184
+ capScope: "system",
73185
+ addonId: null,
73186
+ access: "create"
73187
+ },
72004
73188
  "recording.getAvailability": {
72005
73189
  capName: "recording",
72006
73190
  capScope: "device",
@@ -72301,6 +73485,102 @@ Object.freeze({
72301
73485
  addonId: null,
72302
73486
  access: "view"
72303
73487
  },
73488
+ "records.aggregate": {
73489
+ capName: "records",
73490
+ capScope: "system",
73491
+ addonId: null,
73492
+ access: "view"
73493
+ },
73494
+ "records.allocateId": {
73495
+ capName: "records",
73496
+ capScope: "system",
73497
+ addonId: null,
73498
+ access: "create"
73499
+ },
73500
+ "records.count": {
73501
+ capName: "records",
73502
+ capScope: "system",
73503
+ addonId: null,
73504
+ access: "view"
73505
+ },
73506
+ "records.declareKinds": {
73507
+ capName: "records",
73508
+ capScope: "system",
73509
+ addonId: null,
73510
+ access: "create"
73511
+ },
73512
+ "records.delete": {
73513
+ capName: "records",
73514
+ capScope: "system",
73515
+ addonId: null,
73516
+ access: "delete"
73517
+ },
73518
+ "records.deleteDevice": {
73519
+ capName: "records",
73520
+ capScope: "system",
73521
+ addonId: null,
73522
+ access: "delete"
73523
+ },
73524
+ "records.deleteMany": {
73525
+ capName: "records",
73526
+ capScope: "system",
73527
+ addonId: null,
73528
+ access: "delete"
73529
+ },
73530
+ "records.deleteWhere": {
73531
+ capName: "records",
73532
+ capScope: "system",
73533
+ addonId: null,
73534
+ access: "delete"
73535
+ },
73536
+ "records.get": {
73537
+ capName: "records",
73538
+ capScope: "system",
73539
+ addonId: null,
73540
+ access: "view"
73541
+ },
73542
+ "records.getMany": {
73543
+ capName: "records",
73544
+ capScope: "system",
73545
+ addonId: null,
73546
+ access: "view"
73547
+ },
73548
+ "records.histogram": {
73549
+ capName: "records",
73550
+ capScope: "system",
73551
+ addonId: null,
73552
+ access: "view"
73553
+ },
73554
+ "records.patch": {
73555
+ capName: "records",
73556
+ capScope: "system",
73557
+ addonId: null,
73558
+ access: "create"
73559
+ },
73560
+ "records.put": {
73561
+ capName: "records",
73562
+ capScope: "system",
73563
+ addonId: null,
73564
+ access: "create"
73565
+ },
73566
+ "records.putMany": {
73567
+ capName: "records",
73568
+ capScope: "system",
73569
+ addonId: null,
73570
+ access: "create"
73571
+ },
73572
+ "records.query": {
73573
+ capName: "records",
73574
+ capScope: "system",
73575
+ addonId: null,
73576
+ access: "view"
73577
+ },
73578
+ "records.secretRefs": {
73579
+ capName: "records",
73580
+ capScope: "system",
73581
+ addonId: null,
73582
+ access: "view"
73583
+ },
72304
73584
  "sceneMonitor.captureReference": {
72305
73585
  capName: "scene-monitor",
72306
73586
  capScope: "device",
@@ -72733,6 +74013,48 @@ Object.freeze({
72733
74013
  addonId: null,
72734
74014
  access: "create"
72735
74015
  },
74016
+ "storageAdmin.adoptRecords": {
74017
+ capName: "storage-admin",
74018
+ capScope: "system",
74019
+ addonId: null,
74020
+ access: "create"
74021
+ },
74022
+ "storageAdmin.dropCollection": {
74023
+ capName: "storage-admin",
74024
+ capScope: "system",
74025
+ addonId: null,
74026
+ access: "delete"
74027
+ },
74028
+ "storageAdmin.isAdoptedLegacyTable": {
74029
+ capName: "storage-admin",
74030
+ capScope: "system",
74031
+ addonId: null,
74032
+ access: "view"
74033
+ },
74034
+ "storageAdmin.listKinds": {
74035
+ capName: "storage-admin",
74036
+ capScope: "system",
74037
+ addonId: null,
74038
+ access: "view"
74039
+ },
74040
+ "storageAdmin.listTables": {
74041
+ capName: "storage-admin",
74042
+ capScope: "system",
74043
+ addonId: null,
74044
+ access: "view"
74045
+ },
74046
+ "storageAdmin.readLegacyCollection": {
74047
+ capName: "storage-admin",
74048
+ capScope: "system",
74049
+ addonId: null,
74050
+ access: "view"
74051
+ },
74052
+ "storageAdmin.readRecords": {
74053
+ capName: "storage-admin",
74054
+ capScope: "system",
74055
+ addonId: null,
74056
+ access: "view"
74057
+ },
72736
74058
  "storageEvictable.evict": {
72737
74059
  capName: "storage-evictable",
72738
74060
  capScope: "system",
@@ -72781,6 +74103,12 @@ Object.freeze({
72781
74103
  addonId: null,
72782
74104
  access: "view"
72783
74105
  },
74106
+ "storageMigration.moverClearance": {
74107
+ capName: "storage-migration",
74108
+ capScope: "system",
74109
+ addonId: null,
74110
+ access: "view"
74111
+ },
72784
74112
  "storageMigration.movers": {
72785
74113
  capName: "storage-migration",
72786
74114
  capScope: "system",
@@ -73645,6 +74973,12 @@ Object.freeze({
73645
74973
  addonId: null,
73646
74974
  access: "view"
73647
74975
  },
74976
+ "userManagement.migrateRawSecrets": {
74977
+ capName: "user-management",
74978
+ capScope: "system",
74979
+ addonId: null,
74980
+ access: "create"
74981
+ },
73648
74982
  "userManagement.oauthExchangeCode": {
73649
74983
  capName: "user-management",
73650
74984
  capScope: "system",
@@ -74144,7 +75478,7 @@ Object.freeze({
74144
75478
  access: "create"
74145
75479
  }
74146
75480
  });
74147
- 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;
75481
+ 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.Dishwasher;
74148
75482
  DeviceFeature.BatteryOperated;
74149
75483
  Object.freeze({
74150
75484
  "accessories.getStatus": [{
@@ -74968,6 +76302,81 @@ Object.freeze({
74968
76302
  form: "single",
74969
76303
  optional: false
74970
76304
  }],
76305
+ "dishwasher.getOptions": [{
76306
+ name: "deviceId",
76307
+ form: "single",
76308
+ optional: false
76309
+ }],
76310
+ "dishwasher.getStatus": [{
76311
+ name: "deviceId",
76312
+ form: "single",
76313
+ optional: false
76314
+ }],
76315
+ "dishwasher.pause": [{
76316
+ name: "deviceId",
76317
+ form: "single",
76318
+ optional: false
76319
+ }],
76320
+ "dishwasher.resume": [{
76321
+ name: "deviceId",
76322
+ form: "single",
76323
+ optional: false
76324
+ }],
76325
+ "dishwasher.setChildLock": [{
76326
+ name: "deviceId",
76327
+ form: "single",
76328
+ optional: false
76329
+ }],
76330
+ "dishwasher.setExtraDry": [{
76331
+ name: "deviceId",
76332
+ form: "single",
76333
+ optional: false
76334
+ }],
76335
+ "dishwasher.setHalfLoad": [{
76336
+ name: "deviceId",
76337
+ form: "single",
76338
+ optional: false
76339
+ }],
76340
+ "dishwasher.setHygienePlus": [{
76341
+ name: "deviceId",
76342
+ form: "single",
76343
+ optional: false
76344
+ }],
76345
+ "dishwasher.setIntensiveZone": [{
76346
+ name: "deviceId",
76347
+ form: "single",
76348
+ optional: false
76349
+ }],
76350
+ "dishwasher.setOption": [{
76351
+ name: "deviceId",
76352
+ form: "single",
76353
+ optional: false
76354
+ }],
76355
+ "dishwasher.setPower": [{
76356
+ name: "deviceId",
76357
+ form: "single",
76358
+ optional: false
76359
+ }],
76360
+ "dishwasher.setProgram": [{
76361
+ name: "deviceId",
76362
+ form: "single",
76363
+ optional: false
76364
+ }],
76365
+ "dishwasher.setVarioSpeedPlus": [{
76366
+ name: "deviceId",
76367
+ form: "single",
76368
+ optional: false
76369
+ }],
76370
+ "dishwasher.start": [{
76371
+ name: "deviceId",
76372
+ form: "single",
76373
+ optional: false
76374
+ }],
76375
+ "dishwasher.stop": [{
76376
+ name: "deviceId",
76377
+ form: "single",
76378
+ optional: false
76379
+ }],
74971
76380
  "doorbell.getStatus": [{
74972
76381
  name: "deviceId",
74973
76382
  form: "single",
@@ -75037,6 +76446,11 @@ Object.freeze({
75037
76446
  form: "single",
75038
76447
  optional: false
75039
76448
  }],
76449
+ "heatingValve.getStatus": [{
76450
+ name: "deviceId",
76451
+ form: "single",
76452
+ optional: false
76453
+ }],
75040
76454
  "humidifier.getStatus": [{
75041
76455
  name: "deviceId",
75042
76456
  form: "single",
@@ -76321,6 +77735,37 @@ Object.freeze({
76321
77735
  form: "single",
76322
77736
  optional: false
76323
77737
  }],
77738
+ "records.count": [{
77739
+ name: "deviceId",
77740
+ form: "single",
77741
+ optional: true
77742
+ }],
77743
+ "records.deleteDevice": [{
77744
+ name: "deviceId",
77745
+ form: "single",
77746
+ optional: false
77747
+ }],
77748
+ "records.deleteWhere": [{
77749
+ name: "deviceId",
77750
+ form: "single",
77751
+ optional: true
77752
+ }],
77753
+ "records.histogram": [{
77754
+ name: "deviceId",
77755
+ form: "single",
77756
+ optional: true
77757
+ }],
77758
+ "records.putMany": [{
77759
+ name: "records",
77760
+ form: "object-array",
77761
+ optional: false,
77762
+ itemField: "deviceId"
77763
+ }],
77764
+ "records.query": [{
77765
+ name: "deviceId",
77766
+ form: "single",
77767
+ optional: true
77768
+ }],
76324
77769
  "sceneMonitor.captureReference": [{
76325
77770
  name: "deviceId",
76326
77771
  form: "single",
@@ -76437,6 +77882,17 @@ Object.freeze({
76437
77882
  form: "single",
76438
77883
  optional: false
76439
77884
  }],
77885
+ "storageAdmin.adoptRecords": [{
77886
+ name: "records",
77887
+ form: "object-array",
77888
+ optional: false,
77889
+ itemField: "deviceId"
77890
+ }],
77891
+ "storageAdmin.readRecords": [{
77892
+ name: "deviceId",
77893
+ form: "single",
77894
+ optional: true
77895
+ }],
76440
77896
  "streamBroker.acquireEgressTranscode": [{
76441
77897
  name: "deviceId",
76442
77898
  form: "single",
@@ -76952,6 +78408,9 @@ new Map(Object.entries({
76952
78408
  "wrapper-update-available": "system",
76953
78409
  "backup-completed": "system",
76954
78410
  "export-completed": "system",
78411
+ "alert-critical": "system",
78412
+ "alert-error": "system",
78413
+ "alert-critical-resolved": "system",
76955
78414
  "storage-location-low": "system",
76956
78415
  "storage-location-critical": "system",
76957
78416
  "storage-location-ok": "system",
@@ -77076,6 +78535,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
77076
78535
  "storage-location-ok"
77077
78536
  ]
77078
78537
  },
78538
+ {
78539
+ id: "alerts",
78540
+ family: "system",
78541
+ label: "Alerts",
78542
+ kinds: [
78543
+ "alert-critical",
78544
+ "alert-error",
78545
+ "alert-critical-resolved"
78546
+ ]
78547
+ },
77079
78548
  {
77080
78549
  id: "alarm",
77081
78550
  family: "alarm",
@@ -77120,6 +78589,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
77120
78589
  return [[descriptor.kind, field]];
77121
78590
  })));
77122
78591
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
78592
+ object({
78593
+ phase: _enum(["raised", "resolved"]),
78594
+ episodeId: string().min(1),
78595
+ alertId: string().min(1),
78596
+ severity: AlertSeveritySchema,
78597
+ category: string(),
78598
+ title: string(),
78599
+ message: string(),
78600
+ sourceType: string().optional(),
78601
+ sourceId: string().optional(),
78602
+ nodeId: string().optional(),
78603
+ /** The alert's own action link (where the operator acts on it), when it has one. */
78604
+ actionUrl: string().optional(),
78605
+ at: number()
78606
+ });
77123
78607
  var RULE_BODY_ONLY = ["body"];
77124
78608
  var RULE_TEXT = ["title", "body"];
77125
78609
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -77129,6 +78613,11 @@ var TANK = [
77129
78613
  "device-tank-full",
77130
78614
  "device-tank-normal"
77131
78615
  ];
78616
+ var ALERT_EPISODE = [
78617
+ "alert-critical",
78618
+ "alert-error",
78619
+ "alert-critical-resolved"
78620
+ ];
77132
78621
  var UPDATES = [
77133
78622
  "addon-update-available",
77134
78623
  "server-update-available",
@@ -77321,14 +78810,14 @@ var STATE_SUMMARY_VARS = [
77321
78810
  ([...RULE_TEXT], [...CONSUMABLE]),
77322
78811
  ([...RULE_TEXT], [...TANK]),
77323
78812
  [...RULE_TEXT],
77324
- ([...RULE_TEXT], [...UPDATES]),
77325
- ([...RULE_TEXT], [...UPDATES]),
77326
- [...RULE_TEXT],
78813
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78814
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
77327
78815
  [...RULE_TEXT],
77328
78816
  [...RULE_TEXT],
77329
78817
  [...RULE_TEXT],
77330
78818
  [...RULE_TEXT],
77331
78819
  [...RULE_TEXT],
78820
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
77332
78821
  [...RULE_TEXT],
77333
78822
  [...RULE_TEXT],
77334
78823
  [...RULE_TEXT],
@@ -77346,7 +78835,11 @@ var STATE_SUMMARY_VARS = [
77346
78835
  [...RULE_TEXT],
77347
78836
  [...RULE_TEXT],
77348
78837
  [...RULE_TEXT],
77349
- [...RULE_TEXT],
78838
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78839
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78840
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78841
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78842
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
77350
78843
  [...RULE_TEXT],
77351
78844
  [...RULE_TEXT],
77352
78845
  [...RULE_TEXT],