@camstack/addon-provider-dreame 0.2.133 → 0.2.135

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 +1398 -125
  2. package/dist/addon.mjs +1398 -125
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -41,7 +41,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
41
41
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
42
42
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
43
43
  //#endregion
44
- //#region ../types/dist/event-category-C4hVnRo8.mjs
44
+ //#region ../types/dist/event-category-BvOFi6PY.mjs
45
45
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
46
46
  EventCategory["SystemBoot"] = "system.boot";
47
47
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -105,6 +105,24 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
105
105
  * consumes this category and maps it to the `addon-crash-loop` kind.
106
106
  */
107
107
  EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
108
+ /**
109
+ * A runner whose addon refused to start with a typed reason (D877) - parked
110
+ * in `refused`, never counted by the crash breaker, retried on operator
111
+ * action. One event per refusal.
112
+ */
113
+ EventCategory["AddonRunnerRefused"] = "addon.runner-refused";
114
+ /**
115
+ * A runner settled on a state (D877): `running` (READY), `crashed`, `failed` or
116
+ * `refused`. In-process telemetry for the boot check (re-evaluate while any
117
+ * runner is still pending) and the alert centre (close a recovered runner).
118
+ */
119
+ EventCategory["ProcessStateChanged"] = "process.state-changed";
120
+ /**
121
+ * The node's one-shot runner boot check (D877): planned runners against the
122
+ * process service, `degraded` when any is failed, refused or missing. The
123
+ * alert centre turns it into one alert and a direct critical push.
124
+ */
125
+ EventCategory["SystemRunnerCheck"] = "system.runner-check";
108
126
  EventCategory["AddonError"] = "addon.error";
109
127
  EventCategory["AddonPageReady"] = "addon.page-ready";
