@camstack/addon-provider-unraid 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,4 +1,4 @@
1
- //#region ../types/dist/event-category-C4hVnRo8.mjs
1
+ //#region ../types/dist/event-category-DOl51-Ij.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -62,6 +62,33 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
62
62
  * consumes this category and maps it to the `addon-crash-loop` kind.
63
63
  */
64
64
  EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
65
+ /**
66
+ * A runner whose addon refused to start with a typed reason (D877) - parked
67
+ * in `refused`, never counted by the crash breaker, retried on operator
68
+ * action. One event per refusal.
69
+ */
70
+ EventCategory["AddonRunnerRefused"] = "addon.runner-refused";
71
+ /**
72
+ * A runner settled on a state (D877): `running` (READY), `crashed`, `failed` or
73
+ * `refused`. In-process telemetry for the boot check (re-evaluate while any
74
+ * runner is still pending) and the alert centre (close a recovered runner).
75
+ */
76
+ EventCategory["ProcessStateChanged"] = "process.state-changed";
77
+ /**
78
+ * The node's one-shot runner boot check (D877): planned runners against the
79
+ * process service, `degraded` when any is failed, refused or missing. The
80
+ * alert centre turns it into one critical alert.
81
+ */
82
+ EventCategory["SystemRunnerCheck"] = "system.runner-check";
83
+ /**
84
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
85
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
86
+ * centre sends no notification of its own: Notification Center turns this
87
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
88
+ * system-event kinds, and reconciles from the alerts store because a bus
89
+ * event may be dropped (D8, D11).
90
+ */
91
+ EventCategory["AlertEpisode"] = "alert.episode";
65
92
  EventCategory["AddonError"] = "addon.error";
66
93
  EventCategory["AddonPageReady"] = "addon.page-ready";
