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