110
128
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5429,7 +5447,7 @@ var ZodIssueCode$1 = {
5429
5447
  var ZodFirstPartyTypeKind$1;
5430
5448
  ZodFirstPartyTypeKind$1 || (ZodFirstPartyTypeKind$1 = {});
5431
5449
  //#endregion
5432
- //#region ../types/dist/sleep-DRqxtc0C.mjs
5450
+ //#region ../types/dist/sleep-BegKjwUu.mjs
5433
5451
  /**
5434
5452
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5435
5453
  * window to float samples (D455).
@@ -5546,7 +5564,7 @@ function isKeychainStoredField(field) {
5546
5564
  var SECRET_CLEAR = { $secretClear: true };
5547
5565
  /** The `'***'` token D634 redaction writes for non-admins. */
5548
5566
  var LEGACY_DEVICE_REDACTION = "***";
5549
- function isRecord$2(value) {
5567
+ function isRecord$5(value) {
5550
5568
  return typeof value === "object" && value !== null && !Array.isArray(value);
5551
5569
  }
5552
5570
  function makeSecretMarker(ref) {
@@ -5557,12 +5575,12 @@ function makeSecretMarker(ref) {
5557
5575
  }
5558
5576
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5559
5577
  function isSecretMarker(value) {
5560
- if (!isRecord$2(value)) return false;
5578
+ if (!isRecord$5(value)) return false;
5561
5579
  const ref = value["$secret"];
5562
5580
  return typeof ref === "string" && ref.length > 0;
5563
5581
  }
5564
5582
  function isSecretClear(value) {
5565
- return isRecord$2(value) && value["$secretClear"] === true;
5583
+ return isRecord$5(value) && value["$secretClear"] === true;
5566
5584
  }
5567
5585
  /**
5568
5586
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6172,7 +6190,7 @@ var KeychainWriteRefusedError = class extends Error {
6172
6190
  }
6173
6191
  };
6174
6192
  var KEEP = { kind: "keep" };
6175
- function isRecord$1(value) {
6193
+ function isRecord$4(value) {
6176
6194
  return typeof value === "object" && value !== null && !Array.isArray(value);
6177
6195
  }
6178
6196
  function defaultMintId() {
@@ -6185,7 +6203,7 @@ function collectSecretMarkerRefs(value, out = []) {
6185
6203
  return out;
6186
6204
  }
6187
6205
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6188
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6206
+ else if (isRecord$4(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6189
6207
  return out;
6190
6208
  }
6191
6209
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6240,7 +6258,7 @@ function rowId(row, idKey) {
6240
6258
  return null;
6241
6259
  }
6242
6260
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6243
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6261
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$4) : [];
6244
6262
  if (!Array.isArray(incoming)) {
6245
6263
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6246
6264
  return {
@@ -6256,7 +6274,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6256
6274
  const kept = /* @__PURE__ */ new Set();
6257
6275
  const rows = [];
6258
6276
  for (const row of incoming) {
6259
- if (!isRecord$1(row)) {
6277
+ if (!isRecord$4(row)) {
6260
6278
  rows.push(row);
6261
6279
  continue;
6262
6280
  }
@@ -6281,7 +6299,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6281
6299
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6282
6300
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6283
6301
  case "object": {
6284
- if (!isRecord$1(incoming)) {
6302
+ if (!isRecord$4(incoming)) {
6285
6303
  if (incoming === void 0) return KEEP;
6286
6304
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6287
6305
  return {
@@ -6289,7 +6307,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6289
6307
  value: incoming
6290
6308
  };
6291
6309
  }
6292
- const storedObj = isRecord$1(stored) ? stored : {};
6310
+ const storedObj = isRecord$4(stored) ? stored : {};
6293
6311
  return {
6294
6312
  kind: "value",
6295
6313
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6412,7 +6430,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6412
6430
  value: items
6413
6431
  };
6414
6432
  }
6415
- if (isRecord$1(v)) {
6433
+ if (isRecord$4(v)) {
6416
6434
  const out = {};
6417
6435
  for (const [k, child] of Object.entries(v)) {
6418
6436
  const s = substitute(child);
@@ -6680,7 +6698,6 @@ function createHandle(raw, opts) {
6680
6698
  const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
6681
6699
  const readAddonStoreResult = raw.readAddonStoreResult;
6682
6700
  const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
6683
- const readDeviceStoreBatch = raw.readDeviceStoreBatch;
6684
6701
  const overrides = {
6685
6702
  readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
6686
6703
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
@@ -6704,12 +6721,12 @@ function createHandle(raw, opts) {
6704
6721
  };
6705
6722
  } } : {},
6706
6723
  readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
6707
- ...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
6708
- const rows = await readDeviceStoreBatch.call(raw, deviceIds);
6724
+ readDeviceStoreBatch: async (deviceIds) => {
6725
+ const rows = await raw.readDeviceStoreBatch(deviceIds);
6709
6726
  const out = /* @__PURE__ */ new Map();
6710
6727
  for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
6711
6728
  return out;
6712
- } } : {},
6729
+ },
6713
6730
  writeAddonStore: async (patch) => {
6714
6731
  await writeAddon(patch);
6715
6732
  },
@@ -7336,7 +7353,7 @@ var BaseAddon = class {
7336
7353
  if (!ctx) return;
7337
7354
  const addonId = ctx.id;
7338
7355
  setImmediate(() => {
7339
- ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
7356
+ ctx.api.addons.restartAddon.mutate({ addonId }).then(() => {
7340
7357
  ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
7341
7358
  }).catch((err) => {
7342
7359
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
@@ -7536,7 +7553,7 @@ var BaseAddon = class {
7536
7553
  return this._addonSecretTree;
7537
7554
  }
7538
7555
  deviceSecretTree() {
7539
- this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7556
+ this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
7540
7557
  return this._deviceSecretTree;
7541
7558
  }
7542
7559
  /**
@@ -7612,42 +7629,135 @@ var BaseAddon = class {
7612
7629
  this[timerOf] = timer;
7613
7630
  }
7614
7631
  /**
7615
- * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
7616
- * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
7617
- * swap, or any race where the SqliteSettingsBackend is between shutdown and
7618
- * re-initialize) doesn't propagate up into `initialize()` and leave the
7632
+ * Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
7633
+ * settings-store outage doesn't propagate up into `initialize()` and leave the
7619
7634
  * addon permanently broken.
7620
7635
  *
7621
- * Retry only the two known infra fingerprints. Anything else propagates so
7622
- * real bugs surface immediately. After the budget expires we fall back to
7623
- * `{}` (defaults) — the addon's first successful patch will rehydrate.
7636
+ * Two kinds of outage, two budgets:
7637
+ * - the store's own restart fingerprints (`SqliteSettingsBackend not
7638
+ * initialized`, `provider not available`): a short budget, then the addon
7639
+ * falls back to `{}` (defaults) - its first successful patch rehydrates;
7640
+ * - a TRANSPORT failure (the hub is restarting while this runner boots:
7641
+ * `discovery deadline exceeded`, `parent could not route`, a refused or
7642
+ * timed-out connection). Since D870 a runner's settings read THROWS instead
7643
+ * of answering `{}`, so without a budget a hub restart ends in a respawn
7644
+ * loop. A long, bounded budget; only after it the error propagates - the
7645
+ * addon never runs on defaults for a store it could not ask.
7646
+ * Anything else propagates immediately so real bugs surface.
7624
7647
  */
7625
7648
  async readAddonStoreWithRetry() {
7626
7649
  const settings = this.rawSettings();
7627
7650
  if (!settings) return {};
7628
- const delaysMs = [
7629
- 150,
7630
- 350,
7631
- 600,
7632
- 900
7633
- ];
7634
7651
  let lastErr;
7635
- for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
7652
+ for (let attempt = 0;; attempt++) try {
7636
7653
  const stored = await settings.readAddonStore() ?? {};
7637
7654
  this.settingsStoreReady = true;
7638
7655
  return stored;
7639
7656
  } catch (err) {
7640
7657
  lastErr = err;
7641
- const msg = err instanceof Error ? err.message : String(err);
7642
- if (!(msg.includes("SqliteSettingsBackend not initialized") || msg.includes("provider not available"))) throw err;
7643
- if (attempt === delaysMs.length) break;
7644
- await new Promise((r) => setTimeout(r, delaysMs[attempt]));
7658
+ const kind = classifyStoreError(err);
7659
+ if (kind === "permanent") throw err;
7660
+ const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
7661
+ if (delay === void 0) {
7662
+ if (kind === "transport") throw err;
7663
+ break;
7664
+ }
7665
+ await new Promise((r) => setTimeout(r, delay));
7645
7666
  }
7646
7667
  this.settingsStoreReady = false;
7647
7668
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
7648
7669
  return {};
7649
7670
  }
7650
7671
  };
7672
+ /** The settings store's own restart fingerprints. */
7673
+ var RESTART_RETRY_DELAYS_MS = [
7674
+ 150,
7675
+ 350,
7676
+ 600,
7677
+ 900
7678
+ ];
7679
+ /** A hub restarting under a booting runner: ~100 s in total. */
7680
+ var TRANSPORT_RETRY_DELAYS_MS = [
7681
+ 150,
7682
+ 350,
7683
+ 600,
7684
+ 900,
7685
+ 2e3,
7686
+ 5e3,
7687
+ 1e4,
7688
+ 2e4,
7689
+ 3e4,
7690
+ 3e4
7691
+ ];
7692
+ var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
7693
+ /** Node / socket error codes of a connection that did not happen or broke. */
7694
+ var TRANSPORT_CODES = new Set([
7695
+ "ECONNREFUSED",
7696
+ "ECONNRESET",
7697
+ "ETIMEDOUT",
7698
+ "EPIPE",
7699
+ "EHOSTUNREACH",
7700
+ "ENETUNREACH"
7701
+ ]);
7702
+ /** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
7703
+ var UNAVAILABLE_TRPC_CODES = new Set([
7704
+ "TIMEOUT",
7705
+ "SERVICE_UNAVAILABLE",
7706
+ "BAD_GATEWAY",
7707
+ "GATEWAY_TIMEOUT"
7708
+ ]);
7709
+ /** The exact phrases OUR transport raises when it cannot reach the hub. */
7710
+ var TRANSPORT_PHRASES = [
7711
+ "discovery deadline exceeded",
7712
+ "parent could not route child unowned cap call",
7713
+ "UDS request timed out after",
7714
+ "channel closed"
7715
+ ];
7716
+ /** Moleculer error `type`s of a call that could not be served right now. */
7717
+ var MOLECULER_TRANSIENT_TYPES = new Set([
7718
+ "REQUEST_TIMEOUT",
7719
+ "SERVICE_NOT_FOUND",
7720
+ "SERVICE_NOT_AVAILABLE",
7721
+ "REQUEST_REJECTED",
7722
+ "BROKER_DISCONNECTED"
7723
+ ]);
7724
+ function stringProp(value, key) {
7725
+ if (typeof value !== "object" || value === null) return void 0;
7726
+ const found = Reflect.get(value, key);
7727
+ return typeof found === "string" ? found : void 0;
7728
+ }
7729
+ /** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
7730
+ function errorCode(err) {
7731
+ const out = {};
7732
+ const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
7733
+ const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
7734
+ const node = stringProp(err, "code") ?? stringProp(cause, "code");
7735
+ if (node !== void 0) out.node = node;
7736
+ const trpc = stringProp(data, "code");
7737
+ if (trpc !== void 0) out.trpc = trpc;
7738
+ return out;
7739
+ }
7740
+ /**
7741
+ * Is a settings read failure worth retrying, and with which budget? Only
7742
+ * EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
7743
+ * one of the exact phrases our own transport raises. A message that merely
7744
+ * contains "timed out" or "unreachable" is not evidence of anything, and
7745
+ * `settings store not wired` is a wiring bug that retrying cannot fix.
7746
+ */
7747
+ function classifyStoreError(err) {
7748
+ const message = err instanceof Error ? err.message : String(err);
7749
+ if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
7750
+ const code = errorCode(err);
7751
+ if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
7752
+ if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
7753
+ if (typeof err === "object" && err !== null) {
7754
+ if (Reflect.get(err, "retryable") === true) return "transport";
7755
+ const type = stringProp(err, "type");
7756
+ if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
7757
+ }
7758
+ if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
7759
+ return "permanent";
7760
+ }
7651
7761
  /**
7652
7762
  * Collect the keys of every field marked `perNode: true`, recursing into
7653
7763
  * layout containers (`group` fields and `sub-tabs` tabs) the same way
@@ -7737,6 +7847,156 @@ var PeerBytesTicketSchema = object({
7737
7847
  */
7738
7848
  declaredBytes: number().int().nonnegative().nullable()
7739
7849
  });
7850
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
7851
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
7852
+ var RECORD_DATABASES = ["settings", "events"];
7853
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
7854
+ var RECORD_CLASSES = [
7855
+ "config",
7856
+ "ledger",
7857
+ "audit",
7858
+ "mirror",
7859
+ "ephemeral"
7860
+ ];
7861
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
7862
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
7863
+ var RECORD_BATCH_MAX = 1e3;
7864
+ var RECORD_QUERY_MAX = 1e3;
7865
+ function defOf(schema) {
7866
+ const zodBag = Reflect.get(schema, "_zod");
7867
+ if (typeof zodBag !== "object" || zodBag === null) return {};
7868
+ const def = Reflect.get(zodBag, "def");
7869
+ if (typeof def !== "object" || def === null) return {};
7870
+ return def;
7871
+ }
7872
+ function declaredHere(schema) {
7873
+ return globalRegistry.get(schema)?.secret === true;
7874
+ }
7875
+ /** Wrapper kinds whose `innerType` is the field itself. */
7876
+ var WRAPPERS = new Set([
7877
+ "optional",
7878
+ "nullable",
7879
+ "default",
7880
+ "prefault",
7881
+ "catch",
7882
+ "readonly",
7883
+ "nonoptional"
7884
+ ]);
7885
+ /**
7886
+ * The schema layers that make up ONE field: the schema itself and every
7887
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
7888
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
7889
+ * `.transform` on `in`).
7890
+ */
7891
+ function layersOf(schema) {
7892
+ const out = [];
7893
+ const queue = [schema];
7894
+ while (queue.length > 0) {
7895
+ const s = queue.shift();
7896
+ if (!s || out.includes(s)) continue;
7897
+ out.push(s);
7898
+ const def = defOf(s);
7899
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
7900
+ if (def.type === "pipe") {
7901
+ if (def.in) queue.push(def.in);
7902
+ if (def.out) queue.push(def.out);
7903
+ }
7904
+ }
7905
+ return out;
7906
+ }
7907
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
7908
+ function isZodSecret(schema) {
7909
+ return layersOf(schema).some(declaredHere);
7910
+ }
7911
+ /**
7912
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
7913
+ * element of this array" (`connection.password`, `rows[].token`). A declared
7914
+ * object or array is reported as one path and not descended into — everything
7915
+ * under it is secret.
7916
+ */
7917
+ function collectZodSecretPaths(schema, prefix = "") {
7918
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
7919
+ const paths = [];
7920
+ for (const layer of layersOf(schema)) {
7921
+ const def = defOf(layer);
7922
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
7923
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
7924
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
7925
+ else if (def.type === "intersection") {
7926
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
7927
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
7928
+ }
7929
+ }
7930
+ return [...new Set(paths)];
7931
+ }
7932
+ /**
7933
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
7934
+ * Zod row schema that describes it, and the helper that turns the two into the
7935
+ * JSON the engine stores.
7936
+ *
7937
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
7938
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
7939
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
7940
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
7941
+ * never a field name (D879).
7942
+ */
7943
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
7944
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
7945
+ var RecordIndexSchema = object({
7946
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
7947
+ fields: array(RecordFieldPathSchema).min(1).max(4),
7948
+ unique: boolean().optional()
7949
+ }).strict();
7950
+ var RecordRetentionSchema = union([
7951
+ object({
7952
+ ttlMs: number().int().positive(),
7953
+ from: _enum(["at", "write"])
7954
+ }).strict(),
7955
+ object({
7956
+ maxRows: number().int().positive().optional(),
7957
+ maxRowsPerDevice: number().int().positive().optional()
7958
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
7959
+ object({
7960
+ owner: string().min(1),
7961
+ reason: string().min(1)
7962
+ }).strict(),
7963
+ object({ none: string().min(1) }).strict()
7964
+ ]);
7965
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
7966
+ var EntryDescriptorSchema = object({
7967
+ title: string().min(1),
7968
+ /** The record body field shown as the entry's name. */
7969
+ nameField: string().min(1),
7970
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
7971
+ fields: record(string(), unknown())
7972
+ }).strict();
7973
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
7974
+ var RecordKindDeclarationSchema = object({
7975
+ database: _enum(RECORD_DATABASES).default("settings"),
7976
+ class: _enum(RECORD_CLASSES),
7977
+ writeTrigger: string().min(1),
7978
+ device: _enum([
7979
+ "required",
7980
+ "optional",
7981
+ "none"
7982
+ ]).default("none"),
7983
+ at: _enum(["required", "none"]).default("none"),
7984
+ indexes: array(RecordIndexSchema).max(8).default([]),
7985
+ retention: RecordRetentionSchema,
7986
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
7987
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
7988
+ /** Derived from the Zod schema; never written by hand. */
7989
+ secretPaths: array(string().min(1)).default([]),
7990
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
7991
+ secretArrayKeys: record(string(), string()).default({}),
7992
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
7993
+ adoptsFrom: string().min(1).optional(),
7994
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
7995
+ transactFamily: string().min(1).optional(),
7996
+ entry: EntryDescriptorSchema.optional()
7997
+ }).strict();
7998
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
7999
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7740
8000
  /** Shared Zod schemas used across streaming capabilities. */
7741
8001
  var CamProfileSchema = _enum([
7742
8002
  "high",
@@ -8201,69 +8461,6 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
8201
8461
  kind: "mutation",
8202
8462
  auth: "admin"
8203
8463
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
8204
- function defOf(schema) {
8205
- return schema._zod?.def ?? {};
8206
- }
8207
- function declaredHere(schema) {
8208
- return globalRegistry.get(schema)?.secret === true;
8209
- }
8210
- /** Wrapper kinds whose `innerType` is the field itself. */
8211
- var WRAPPERS = new Set([
8212
- "optional",
8213
- "nullable",
8214
- "default",
8215
- "prefault",
8216
- "catch",
8217
- "readonly",
8218
- "nonoptional"
8219
- ]);
8220
- /**
8221
- * The schema layers that make up ONE field: the schema itself and every
8222
- * wrapper below it (optional / default / nullable / readonly / catch), plus
8223
- * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
8224
- * `.transform` on `in`).
8225
- */
8226
- function layersOf(schema) {
8227
- const out = [];
8228
- const queue = [schema];
8229
- while (queue.length > 0) {
8230
- const s = queue.shift();
8231
- if (!s || out.includes(s)) continue;
8232
- out.push(s);
8233
- const def = defOf(s);
8234
- if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
8235
- if (def.type === "pipe") {
8236
- if (def.in) queue.push(def.in);
8237
- if (def.out) queue.push(def.out);
8238
- }
8239
- }
8240
- return out;
8241
- }
8242
- /** True when any layer of this field declares `.meta({ secret: true })`. */
8243
- function isZodSecret(schema) {
8244
- return layersOf(schema).some(declaredHere);
8245
- }
8246
- /**
8247
- * Every declared secret path in a config schema: dotted keys, `[]` for "each
8248
- * element of this array" (`connection.password`, `rows[].token`). A declared
8249
- * object or array is reported as one path and not descended into — everything
8250
- * under it is secret.
8251
- */
8252
- function collectZodSecretPaths(schema, prefix = "") {
8253
- if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
8254
- const paths = [];
8255
- for (const layer of layersOf(schema)) {
8256
- const def = defOf(layer);
8257
- if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
8258
- else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
8259
- else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
8260
- else if (def.type === "intersection") {
8261
- if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
8262
- if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
8263
- }
8264
- }
8265
- return [...new Set(paths)];
8266
- }
8267
8464
  object({
8268
8465
  code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
8269
8466
  params: record(string(), union([string(), number()])).optional()
@@ -8283,7 +8480,7 @@ function userError(code, params, englishFallback) {
8283
8480
  return new CamstackError(code, params, englishFallback);
8284
8481
  }
8285
8482
  //#endregion
8286
- //#region ../types/dist/err-msg-DLerKiVO.mjs
8483
+ //#region ../types/dist/err-msg-BXKzRBwg.mjs
8287
8484
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
8288
8485
  DeviceType["Camera"] = "camera";
8289
8486
  DeviceType["Hub"] = "hub";
@@ -8375,6 +8572,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
8375
8572
  * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
8376
8573
  * integrations sharing the same food/desiccant/hopper surface. */
8377
8574
  DeviceType["PetFeeder"] = "pet-feeder";
8575
+ /** Built-in dishwasher — program lifecycle, door / remote-start gates,
8576
+ * salt and rinse-aid levels. Installed with the `dishwasher` cap.
8577
+ * Sources: native Bosch Home Connect, reusable by similar integrations. */
8578
+ DeviceType["Dishwasher"] = "dishwasher";
8378
8579
  return DeviceType;
8379
8580
  }({});
8380
8581
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -8552,6 +8753,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8552
8753
  /** Virtual HA toggle (input_boolean.*) — distinguishable from a
8553
8754
  * real Switch device for UI rendering / export adapters. */
8554
8755
  DeviceRole["BinaryHelper"] = "binary-helper";
8756
+ /** A smart plug: a `switch` whose source says it is an outlet (HA
8757
+ * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
8758
+ DeviceRole["Outlet"] = "outlet";
8555
8759
  /** Generic motion / occupancy / moving event source. Distinct from
8556
8760
  * the camera accessory PirSensor role: that one is a camera child;
8557
8761
  * this is a standalone HA / 3rd-party motion sensor. */
@@ -8629,7 +8833,7 @@ function errMsg(err) {
8629
8833
  return String(err);
8630
8834
  }
8631
8835
  //#endregion
8632
- //#region ../types/dist/composition-EQ9Ok0Ee.mjs
8836
+ //#region ../types/dist/composition-CB6PMT9p.mjs
8633
8837
  /**
8634
8838
  * The ffmpeg build every CamStack node downloads, per platform and arch.
8635
8839
  *
@@ -11833,11 +12037,10 @@ var ClipModelMetaSchema = object({
11833
12037
  /**
11834
12038
  * The `vector-store` index this model's vectors live in. ONE feature space
11835
12039
  * per index: two models share an index only when their vectors are ranked
11836
- * against each other, which for CLIP means never across families. MobileCLIP
11837
- * S1 and S2 share `object-clip` for history (separated by the row's
11838
- * `modelId`); any other model gets its own.
12040
+ * against each other, which for CLIP means never across families. Every
12041
+ * model gets its own.
11839
12042
  */
11840
- vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
12043
+ vectorIndex: string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
11841
12044
  /**
11842
12045
  * The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
11843
12046
  * must be unique per tokenizer: every model's siblings land in ONE flat
@@ -13016,8 +13219,13 @@ var AlertSeveritySchema = _enum([
13016
13219
  "info",
13017
13220
  "success",
13018
13221
  "warning",
13019
- "error"
13222
+ "error",
13223
+ "critical"
13020
13224
  ]);
13225
+ var AlertActionSchema = object({
13226
+ label: string(),
13227
+ href: string().optional()
13228
+ });
13021
13229
  var AlertStatusSchema = _enum([
13022
13230
  "active",
13023
13231
  "in-progress",
@@ -13035,6 +13243,7 @@ var AlertSchema = object({
13035
13243
  severity: AlertSeveritySchema,
13036
13244
  title: string(),
13037
13245
  message: string(),
13246
+ action: AlertActionSchema.optional(),
13038
13247
  status: AlertStatusSchema,
13039
13248
  progress: number().optional(),
13040
13249
  read: boolean(),
@@ -15570,6 +15779,41 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
15570
15779
  keyField: string()
15571
15780
  }).optional()
15572
15781
  })) });
15782
+ /**
15783
+ * The report of a one-shot "move this owner's plaintext secrets into the
15784
+ * keychain" run (D878). COUNTS only - never a value, never a ref.
15785
+ *
15786
+ * The owner runs it on its own rows, through its own write path; an operator
15787
+ * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
15788
+ * Dry run (`apply: false`) reports what WOULD move and changes nothing.
15789
+ */
15790
+ var RawSecretMigrationInputSchema = object({
15791
+ /** `false` (the default of the script) = report only. */
15792
+ apply: boolean() });
15793
+ var RawSecretMigrationReportSchema = object({
15794
+ apply: boolean(),
15795
+ /** Rows that can carry a secret (a profile, an enrolment). */
15796
+ rows: number().int(),
15797
+ /** Rows whose secret was plaintext when the run started. */
15798
+ raw: number().int(),
15799
+ /** Rows that already held a keychain marker when the run started. */
15800
+ markers: number().int(),
15801
+ /** Plaintext rows moved by THIS run (always 0 on a dry run). */
15802
+ migrated: number().int(),
15803
+ /** Plaintext rows left in place because the move or its read-back failed. */
15804
+ failed: number().int(),
15805
+ /** After the run: rows still holding plaintext. */
15806
+ remainingRaw: number().int(),
15807
+ /** After the run: markers the keychain could not resolve right now. */
15808
+ unresolvedMarkers: number().int(),
15809
+ /**
15810
+ * A second, redundant copy of the secrets' rows that the run found (and, on
15811
+ * `apply`, deleted after verifying the first). Owners with a single copy omit it.
15812
+ */
15813
+ redundantCopies: number().int().optional(),
15814
+ /** True when nothing is raw and every marker resolves. */
15815
+ verified: boolean()
15816
+ });
15573
15817
  /** Where a block runs. The operator chooses — a block driving a device on an
15574
15818
  * agent is the reason placement is not fixed to the hub. */
15575
15819
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -15796,6 +16040,9 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
15796
16040
  }), SettingsUpdateResultSchema, {
15797
16041
  kind: "mutation",
15798
16042
  auth: "admin"
16043
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
16044
+ kind: "mutation",
16045
+ auth: "admin"
15799
16046
  }), method(object({}), object({ libs: array(object({
15800
16047
  filePath: string(),
15801
16048
  content: string()
@@ -16059,6 +16306,347 @@ id: union([string(), number()]) }), {
16059
16306
  auth: "admin"
16060
16307
  });
16061
16308
  /**
16309
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16310
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16311
+ * (operator intent, D870) and device-history (numbers over time, D850).
16312
+ *
16313
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16314
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16315
+ * that with the addon id closed over). It is deliberately NOT in any input
16316
+ * schema, so a session can never supply it, and a call with no stamp is refused
16317
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16318
+ * addons go through the owner's capability.
16319
+ *
16320
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16321
+ * never `[]`. Secret fields are never on the wire: a read shows the
16322
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16323
+ * resolves itself, and a write may carry only a keychain marker bound to the
16324
+ * row's own ref.
16325
+ *
16326
+ * Internal: addons reach it through `ctx.records`, never directly.
16327
+ */
16328
+ var RecordIdSchema = string().min(1).max(256);
16329
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16330
+ var RecordBodySchema = record(string(), unknown());
16331
+ var RecordInputSchema = object({
16332
+ id: RecordIdSchema,
16333
+ /** The device this row belongs to (D865 removal, per-device reads). */
16334
+ deviceId: number().int().optional(),
16335
+ /** The domain clock, ms: observed / created / opened. */
16336
+ at: number().int().optional(),
16337
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16338
+ expiresAt: number().int().optional(),
16339
+ data: RecordBodySchema
16340
+ });
16341
+ var RecordViewSchema = object({
16342
+ id: string(),
16343
+ deviceId: number().int().nullable(),
16344
+ at: number().nullable(),
16345
+ expiresAt: number().nullable(),
16346
+ rev: number().int(),
16347
+ updatedAt: number(),
16348
+ data: RecordBodySchema
16349
+ });
16350
+ /** Declared index fields only. Anything else does not compile, by design. */
16351
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16352
+ string(),
16353
+ number(),
16354
+ boolean(),
16355
+ object({ in: array(union([
16356
+ string(),
16357
+ number(),
16358
+ boolean()
16359
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16360
+ object({
16361
+ gt: union([string(), number()]).optional(),
16362
+ gte: union([string(), number()]).optional(),
16363
+ lt: union([string(), number()]).optional(),
16364
+ lte: union([string(), number()]).optional()
16365
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16366
+ ]));
16367
+ var KindShape = { kind: RecordKindNameSchema };
16368
+ var TimeWindowShape = {
16369
+ deviceId: number().int().optional(),
16370
+ atFrom: number().optional(),
16371
+ atTo: number().optional()
16372
+ };
16373
+ var RecordQueryInputSchema = object({
16374
+ ...KindShape,
16375
+ ...TimeWindowShape,
16376
+ where: RecordWhereSchema.optional(),
16377
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16378
+ order: _enum(["at", "id"]).optional(),
16379
+ desc: boolean().optional(),
16380
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16381
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16382
+ cursor: string().min(1).optional()
16383
+ });
16384
+ var RecordQueryResultSchema = object({
16385
+ records: array(RecordViewSchema),
16386
+ nextCursor: string().nullable()
16387
+ });
16388
+ var RecordKindStateSchema = _enum([
16389
+ "created",
16390
+ "unchanged",
16391
+ "updated"
16392
+ ]);
16393
+ var DeclareKindResultSchema = object({
16394
+ kindId: number().int(),
16395
+ state: RecordKindStateSchema,
16396
+ createdIndexes: array(string()),
16397
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16398
+ adoptionPending: object({
16399
+ legacyTable: string(),
16400
+ legacyRows: number().int()
16401
+ }).nullable()
16402
+ });
16403
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16404
+ var SecretRefsList = array(string());
16405
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16406
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16407
+ kind: "mutation",
16408
+ auth: "admin"
16409
+ }), method(object({
16410
+ ...KindShape,
16411
+ id: RecordIdSchema
16412
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16413
+ ...KindShape,
16414
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16415
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16416
+ ...KindShape,
16417
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16418
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16419
+ ...KindShape,
16420
+ record: RecordInputSchema,
16421
+ /** Compare-and-set. `0` means "the row must not exist". */
16422
+ ifRev: number().int().min(0).optional()
16423
+ }), object({
16424
+ rev: number().int(),
16425
+ releasedRefs: SecretRefsList
16426
+ }), {
16427
+ kind: "mutation",
16428
+ auth: "admin"
16429
+ }), method(object({
16430
+ ...KindShape,
16431
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16432
+ }), object({
16433
+ count: number().int(),
16434
+ releasedRefs: SecretRefsList
16435
+ }), {
16436
+ kind: "mutation",
16437
+ auth: "admin"
16438
+ }), method(object({
16439
+ ...KindShape,
16440
+ id: RecordIdSchema,
16441
+ data: RecordBodySchema,
16442
+ at: number().int().nullable().optional(),
16443
+ expiresAt: number().int().nullable().optional(),
16444
+ ifRev: number().int().min(1).optional()
16445
+ }), object({
16446
+ rev: number().int(),
16447
+ releasedRefs: SecretRefsList
16448
+ }), {
16449
+ kind: "mutation",
16450
+ auth: "admin"
16451
+ }), method(object({
16452
+ ...KindShape,
16453
+ id: RecordIdSchema
16454
+ }), object({
16455
+ deleted: boolean(),
16456
+ secretRefs: SecretRefsList
16457
+ }), {
16458
+ kind: "mutation",
16459
+ auth: "admin"
16460
+ }), method(object({
16461
+ ...KindShape,
16462
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16463
+ }), object({
16464
+ deleted: number().int(),
16465
+ secretRefs: SecretRefsList
16466
+ }), {
16467
+ kind: "mutation",
16468
+ auth: "admin"
16469
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16470
+ ...KindShape,
16471
+ ...TimeWindowShape,
16472
+ where: RecordWhereSchema.optional()
16473
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16474
+ ...KindShape,
16475
+ deviceId: number().int().optional(),
16476
+ from: number(),
16477
+ to: number(),
16478
+ bucketMs: number().int().positive()
16479
+ }), object({ buckets: array(object({
16480
+ bucketStart: number(),
16481
+ count: number().int()
16482
+ })) }), { auth: "admin" }), method(object({
16483
+ ...KindShape,
16484
+ op: _enum([
16485
+ "sum",
16486
+ "min",
16487
+ "max",
16488
+ "count"
16489
+ ]),
16490
+ field: RecordFieldPathSchema.optional(),
16491
+ groupBy: RecordFieldPathSchema.optional(),
16492
+ where: RecordWhereSchema.optional()
16493
+ }), object({ rows: array(object({
16494
+ group: union([
16495
+ string(),
16496
+ number(),
16497
+ _null()
16498
+ ]),
16499
+ value: number().nullable()
16500
+ })) }), { auth: "admin" }), method(object({
16501
+ ...KindShape,
16502
+ deviceId: number().int().optional(),
16503
+ atBefore: number().optional(),
16504
+ where: RecordWhereSchema.optional()
16505
+ }), object({
16506
+ deleted: number().int(),
16507
+ secretRefs: SecretRefsList
16508
+ }), {
16509
+ kind: "mutation",
16510
+ auth: "admin"
16511
+ }), method(object({
16512
+ deviceId: number().int(),
16513
+ kinds: array(RecordKindNameSchema).optional()
16514
+ }), object({
16515
+ deleted: record(string(), number().int()),
16516
+ secretRefs: SecretRefsList
16517
+ }), {
16518
+ kind: "mutation",
16519
+ auth: "admin"
16520
+ }), method(object(KindShape), object({ id: number().int() }), {
16521
+ kind: "mutation",
16522
+ auth: "admin"
16523
+ });
16524
+ /** One table of the settings database. */
16525
+ var StorageTableSchema = object({
16526
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
16527
+ name: string(),
16528
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
16529
+ owner: string().nullable(),
16530
+ rows: number().int().nonnegative(),
16531
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
16532
+ bytes: number().int().nonnegative().nullable(),
16533
+ /** Declared by an addon since this engine process started (a running addon claims it). */
16534
+ declaredThisBoot: boolean()
16535
+ });
16536
+ /** One declared record kind (D881) as System -> Data shows it. */
16537
+ var StorageKindSchema = object({
16538
+ owner: string(),
16539
+ kind: string(),
16540
+ database: _enum(["settings", "events"]),
16541
+ class: string(),
16542
+ state: _enum([
16543
+ "declared",
16544
+ "orphaned",
16545
+ "dropped"
16546
+ ]),
16547
+ /** `null` when the caller asked for no counts (`counts: false`). */
16548
+ rows: number().int().nonnegative().nullable(),
16549
+ /** Rows x the average size of a sample; null for an empty kind. */
16550
+ bytesEstimate: number().int().nonnegative().nullable(),
16551
+ writeTrigger: string(),
16552
+ retention: RecordRetentionSchema,
16553
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16554
+ entry: boolean(),
16555
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16556
+ declaration: RecordKindDeclarationSchema
16557
+ });
16558
+ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16559
+ collection: string().min(1),
16560
+ expectRows: number().int().nonnegative()
16561
+ }), object({
16562
+ dropped: literal(true),
16563
+ rows: number().int().nonnegative()
16564
+ }), {
16565
+ kind: "mutation",
16566
+ auth: "admin"
16567
+ }), method(object({
16568
+ owner: string().min(1).optional(),
16569
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16570
+ counts: boolean().optional()
16571
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16572
+ owner: string().min(1),
16573
+ kind: RecordKindNameSchema
16574
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16575
+ owner: string().min(1),
16576
+ kind: RecordKindNameSchema,
16577
+ records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
16578
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16579
+ complete: boolean().optional()
16580
+ }).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
16581
+ kind: "mutation",
16582
+ auth: "admin"
16583
+ }), method(object({
16584
+ collection: string().min(1),
16585
+ cursor: string().optional(),
16586
+ limit: number().int().min(1).max(1e3).optional()
16587
+ }), object({
16588
+ rows: array(object({
16589
+ id: string(),
16590
+ data: record(string(), unknown())
16591
+ })),
16592
+ nextCursor: string().nullable()
16593
+ }), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
16594
+ /**
16595
+ * record-entries - the ONE admin surface for every list of user-created entries
16596
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16597
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16598
+ *
16599
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16600
+ * the entry body with `secret: true` on every credential field, so a password
16601
+ * field is derived from the schema and never from a name. `putEntry` takes the
16602
+ * redaction token for an untouched secret (the stored value is kept), a string
16603
+ * for a new one, and the clear instruction to remove one. A read never carries
16604
+ * a secret value, and a locked keychain refuses the write with
16605
+ * `records/secret-unavailable` instead of storing plaintext.
16606
+ *
16607
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
16608
+ */
16609
+ var EntryKindInfoSchema = object({
16610
+ owner: string(),
16611
+ kind: RecordKindNameSchema,
16612
+ title: string(),
16613
+ nameField: string(),
16614
+ /** JSON Schema of the body; `secret: true` marks a password field. */
16615
+ fields: record(string(), unknown()),
16616
+ secretPaths: array(string()),
16617
+ rows: number().int().nonnegative()
16618
+ });
16619
+ var EntryViewSchema = object({
16620
+ id: RecordIdSchema,
16621
+ name: string(),
16622
+ rev: number().int(),
16623
+ updatedAt: number(),
16624
+ /** Secret fields hold the redaction token. */
16625
+ data: RecordBodySchema
16626
+ });
16627
+ var EntryAddress = {
16628
+ owner: string().min(1),
16629
+ kind: RecordKindNameSchema
16630
+ };
16631
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
16632
+ ...EntryAddress,
16633
+ id: RecordIdSchema.optional(),
16634
+ data: RecordBodySchema,
16635
+ ifRev: number().int().min(1).optional()
16636
+ }), object({
16637
+ id: string(),
16638
+ rev: number().int()
16639
+ }), {
16640
+ kind: "mutation",
16641
+ auth: "admin"
16642
+ }), method(object({
16643
+ ...EntryAddress,
16644
+ id: RecordIdSchema
16645
+ }), object({ deleted: boolean() }), {
16646
+ kind: "mutation",
16647
+ auth: "admin"
16648
+ });
16649
+ /**
16062
16650
  * `keychain` — the hub's encrypted store of secret values (D787).
16063
16651
  *
16064
16652
  * Settings blobs never hold a secret: they hold a marker
@@ -16599,6 +17187,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
16599
17187
  kind: "mutation",
16600
17188
  auth: "admin",
16601
17189
  caller: "required"
17190
+ }), method(object({
17191
+ ref: string().min(1),
17192
+ value: string().min(1)
17193
+ }), object({
17194
+ ref: string(),
17195
+ version: number().int()
17196
+ }), {
17197
+ kind: "mutation",
17198
+ auth: "admin",
17199
+ caller: "required"
16602
17200
  }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
16603
17201
  deleted: array(string()).readonly(),
16604
17202
  kept: array(object({
@@ -17007,7 +17605,11 @@ var deviceDiscoveryCapability = {
17007
17605
  };
17008
17606
  /**
17009
17607
  * `device-adoption` — generic discovery + adoption surface,
17010
- * system-scoped singleton. The de-HA-ified successor to `ha-discovery`:
17608
+ * system-scoped collection (one provider per integration addon), routed
17609
+ * by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
17610
+ * pin model as `connection-test`. The admin UI keeps using
17611
+ * `deviceManager.adoption*` (which already threads `addonId`). The de-HA-ified
17612
+ * successor to `ha-discovery`:
17011
17613
  * keyed by `integrationId` (the addon resolves integrationId → broker
17012
17614
  * internally) rather than a connection-specific `brokerId`, and it
17013
17615
  * REUSES the shared `DiscoveredChildDevice` candidate type from
@@ -17172,7 +17774,7 @@ var ResyncResultSchema = object({
17172
17774
  var deviceAdoptionCapability = {
17173
17775
  name: "device-adoption",
17174
17776
  scope: "system",
17175
- mode: "singleton",
17777
+ mode: "collection",
17176
17778
  status: {
17177
17779
  schema: AdoptionStatusSchema,
17178
17780
  kind: "poll"
@@ -39289,6 +39891,9 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
39289
39891
  }), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
39290
39892
  kind: "mutation",
39291
39893
  auth: "admin"
39894
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
39895
+ kind: "mutation",
39896
+ auth: "admin"
39292
39897
  }), method(ProfileRefInputSchema, _void(), {
39293
39898
  kind: "mutation",
39294
39899
  auth: "admin"
@@ -49798,6 +50403,41 @@ var ServerRollbackInfoSchema = object({
49798
50403
  atMs: number(),
49799
50404
  reason: string()
49800
50405
  });
50406
+ /**
50407
+ * The runner boot check (D877): the runners this node PLANNED (hub: one per
50408
+ * `resolveRunnerId` over its forked addons; agent: the runners its process
50409
+ * service holds, because only the hub plans) against the states the process
50410
+ * service reports. Kept in memory, recomputed by the same one-shot check after
50411
+ * every boot, served on `getServerPackageStatus`.
50412
+ *
50413
+ * `failed` is the D6 breaker's terminal state, `refused` a deterministic Init
50414
+ * refusal (an addon that said "I will not start, and here is why"), `missing` a
50415
+ * planned runner the process service has no entry for.
50416
+ */
50417
+ var RunnerRefusalSchema = object({
50418
+ runnerId: string(),
50419
+ addonIds: array(string()),
50420
+ reason: string()
50421
+ });
50422
+ var RunnerBootCheckSchema = object({
50423
+ checkedAtMs: number(),
50424
+ /** Runners planned for this node. */
50425
+ expected: number(),
50426
+ /** Planned runners whose process is `running`. */
50427
+ running: number(),
50428
+ failed: array(string()),
50429
+ refused: array(RunnerRefusalSchema),
50430
+ missing: array(string()),
50431
+ /**
50432
+ * Runners still on their way: `starting`, or `crashed` waiting on a backoff
50433
+ * respawn. The check is FINAL only when this is empty; until then nothing is
50434
+ * pushed and the verdict is re-evaluated on the next runner state change.
50435
+ * Optional for version skew (absent = settled).
50436
+ */
50437
+ pending: array(string()).optional(),
50438
+ /** True when the plan is the hub's (`missing` is then meaningful); false on an agent. */
50439
+ planKnown: boolean()
50440
+ });
49801
50441
  var ServerPackageStatusSchema = object({
49802
50442
  /** Root package name (`@camstack/server` on the hub). */
49803
50443
  packageName: string(),
@@ -49860,7 +50500,14 @@ var ServerPackageStatusSchema = object({
49860
50500
  * for version skew: an older provider's payload simply omits it, and an
49861
50501
  * absent wrapper is unknown — never `native`.
49862
50502
  */
49863
- wrapper: WrapperIdentitySchema.optional()
50503
+ wrapper: WrapperIdentitySchema.optional(),
50504
+ /**
50505
+ * What this node PLANNED to run against what its process service reports
50506
+ * (D877). Absent until the one-shot boot check has run (~60 s after boot) and
50507
+ * on a provider that predates it. Absent is "not checked yet", never "all
50508
+ * well": a consumer that needs the answer treats it as pending.
50509
+ */
50510
+ runners: RunnerBootCheckSchema.optional()
49864
50511
  });
49865
50512
  var ServerUpdateCheckResultSchema = object({
49866
50513
  packageName: string(),
@@ -49911,6 +50558,13 @@ var ServerUpdateOutcomeSchema = _enum([
49911
50558
  "refused",
49912
50559
  "failed"
49913
50560
  ]);
50561
+ /** One addon the pre-flight found the target version would refuse (D877). */
50562
+ var UpdateBlockerSchema = object({
50563
+ addonId: string(),
50564
+ reason: string(),
50565
+ /** What the operator does about it. */
50566
+ remedy: string()
50567
+ });
49914
50568
  var ServerUpdateActionResultSchema = object({
49915
50569
  accepted: boolean(),
49916
50570
  targetVersion: string().nullable(),
@@ -49928,14 +50582,27 @@ var ServerUpdateActionResultSchema = object({
49928
50582
  * The failure itself, verbatim enough to act on (the npm output for a
49929
50583
  * staging install). Non-null only for `failed`.
49930
50584
  */
49931
- error: string().nullable().optional()
50585
+ error: string().nullable().optional(),
50586
+ /**
50587
+ * The addons the target version would refuse to start on this node's live
50588
+ * store (D877), present when the pre-flight refused the update
50589
+ * (`reason: 'addon-would-refuse'`). Optional for version skew.
50590
+ */
50591
+ blockers: array(UpdateBlockerSchema).optional()
49932
50592
  });
49933
50593
  method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
49934
50594
  kind: "mutation",
49935
50595
  auth: "admin"
49936
- }), method(object({
49937
- /** Explicit target version; omitted = latest from the registry. */
49938
- version: string().optional() }), ServerUpdateActionResultSchema, {
50596
+ }), method(object({
50597
+ /** Explicit target version; omitted = latest from the registry. */
50598
+ version: string().optional(),
50599
+ /**
50600
+ * Apply even though the pre-flight (D877) found addons the target would
50601
+ * refuse to start. Off by default: those addons stay down until the
50602
+ * remedy is run, which is the incident this gate exists to prevent.
50603
+ */
50604
+ acknowledgeRefusals: boolean().optional()
50605
+ }), ServerUpdateActionResultSchema, {
49939
50606
  kind: "mutation",
49940
50607
  auth: "admin",
49941
50608
  timeoutMs: 16 * 6e4
@@ -52381,7 +53048,9 @@ var ManifestShapeSchema = object({
52381
53048
  var AddonProcessSchema = object({
52382
53049
  pid: number().optional(),
52383
53050
  mode: string(),
52384
- state: string()
53051
+ state: string(),
53052
+ /** Why the runner is `refused` (an addon's own words), when it is (D877). */
53053
+ reason: string().optional()
52385
53054
  });
52386
53055
  /**
52387
53056
  * Per-addon health snapshot from the kernel's AddonHealthMonitor.
@@ -53149,7 +53818,8 @@ var batteryCapability = {
53149
53818
  DeviceType.Button,
53150
53819
  DeviceType.Switch,
53151
53820
  DeviceType.PetFeeder,
53152
- DeviceType.Container
53821
+ DeviceType.Container,
53822
+ DeviceType.Thermostat
53153
53823
  ],
53154
53824
  methods: {
53155
53825
  /**
@@ -53787,6 +54457,12 @@ var ClimateControlStatusSchema = object({
53787
54457
  /** Horizontal louver swing on/off. Null when the device has no
53788
54458
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
53789
54459
  swingHorizontal: boolean().nullable(),
54460
+ /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
54461
+ minTemp: number().nullable().optional(),
54462
+ /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
54463
+ maxTemp: number().nullable().optional(),
54464
+ /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
54465
+ tempStep: number().positive().nullable().optional(),
53790
54466
  /** Ms epoch when the slice was last updated (push or command). */
53791
54467
  lastFetchedAt: number()
53792
54468
  });
@@ -54641,6 +55317,161 @@ onStatusChanged: { data: object({
54641
55317
  * whether persisting is worth a SQLite commit. */
54642
55318
  volatileStateFields: ["lastChangedAt"]
54643
55319
  };
55320
+ /**
55321
+ * Smart-dishwasher cap — program lifecycle, door / remote-start gates,
55322
+ * consumable levels (salt, rinse aid) and common program options.
55323
+ *
55324
+ * Sources: native Bosch Home Connect (`dishwasher` device type). Reusable
55325
+ * by any integration that exposes the same program / option surface.
55326
+ *
55327
+ * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55328
+ * provider refreshes the slice on an interval and eagerly after commands.
55329
+ */
55330
+ var DishwasherStateSchema = _enum([
55331
+ "idle",
55332
+ "running",
55333
+ "paused",
55334
+ "finished",
55335
+ "error",
55336
+ "unavailable"
55337
+ ]);
55338
+ var DishwasherConsumableLevelSchema = _enum([
55339
+ "ok",
55340
+ "low",
55341
+ "empty"
55342
+ ]);
55343
+ var DishwasherStatusSchema = object({
55344
+ state: DishwasherStateSchema,
55345
+ /** Active program id/name, or null when none selected / unknown. */
55346
+ program: string().nullable(),
55347
+ /** Program tokens the hardware accepts — drives the UI selector. */
55348
+ availablePrograms: array(string()),
55349
+ /** Minutes remaining on the active cycle, or null when not running. */
55350
+ remainingMinutes: number().int().nonnegative().nullable(),
55351
+ /** Cycle completion 0..100, or null when not applicable. */
55352
+ progressPercent: number().min(0).max(100).nullable(),
55353
+ /** True when the door is reported open. */
55354
+ doorOpen: boolean(),
55355
+ /** True when remote start is allowed (door closed, power on, etc.). */
55356
+ remoteStartAllowed: boolean(),
55357
+ /** Main power / switched-on state. */
55358
+ powerOn: boolean(),
55359
+ saltLevel: DishwasherConsumableLevelSchema.nullable(),
55360
+ rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55361
+ halfLoad: boolean(),
55362
+ hygienePlus: boolean(),
55363
+ /** Extra dry option when the appliance exposes it. */
55364
+ extraDry: boolean(),
55365
+ /** Intensive zone (lower basket) when the appliance exposes it. */
55366
+ intensiveZone: boolean(),
55367
+ /** VarioSpeed / VarioSpeed+ when the appliance exposes it. */
55368
+ varioSpeedPlus: boolean(),
55369
+ /** Child lock (controls disabled on the appliance). */
55370
+ childLock: boolean(),
55371
+ errorCode: number().nullable(),
55372
+ errorLabel: string().nullable(),
55373
+ lastFetchedAt: number()
55374
+ });
55375
+ var dishwasherCapability = {
55376
+ name: "dishwasher",
55377
+ scope: "device",
55378
+ deviceNative: true,
55379
+ mode: "singleton",
55380
+ deviceTypes: [DeviceType.Dishwasher],
55381
+ methods: {
55382
+ start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55383
+ kind: "mutation",
55384
+ auth: "protected"
55385
+ }),
55386
+ pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55387
+ kind: "mutation",
55388
+ auth: "protected"
55389
+ }),
55390
+ stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55391
+ kind: "mutation",
55392
+ auth: "protected"
55393
+ }),
55394
+ setProgram: method(object({
55395
+ deviceId: number().int().nonnegative(),
55396
+ program: string().min(1)
55397
+ }), _void(), {
55398
+ kind: "mutation",
55399
+ auth: "protected"
55400
+ }),
55401
+ setPower: method(object({
55402
+ deviceId: number().int().nonnegative(),
55403
+ on: boolean()
55404
+ }), _void(), {
55405
+ kind: "mutation",
55406
+ auth: "protected"
55407
+ }),
55408
+ setHalfLoad: method(object({
55409
+ deviceId: number().int().nonnegative(),
55410
+ on: boolean()
55411
+ }), _void(), {
55412
+ kind: "mutation",
55413
+ auth: "protected"
55414
+ }),
55415
+ setHygienePlus: method(object({
55416
+ deviceId: number().int().nonnegative(),
55417
+ on: boolean()
55418
+ }), _void(), {
55419
+ kind: "mutation",
55420
+ auth: "protected"
55421
+ }),
55422
+ setExtraDry: method(object({
55423
+ deviceId: number().int().nonnegative(),
55424
+ on: boolean()
55425
+ }), _void(), {
55426
+ kind: "mutation",
55427
+ auth: "protected"
55428
+ }),
55429
+ setIntensiveZone: method(object({
55430
+ deviceId: number().int().nonnegative(),
55431
+ on: boolean()
55432
+ }), _void(), {
55433
+ kind: "mutation",
55434
+ auth: "protected"
55435
+ }),
55436
+ setVarioSpeedPlus: method(object({
55437
+ deviceId: number().int().nonnegative(),
55438
+ on: boolean()
55439
+ }), _void(), {
55440
+ kind: "mutation",
55441
+ auth: "protected"
55442
+ }),
55443
+ setChildLock: method(object({
55444
+ deviceId: number().int().nonnegative(),
55445
+ on: boolean()
55446
+ }), _void(), {
55447
+ kind: "mutation",
55448
+ auth: "protected"
55449
+ }),
55450
+ setOption: method(object({
55451
+ deviceId: number().int().nonnegative(),
55452
+ key: string().min(1),
55453
+ value: union([
55454
+ boolean(),
55455
+ string(),
55456
+ number()
55457
+ ])
55458
+ }), _void(), {
55459
+ kind: "mutation",
55460
+ auth: "protected"
55461
+ })
55462
+ },
55463
+ status: {
55464
+ schema: DishwasherStatusSchema,
55465
+ kind: "poll"
55466
+ },
55467
+ runtimeState: DishwasherStatusSchema,
55468
+ durability: "session",
55469
+ history: { fields: { progressPercent: {
55470
+ kind: "gauge",
55471
+ unit: "%",
55472
+ deadband: 2
55473
+ } } }
55474
+ };
54644
55475
  var DoorbellStatusSchema = object({
54645
55476
  /** Ms epoch of the last press. null = never observed since this provider started. */
54646
55477
  lastPressedAt: number().nullable(),
@@ -55443,6 +56274,32 @@ var gasCapability = {
55443
56274
  * whether persisting is worth a SQLite commit. */
55444
56275
  volatileStateFields: ["lastChangedAt"]
55445
56276
  };
56277
+ var HeatingValveStatusSchema = object({
56278
+ /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
56279
+ position: number().min(0).max(100).nullable(),
56280
+ /** Ms epoch when the slice was last updated (push or poll). */
56281
+ lastFetchedAt: number()
56282
+ });
56283
+ var heatingValveCapability = {
56284
+ name: "heating-valve",
56285
+ scope: "device",
56286
+ deviceNative: true,
56287
+ mode: "singleton",
56288
+ deviceTypes: [DeviceType.Thermostat],
56289
+ methods: {},
56290
+ status: {
56291
+ schema: HeatingValveStatusSchema,
56292
+ kind: "push"
56293
+ },
56294
+ runtimeState: HeatingValveStatusSchema,
56295
+ durability: "session",
56296
+ history: { fields: { position: {
56297
+ kind: "gauge",
56298
+ unit: "%",
56299
+ deadband: 1
56300
+ } } },
56301
+ volatileStateFields: ["lastFetchedAt"]
56302
+ };
55446
56303
  /**
55447
56304
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
55448
56305
  * an on/off actuator with an optional target-humidity setpoint and an
@@ -56575,7 +57432,19 @@ var TlsStatusSchema = object({
56575
57432
  sans: array(string()),
56576
57433
  caCertPem: string().nullable(),
56577
57434
  reissueError: string().nullable(),
56578
- restartRequired: boolean()
57435
+ restartRequired: boolean(),
57436
+ /** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
57437
+ caMissing: boolean(),
57438
+ /** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
57439
+ localCaConstrained: boolean().nullable(),
57440
+ /** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
57441
+ caReplacedAt: string().nullable(),
57442
+ /** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
57443
+ storedUpload: object({
57444
+ leafFingerprintSha256: string(),
57445
+ validTo: string(),
57446
+ hasCa: boolean()
57447
+ }).nullable()
56579
57448
  });
56580
57449
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
56581
57450
  /**
@@ -56631,6 +57500,9 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
56631
57500
  }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
56632
57501
  kind: "mutation",
56633
57502
  auth: "admin"
57503
+ }), method(_void(), TlsStatusSchema, {
57504
+ kind: "mutation",
57505
+ auth: "admin"
56634
57506
  });
56635
57507
  var LockControlStatusSchema = object({
56636
57508
  /** Lifecycle state of the lock. `jammed` means the motor reported
@@ -63272,7 +64144,11 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
63272
64144
  kind: "mutation",
63273
64145
  auth: "admin",
63274
64146
  access: "delete"
63275
- }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(object({
64147
+ }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
64148
+ kind: "mutation",
64149
+ auth: "admin",
64150
+ access: "create"
64151
+ }), method(object({
63276
64152
  userId: string(),
63277
64153
  code: string()
63278
64154
  }), object({ valid: boolean() }), {
@@ -64992,6 +65868,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
64992
65868
  dayNight: dayNightCapability,
64993
65869
  deviceDiscovery: deviceDiscoveryCapability,
64994
65870
  deviceStatus: deviceStatusCapability,
65871
+ dishwasher: dishwasherCapability,
64995
65872
  doorbell: doorbellCapability,
64996
65873
  enumSensor: enumSensorCapability,
64997
65874
  eventEmitter: eventEmitterCapability,
@@ -64999,6 +65876,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
64999
65876
  featureProbe: featureProbeCapability,
65000
65877
  flood: floodCapability,
65001
65878
  gas: gasCapability,
65879
+ heatingValve: heatingValveCapability,
65002
65880
  humidifier: humidifierCapability,
65003
65881
  humiditySensor: humiditySensorCapability,
65004
65882
  image: imageCapability,
@@ -65084,13 +65962,14 @@ var BaseDevice$1 = class {
65084
65962
  get state() {
65085
65963
  if (!this._stateProxyCache) {
65086
65964
  const cache = {};
65087
- const handler = { get: (_target, key) => {
65965
+ const handler = { get: (target, key) => {
65088
65966
  const k = key;
65089
- if (k in cache) return cache[k];
65967
+ const existing = Reflect.get(target, k);
65968
+ if (existing !== void 0) return existing;
65090
65969
  const cap = DEVICE_LOCAL_STATE_CAPS[k];
65091
65970
  if (!cap) return void 0;
65092
65971
  const proxy = this.sliceProxy(cap);
65093
- cache[k] = proxy;
65972
+ Reflect.set(target, k, proxy);
65094
65973
  return proxy;
65095
65974
  } };
65096
65975
  this._stateProxyCache = new Proxy(cache, handler);
@@ -65289,7 +66168,7 @@ var BaseDevice$1 = class {
65289
66168
  async updateSourceInfo(patch) {
65290
66169
  const next = mergeSourceInfo(this.sourceInfo, patch);
65291
66170
  this._sourceInfoCache = Object.freeze({ ...next });
65292
- const action = this.ctx.api?.deviceManager?.setMetadata;
66171
+ const action = this.ctx.api.deviceManager?.setMetadata;
65293
66172
  if (action) try {
65294
66173
  await action.mutate({
65295
66174
  deviceId: this.id,
@@ -65324,7 +66203,7 @@ var BaseDevice$1 = class {
65324
66203
  * device boot on a meta refresh.
65325
66204
  */
65326
66205
  async refreshFeatures() {
65327
- const action = this.ctx.api?.deviceManager?.registerDevice;
66206
+ const action = this.ctx.api.deviceManager?.registerDevice;
65328
66207
  if (!action) return;
65329
66208
  try {
65330
66209
  await action.mutate({
@@ -65723,6 +66602,12 @@ var BaseDeviceProvider = class extends BaseAddon {
65723
66602
  provider: this
65724
66603
  }];
65725
66604
  }
66605
+ /** Flatten `super.onInitialize()` whether it returned an array or an envelope. */
66606
+ providerRegistrationsFromSuper(result) {
66607
+ if (Array.isArray(result)) return result;
66608
+ if (result !== void 0 && result.providers !== void 0) return [...result.providers];
66609
+ return [];
66610
+ }
65726
66611
  async onShutdown() {
65727
66612
  this._restoreShuttingDown = true;
65728
66613
  this.cancelRestoreRetries();
@@ -66249,7 +67134,7 @@ var BaseDeviceProvider = class extends BaseAddon {
66249
67134
  return toDeviceSummary(device, this.addonId);
66250
67135
  }
66251
67136
  };
66252
- 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;
67137
+ 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;
66253
67138
  new Set(Object.values(DeviceType));
66254
67139
  Object.freeze({
66255
67140
  "accessories.getStatus": {
@@ -67398,6 +68283,12 @@ Object.freeze({
67398
68283
  addonId: null,
67399
68284
  access: "view"
67400
68285
  },
68286
+ "coreBlocks.migrateRawSecrets": {
68287
+ capName: "core-blocks",
68288
+ capScope: "system",
68289
+ addonId: null,
68290
+ access: "create"
68291
+ },
67401
68292
  "coreBlocks.restart": {
67402
68293
  capName: "core-blocks",
67403
68294
  capScope: "system",
@@ -68664,6 +69555,84 @@ Object.freeze({
68664
69555
  addonId: null,
68665
69556
  access: "view"
68666
69557
  },
69558
+ "dishwasher.getStatus": {
69559
+ capName: "dishwasher",
69560
+ capScope: "device",
69561
+ addonId: null,
69562
+ access: "view"
69563
+ },
69564
+ "dishwasher.pause": {
69565
+ capName: "dishwasher",
69566
+ capScope: "device",
69567
+ addonId: null,
69568
+ access: "create"
69569
+ },
69570
+ "dishwasher.setChildLock": {
69571
+ capName: "dishwasher",
69572
+ capScope: "device",
69573
+ addonId: null,
69574
+ access: "create"
69575
+ },
69576
+ "dishwasher.setExtraDry": {
69577
+ capName: "dishwasher",
69578
+ capScope: "device",
69579
+ addonId: null,
69580
+ access: "create"
69581
+ },
69582
+ "dishwasher.setHalfLoad": {
69583
+ capName: "dishwasher",
69584
+ capScope: "device",
69585
+ addonId: null,
69586
+ access: "create"
69587
+ },
69588
+ "dishwasher.setHygienePlus": {
69589
+ capName: "dishwasher",
69590
+ capScope: "device",
69591
+ addonId: null,
69592
+ access: "create"
69593
+ },
69594
+ "dishwasher.setIntensiveZone": {
69595
+ capName: "dishwasher",
69596
+ capScope: "device",
69597
+ addonId: null,
69598
+ access: "create"
69599
+ },
69600
+ "dishwasher.setOption": {
69601
+ capName: "dishwasher",
69602
+ capScope: "device",
69603
+ addonId: null,
69604
+ access: "create"
69605
+ },
69606
+ "dishwasher.setPower": {
69607
+ capName: "dishwasher",
69608
+ capScope: "device",
69609
+ addonId: null,
69610
+ access: "create"
69611
+ },
69612
+ "dishwasher.setProgram": {
69613
+ capName: "dishwasher",
69614
+ capScope: "device",
69615
+ addonId: null,
69616
+ access: "create"
69617
+ },
69618
+ "dishwasher.setVarioSpeedPlus": {
69619
+ capName: "dishwasher",
69620
+ capScope: "device",
69621
+ addonId: null,
69622
+ access: "create"
69623
+ },
69624
+ "dishwasher.start": {
69625
+ capName: "dishwasher",
69626
+ capScope: "device",
69627
+ addonId: null,
69628
+ access: "create"
69629
+ },
69630
+ "dishwasher.stop": {
69631
+ capName: "dishwasher",
69632
+ capScope: "device",
69633
+ addonId: null,
69634
+ access: "create"
69635
+ },
68667
69636
  "doorbell.getStatus": {
68668
69637
  capName: "doorbell",
68669
69638
  capScope: "device",
@@ -68874,6 +69843,12 @@ Object.freeze({
68874
69843
  addonId: null,
68875
69844
  access: "view"
68876
69845
  },
69846
+ "heatingValve.getStatus": {
69847
+ capName: "heating-valve",
69848
+ capScope: "device",
69849
+ addonId: null,
69850
+ access: "view"
69851
+ },
68877
69852
  "humidifier.getStatus": {
68878
69853
  capName: "humidifier",
68879
69854
  capScope: "device",
@@ -69084,6 +70059,12 @@ Object.freeze({
69084
70059
  addonId: null,
69085
70060
  access: "create"
69086
70061
  },
70062
+ "keychainAdmin.importSecret": {
70063
+ capName: "keychain-admin",
70064
+ capScope: "system",
70065
+ addonId: null,
70066
+ access: "create"
70067
+ },
69087
70068
  "keychainAdmin.listAudit": {
69088
70069
  capName: "keychain-admin",
69089
70070
  capScope: "system",
@@ -69252,6 +70233,12 @@ Object.freeze({
69252
70233
  addonId: null,
69253
70234
  access: "view"
69254
70235
  },
70236
+ "llm.migrateRawSecrets": {
70237
+ capName: "llm",
70238
+ capScope: "system",
70239
+ addonId: null,
70240
+ access: "create"
70241
+ },
69255
70242
  "llm.resolveModelRef": {
69256
70243
  capName: "llm",
69257
70244
  capScope: "system",
@@ -69480,6 +70467,12 @@ Object.freeze({
69480
70467
  addonId: null,
69481
70468
  access: "create"
69482
70469
  },
70470
+ "localNetwork.useStoredUploadedCertificate": {
70471
+ capName: "local-network",
70472
+ capScope: "system",
70473
+ addonId: null,
70474
+ access: "create"
70475
+ },
69483
70476
  "lockControl.getStatus": {
69484
70477
  capName: "lock-control",
69485
70478
  capScope: "device",
@@ -72132,6 +73125,30 @@ Object.freeze({
72132
73125
  addonId: null,
72133
73126
  access: "create"
72134
73127
  },
73128
+ "recordEntries.deleteEntry": {
73129
+ capName: "record-entries",
73130
+ capScope: "system",
73131
+ addonId: null,
73132
+ access: "delete"
73133
+ },
73134
+ "recordEntries.listEntries": {
73135
+ capName: "record-entries",
73136
+ capScope: "system",
73137
+ addonId: null,
73138
+ access: "view"
73139
+ },
73140
+ "recordEntries.listEntryKinds": {
73141
+ capName: "record-entries",
73142
+ capScope: "system",
73143
+ addonId: null,
73144
+ access: "view"
73145
+ },
73146
+ "recordEntries.putEntry": {
73147
+ capName: "record-entries",
73148
+ capScope: "system",
73149
+ addonId: null,
73150
+ access: "create"
73151
+ },
72135
73152
  "recording.getAvailability": {
72136
73153
  capName: "recording",
72137
73154
  capScope: "device",
@@ -72432,6 +73449,102 @@ Object.freeze({
72432
73449
  addonId: null,
72433
73450
  access: "view"
72434
73451
  },
73452
+ "records.aggregate": {
73453
+ capName: "records",
73454
+ capScope: "system",
73455
+ addonId: null,
73456
+ access: "view"
73457
+ },
73458
+ "records.allocateId": {
73459
+ capName: "records",
73460
+ capScope: "system",
73461
+ addonId: null,
73462
+ access: "create"
73463
+ },
73464
+ "records.count": {
73465
+ capName: "records",
73466
+ capScope: "system",
73467
+ addonId: null,
73468
+ access: "view"
73469
+ },
73470
+ "records.declareKinds": {
73471
+ capName: "records",
73472
+ capScope: "system",
73473
+ addonId: null,
73474
+ access: "create"
73475
+ },
73476
+ "records.delete": {
73477
+ capName: "records",
73478
+ capScope: "system",
73479
+ addonId: null,
73480
+ access: "delete"
73481
+ },
73482
+ "records.deleteDevice": {
73483
+ capName: "records",
73484
+ capScope: "system",
73485
+ addonId: null,
73486
+ access: "delete"
73487
+ },
73488
+ "records.deleteMany": {
73489
+ capName: "records",
73490
+ capScope: "system",
73491
+ addonId: null,
73492
+ access: "delete"
73493
+ },
73494
+ "records.deleteWhere": {
73495
+ capName: "records",
73496
+ capScope: "system",
73497
+ addonId: null,
73498
+ access: "delete"
73499
+ },
73500
+ "records.get": {
73501
+ capName: "records",
73502
+ capScope: "system",
73503
+ addonId: null,
73504
+ access: "view"
73505
+ },
73506
+ "records.getMany": {
73507
+ capName: "records",
73508
+ capScope: "system",
73509
+ addonId: null,
73510
+ access: "view"
73511
+ },
73512
+ "records.histogram": {
73513
+ capName: "records",
73514
+ capScope: "system",
73515
+ addonId: null,
73516
+ access: "view"
73517
+ },
73518
+ "records.patch": {
73519
+ capName: "records",
73520
+ capScope: "system",
73521
+ addonId: null,
73522
+ access: "create"
73523
+ },
73524
+ "records.put": {
73525
+ capName: "records",
73526
+ capScope: "system",
73527
+ addonId: null,
73528
+ access: "create"
73529
+ },
73530
+ "records.putMany": {
73531
+ capName: "records",
73532
+ capScope: "system",
73533
+ addonId: null,
73534
+ access: "create"
73535
+ },
73536
+ "records.query": {
73537
+ capName: "records",
73538
+ capScope: "system",
73539
+ addonId: null,
73540
+ access: "view"
73541
+ },
73542
+ "records.secretRefs": {
73543
+ capName: "records",
73544
+ capScope: "system",
73545
+ addonId: null,
73546
+ access: "view"
73547
+ },
72435
73548
  "sceneMonitor.captureReference": {
72436
73549
  capName: "scene-monitor",
72437
73550
  capScope: "device",
@@ -72864,6 +73977,48 @@ Object.freeze({
72864
73977
  addonId: null,
72865
73978
  access: "create"
72866
73979
  },
73980
+ "storageAdmin.adoptRecords": {
73981
+ capName: "storage-admin",
73982
+ capScope: "system",
73983
+ addonId: null,
73984
+ access: "create"
73985
+ },
73986
+ "storageAdmin.dropCollection": {
73987
+ capName: "storage-admin",
73988
+ capScope: "system",
73989
+ addonId: null,
73990
+ access: "delete"
73991
+ },
73992
+ "storageAdmin.isAdoptedLegacyTable": {
73993
+ capName: "storage-admin",
73994
+ capScope: "system",
73995
+ addonId: null,
73996
+ access: "view"
73997
+ },
73998
+ "storageAdmin.listKinds": {
73999
+ capName: "storage-admin",
74000
+ capScope: "system",
74001
+ addonId: null,
74002
+ access: "view"
74003
+ },
74004
+ "storageAdmin.listTables": {
74005
+ capName: "storage-admin",
74006
+ capScope: "system",
74007
+ addonId: null,
74008
+ access: "view"
74009
+ },
74010
+ "storageAdmin.readLegacyCollection": {
74011
+ capName: "storage-admin",
74012
+ capScope: "system",
74013
+ addonId: null,
74014
+ access: "view"
74015
+ },
74016
+ "storageAdmin.readRecords": {
74017
+ capName: "storage-admin",
74018
+ capScope: "system",
74019
+ addonId: null,
74020
+ access: "view"
74021
+ },
72867
74022
  "storageEvictable.evict": {
72868
74023
  capName: "storage-evictable",
72869
74024
  capScope: "system",
@@ -73776,6 +74931,12 @@ Object.freeze({
73776
74931
  addonId: null,
73777
74932
  access: "view"
73778
74933
  },
74934
+ "userManagement.migrateRawSecrets": {
74935
+ capName: "user-management",
74936
+ capScope: "system",
74937
+ addonId: null,
74938
+ access: "create"
74939
+ },
73779
74940
  "userManagement.oauthExchangeCode": {
73780
74941
  capName: "user-management",
73781
74942
  capScope: "system",
@@ -74275,7 +75436,7 @@ Object.freeze({
74275
75436
  access: "create"
74276
75437
  }
74277
75438
  });
74278
- 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;
75439
+ 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;
74279
75440
  DeviceFeature.BatteryOperated;
74280
75441
  Object.freeze({
74281
75442
  "accessories.getStatus": [{
@@ -75099,6 +76260,71 @@ Object.freeze({
75099
76260
  form: "single",
75100
76261
  optional: false
75101
76262
  }],
76263
+ "dishwasher.getStatus": [{
76264
+ name: "deviceId",
76265
+ form: "single",
76266
+ optional: false
76267
+ }],
76268
+ "dishwasher.pause": [{
76269
+ name: "deviceId",
76270
+ form: "single",
76271
+ optional: false
76272
+ }],
76273
+ "dishwasher.setChildLock": [{
76274
+ name: "deviceId",
76275
+ form: "single",
76276
+ optional: false
76277
+ }],
76278
+ "dishwasher.setExtraDry": [{
76279
+ name: "deviceId",
76280
+ form: "single",
76281
+ optional: false
76282
+ }],
76283
+ "dishwasher.setHalfLoad": [{
76284
+ name: "deviceId",
76285
+ form: "single",
76286
+ optional: false
76287
+ }],
76288
+ "dishwasher.setHygienePlus": [{
76289
+ name: "deviceId",
76290
+ form: "single",
76291
+ optional: false
76292
+ }],
76293
+ "dishwasher.setIntensiveZone": [{
76294
+ name: "deviceId",
76295
+ form: "single",
76296
+ optional: false
76297
+ }],
76298
+ "dishwasher.setOption": [{
76299
+ name: "deviceId",
76300
+ form: "single",
76301
+ optional: false
76302
+ }],
76303
+ "dishwasher.setPower": [{
76304
+ name: "deviceId",
76305
+ form: "single",
76306
+ optional: false
76307
+ }],
76308
+ "dishwasher.setProgram": [{
76309
+ name: "deviceId",
76310
+ form: "single",
76311
+ optional: false
76312
+ }],
76313
+ "dishwasher.setVarioSpeedPlus": [{
76314
+ name: "deviceId",
76315
+ form: "single",
76316
+ optional: false
76317
+ }],
76318
+ "dishwasher.start": [{
76319
+ name: "deviceId",
76320
+ form: "single",
76321
+ optional: false
76322
+ }],
76323
+ "dishwasher.stop": [{
76324
+ name: "deviceId",
76325
+ form: "single",
76326
+ optional: false
76327
+ }],
75102
76328
  "doorbell.getStatus": [{
75103
76329
  name: "deviceId",
75104
76330
  form: "single",
@@ -75168,6 +76394,11 @@ Object.freeze({
75168
76394
  form: "single",
75169
76395
  optional: false
75170
76396
  }],
76397
+ "heatingValve.getStatus": [{
76398
+ name: "deviceId",
76399
+ form: "single",
76400
+ optional: false
76401
+ }],
75171
76402
  "humidifier.getStatus": [{
75172
76403
  name: "deviceId",
75173
76404
  form: "single",
@@ -76452,6 +77683,37 @@ Object.freeze({
76452
77683
  form: "single",
76453
77684
  optional: false
76454
77685
  }],
77686
+ "records.count": [{
77687
+ name: "deviceId",
77688
+ form: "single",
77689
+ optional: true
77690
+ }],
77691
+ "records.deleteDevice": [{
77692
+ name: "deviceId",
77693
+ form: "single",
77694
+ optional: false
77695
+ }],
77696
+ "records.deleteWhere": [{
77697
+ name: "deviceId",
77698
+ form: "single",
77699
+ optional: true
77700
+ }],
77701
+ "records.histogram": [{
77702
+ name: "deviceId",
77703
+ form: "single",
77704
+ optional: true
77705
+ }],
77706
+ "records.putMany": [{
77707
+ name: "records",
77708
+ form: "object-array",
77709
+ optional: false,
77710
+ itemField: "deviceId"
77711
+ }],
77712
+ "records.query": [{
77713
+ name: "deviceId",
77714
+ form: "single",
77715
+ optional: true
77716
+ }],
76455
77717
  "sceneMonitor.captureReference": [{
76456
77718
  name: "deviceId",
76457
77719
  form: "single",
@@ -76568,6 +77830,17 @@ Object.freeze({
76568
77830
  form: "single",
76569
77831
  optional: false
76570
77832
  }],
77833
+ "storageAdmin.adoptRecords": [{
77834
+ name: "records",
77835
+ form: "object-array",
77836
+ optional: false,
77837
+ itemField: "deviceId"
77838
+ }],
77839
+ "storageAdmin.readRecords": [{
77840
+ name: "deviceId",
77841
+ form: "single",
77842
+ optional: true
77843
+ }],
76571
77844
  "streamBroker.acquireEgressTranscode": [{
76572
77845
  name: "deviceId",
76573
77846
  form: "single",
@@ -183466,7 +184739,7 @@ var DreameProviderAddon = class extends BaseDeviceProvider {
183466
184739
  super({});
183467
184740
  }
183468
184741
  async onInitialize() {
183469
- const regs = await super.onInitialize();
184742
+ const regs = this.providerRegistrationsFromSuper(await super.onInitialize());
183470
184743
  this.clients = new DreameClientRegistry(this.ctx.logger);
183471
184744
  this.clients.setOnConnected((integrationId) => {
183472
184745
  this.ctx.logger.info("Dreame: integration connected", { meta: { integrationId } });