67
94
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5386,7 +5413,7 @@ var ZodIssueCode = {
5386
5413
  var ZodFirstPartyTypeKind;
5387
5414
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5388
5415
  //#endregion
5389
- //#region ../types/dist/sleep-DRqxtc0C.mjs
5416
+ //#region ../types/dist/sleep-BxjU_fJM.mjs
5390
5417
  /**
5391
5418
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5392
5419
  * window to float samples (D455).
@@ -5503,7 +5530,7 @@ function isKeychainStoredField(field) {
5503
5530
  var SECRET_CLEAR = { $secretClear: true };
5504
5531
  /** The `'***'` token D634 redaction writes for non-admins. */
5505
5532
  var LEGACY_DEVICE_REDACTION = "***";
5506
- function isRecord$2(value) {
5533
+ function isRecord$5(value) {
5507
5534
  return typeof value === "object" && value !== null && !Array.isArray(value);
5508
5535
  }
5509
5536
  function makeSecretMarker(ref) {
@@ -5514,12 +5541,12 @@ function makeSecretMarker(ref) {
5514
5541
  }
5515
5542
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5516
5543
  function isSecretMarker(value) {
5517
- if (!isRecord$2(value)) return false;
5544
+ if (!isRecord$5(value)) return false;
5518
5545
  const ref = value["$secret"];
5519
5546
  return typeof ref === "string" && ref.length > 0;
5520
5547
  }
5521
5548
  function isSecretClear(value) {
5522
- return isRecord$2(value) && value["$secretClear"] === true;
5549
+ return isRecord$5(value) && value["$secretClear"] === true;
5523
5550
  }
5524
5551
  /**
5525
5552
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6129,7 +6156,7 @@ var KeychainWriteRefusedError = class extends Error {
6129
6156
  }
6130
6157
  };
6131
6158
  var KEEP = { kind: "keep" };
6132
- function isRecord$1(value) {
6159
+ function isRecord$4(value) {
6133
6160
  return typeof value === "object" && value !== null && !Array.isArray(value);
6134
6161
  }
6135
6162
  function defaultMintId() {
@@ -6142,7 +6169,7 @@ function collectSecretMarkerRefs(value, out = []) {
6142
6169
  return out;
6143
6170
  }
6144
6171
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6145
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6172
+ else if (isRecord$4(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6146
6173
  return out;
6147
6174
  }
6148
6175
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6197,7 +6224,7 @@ function rowId(row, idKey) {
6197
6224
  return null;
6198
6225
  }
6199
6226
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6200
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6227
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$4) : [];
6201
6228
  if (!Array.isArray(incoming)) {
6202
6229
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6203
6230
  return {
@@ -6213,7 +6240,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6213
6240
  const kept = /* @__PURE__ */ new Set();
6214
6241
  const rows = [];
6215
6242
  for (const row of incoming) {
6216
- if (!isRecord$1(row)) {
6243
+ if (!isRecord$4(row)) {
6217
6244
  rows.push(row);
6218
6245
  continue;
6219
6246
  }
@@ -6238,7 +6265,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6238
6265
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6239
6266
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6240
6267
  case "object": {
6241
- if (!isRecord$1(incoming)) {
6268
+ if (!isRecord$4(incoming)) {
6242
6269
  if (incoming === void 0) return KEEP;
6243
6270
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6244
6271
  return {
@@ -6246,7 +6273,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6246
6273
  value: incoming
6247
6274
  };
6248
6275
  }
6249
- const storedObj = isRecord$1(stored) ? stored : {};
6276
+ const storedObj = isRecord$4(stored) ? stored : {};
6250
6277
  return {
6251
6278
  kind: "value",
6252
6279
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6369,7 +6396,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6369
6396
  value: items
6370
6397
  };
6371
6398
  }
6372
- if (isRecord$1(v)) {
6399
+ if (isRecord$4(v)) {
6373
6400
  const out = {};
6374
6401
  for (const [k, child] of Object.entries(v)) {
6375
6402
  const s = substitute(child);
@@ -6401,7 +6428,7 @@ var SecretOverwriteRefusedError = class extends Error {
6401
6428
  this.name = "SecretOverwriteRefusedError";
6402
6429
  }
6403
6430
  };
6404
- function isRecord(value) {
6431
+ function isRecord$3(value) {
6405
6432
  return typeof value === "object" && value !== null && !Array.isArray(value);
6406
6433
  }
6407
6434
  function resolvedValue(pass, marker) {
@@ -6430,7 +6457,7 @@ function inArray(pass, incoming, stored) {
6430
6457
  return incoming.map((item, index) => {
6431
6458
  const twin = stored[index];
6432
6459
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
6433
- if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
6460
+ if (isRecord$3(item) && isRecord$3(twin)) return inArrayRow(pass, item, twin);
6434
6461
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
6435
6462
  return item;
6436
6463
  });
@@ -6441,7 +6468,7 @@ function inArrayRow(pass, incoming, stored) {
6441
6468
  const twin = stored[key];
6442
6469
  if (isSecretMarker(twin)) {
6443
6470
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
6444
- } else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
6471
+ } else if (isRecord$3(value) && isRecord$3(twin)) out[key] = inArrayRow(pass, value, twin);
6445
6472
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
6446
6473
  }
6447
6474
  return out;
@@ -6449,7 +6476,7 @@ function inArrayRow(pass, incoming, stored) {
6449
6476
  async function walk(pass, incoming, stored) {
6450
6477
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
6451
6478
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
6452
- if (!isRecord(incoming) || !isRecord(stored)) return incoming;
6479
+ if (!isRecord$3(incoming) || !isRecord$3(stored)) return incoming;
6453
6480
  const out = { ...incoming };
6454
6481
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
6455
6482
  return out;
@@ -6480,7 +6507,7 @@ async function restoreUnchangedSecrets(input) {
6480
6507
  function isJsonEqual(a, b) {
6481
6508
  if (Object.is(a, b)) return true;
6482
6509
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
6483
- if (isRecord(a) && isRecord(b)) {
6510
+ if (isRecord$3(a) && isRecord$3(b)) {
6484
6511
  const keys = Object.keys(a);
6485
6512
  if (keys.length !== Object.keys(b).length) return false;
6486
6513
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -6504,7 +6531,7 @@ function markerKeysOf(blob, owner) {
6504
6531
  }
6505
6532
  function nodeFromStored(value, owner) {
6506
6533
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
6507
- if (!isRecord(value)) return null;
6534
+ if (!isRecord$3(value)) return null;
6508
6535
  const children = /* @__PURE__ */ new Map();
6509
6536
  for (const [key, child] of Object.entries(value)) {
6510
6537
  const node = nodeFromStored(child, owner);
@@ -6637,7 +6664,6 @@ function createHandle(raw, opts) {
6637
6664
  const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
6638
6665
  const readAddonStoreResult = raw.readAddonStoreResult;
6639
6666
  const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
6640
- const readDeviceStoreBatch = raw.readDeviceStoreBatch;
6641
6667
  const overrides = {
6642
6668
  readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
6643
6669
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
@@ -6661,12 +6687,12 @@ function createHandle(raw, opts) {
6661
6687
  };
6662
6688
  } } : {},
6663
6689
  readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
6664
- ...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
6665
- const rows = await readDeviceStoreBatch.call(raw, deviceIds);
6690
+ readDeviceStoreBatch: async (deviceIds) => {
6691
+ const rows = await raw.readDeviceStoreBatch(deviceIds);
6666
6692
  const out = /* @__PURE__ */ new Map();
6667
6693
  for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
6668
6694
  return out;
6669
- } } : {},
6695
+ },
6670
6696
  writeAddonStore: async (patch) => {
6671
6697
  await writeAddon(patch);
6672
6698
  },
@@ -7293,7 +7319,7 @@ var BaseAddon = class {
7293
7319
  if (!ctx) return;
7294
7320
  const addonId = ctx.id;
7295
7321
  setImmediate(() => {
7296
- ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
7322
+ ctx.api.addons.restartAddon.mutate({ addonId }).then(() => {
7297
7323
  ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
7298
7324
  }).catch((err) => {
7299
7325
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
@@ -7493,7 +7519,7 @@ var BaseAddon = class {
7493
7519
  return this._addonSecretTree;
7494
7520
  }
7495
7521
  deviceSecretTree() {
7496
- this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7522
+ this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
7497
7523
  return this._deviceSecretTree;
7498
7524
  }
7499
7525
  /**
@@ -7569,42 +7595,135 @@ var BaseAddon = class {
7569
7595
  this[timerOf] = timer;
7570
7596
  }
7571
7597
  /**
7572
- * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
7573
- * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
7574
- * swap, or any race where the SqliteSettingsBackend is between shutdown and
7575
- * re-initialize) doesn't propagate up into `initialize()` and leave the
7598
+ * Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
7599
+ * settings-store outage doesn't propagate up into `initialize()` and leave the
7576
7600
  * addon permanently broken.
7577
7601
  *
7578
- * Retry only the two known infra fingerprints. Anything else propagates so
7579
- * real bugs surface immediately. After the budget expires we fall back to
7580
- * `{}` (defaults) — the addon's first successful patch will rehydrate.
7602
+ * Two kinds of outage, two budgets:
7603
+ * - the store's own restart fingerprints (`SqliteSettingsBackend not
7604
+ * initialized`, `provider not available`): a short budget, then the addon
7605
+ * falls back to `{}` (defaults) - its first successful patch rehydrates;
7606
+ * - a TRANSPORT failure (the hub is restarting while this runner boots:
7607
+ * `discovery deadline exceeded`, `parent could not route`, a refused or
7608
+ * timed-out connection). Since D870 a runner's settings read THROWS instead
7609
+ * of answering `{}`, so without a budget a hub restart ends in a respawn
7610
+ * loop. A long, bounded budget; only after it the error propagates - the
7611
+ * addon never runs on defaults for a store it could not ask.
7612
+ * Anything else propagates immediately so real bugs surface.
7581
7613
  */
7582
7614
  async readAddonStoreWithRetry() {
7583
7615
  const settings = this.rawSettings();
7584
7616
  if (!settings) return {};
7585
- const delaysMs = [
7586
- 150,
7587
- 350,
7588
- 600,
7589
- 900
7590
- ];
7591
7617
  let lastErr;
7592
- for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
7618
+ for (let attempt = 0;; attempt++) try {
7593
7619
  const stored = await settings.readAddonStore() ?? {};
7594
7620
  this.settingsStoreReady = true;
7595
7621
  return stored;
7596
7622
  } catch (err) {
7597
7623
  lastErr = err;
7598
- const msg = err instanceof Error ? err.message : String(err);
7599
- if (!(msg.includes("SqliteSettingsBackend not initialized") || msg.includes("provider not available"))) throw err;
7600
- if (attempt === delaysMs.length) break;
7601
- await new Promise((r) => setTimeout(r, delaysMs[attempt]));
7624
+ const kind = classifyStoreError(err);
7625
+ if (kind === "permanent") throw err;
7626
+ const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
7627
+ if (delay === void 0) {
7628
+ if (kind === "transport") throw err;
7629
+ break;
7630
+ }
7631
+ await new Promise((r) => setTimeout(r, delay));
7602
7632
  }
7603
7633
  this.settingsStoreReady = false;
7604
7634
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
7605
7635
  return {};
7606
7636
  }
7607
7637
  };
7638
+ /** The settings store's own restart fingerprints. */
7639
+ var RESTART_RETRY_DELAYS_MS = [
7640
+ 150,
7641
+ 350,
7642
+ 600,
7643
+ 900
7644
+ ];
7645
+ /** A hub restarting under a booting runner: ~100 s in total. */
7646
+ var TRANSPORT_RETRY_DELAYS_MS = [
7647
+ 150,
7648
+ 350,
7649
+ 600,
7650
+ 900,
7651
+ 2e3,
7652
+ 5e3,
7653
+ 1e4,
7654
+ 2e4,
7655
+ 3e4,
7656
+ 3e4
7657
+ ];
7658
+ var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
7659
+ /** Node / socket error codes of a connection that did not happen or broke. */
7660
+ var TRANSPORT_CODES = new Set([
7661
+ "ECONNREFUSED",
7662
+ "ECONNRESET",
7663
+ "ETIMEDOUT",
7664
+ "EPIPE",
7665
+ "EHOSTUNREACH",
7666
+ "ENETUNREACH"
7667
+ ]);
7668
+ /** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
7669
+ var UNAVAILABLE_TRPC_CODES = new Set([
7670
+ "TIMEOUT",
7671
+ "SERVICE_UNAVAILABLE",
7672
+ "BAD_GATEWAY",
7673
+ "GATEWAY_TIMEOUT"
7674
+ ]);
7675
+ /** The exact phrases OUR transport raises when it cannot reach the hub. */
7676
+ var TRANSPORT_PHRASES = [
7677
+ "discovery deadline exceeded",
7678
+ "parent could not route child unowned cap call",
7679
+ "UDS request timed out after",
7680
+ "channel closed"
7681
+ ];
7682
+ /** Moleculer error `type`s of a call that could not be served right now. */
7683
+ var MOLECULER_TRANSIENT_TYPES = new Set([
7684
+ "REQUEST_TIMEOUT",
7685
+ "SERVICE_NOT_FOUND",
7686
+ "SERVICE_NOT_AVAILABLE",
7687
+ "REQUEST_REJECTED",
7688
+ "BROKER_DISCONNECTED"
7689
+ ]);
7690
+ function stringProp(value, key) {
7691
+ if (typeof value !== "object" || value === null) return void 0;
7692
+ const found = Reflect.get(value, key);
7693
+ return typeof found === "string" ? found : void 0;
7694
+ }
7695
+ /** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
7696
+ function errorCode(err) {
7697
+ const out = {};
7698
+ const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
7699
+ const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
7700
+ const node = stringProp(err, "code") ?? stringProp(cause, "code");
7701
+ if (node !== void 0) out.node = node;
7702
+ const trpc = stringProp(data, "code");
7703
+ if (trpc !== void 0) out.trpc = trpc;
7704
+ return out;
7705
+ }
7706
+ /**
7707
+ * Is a settings read failure worth retrying, and with which budget? Only
7708
+ * EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
7709
+ * one of the exact phrases our own transport raises. A message that merely
7710
+ * contains "timed out" or "unreachable" is not evidence of anything, and
7711
+ * `settings store not wired` is a wiring bug that retrying cannot fix.
7712
+ */
7713
+ function classifyStoreError(err) {
7714
+ const message = err instanceof Error ? err.message : String(err);
7715
+ if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
7716
+ const code = errorCode(err);
7717
+ if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
7718
+ if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
7719
+ if (typeof err === "object" && err !== null) {
7720
+ if (Reflect.get(err, "retryable") === true) return "transport";
7721
+ const type = stringProp(err, "type");
7722
+ if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
7723
+ }
7724
+ if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
7725
+ return "permanent";
7726
+ }
7608
7727
  /**
7609
7728
  * Collect the keys of every field marked `perNode: true`, recursing into
7610
7729
  * layout containers (`group` fields and `sub-tabs` tabs) the same way
@@ -7694,6 +7813,156 @@ var PeerBytesTicketSchema = object({
7694
7813
  */
7695
7814
  declaredBytes: number().int().nonnegative().nullable()
7696
7815
  });
7816
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
7817
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
7818
+ var RECORD_DATABASES = ["settings", "events"];
7819
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
7820
+ var RECORD_CLASSES = [
7821
+ "config",
7822
+ "ledger",
7823
+ "audit",
7824
+ "mirror",
7825
+ "ephemeral"
7826
+ ];
7827
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
7828
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
7829
+ var RECORD_BATCH_MAX = 1e3;
7830
+ var RECORD_QUERY_MAX = 1e3;
7831
+ function defOf(schema) {
7832
+ const zodBag = Reflect.get(schema, "_zod");
7833
+ if (typeof zodBag !== "object" || zodBag === null) return {};
7834
+ const def = Reflect.get(zodBag, "def");
7835
+ if (typeof def !== "object" || def === null) return {};
7836
+ return def;
7837
+ }
7838
+ function declaredHere(schema) {
7839
+ return globalRegistry.get(schema)?.secret === true;
7840
+ }
7841
+ /** Wrapper kinds whose `innerType` is the field itself. */
7842
+ var WRAPPERS = new Set([
7843
+ "optional",
7844
+ "nullable",
7845
+ "default",
7846
+ "prefault",
7847
+ "catch",
7848
+ "readonly",
7849
+ "nonoptional"
7850
+ ]);
7851
+ /**
7852
+ * The schema layers that make up ONE field: the schema itself and every
7853
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
7854
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
7855
+ * `.transform` on `in`).
7856
+ */
7857
+ function layersOf(schema) {
7858
+ const out = [];
7859
+ const queue = [schema];
7860
+ while (queue.length > 0) {
7861
+ const s = queue.shift();
7862
+ if (!s || out.includes(s)) continue;
7863
+ out.push(s);
7864
+ const def = defOf(s);
7865
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
7866
+ if (def.type === "pipe") {
7867
+ if (def.in) queue.push(def.in);
7868
+ if (def.out) queue.push(def.out);
7869
+ }
7870
+ }
7871
+ return out;
7872
+ }
7873
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
7874
+ function isZodSecret(schema) {
7875
+ return layersOf(schema).some(declaredHere);
7876
+ }
7877
+ /**
7878
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
7879
+ * element of this array" (`connection.password`, `rows[].token`). A declared
7880
+ * object or array is reported as one path and not descended into — everything
7881
+ * under it is secret.
7882
+ */
7883
+ function collectZodSecretPaths(schema, prefix = "") {
7884
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
7885
+ const paths = [];
7886
+ for (const layer of layersOf(schema)) {
7887
+ const def = defOf(layer);
7888
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
7889
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
7890
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
7891
+ else if (def.type === "intersection") {
7892
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
7893
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
7894
+ }
7895
+ }
7896
+ return [...new Set(paths)];
7897
+ }
7898
+ /**
7899
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
7900
+ * Zod row schema that describes it, and the helper that turns the two into the
7901
+ * JSON the engine stores.
7902
+ *
7903
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
7904
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
7905
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
7906
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
7907
+ * never a field name (D879).
7908
+ */
7909
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
7910
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
7911
+ var RecordIndexSchema = object({
7912
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
7913
+ fields: array(RecordFieldPathSchema).min(1).max(4),
7914
+ unique: boolean().optional()
7915
+ }).strict();
7916
+ var RecordRetentionSchema = union([
7917
+ object({
7918
+ ttlMs: number().int().positive(),
7919
+ from: _enum(["at", "write"])
7920
+ }).strict(),
7921
+ object({
7922
+ maxRows: number().int().positive().optional(),
7923
+ maxRowsPerDevice: number().int().positive().optional()
7924
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
7925
+ object({
7926
+ owner: string().min(1),
7927
+ reason: string().min(1)
7928
+ }).strict(),
7929
+ object({ none: string().min(1) }).strict()
7930
+ ]);
7931
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
7932
+ var EntryDescriptorSchema = object({
7933
+ title: string().min(1),
7934
+ /** The record body field shown as the entry's name. */
7935
+ nameField: string().min(1),
7936
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
7937
+ fields: record(string(), unknown())
7938
+ }).strict();
7939
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
7940
+ var RecordKindDeclarationSchema = object({
7941
+ database: _enum(RECORD_DATABASES).default("settings"),
7942
+ class: _enum(RECORD_CLASSES),
7943
+ writeTrigger: string().min(1),
7944
+ device: _enum([
7945
+ "required",
7946
+ "optional",
7947
+ "none"
7948
+ ]).default("none"),
7949
+ at: _enum(["required", "none"]).default("none"),
7950
+ indexes: array(RecordIndexSchema).max(8).default([]),
7951
+ retention: RecordRetentionSchema,
7952
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
7953
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
7954
+ /** Derived from the Zod schema; never written by hand. */
7955
+ secretPaths: array(string().min(1)).default([]),
7956
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
7957
+ secretArrayKeys: record(string(), string()).default({}),
7958
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
7959
+ adoptsFrom: string().min(1).optional(),
7960
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
7961
+ transactFamily: string().min(1).optional(),
7962
+ entry: EntryDescriptorSchema.optional()
7963
+ }).strict();
7964
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
7965
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7697
7966
  /** Shared Zod schemas used across streaming capabilities. */
7698
7967
  var CamProfileSchema = _enum([
7699
7968
  "high",
@@ -8158,69 +8427,6 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
8158
8427
  kind: "mutation",
8159
8428
  auth: "admin"
8160
8429
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
8161
- function defOf(schema) {
8162
- return schema._zod?.def ?? {};
8163
- }
8164
- function declaredHere(schema) {
8165
- return globalRegistry.get(schema)?.secret === true;
8166
- }
8167
- /** Wrapper kinds whose `innerType` is the field itself. */
8168
- var WRAPPERS = new Set([
8169
- "optional",
8170
- "nullable",
8171
- "default",
8172
- "prefault",
8173
- "catch",
8174
- "readonly",
8175
- "nonoptional"
8176
- ]);
8177
- /**
8178
- * The schema layers that make up ONE field: the schema itself and every
8179
- * wrapper below it (optional / default / nullable / readonly / catch), plus
8180
- * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
8181
- * `.transform` on `in`).
8182
- */
8183
- function layersOf(schema) {
8184
- const out = [];
8185
- const queue = [schema];
8186
- while (queue.length > 0) {
8187
- const s = queue.shift();
8188
- if (!s || out.includes(s)) continue;
8189
- out.push(s);
8190
- const def = defOf(s);
8191
- if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
8192
- if (def.type === "pipe") {
8193
- if (def.in) queue.push(def.in);
8194
- if (def.out) queue.push(def.out);
8195
- }
8196
- }
8197
- return out;
8198
- }
8199
- /** True when any layer of this field declares `.meta({ secret: true })`. */
8200
- function isZodSecret(schema) {
8201
- return layersOf(schema).some(declaredHere);
8202
- }
8203
- /**
8204
- * Every declared secret path in a config schema: dotted keys, `[]` for "each
8205
- * element of this array" (`connection.password`, `rows[].token`). A declared
8206
- * object or array is reported as one path and not descended into — everything
8207
- * under it is secret.
8208
- */
8209
- function collectZodSecretPaths(schema, prefix = "") {
8210
- if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
8211
- const paths = [];
8212
- for (const layer of layersOf(schema)) {
8213
- const def = defOf(layer);
8214
- if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
8215
- else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
8216
- else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
8217
- else if (def.type === "intersection") {
8218
- if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
8219
- if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
8220
- }
8221
- }
8222
- return [...new Set(paths)];
8223
- }
8224
8430
  object({
8225
8431
  code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
8226
8432
  params: record(string(), union([string(), number()])).optional()
@@ -8240,7 +8446,7 @@ function userError(code, params, englishFallback) {
8240
8446
  return new CamstackError(code, params, englishFallback);
8241
8447
  }
8242
8448
  //#endregion
8243
- //#region ../types/dist/err-msg-DLerKiVO.mjs
8449
+ //#region ../types/dist/err-msg-BXKzRBwg.mjs
8244
8450
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
8245
8451
  DeviceType["Camera"] = "camera";
8246
8452
  DeviceType["Hub"] = "hub";
@@ -8332,6 +8538,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
8332
8538
  * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
8333
8539
  * integrations sharing the same food/desiccant/hopper surface. */
8334
8540
  DeviceType["PetFeeder"] = "pet-feeder";
8541
+ /** Built-in dishwasher — program lifecycle, door / remote-start gates,
8542
+ * salt and rinse-aid levels. Installed with the `dishwasher` cap.
8543
+ * Sources: native Bosch Home Connect, reusable by similar integrations. */
8544
+ DeviceType["Dishwasher"] = "dishwasher";
8335
8545
  return DeviceType;
8336
8546
  }({});
8337
8547
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -8509,6 +8719,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8509
8719
  /** Virtual HA toggle (input_boolean.*) — distinguishable from a
8510
8720
  * real Switch device for UI rendering / export adapters. */
8511
8721
  DeviceRole["BinaryHelper"] = "binary-helper";
8722
+ /** A smart plug: a `switch` whose source says it is an outlet (HA
8723
+ * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
8724
+ DeviceRole["Outlet"] = "outlet";
8512
8725
  /** Generic motion / occupancy / moving event source. Distinct from
8513
8726
  * the camera accessory PirSensor role: that one is a camera child;
8514
8727
  * this is a standalone HA / 3rd-party motion sensor. */
@@ -8586,7 +8799,7 @@ function errMsg(err) {
8586
8799
  return String(err);
8587
8800
  }
8588
8801
  //#endregion
8589
- //#region ../types/dist/composition-EQ9Ok0Ee.mjs
8802
+ //#region ../types/dist/composition-CB6PMT9p.mjs
8590
8803
  /**
8591
8804
  * The ffmpeg build every CamStack node downloads, per platform and arch.
8592
8805
  *
@@ -11790,11 +12003,10 @@ var ClipModelMetaSchema = object({
11790
12003
  /**
11791
12004
  * The `vector-store` index this model's vectors live in. ONE feature space
11792
12005
  * per index: two models share an index only when their vectors are ranked
11793
- * against each other, which for CLIP means never across families. MobileCLIP
11794
- * S1 and S2 share `object-clip` for history (separated by the row's
11795
- * `modelId`); any other model gets its own.
12006
+ * against each other, which for CLIP means never across families. Every
12007
+ * model gets its own.
11796
12008
  */
11797
- vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
12009
+ vectorIndex: string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
11798
12010
  /**
11799
12011
  * The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
11800
12012
  * must be unique per tokenizer: every model's siblings land in ONE flat
@@ -12973,8 +13185,20 @@ var AlertSeveritySchema = _enum([
12973
13185
  "info",
12974
13186
  "success",
12975
13187
  "warning",
12976
- "error"
13188
+ "error",
13189
+ "critical"
12977
13190
  ]);
13191
+ var AlertActionSchema = object({
13192
+ label: string(),
13193
+ href: string().optional(),
13194
+ /**
13195
+ * How `href` is followed. Absent / `app`: an admin-ui route (client-side).
13196
+ * `server`: a route the HUB serves (an addon HTTP route such as an OAuth
13197
+ * start) — the browser must leave the SPA with a full navigation, because
13198
+ * the SPA has no such route and would bounce to the home page.
13199
+ */
13200
+ navigation: _enum(["app", "server"]).optional()
13201
+ });
12978
13202
  var AlertStatusSchema = _enum([
12979
13203
  "active",
12980
13204
  "in-progress",
@@ -12992,6 +13216,7 @@ var AlertSchema = object({
12992
13216
  severity: AlertSeveritySchema,
12993
13217
  title: string(),
12994
13218
  message: string(),
13219
+ action: AlertActionSchema.optional(),
12995
13220
  status: AlertStatusSchema,
12996
13221
  progress: number().optional(),
12997
13222
  read: boolean(),
@@ -15527,6 +15752,41 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
15527
15752
  keyField: string()
15528
15753
  }).optional()
15529
15754
  })) });
15755
+ /**
15756
+ * The report of a one-shot "move this owner's plaintext secrets into the
15757
+ * keychain" run (D878). COUNTS only - never a value, never a ref.
15758
+ *
15759
+ * The owner runs it on its own rows, through its own write path; an operator
15760
+ * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
15761
+ * Dry run (`apply: false`) reports what WOULD move and changes nothing.
15762
+ */
15763
+ var RawSecretMigrationInputSchema = object({
15764
+ /** `false` (the default of the script) = report only. */
15765
+ apply: boolean() });
15766
+ var RawSecretMigrationReportSchema = object({
15767
+ apply: boolean(),
15768
+ /** Rows that can carry a secret (a profile, an enrolment). */
15769
+ rows: number().int(),
15770
+ /** Rows whose secret was plaintext when the run started. */
15771
+ raw: number().int(),
15772
+ /** Rows that already held a keychain marker when the run started. */
15773
+ markers: number().int(),
15774
+ /** Plaintext rows moved by THIS run (always 0 on a dry run). */
15775
+ migrated: number().int(),
15776
+ /** Plaintext rows left in place because the move or its read-back failed. */
15777
+ failed: number().int(),
15778
+ /** After the run: rows still holding plaintext. */
15779
+ remainingRaw: number().int(),
15780
+ /** After the run: markers the keychain could not resolve right now. */
15781
+ unresolvedMarkers: number().int(),
15782
+ /**
15783
+ * A second, redundant copy of the secrets' rows that the run found (and, on
15784
+ * `apply`, deleted after verifying the first). Owners with a single copy omit it.
15785
+ */
15786
+ redundantCopies: number().int().optional(),
15787
+ /** True when nothing is raw and every marker resolves. */
15788
+ verified: boolean()
15789
+ });
15530
15790
  /** Where a block runs. The operator chooses — a block driving a device on an
15531
15791
  * agent is the reason placement is not fixed to the hub. */
15532
15792
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -15753,6 +16013,9 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
15753
16013
  }), SettingsUpdateResultSchema, {
15754
16014
  kind: "mutation",
15755
16015
  auth: "admin"
16016
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
16017
+ kind: "mutation",
16018
+ auth: "admin"
15756
16019
  }), method(object({}), object({ libs: array(object({
15757
16020
  filePath: string(),
15758
16021
  content: string()
@@ -16016,6 +16279,347 @@ id: union([string(), number()]) }), {
16016
16279
  auth: "admin"
16017
16280
  });
16018
16281
  /**
16282
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16283
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16284
+ * (operator intent, D870) and device-history (numbers over time, D850).
16285
+ *
16286
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16287
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16288
+ * that with the addon id closed over). It is deliberately NOT in any input
16289
+ * schema, so a session can never supply it, and a call with no stamp is refused
16290
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16291
+ * addons go through the owner's capability.
16292
+ *
16293
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16294
+ * never `[]`. Secret fields are never on the wire: a read shows the
16295
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16296
+ * resolves itself, and a write may carry only a keychain marker bound to the
16297
+ * row's own ref.
16298
+ *
16299
+ * Internal: addons reach it through `ctx.records`, never directly.
16300
+ */
16301
+ var RecordIdSchema = string().min(1).max(256);
16302
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16303
+ var RecordBodySchema = record(string(), unknown());
16304
+ var RecordInputSchema = object({
16305
+ id: RecordIdSchema,
16306
+ /** The device this row belongs to (D865 removal, per-device reads). */
16307
+ deviceId: number().int().optional(),
16308
+ /** The domain clock, ms: observed / created / opened. */
16309
+ at: number().int().optional(),
16310
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16311
+ expiresAt: number().int().optional(),
16312
+ data: RecordBodySchema
16313
+ });
16314
+ var RecordViewSchema = object({
16315
+ id: string(),
16316
+ deviceId: number().int().nullable(),
16317
+ at: number().nullable(),
16318
+ expiresAt: number().nullable(),
16319
+ rev: number().int(),
16320
+ updatedAt: number(),
16321
+ data: RecordBodySchema
16322
+ });
16323
+ /** Declared index fields only. Anything else does not compile, by design. */
16324
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16325
+ string(),
16326
+ number(),
16327
+ boolean(),
16328
+ object({ in: array(union([
16329
+ string(),
16330
+ number(),
16331
+ boolean()
16332
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16333
+ object({
16334
+ gt: union([string(), number()]).optional(),
16335
+ gte: union([string(), number()]).optional(),
16336
+ lt: union([string(), number()]).optional(),
16337
+ lte: union([string(), number()]).optional()
16338
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16339
+ ]));
16340
+ var KindShape = { kind: RecordKindNameSchema };
16341
+ var TimeWindowShape = {
16342
+ deviceId: number().int().optional(),
16343
+ atFrom: number().optional(),
16344
+ atTo: number().optional()
16345
+ };
16346
+ var RecordQueryInputSchema = object({
16347
+ ...KindShape,
16348
+ ...TimeWindowShape,
16349
+ where: RecordWhereSchema.optional(),
16350
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16351
+ order: _enum(["at", "id"]).optional(),
16352
+ desc: boolean().optional(),
16353
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16354
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16355
+ cursor: string().min(1).optional()
16356
+ });
16357
+ var RecordQueryResultSchema = object({
16358
+ records: array(RecordViewSchema),
16359
+ nextCursor: string().nullable()
16360
+ });
16361
+ var RecordKindStateSchema = _enum([
16362
+ "created",
16363
+ "unchanged",
16364
+ "updated"
16365
+ ]);
16366
+ var DeclareKindResultSchema = object({
16367
+ kindId: number().int(),
16368
+ state: RecordKindStateSchema,
16369
+ createdIndexes: array(string()),
16370
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16371
+ adoptionPending: object({
16372
+ legacyTable: string(),
16373
+ legacyRows: number().int()
16374
+ }).nullable()
16375
+ });
16376
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16377
+ var SecretRefsList = array(string());
16378
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16379
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16380
+ kind: "mutation",
16381
+ auth: "admin"
16382
+ }), method(object({
16383
+ ...KindShape,
16384
+ id: RecordIdSchema
16385
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16386
+ ...KindShape,
16387
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16388
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16389
+ ...KindShape,
16390
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16391
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16392
+ ...KindShape,
16393
+ record: RecordInputSchema,
16394
+ /** Compare-and-set. `0` means "the row must not exist". */
16395
+ ifRev: number().int().min(0).optional()
16396
+ }), object({
16397
+ rev: number().int(),
16398
+ releasedRefs: SecretRefsList
16399
+ }), {
16400
+ kind: "mutation",
16401
+ auth: "admin"
16402
+ }), method(object({
16403
+ ...KindShape,
16404
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16405
+ }), object({
16406
+ count: number().int(),
16407
+ releasedRefs: SecretRefsList
16408
+ }), {
16409
+ kind: "mutation",
16410
+ auth: "admin"
16411
+ }), method(object({
16412
+ ...KindShape,
16413
+ id: RecordIdSchema,
16414
+ data: RecordBodySchema,
16415
+ at: number().int().nullable().optional(),
16416
+ expiresAt: number().int().nullable().optional(),
16417
+ ifRev: number().int().min(1).optional()
16418
+ }), object({
16419
+ rev: number().int(),
16420
+ releasedRefs: SecretRefsList
16421
+ }), {
16422
+ kind: "mutation",
16423
+ auth: "admin"
16424
+ }), method(object({
16425
+ ...KindShape,
16426
+ id: RecordIdSchema
16427
+ }), object({
16428
+ deleted: boolean(),
16429
+ secretRefs: SecretRefsList
16430
+ }), {
16431
+ kind: "mutation",
16432
+ auth: "admin"
16433
+ }), method(object({
16434
+ ...KindShape,
16435
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16436
+ }), object({
16437
+ deleted: number().int(),
16438
+ secretRefs: SecretRefsList
16439
+ }), {
16440
+ kind: "mutation",
16441
+ auth: "admin"
16442
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16443
+ ...KindShape,
16444
+ ...TimeWindowShape,
16445
+ where: RecordWhereSchema.optional()
16446
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16447
+ ...KindShape,
16448
+ deviceId: number().int().optional(),
16449
+ from: number(),
16450
+ to: number(),
16451
+ bucketMs: number().int().positive()
16452
+ }), object({ buckets: array(object({
16453
+ bucketStart: number(),
16454
+ count: number().int()
16455
+ })) }), { auth: "admin" }), method(object({
16456
+ ...KindShape,
16457
+ op: _enum([
16458
+ "sum",
16459
+ "min",
16460
+ "max",
16461
+ "count"
16462
+ ]),
16463
+ field: RecordFieldPathSchema.optional(),
16464
+ groupBy: RecordFieldPathSchema.optional(),
16465
+ where: RecordWhereSchema.optional()
16466
+ }), object({ rows: array(object({
16467
+ group: union([
16468
+ string(),
16469
+ number(),
16470
+ _null()
16471
+ ]),
16472
+ value: number().nullable()
16473
+ })) }), { auth: "admin" }), method(object({
16474
+ ...KindShape,
16475
+ deviceId: number().int().optional(),
16476
+ atBefore: number().optional(),
16477
+ where: RecordWhereSchema.optional()
16478
+ }), object({
16479
+ deleted: number().int(),
16480
+ secretRefs: SecretRefsList
16481
+ }), {
16482
+ kind: "mutation",
16483
+ auth: "admin"
16484
+ }), method(object({
16485
+ deviceId: number().int(),
16486
+ kinds: array(RecordKindNameSchema).optional()
16487
+ }), object({
16488
+ deleted: record(string(), number().int()),
16489
+ secretRefs: SecretRefsList
16490
+ }), {
16491
+ kind: "mutation",
16492
+ auth: "admin"
16493
+ }), method(object(KindShape), object({ id: number().int() }), {
16494
+ kind: "mutation",
16495
+ auth: "admin"
16496
+ });
16497
+ /** One table of the settings database. */
16498
+ var StorageTableSchema = object({
16499
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
16500
+ name: string(),
16501
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
16502
+ owner: string().nullable(),
16503
+ rows: number().int().nonnegative(),
16504
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
16505
+ bytes: number().int().nonnegative().nullable(),
16506
+ /** Declared by an addon since this engine process started (a running addon claims it). */
16507
+ declaredThisBoot: boolean()
16508
+ });
16509
+ /** One declared record kind (D881) as System -> Data shows it. */
16510
+ var StorageKindSchema = object({
16511
+ owner: string(),
16512
+ kind: string(),
16513
+ database: _enum(["settings", "events"]),
16514
+ class: string(),
16515
+ state: _enum([
16516
+ "declared",
16517
+ "orphaned",
16518
+ "dropped"
16519
+ ]),
16520
+ /** `null` when the caller asked for no counts (`counts: false`). */
16521
+ rows: number().int().nonnegative().nullable(),
16522
+ /** Rows x the average size of a sample; null for an empty kind. */
16523
+ bytesEstimate: number().int().nonnegative().nullable(),
16524
+ writeTrigger: string(),
16525
+ retention: RecordRetentionSchema,
16526
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16527
+ entry: boolean(),
16528
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16529
+ declaration: RecordKindDeclarationSchema
16530
+ });
16531
+ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16532
+ collection: string().min(1),
16533
+ expectRows: number().int().nonnegative()
16534
+ }), object({
16535
+ dropped: literal(true),
16536
+ rows: number().int().nonnegative()
16537
+ }), {
16538
+ kind: "mutation",
16539
+ auth: "admin"
16540
+ }), method(object({
16541
+ owner: string().min(1).optional(),
16542
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16543
+ counts: boolean().optional()
16544
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16545
+ owner: string().min(1),
16546
+ kind: RecordKindNameSchema
16547
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16548
+ owner: string().min(1),
16549
+ kind: RecordKindNameSchema,
16550
+ records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
16551
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16552
+ complete: boolean().optional()
16553
+ }).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
16554
+ kind: "mutation",
16555
+ auth: "admin"
16556
+ }), method(object({
16557
+ collection: string().min(1),
16558
+ cursor: string().optional(),
16559
+ limit: number().int().min(1).max(1e3).optional()
16560
+ }), object({
16561
+ rows: array(object({
16562
+ id: string(),
16563
+ data: record(string(), unknown())
16564
+ })),
16565
+ nextCursor: string().nullable()
16566
+ }), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
16567
+ /**
16568
+ * record-entries - the ONE admin surface for every list of user-created entries
16569
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16570
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16571
+ *
16572
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16573
+ * the entry body with `secret: true` on every credential field, so a password
16574
+ * field is derived from the schema and never from a name. `putEntry` takes the
16575
+ * redaction token for an untouched secret (the stored value is kept), a string
16576
+ * for a new one, and the clear instruction to remove one. A read never carries
16577
+ * a secret value, and a locked keychain refuses the write with
16578
+ * `records/secret-unavailable` instead of storing plaintext.
16579
+ *
16580
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
16581
+ */
16582
+ var EntryKindInfoSchema = object({
16583
+ owner: string(),
16584
+ kind: RecordKindNameSchema,
16585
+ title: string(),
16586
+ nameField: string(),
16587
+ /** JSON Schema of the body; `secret: true` marks a password field. */
16588
+ fields: record(string(), unknown()),
16589
+ secretPaths: array(string()),
16590
+ rows: number().int().nonnegative()
16591
+ });
16592
+ var EntryViewSchema = object({
16593
+ id: RecordIdSchema,
16594
+ name: string(),
16595
+ rev: number().int(),
16596
+ updatedAt: number(),
16597
+ /** Secret fields hold the redaction token. */
16598
+ data: RecordBodySchema
16599
+ });
16600
+ var EntryAddress = {
16601
+ owner: string().min(1),
16602
+ kind: RecordKindNameSchema
16603
+ };
16604
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
16605
+ ...EntryAddress,
16606
+ id: RecordIdSchema.optional(),
16607
+ data: RecordBodySchema,
16608
+ ifRev: number().int().min(1).optional()
16609
+ }), object({
16610
+ id: string(),
16611
+ rev: number().int()
16612
+ }), {
16613
+ kind: "mutation",
16614
+ auth: "admin"
16615
+ }), method(object({
16616
+ ...EntryAddress,
16617
+ id: RecordIdSchema
16618
+ }), object({ deleted: boolean() }), {
16619
+ kind: "mutation",
16620
+ auth: "admin"
16621
+ });
16622
+ /**
16019
16623
  * `keychain` — the hub's encrypted store of secret values (D787).
16020
16624
  *
16021
16625
  * Settings blobs never hold a secret: they hold a marker
@@ -16556,6 +17160,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
16556
17160
  kind: "mutation",
16557
17161
  auth: "admin",
16558
17162
  caller: "required"
17163
+ }), method(object({
17164
+ ref: string().min(1),
17165
+ value: string().min(1)
17166
+ }), object({
17167
+ ref: string(),
17168
+ version: number().int()
17169
+ }), {
17170
+ kind: "mutation",
17171
+ auth: "admin",
17172
+ caller: "required"
16559
17173
  }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
16560
17174
  deleted: array(string()).readonly(),
16561
17175
  kept: array(object({
@@ -17077,7 +17691,11 @@ var deviceDiscoveryCapability = {
17077
17691
  };
17078
17692
  /**
17079
17693
  * `device-adoption` — generic discovery + adoption surface,
17080
- * system-scoped singleton. The de-HA-ified successor to `ha-discovery`:
17694
+ * system-scoped collection (one provider per integration addon), routed
17695
+ * by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
17696
+ * pin model as `connection-test`. The admin UI keeps using
17697
+ * `deviceManager.adoption*` (which already threads `addonId`). The de-HA-ified
17698
+ * successor to `ha-discovery`:
17081
17699
  * keyed by `integrationId` (the addon resolves integrationId → broker
17082
17700
  * internally) rather than a connection-specific `brokerId`, and it
17083
17701
  * REUSES the shared `DiscoveredChildDevice` candidate type from
@@ -39330,6 +39948,9 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
39330
39948
  }), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
39331
39949
  kind: "mutation",
39332
39950
  auth: "admin"
39951
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
39952
+ kind: "mutation",
39953
+ auth: "admin"
39333
39954
  }), method(ProfileRefInputSchema, _void(), {
39334
39955
  kind: "mutation",
39335
39956
  auth: "admin"
@@ -41405,6 +42026,9 @@ var NcSystemEventKindSchema = _enum([
41405
42026
  "server-updated",
41406
42027
  "export-completed",
41407
42028
  "backup-completed",
42029
+ "alert-critical",
42030
+ "alert-error",
42031
+ "alert-critical-resolved",
41408
42032
  "camera-online",
41409
42033
  "camera-offline",
41410
42034
  "camera-disabled",
@@ -49839,6 +50463,41 @@ var ServerRollbackInfoSchema = object({
49839
50463
  atMs: number(),
49840
50464
  reason: string()
49841
50465
  });
50466
+ /**
50467
+ * The runner boot check (D877): the runners this node PLANNED (hub: one per
50468
+ * `resolveRunnerId` over its forked addons; agent: the runners its process
50469
+ * service holds, because only the hub plans) against the states the process
50470
+ * service reports. Kept in memory, recomputed by the same one-shot check after
50471
+ * every boot, served on `getServerPackageStatus`.
50472
+ *
50473
+ * `failed` is the D6 breaker's terminal state, `refused` a deterministic Init
50474
+ * refusal (an addon that said "I will not start, and here is why"), `missing` a
50475
+ * planned runner the process service has no entry for.
50476
+ */
50477
+ var RunnerRefusalSchema = object({
50478
+ runnerId: string(),
50479
+ addonIds: array(string()),
50480
+ reason: string()
50481
+ });
50482
+ var RunnerBootCheckSchema = object({
50483
+ checkedAtMs: number(),
50484
+ /** Runners planned for this node. */
50485
+ expected: number(),
50486
+ /** Planned runners whose process is `running`. */
50487
+ running: number(),
50488
+ failed: array(string()),
50489
+ refused: array(RunnerRefusalSchema),
50490
+ missing: array(string()),
50491
+ /**
50492
+ * Runners still on their way: `starting`, or `crashed` waiting on a backoff
50493
+ * respawn. The check is FINAL only when this is empty; until then nothing is
50494
+ * pushed and the verdict is re-evaluated on the next runner state change.
50495
+ * Optional for version skew (absent = settled).
50496
+ */
50497
+ pending: array(string()).optional(),
50498
+ /** True when the plan is the hub's (`missing` is then meaningful); false on an agent. */
50499
+ planKnown: boolean()
50500
+ });
49842
50501
  var ServerPackageStatusSchema = object({
49843
50502
  /** Root package name (`@camstack/server` on the hub). */
49844
50503
  packageName: string(),
@@ -49901,7 +50560,14 @@ var ServerPackageStatusSchema = object({
49901
50560
  * for version skew: an older provider's payload simply omits it, and an
49902
50561
  * absent wrapper is unknown — never `native`.
49903
50562
  */
49904
- wrapper: WrapperIdentitySchema.optional()
50563
+ wrapper: WrapperIdentitySchema.optional(),
50564
+ /**
50565
+ * What this node PLANNED to run against what its process service reports
50566
+ * (D877). Absent until the one-shot boot check has run (~60 s after boot) and
50567
+ * on a provider that predates it. Absent is "not checked yet", never "all
50568
+ * well": a consumer that needs the answer treats it as pending.
50569
+ */
50570
+ runners: RunnerBootCheckSchema.optional()
49905
50571
  });
49906
50572
  var ServerUpdateCheckResultSchema = object({
49907
50573
  packageName: string(),
@@ -49952,6 +50618,13 @@ var ServerUpdateOutcomeSchema = _enum([
49952
50618
  "refused",
49953
50619
  "failed"
49954
50620
  ]);
50621
+ /** One addon the pre-flight found the target version would refuse (D877). */
50622
+ var UpdateBlockerSchema = object({
50623
+ addonId: string(),
50624
+ reason: string(),
50625
+ /** What the operator does about it. */
50626
+ remedy: string()
50627
+ });
49955
50628
  var ServerUpdateActionResultSchema = object({
49956
50629
  accepted: boolean(),
49957
50630
  targetVersion: string().nullable(),
@@ -49969,14 +50642,27 @@ var ServerUpdateActionResultSchema = object({
49969
50642
  * The failure itself, verbatim enough to act on (the npm output for a
49970
50643
  * staging install). Non-null only for `failed`.
49971
50644
  */
49972
- error: string().nullable().optional()
50645
+ error: string().nullable().optional(),
50646
+ /**
50647
+ * The addons the target version would refuse to start on this node's live
50648
+ * store (D877), present when the pre-flight refused the update
50649
+ * (`reason: 'addon-would-refuse'`). Optional for version skew.
50650
+ */
50651
+ blockers: array(UpdateBlockerSchema).optional()
49973
50652
  });
49974
50653
  method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
49975
50654
  kind: "mutation",
49976
50655
  auth: "admin"
49977
- }), method(object({
49978
- /** Explicit target version; omitted = latest from the registry. */
49979
- version: string().optional() }), ServerUpdateActionResultSchema, {
50656
+ }), method(object({
50657
+ /** Explicit target version; omitted = latest from the registry. */
50658
+ version: string().optional(),
50659
+ /**
50660
+ * Apply even though the pre-flight (D877) found addons the target would
50661
+ * refuse to start. Off by default: those addons stay down until the
50662
+ * remedy is run, which is the incident this gate exists to prevent.
50663
+ */
50664
+ acknowledgeRefusals: boolean().optional()
50665
+ }), ServerUpdateActionResultSchema, {
49980
50666
  kind: "mutation",
49981
50667
  auth: "admin",
49982
50668
  timeoutMs: 16 * 6e4
@@ -50419,7 +51105,10 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
50419
51105
  }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
50420
51106
  kind: "mutation",
50421
51107
  auth: "admin"
50422
- }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
51108
+ }), method(object({}), array(StorageMigrationMoverSchema).readonly(), { auth: "admin" }), method(object({ locationIds: array(string()).readonly() }), object({
51109
+ clear: boolean(),
51110
+ repointLocationId: string().optional()
51111
+ }), { auth: "admin" }), method(object({}), array(StorageMigrationResidueSchema).readonly(), { auth: "admin" }), method(StorageMigrationDrainInputSchema, object({ jobId: string() }), {
50423
51112
  kind: "mutation",
50424
51113
  auth: "admin"
50425
51114
  }), method(StorageCleanupInputSchema, object({ jobId: string() }), {
@@ -52422,7 +53111,9 @@ var ManifestShapeSchema = object({
52422
53111
  var AddonProcessSchema = object({
52423
53112
  pid: number().optional(),
52424
53113
  mode: string(),
52425
- state: string()
53114
+ state: string(),
53115
+ /** Why the runner is `refused` (an addon's own words), when it is (D877). */
53116
+ reason: string().optional()
52426
53117
  });
52427
53118
  /**
52428
53119
  * Per-addon health snapshot from the kernel's AddonHealthMonitor.
@@ -53190,7 +53881,8 @@ var batteryCapability = {
53190
53881
  DeviceType.Button,
53191
53882
  DeviceType.Switch,
53192
53883
  DeviceType.PetFeeder,
53193
- DeviceType.Container
53884
+ DeviceType.Container,
53885
+ DeviceType.Thermostat
53194
53886
  ],
53195
53887
  methods: {
53196
53888
  /**
@@ -53828,6 +54520,12 @@ var ClimateControlStatusSchema = object({
53828
54520
  /** Horizontal louver swing on/off. Null when the device has no
53829
54521
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
53830
54522
  swingHorizontal: boolean().nullable(),
54523
+ /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
54524
+ minTemp: number().nullable().optional(),
54525
+ /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
54526
+ maxTemp: number().nullable().optional(),
54527
+ /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
54528
+ tempStep: number().positive().nullable().optional(),
53831
54529
  /** Ms epoch when the slice was last updated (push or command). */
53832
54530
  lastFetchedAt: number()
53833
54531
  });
@@ -54674,6 +55372,294 @@ onStatusChanged: { data: object({
54674
55372
  * whether persisting is worth a SQLite commit. */
54675
55373
  volatileStateFields: ["lastChangedAt"]
54676
55374
  };
55375
+ /**
55376
+ * Smart-dishwasher cap — program lifecycle, door / remote-start gates,
55377
+ * consumable levels (salt, rinse aid) and common program options.
55378
+ *
55379
+ * Sources: native Bosch Home Connect (`dishwasher` device type). Reusable
55380
+ * by any integration that exposes the same program / option surface.
55381
+ *
55382
+ * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55383
+ * provider refreshes the slice on an interval and eagerly after commands.
55384
+ *
55385
+ * UNKNOWN IS NOT OFF. Every field the appliance reports separately is
55386
+ * nullable: `null` means "not known right now" (the appliance has not said,
55387
+ * the link is down, or the description does not carry it) and is never
55388
+ * rendered or exported as `false` / `0`. `availability` says why.
55389
+ */
55390
+ var DishwasherStateSchema = _enum([
55391
+ "idle",
55392
+ "running",
55393
+ "paused",
55394
+ "finished",
55395
+ "error",
55396
+ "unavailable"
55397
+ ]);
55398
+ /**
55399
+ * The appliance's own operation state, uncollapsed. `state` above is the coarse
55400
+ * view for compact surfaces; this is what the appliance said.
55401
+ */
55402
+ var DishwasherOperationStateSchema = _enum([
55403
+ "Inactive",
55404
+ "Ready",
55405
+ "DelayedStart",
55406
+ "Run",
55407
+ "Pause",
55408
+ "ActionRequired",
55409
+ "Finished",
55410
+ "Error",
55411
+ "Aborting"
55412
+ ]);
55413
+ /**
55414
+ * Why fields may be `null`:
55415
+ * - `available` — the link is up and the description is loaded;
55416
+ * - `offline` — the local link is down (values are unknown, not last-known);
55417
+ * - `description-missing` — the link is up but the appliance's description could not
55418
+ * be loaded, so its values cannot be decoded.
55419
+ */
55420
+ var DishwasherAvailabilitySchema = _enum([
55421
+ "available",
55422
+ "offline",
55423
+ "description-missing"
55424
+ ]);
55425
+ var DishwasherConsumableLevelSchema = _enum([
55426
+ "ok",
55427
+ "low",
55428
+ "empty"
55429
+ ]);
55430
+ var DishwasherStatusSchema = object({
55431
+ availability: DishwasherAvailabilitySchema,
55432
+ /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
55433
+ state: DishwasherStateSchema,
55434
+ /** The appliance's operation state as reported; null when not known. */
55435
+ operationState: DishwasherOperationStateSchema.nullable(),
55436
+ /** Feature key of the ACTIVE (running) program, or null when none runs / not known. */
55437
+ program: string().nullable(),
55438
+ /** Feature key of the SELECTED program (what Start would run), or null when none / not known. */
55439
+ selectedProgram: string().nullable(),
55440
+ /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
55441
+ availablePrograms: array(string()),
55442
+ /** Seconds remaining on the active cycle, or null when not running / not known. */
55443
+ remainingSeconds: number().int().nonnegative().nullable(),
55444
+ /** Seconds the delayed start is set to (time until the cycle starts), or null. */
55445
+ delayedStartSeconds: number().int().nonnegative().nullable(),
55446
+ /** Cycle completion 0..100, or null when not applicable. */
55447
+ progressPercent: number().min(0).max(100).nullable(),
55448
+ /** True when the door is reported open; null when the door state is not known. */
55449
+ doorOpen: boolean().nullable(),
55450
+ /** True when the door is latched (locked) during a cycle; null when not reported. */
55451
+ doorLocked: boolean().nullable(),
55452
+ /** True when remote start is allowed (door closed, power on, etc.); null when not known. */
55453
+ remoteStartAllowed: boolean().nullable(),
55454
+ /** True when the appliance accepts remote control now; null when not known. */
55455
+ remoteControlActive: boolean().nullable(),
55456
+ /** True while somebody operates the appliance at its panel; null when not reported. */
55457
+ localControlActive: boolean().nullable(),
55458
+ /** Main power / switched-on state; null when not known. */
55459
+ powerOn: boolean().nullable(),
55460
+ /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55461
+ powerState: string().nullable(),
55462
+ saltLevel: DishwasherConsumableLevelSchema.nullable(),
55463
+ rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55464
+ /** Option states: null when the appliance does not expose the option or has not said. */
55465
+ halfLoad: boolean().nullable(),
55466
+ hygienePlus: boolean().nullable(),
55467
+ /** Extra dry option when the appliance exposes it. */
55468
+ extraDry: boolean().nullable(),
55469
+ /** Intensive zone (lower basket) when the appliance exposes it. */
55470
+ intensiveZone: boolean().nullable(),
55471
+ /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55472
+ varioSpeedPlus: boolean().nullable(),
55473
+ /** Child lock (controls disabled on the appliance); null when not known. */
55474
+ childLock: boolean().nullable(),
55475
+ /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
55476
+ activeEvents: array(string()),
55477
+ /** Numeric error code when the appliance reports one; null otherwise. */
55478
+ errorCode: number().nullable(),
55479
+ /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
55480
+ errorLabel: string().nullable(),
55481
+ /** Ms epoch of the last value received from the appliance; 0 = never. */
55482
+ lastFetchedAt: number()
55483
+ });
55484
+ var DeviceIdSchema = number().int().nonnegative();
55485
+ /** A value a program option or setting can take. */
55486
+ var DishwasherValueSchema = union([
55487
+ boolean(),
55488
+ string(),
55489
+ number()
55490
+ ]);
55491
+ var DishwasherAccessSchema = _enum([
55492
+ "none",
55493
+ "read",
55494
+ "readWrite",
55495
+ "writeOnly",
55496
+ "readStatic"
55497
+ ]);
55498
+ /**
55499
+ * One option or setting the appliance declares, with the constraints its description
55500
+ * gives. A `readWrite` descriptor that is `available` is what `setOption` accepts.
55501
+ */
55502
+ var DishwasherOptionDescriptorSchema = object({
55503
+ /** Feature key (`Dishcare.Dishwasher.Option.ExtraDry`). */
55504
+ key: string(),
55505
+ /** Last segment of the key, for display. */
55506
+ name: string(),
55507
+ type: _enum([
55508
+ "boolean",
55509
+ "number",
55510
+ "enum",
55511
+ "string"
55512
+ ]),
55513
+ access: DishwasherAccessSchema,
55514
+ /** The appliance reports this entity as currently available. */
55515
+ available: boolean(),
55516
+ /** Unit the description declares for a number; null when it declares none. */
55517
+ unit: string().nullable(),
55518
+ min: number().nullable(),
55519
+ max: number().nullable(),
55520
+ step: number().nullable(),
55521
+ /** Allowed members of an enum; null for other types. */
55522
+ enumValues: array(string()).nullable(),
55523
+ defaultValue: DishwasherValueSchema.nullable()
55524
+ });
55525
+ var DishwasherProgramSchema = object({
55526
+ /** Feature key (`Dishcare.Dishwasher.Program.Eco50`) — what `setProgram` / `start` take. */
55527
+ key: string(),
55528
+ name: string(),
55529
+ /** The appliance currently offers this program. */
55530
+ available: boolean(),
55531
+ /** The options this program lists, with the program-level access / availability / default. */
55532
+ options: array(DishwasherOptionDescriptorSchema)
55533
+ });
55534
+ var DishwasherOptionsSchema = object({
55535
+ availability: DishwasherAvailabilitySchema,
55536
+ /** What the appliance can be told to do, from the commands its description declares. */
55537
+ supportsStart: boolean(),
55538
+ supportsPause: boolean(),
55539
+ supportsResume: boolean(),
55540
+ supportsStop: boolean(),
55541
+ supportsPower: boolean(),
55542
+ /** Every program the description lists, with its options. */
55543
+ programs: array(DishwasherProgramSchema),
55544
+ /** Every option and setting entity the description lists (programs reference these by key). */
55545
+ options: array(DishwasherOptionDescriptorSchema)
55546
+ });
55547
+ var dishwasherCapability = {
55548
+ name: "dishwasher",
55549
+ scope: "device",
55550
+ deviceNative: true,
55551
+ mode: "singleton",
55552
+ deviceTypes: [DeviceType.Dishwasher],
55553
+ methods: {
55554
+ /**
55555
+ * Start a program. Without `program` the selected one starts. `options` are
55556
+ * option feature keys; each is checked against the program's constraints.
55557
+ */
55558
+ start: method(object({
55559
+ deviceId: DeviceIdSchema,
55560
+ program: string().min(1).optional(),
55561
+ options: record(string(), DishwasherValueSchema).optional()
55562
+ }), _void(), {
55563
+ kind: "mutation",
55564
+ auth: "protected"
55565
+ }),
55566
+ pause: method(object({ deviceId: DeviceIdSchema }), _void(), {
55567
+ kind: "mutation",
55568
+ auth: "protected"
55569
+ }),
55570
+ resume: method(object({ deviceId: DeviceIdSchema }), _void(), {
55571
+ kind: "mutation",
55572
+ auth: "protected"
55573
+ }),
55574
+ stop: method(object({ deviceId: DeviceIdSchema }), _void(), {
55575
+ kind: "mutation",
55576
+ auth: "protected"
55577
+ }),
55578
+ /** Select (not start) a program; refused when the appliance does not offer it. */
55579
+ setProgram: method(object({
55580
+ deviceId: DeviceIdSchema,
55581
+ program: string().min(1)
55582
+ }), _void(), {
55583
+ kind: "mutation",
55584
+ auth: "protected"
55585
+ }),
55586
+ setPower: method(object({
55587
+ deviceId: DeviceIdSchema,
55588
+ on: boolean()
55589
+ }), _void(), {
55590
+ kind: "mutation",
55591
+ auth: "protected"
55592
+ }),
55593
+ setHalfLoad: method(object({
55594
+ deviceId: DeviceIdSchema,
55595
+ on: boolean()
55596
+ }), _void(), {
55597
+ kind: "mutation",
55598
+ auth: "protected"
55599
+ }),
55600
+ setHygienePlus: method(object({
55601
+ deviceId: DeviceIdSchema,
55602
+ on: boolean()
55603
+ }), _void(), {
55604
+ kind: "mutation",
55605
+ auth: "protected"
55606
+ }),
55607
+ setExtraDry: method(object({
55608
+ deviceId: DeviceIdSchema,
55609
+ on: boolean()
55610
+ }), _void(), {
55611
+ kind: "mutation",
55612
+ auth: "protected"
55613
+ }),
55614
+ setIntensiveZone: method(object({
55615
+ deviceId: DeviceIdSchema,
55616
+ on: boolean()
55617
+ }), _void(), {
55618
+ kind: "mutation",
55619
+ auth: "protected"
55620
+ }),
55621
+ setVarioSpeedPlus: method(object({
55622
+ deviceId: DeviceIdSchema,
55623
+ on: boolean()
55624
+ }), _void(), {
55625
+ kind: "mutation",
55626
+ auth: "protected"
55627
+ }),
55628
+ setChildLock: method(object({
55629
+ deviceId: DeviceIdSchema,
55630
+ on: boolean()
55631
+ }), _void(), {
55632
+ kind: "mutation",
55633
+ auth: "protected"
55634
+ }),
55635
+ /**
55636
+ * Write any option or setting by feature key. Refused when the description does
55637
+ * not list it, it is not writable or not available now, or the value is outside
55638
+ * its declared range / members.
55639
+ */
55640
+ setOption: method(object({
55641
+ deviceId: DeviceIdSchema,
55642
+ key: string().min(1),
55643
+ value: DishwasherValueSchema
55644
+ }), _void(), {
55645
+ kind: "mutation",
55646
+ auth: "protected"
55647
+ }),
55648
+ /** What this appliance can do, from its own description — the UI is derived from it. */
55649
+ getOptions: method(object({ deviceId: DeviceIdSchema }), DishwasherOptionsSchema, { auth: "protected" })
55650
+ },
55651
+ status: {
55652
+ schema: DishwasherStatusSchema,
55653
+ kind: "poll"
55654
+ },
55655
+ runtimeState: DishwasherStatusSchema,
55656
+ durability: "session",
55657
+ history: { fields: { progressPercent: {
55658
+ kind: "gauge",
55659
+ unit: "%",
55660
+ deadband: 2
55661
+ } } }
55662
+ };
54677
55663
  var DoorbellStatusSchema = object({
54678
55664
  /** Ms epoch of the last press. null = never observed since this provider started. */
54679
55665
  lastPressedAt: number().nullable(),
@@ -55476,6 +56462,32 @@ var gasCapability = {
55476
56462
  * whether persisting is worth a SQLite commit. */
55477
56463
  volatileStateFields: ["lastChangedAt"]
55478
56464
  };
56465
+ var HeatingValveStatusSchema = object({
56466
+ /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
56467
+ position: number().min(0).max(100).nullable(),
56468
+ /** Ms epoch when the slice was last updated (push or poll). */
56469
+ lastFetchedAt: number()
56470
+ });
56471
+ var heatingValveCapability = {
56472
+ name: "heating-valve",
56473
+ scope: "device",
56474
+ deviceNative: true,
56475
+ mode: "singleton",
56476
+ deviceTypes: [DeviceType.Thermostat],
56477
+ methods: {},
56478
+ status: {
56479
+ schema: HeatingValveStatusSchema,
56480
+ kind: "push"
56481
+ },
56482
+ runtimeState: HeatingValveStatusSchema,
56483
+ durability: "session",
56484
+ history: { fields: { position: {
56485
+ kind: "gauge",
56486
+ unit: "%",
56487
+ deadband: 1
56488
+ } } },
56489
+ volatileStateFields: ["lastFetchedAt"]
56490
+ };
55479
56491
  /**
55480
56492
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
55481
56493
  * an on/off actuator with an optional target-humidity setpoint and an
@@ -56608,7 +57620,19 @@ var TlsStatusSchema = object({
56608
57620
  sans: array(string()),
56609
57621
  caCertPem: string().nullable(),
56610
57622
  reissueError: string().nullable(),
56611
- restartRequired: boolean()
57623
+ restartRequired: boolean(),
57624
+ /** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
57625
+ caMissing: boolean(),
57626
+ /** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
57627
+ localCaConstrained: boolean().nullable(),
57628
+ /** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
57629
+ caReplacedAt: string().nullable(),
57630
+ /** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
57631
+ storedUpload: object({
57632
+ leafFingerprintSha256: string(),
57633
+ validTo: string(),
57634
+ hasCa: boolean()
57635
+ }).nullable()
56612
57636
  });
56613
57637
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
56614
57638
  /**
@@ -56664,6 +57688,9 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
56664
57688
  }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
56665
57689
  kind: "mutation",
56666
57690
  auth: "admin"
57691
+ }), method(_void(), TlsStatusSchema, {
57692
+ kind: "mutation",
57693
+ auth: "admin"
56667
57694
  });
56668
57695
  var LockControlStatusSchema = object({
56669
57696
  /** Lifecycle state of the lock. `jammed` means the motor reported
@@ -63157,7 +64184,11 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
63157
64184
  kind: "mutation",
63158
64185
  auth: "admin",
63159
64186
  access: "delete"
63160
- }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(object({
64187
+ }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
64188
+ kind: "mutation",
64189
+ auth: "admin",
64190
+ access: "create"
64191
+ }), method(object({
63161
64192
  userId: string(),
63162
64193
  code: string()
63163
64194
  }), object({ valid: boolean() }), {
@@ -64877,6 +65908,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
64877
65908
  dayNight: dayNightCapability,
64878
65909
  deviceDiscovery: deviceDiscoveryCapability,
64879
65910
  deviceStatus: deviceStatusCapability,
65911
+ dishwasher: dishwasherCapability,
64880
65912
  doorbell: doorbellCapability,
64881
65913
  enumSensor: enumSensorCapability,
64882
65914
  eventEmitter: eventEmitterCapability,
@@ -64884,6 +65916,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
64884
65916
  featureProbe: featureProbeCapability,
64885
65917
  flood: floodCapability,
64886
65918
  gas: gasCapability,
65919
+ heatingValve: heatingValveCapability,
64887
65920
  humidifier: humidifierCapability,
64888
65921
  humiditySensor: humiditySensorCapability,
64889
65922
  image: imageCapability,
@@ -64969,13 +66002,14 @@ var BaseDevice = class {
64969
66002
  get state() {
64970
66003
  if (!this._stateProxyCache) {
64971
66004
  const cache = {};
64972
- const handler = { get: (_target, key) => {
66005
+ const handler = { get: (target, key) => {
64973
66006
  const k = key;
64974
- if (k in cache) return cache[k];
66007
+ const existing = Reflect.get(target, k);
66008
+ if (existing !== void 0) return existing;
64975
66009
  const cap = DEVICE_LOCAL_STATE_CAPS[k];
64976
66010
  if (!cap) return void 0;
64977
66011
  const proxy = this.sliceProxy(cap);
64978
- cache[k] = proxy;
66012
+ Reflect.set(target, k, proxy);
64979
66013
  return proxy;
64980
66014
  } };
64981
66015
  this._stateProxyCache = new Proxy(cache, handler);
@@ -65174,7 +66208,7 @@ var BaseDevice = class {
65174
66208
  async updateSourceInfo(patch) {
65175
66209
  const next = mergeSourceInfo(this.sourceInfo, patch);
65176
66210
  this._sourceInfoCache = Object.freeze({ ...next });
65177
- const action = this.ctx.api?.deviceManager?.setMetadata;
66211
+ const action = this.ctx.api.deviceManager?.setMetadata;
65178
66212
  if (action) try {
65179
66213
  await action.mutate({
65180
66214
  deviceId: this.id,
@@ -65209,7 +66243,7 @@ var BaseDevice = class {
65209
66243
  * device boot on a meta refresh.
65210
66244
  */
65211
66245
  async refreshFeatures() {
65212
- const action = this.ctx.api?.deviceManager?.registerDevice;
66246
+ const action = this.ctx.api.deviceManager?.registerDevice;
65213
66247
  if (!action) return;
65214
66248
  try {
65215
66249
  await action.mutate({
@@ -65608,6 +66642,12 @@ var BaseDeviceProvider = class extends BaseAddon {
65608
66642
  provider: this
65609
66643
  }];
65610
66644
  }
66645
+ /** Flatten `super.onInitialize()` whether it returned an array or an envelope. */
66646
+ providerRegistrationsFromSuper(result) {
66647
+ if (Array.isArray(result)) return result;
66648
+ if (result !== void 0 && result.providers !== void 0) return [...result.providers];
66649
+ return [];
66650
+ }
65611
66651
  async onShutdown() {
65612
66652
  this._restoreShuttingDown = true;
65613
66653
  this.cancelRestoreRetries();
@@ -66134,7 +67174,7 @@ var BaseDeviceProvider = class extends BaseAddon {
66134
67174
  return toDeviceSummary(device, this.addonId);
66135
67175
  }
66136
67176
  };
66137
- 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;
67177
+ 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;
66138
67178
  new Set(Object.values(DeviceType));
66139
67179
  Object.freeze({
66140
67180
  "accessories.getStatus": {
@@ -67283,6 +68323,12 @@ Object.freeze({
67283
68323
  addonId: null,
67284
68324
  access: "view"
67285
68325
  },
68326
+ "coreBlocks.migrateRawSecrets": {
68327
+ capName: "core-blocks",
68328
+ capScope: "system",
68329
+ addonId: null,
68330
+ access: "create"
68331
+ },
67286
68332
  "coreBlocks.restart": {
67287
68333
  capName: "core-blocks",
67288
68334
  capScope: "system",
@@ -68549,6 +69595,96 @@ Object.freeze({
68549
69595
  addonId: null,
68550
69596
  access: "view"
68551
69597
  },
69598
+ "dishwasher.getOptions": {
69599
+ capName: "dishwasher",
69600
+ capScope: "device",
69601
+ addonId: null,
69602
+ access: "view"
69603
+ },
69604
+ "dishwasher.getStatus": {
69605
+ capName: "dishwasher",
69606
+ capScope: "device",
69607
+ addonId: null,
69608
+ access: "view"
69609
+ },
69610
+ "dishwasher.pause": {
69611
+ capName: "dishwasher",
69612
+ capScope: "device",
69613
+ addonId: null,
69614
+ access: "create"
69615
+ },
69616
+ "dishwasher.resume": {
69617
+ capName: "dishwasher",
69618
+ capScope: "device",
69619
+ addonId: null,
69620
+ access: "create"
69621
+ },
69622
+ "dishwasher.setChildLock": {
69623
+ capName: "dishwasher",
69624
+ capScope: "device",
69625
+ addonId: null,
69626
+ access: "create"
69627
+ },
69628
+ "dishwasher.setExtraDry": {
69629
+ capName: "dishwasher",
69630
+ capScope: "device",
69631
+ addonId: null,
69632
+ access: "create"
69633
+ },
69634
+ "dishwasher.setHalfLoad": {
69635
+ capName: "dishwasher",
69636
+ capScope: "device",
69637
+ addonId: null,
69638
+ access: "create"
69639
+ },
69640
+ "dishwasher.setHygienePlus": {
69641
+ capName: "dishwasher",
69642
+ capScope: "device",
69643
+ addonId: null,
69644
+ access: "create"
69645
+ },
69646
+ "dishwasher.setIntensiveZone": {
69647
+ capName: "dishwasher",
69648
+ capScope: "device",
69649
+ addonId: null,
69650
+ access: "create"
69651
+ },
69652
+ "dishwasher.setOption": {
69653
+ capName: "dishwasher",
69654
+ capScope: "device",
69655
+ addonId: null,
69656
+ access: "create"
69657
+ },
69658
+ "dishwasher.setPower": {
69659
+ capName: "dishwasher",
69660
+ capScope: "device",
69661
+ addonId: null,
69662
+ access: "create"
69663
+ },
69664
+ "dishwasher.setProgram": {
69665
+ capName: "dishwasher",
69666
+ capScope: "device",
69667
+ addonId: null,
69668
+ access: "create"
69669
+ },
69670
+ "dishwasher.setVarioSpeedPlus": {
69671
+ capName: "dishwasher",
69672
+ capScope: "device",
69673
+ addonId: null,
69674
+ access: "create"
69675
+ },
69676
+ "dishwasher.start": {
69677
+ capName: "dishwasher",
69678
+ capScope: "device",
69679
+ addonId: null,
69680
+ access: "create"
69681
+ },
69682
+ "dishwasher.stop": {
69683
+ capName: "dishwasher",
69684
+ capScope: "device",
69685
+ addonId: null,
69686
+ access: "create"
69687
+ },
68552
69688
  "doorbell.getStatus": {
68553
69689
  capName: "doorbell",
68554
69690
  capScope: "device",
@@ -68759,6 +69895,12 @@ Object.freeze({
68759
69895
  addonId: null,
68760
69896
  access: "view"
68761
69897
  },
69898
+ "heatingValve.getStatus": {
69899
+ capName: "heating-valve",
69900
+ capScope: "device",
69901
+ addonId: null,
69902
+ access: "view"
69903
+ },
68762
69904
  "humidifier.getStatus": {
68763
69905
  capName: "humidifier",
68764
69906
  capScope: "device",
@@ -68969,6 +70111,12 @@ Object.freeze({
68969
70111
  addonId: null,
68970
70112
  access: "create"
68971
70113
  },
70114
+ "keychainAdmin.importSecret": {
70115
+ capName: "keychain-admin",
70116
+ capScope: "system",
70117
+ addonId: null,
70118
+ access: "create"
70119
+ },
68972
70120
  "keychainAdmin.listAudit": {
68973
70121
  capName: "keychain-admin",
68974
70122
  capScope: "system",
@@ -69137,6 +70285,12 @@ Object.freeze({
69137
70285
  addonId: null,
69138
70286
  access: "view"
69139
70287
  },
70288
+ "llm.migrateRawSecrets": {
70289
+ capName: "llm",
70290
+ capScope: "system",
70291
+ addonId: null,
70292
+ access: "create"
70293
+ },
69140
70294
  "llm.resolveModelRef": {
69141
70295
  capName: "llm",
69142
70296
  capScope: "system",
@@ -69365,6 +70519,12 @@ Object.freeze({
69365
70519
  addonId: null,
69366
70520
  access: "create"
69367
70521
  },
70522
+ "localNetwork.useStoredUploadedCertificate": {
70523
+ capName: "local-network",
70524
+ capScope: "system",
70525
+ addonId: null,
70526
+ access: "create"
70527
+ },
69368
70528
  "lockControl.getStatus": {
69369
70529
  capName: "lock-control",
69370
70530
  capScope: "device",
@@ -72017,6 +73177,30 @@ Object.freeze({
72017
73177
  addonId: null,
72018
73178
  access: "create"
72019
73179
  },
73180
+ "recordEntries.deleteEntry": {
73181
+ capName: "record-entries",
73182
+ capScope: "system",
73183
+ addonId: null,
73184
+ access: "delete"
73185
+ },
73186
+ "recordEntries.listEntries": {
73187
+ capName: "record-entries",
73188
+ capScope: "system",
73189
+ addonId: null,
73190
+ access: "view"
73191
+ },
73192
+ "recordEntries.listEntryKinds": {
73193
+ capName: "record-entries",
73194
+ capScope: "system",
73195
+ addonId: null,
73196
+ access: "view"
73197
+ },
73198
+ "recordEntries.putEntry": {
73199
+ capName: "record-entries",
73200
+ capScope: "system",
73201
+ addonId: null,
73202
+ access: "create"
73203
+ },
72020
73204
  "recording.getAvailability": {
72021
73205
  capName: "recording",
72022
73206
  capScope: "device",
@@ -72317,6 +73501,102 @@ Object.freeze({
72317
73501
  addonId: null,
72318
73502
  access: "view"
72319
73503
  },
73504
+ "records.aggregate": {
73505
+ capName: "records",
73506
+ capScope: "system",
73507
+ addonId: null,
73508
+ access: "view"
73509
+ },
73510
+ "records.allocateId": {
73511
+ capName: "records",
73512
+ capScope: "system",
73513
+ addonId: null,
73514
+ access: "create"
73515
+ },
73516
+ "records.count": {
73517
+ capName: "records",
73518
+ capScope: "system",
73519
+ addonId: null,
73520
+ access: "view"
73521
+ },
73522
+ "records.declareKinds": {
73523
+ capName: "records",
73524
+ capScope: "system",
73525
+ addonId: null,
73526
+ access: "create"
73527
+ },
73528
+ "records.delete": {
73529
+ capName: "records",
73530
+ capScope: "system",
73531
+ addonId: null,
73532
+ access: "delete"
73533
+ },
73534
+ "records.deleteDevice": {
73535
+ capName: "records",
73536
+ capScope: "system",
73537
+ addonId: null,
73538
+ access: "delete"
73539
+ },
73540
+ "records.deleteMany": {
73541
+ capName: "records",
73542
+ capScope: "system",
73543
+ addonId: null,
73544
+ access: "delete"
73545
+ },
73546
+ "records.deleteWhere": {
73547
+ capName: "records",
73548
+ capScope: "system",
73549
+ addonId: null,
73550
+ access: "delete"
73551
+ },
73552
+ "records.get": {
73553
+ capName: "records",
73554
+ capScope: "system",
73555
+ addonId: null,
73556
+ access: "view"
73557
+ },
73558
+ "records.getMany": {
73559
+ capName: "records",
73560
+ capScope: "system",
73561
+ addonId: null,
73562
+ access: "view"
73563
+ },
73564
+ "records.histogram": {
73565
+ capName: "records",
73566
+ capScope: "system",
73567
+ addonId: null,
73568
+ access: "view"
73569
+ },
73570
+ "records.patch": {
73571
+ capName: "records",
73572
+ capScope: "system",
73573
+ addonId: null,
73574
+ access: "create"
73575
+ },
73576
+ "records.put": {
73577
+ capName: "records",
73578
+ capScope: "system",
73579
+ addonId: null,
73580
+ access: "create"
73581
+ },
73582
+ "records.putMany": {
73583
+ capName: "records",
73584
+ capScope: "system",
73585
+ addonId: null,
73586
+ access: "create"
73587
+ },
73588
+ "records.query": {
73589
+ capName: "records",
73590
+ capScope: "system",
73591
+ addonId: null,
73592
+ access: "view"
73593
+ },
73594
+ "records.secretRefs": {
73595
+ capName: "records",
73596
+ capScope: "system",
73597
+ addonId: null,
73598
+ access: "view"
73599
+ },
72320
73600
  "sceneMonitor.captureReference": {
72321
73601
  capName: "scene-monitor",
72322
73602
  capScope: "device",
@@ -72749,6 +74029,48 @@ Object.freeze({
72749
74029
  addonId: null,
72750
74030
  access: "create"
72751
74031
  },
74032
+ "storageAdmin.adoptRecords": {
74033
+ capName: "storage-admin",
74034
+ capScope: "system",
74035
+ addonId: null,
74036
+ access: "create"
74037
+ },
74038
+ "storageAdmin.dropCollection": {
74039
+ capName: "storage-admin",
74040
+ capScope: "system",
74041
+ addonId: null,
74042
+ access: "delete"
74043
+ },
74044
+ "storageAdmin.isAdoptedLegacyTable": {
74045
+ capName: "storage-admin",
74046
+ capScope: "system",
74047
+ addonId: null,
74048
+ access: "view"
74049
+ },
74050
+ "storageAdmin.listKinds": {
74051
+ capName: "storage-admin",
74052
+ capScope: "system",
74053
+ addonId: null,
74054
+ access: "view"
74055
+ },
74056
+ "storageAdmin.listTables": {
74057
+ capName: "storage-admin",
74058
+ capScope: "system",
74059
+ addonId: null,
74060
+ access: "view"
74061
+ },
74062
+ "storageAdmin.readLegacyCollection": {
74063
+ capName: "storage-admin",
74064
+ capScope: "system",
74065
+ addonId: null,
74066
+ access: "view"
74067
+ },
74068
+ "storageAdmin.readRecords": {
74069
+ capName: "storage-admin",
74070
+ capScope: "system",
74071
+ addonId: null,
74072
+ access: "view"
74073
+ },
72752
74074
  "storageEvictable.evict": {
72753
74075
  capName: "storage-evictable",
72754
74076
  capScope: "system",
@@ -72797,6 +74119,12 @@ Object.freeze({
72797
74119
  addonId: null,
72798
74120
  access: "view"
72799
74121
  },
74122
+ "storageMigration.moverClearance": {
74123
+ capName: "storage-migration",
74124
+ capScope: "system",
74125
+ addonId: null,
74126
+ access: "view"
74127
+ },
72800
74128
  "storageMigration.movers": {
72801
74129
  capName: "storage-migration",
72802
74130
  capScope: "system",
@@ -73661,6 +74989,12 @@ Object.freeze({
73661
74989
  addonId: null,
73662
74990
  access: "view"
73663
74991
  },
74992
+ "userManagement.migrateRawSecrets": {
74993
+ capName: "user-management",
74994
+ capScope: "system",
74995
+ addonId: null,
74996
+ access: "create"
74997
+ },
73664
74998
  "userManagement.oauthExchangeCode": {
73665
74999
  capName: "user-management",
73666
75000
  capScope: "system",
@@ -74160,7 +75494,7 @@ Object.freeze({
74160
75494
  access: "create"
74161
75495
  }
74162
75496
  });
74163
- 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;
75497
+ 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;
74164
75498
  DeviceFeature.BatteryOperated;
74165
75499
  Object.freeze({
74166
75500
  "accessories.getStatus": [{
@@ -74984,6 +76318,81 @@ Object.freeze({
74984
76318
  form: "single",
74985
76319
  optional: false
74986
76320
  }],
76321
+ "dishwasher.getOptions": [{
76322
+ name: "deviceId",
76323
+ form: "single",
76324
+ optional: false
76325
+ }],
76326
+ "dishwasher.getStatus": [{
76327
+ name: "deviceId",
76328
+ form: "single",
76329
+ optional: false
76330
+ }],
76331
+ "dishwasher.pause": [{
76332
+ name: "deviceId",
76333
+ form: "single",
76334
+ optional: false
76335
+ }],
76336
+ "dishwasher.resume": [{
76337
+ name: "deviceId",
76338
+ form: "single",
76339
+ optional: false
76340
+ }],
76341
+ "dishwasher.setChildLock": [{
76342
+ name: "deviceId",
76343
+ form: "single",
76344
+ optional: false
76345
+ }],
76346
+ "dishwasher.setExtraDry": [{
76347
+ name: "deviceId",
76348
+ form: "single",
76349
+ optional: false
76350
+ }],
76351
+ "dishwasher.setHalfLoad": [{
76352
+ name: "deviceId",
76353
+ form: "single",
76354
+ optional: false
76355
+ }],
76356
+ "dishwasher.setHygienePlus": [{
76357
+ name: "deviceId",
76358
+ form: "single",
76359
+ optional: false
76360
+ }],
76361
+ "dishwasher.setIntensiveZone": [{
76362
+ name: "deviceId",
76363
+ form: "single",
76364
+ optional: false
76365
+ }],
76366
+ "dishwasher.setOption": [{
76367
+ name: "deviceId",
76368
+ form: "single",
76369
+ optional: false
76370
+ }],
76371
+ "dishwasher.setPower": [{
76372
+ name: "deviceId",
76373
+ form: "single",
76374
+ optional: false
76375
+ }],
76376
+ "dishwasher.setProgram": [{
76377
+ name: "deviceId",
76378
+ form: "single",
76379
+ optional: false
76380
+ }],
76381
+ "dishwasher.setVarioSpeedPlus": [{
76382
+ name: "deviceId",
76383
+ form: "single",
76384
+ optional: false
76385
+ }],
76386
+ "dishwasher.start": [{
76387
+ name: "deviceId",
76388
+ form: "single",
76389
+ optional: false
76390
+ }],
76391
+ "dishwasher.stop": [{
76392
+ name: "deviceId",
76393
+ form: "single",
76394
+ optional: false
76395
+ }],
74987
76396
  "doorbell.getStatus": [{
74988
76397
  name: "deviceId",
74989
76398
  form: "single",
@@ -75053,6 +76462,11 @@ Object.freeze({
75053
76462
  form: "single",
75054
76463
  optional: false
75055
76464
  }],
76465
+ "heatingValve.getStatus": [{
76466
+ name: "deviceId",
76467
+ form: "single",
76468
+ optional: false
76469
+ }],
75056
76470
  "humidifier.getStatus": [{
75057
76471
  name: "deviceId",
75058
76472
  form: "single",
@@ -76337,6 +77751,37 @@ Object.freeze({
76337
77751
  form: "single",
76338
77752
  optional: false
76339
77753
  }],
77754
+ "records.count": [{
77755
+ name: "deviceId",
77756
+ form: "single",
77757
+ optional: true
77758
+ }],
77759
+ "records.deleteDevice": [{
77760
+ name: "deviceId",
77761
+ form: "single",
77762
+ optional: false
77763
+ }],
77764
+ "records.deleteWhere": [{
77765
+ name: "deviceId",
77766
+ form: "single",
77767
+ optional: true
77768
+ }],
77769
+ "records.histogram": [{
77770
+ name: "deviceId",
77771
+ form: "single",
77772
+ optional: true
77773
+ }],
77774
+ "records.putMany": [{
77775
+ name: "records",
77776
+ form: "object-array",
77777
+ optional: false,
77778
+ itemField: "deviceId"
77779
+ }],
77780
+ "records.query": [{
77781
+ name: "deviceId",
77782
+ form: "single",
77783
+ optional: true
77784
+ }],
76340
77785
  "sceneMonitor.captureReference": [{
76341
77786
  name: "deviceId",
76342
77787
  form: "single",
@@ -76453,6 +77898,17 @@ Object.freeze({
76453
77898
  form: "single",
76454
77899
  optional: false
76455
77900
  }],
77901
+ "storageAdmin.adoptRecords": [{
77902
+ name: "records",
77903
+ form: "object-array",
77904
+ optional: false,
77905
+ itemField: "deviceId"
77906
+ }],
77907
+ "storageAdmin.readRecords": [{
77908
+ name: "deviceId",
77909
+ form: "single",
77910
+ optional: true
77911
+ }],
76456
77912
  "streamBroker.acquireEgressTranscode": [{
76457
77913
  name: "deviceId",
76458
77914
  form: "single",
@@ -76968,6 +78424,9 @@ new Map(Object.entries({
76968
78424
  "wrapper-update-available": "system",
76969
78425
  "backup-completed": "system",
76970
78426
  "export-completed": "system",
78427
+ "alert-critical": "system",
78428
+ "alert-error": "system",
78429
+ "alert-critical-resolved": "system",
76971
78430
  "storage-location-low": "system",
76972
78431
  "storage-location-critical": "system",
76973
78432
  "storage-location-ok": "system",
@@ -77092,6 +78551,16 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
77092
78551
  "storage-location-ok"
77093
78552
  ]
77094
78553
  },
78554
+ {
78555
+ id: "alerts",
78556
+ family: "system",
78557
+ label: "Alerts",
78558
+ kinds: [
78559
+ "alert-critical",
78560
+ "alert-error",
78561
+ "alert-critical-resolved"
78562
+ ]
78563
+ },
77095
78564
  {
77096
78565
  id: "alarm",
77097
78566
  family: "alarm",
@@ -77136,6 +78605,21 @@ var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.ent
77136
78605
  return [[descriptor.kind, field]];
77137
78606
  })));
77138
78607
  Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
78608
+ object({
78609
+ phase: _enum(["raised", "resolved"]),
78610
+ episodeId: string().min(1),
78611
+ alertId: string().min(1),
78612
+ severity: AlertSeveritySchema,
78613
+ category: string(),
78614
+ title: string(),
78615
+ message: string(),
78616
+ sourceType: string().optional(),
78617
+ sourceId: string().optional(),
78618
+ nodeId: string().optional(),
78619
+ /** The alert's own action link (where the operator acts on it), when it has one. */
78620
+ actionUrl: string().optional(),
78621
+ at: number()
78622
+ });
77139
78623
  var RULE_BODY_ONLY = ["body"];
77140
78624
  var RULE_TEXT = ["title", "body"];
77141
78625
  var BATTERY = ["device-battery-low", "device-battery-normal"];
@@ -77145,6 +78629,11 @@ var TANK = [
77145
78629
  "device-tank-full",
77146
78630
  "device-tank-normal"
77147
78631
  ];
78632
+ var ALERT_EPISODE = [
78633
+ "alert-critical",
78634
+ "alert-error",
78635
+ "alert-critical-resolved"
78636
+ ];
77148
78637
  var UPDATES = [
77149
78638
  "addon-update-available",
77150
78639
  "server-update-available",
@@ -77337,14 +78826,14 @@ var STATE_SUMMARY_VARS = [
77337
78826
  ([...RULE_TEXT], [...CONSUMABLE]),
77338
78827
  ([...RULE_TEXT], [...TANK]),
77339
78828
  [...RULE_TEXT],
77340
- ([...RULE_TEXT], [...UPDATES]),
77341
- ([...RULE_TEXT], [...UPDATES]),
77342
- [...RULE_TEXT],
78829
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
78830
+ ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
77343
78831
  [...RULE_TEXT],
77344
78832
  [...RULE_TEXT],
77345
78833
  [...RULE_TEXT],
77346
78834
  [...RULE_TEXT],
77347
78835
  [...RULE_TEXT],
78836
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
77348
78837
  [...RULE_TEXT],
77349
78838
  [...RULE_TEXT],
77350
78839
  [...RULE_TEXT],
@@ -77362,7 +78851,11 @@ var STATE_SUMMARY_VARS = [
77362
78851
  [...RULE_TEXT],
77363
78852
  [...RULE_TEXT],
77364
78853
  [...RULE_TEXT],
77365
- [...RULE_TEXT],
78854
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78855
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78856
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78857
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
78858
+ ([...RULE_TEXT], [...ALERT_EPISODE]),
77366
78859
  [...RULE_TEXT],
77367
78860
  [...RULE_TEXT],
77368
78861
  [...RULE_TEXT],