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