@camstack/addon-provider-wyze 0.2.137 → 0.2.139

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 +1318 -129
  2. package/dist/addon.mjs +1318 -129
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -31,7 +31,7 @@ let net = require("net");
31
31
  net = __toESM(net, 1);
32
32
  let node_child_process = require("node:child_process");
33
33
  let node_tls = require("node:tls");
34
- //#region ../types/dist/event-category-C4hVnRo8.mjs
34
+ //#region ../types/dist/event-category-BvOFi6PY.mjs
35
35
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
36
36
  EventCategory["SystemBoot"] = "system.boot";
37
37
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -95,6 +95,24 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
95
95
  * consumes this category and maps it to the `addon-crash-loop` kind.
96
96
  */
97
97
  EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
98
+ /**
99
+ * A runner whose addon refused to start with a typed reason (D877) - parked
100
+ * in `refused`, never counted by the crash breaker, retried on operator
101
+ * action. One event per refusal.
102
+ */
103
+ EventCategory["AddonRunnerRefused"] = "addon.runner-refused";
104
+ /**
105
+ * A runner settled on a state (D877): `running` (READY), `crashed`, `failed` or
106
+ * `refused`. In-process telemetry for the boot check (re-evaluate while any
107
+ * runner is still pending) and the alert centre (close a recovered runner).
108
+ */
109
+ EventCategory["ProcessStateChanged"] = "process.state-changed";
110
+ /**
111
+ * The node's one-shot runner boot check (D877): planned runners against the
112
+ * process service, `degraded` when any is failed, refused or missing. The
113
+ * alert centre turns it into one alert and a direct critical push.
114
+ */
115
+ EventCategory["SystemRunnerCheck"] = "system.runner-check";
98
116
  EventCategory["AddonError"] = "addon.error";
99
117
  EventCategory["AddonPageReady"] = "addon.page-ready";
100
118
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5419,7 +5437,7 @@ var ZodIssueCode = {
5419
5437
  var ZodFirstPartyTypeKind;
5420
5438
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5421
5439
  //#endregion
5422
- //#region ../types/dist/sleep-DRqxtc0C.mjs
5440
+ //#region ../types/dist/sleep-BOjuyoPC.mjs
5423
5441
  /**
5424
5442
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5425
5443
  * window to float samples (D455).
@@ -5536,7 +5554,7 @@ function isKeychainStoredField(field) {
5536
5554
  var SECRET_CLEAR = { $secretClear: true };
5537
5555
  /** The `'***'` token D634 redaction writes for non-admins. */
5538
5556
  var LEGACY_DEVICE_REDACTION = "***";
5539
- function isRecord$2(value) {
5557
+ function isRecord$5(value) {
5540
5558
  return typeof value === "object" && value !== null && !Array.isArray(value);
5541
5559
  }
5542
5560
  function makeSecretMarker(ref) {
@@ -5547,12 +5565,12 @@ function makeSecretMarker(ref) {
5547
5565
  }
5548
5566
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5549
5567
  function isSecretMarker(value) {
5550
- if (!isRecord$2(value)) return false;
5568
+ if (!isRecord$5(value)) return false;
5551
5569
  const ref = value["$secret"];
5552
5570
  return typeof ref === "string" && ref.length > 0;
5553
5571
  }
5554
5572
  function isSecretClear(value) {
5555
- return isRecord$2(value) && value["$secretClear"] === true;
5573
+ return isRecord$5(value) && value["$secretClear"] === true;
5556
5574
  }
5557
5575
  /**
5558
5576
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6162,7 +6180,7 @@ var KeychainWriteRefusedError = class extends Error {
6162
6180
  }
6163
6181
  };
6164
6182
  var KEEP = { kind: "keep" };
6165
- function isRecord$1(value) {
6183
+ function isRecord$4(value) {
6166
6184
  return typeof value === "object" && value !== null && !Array.isArray(value);
6167
6185
  }
6168
6186
  function defaultMintId() {
@@ -6175,7 +6193,7 @@ function collectSecretMarkerRefs(value, out = []) {
6175
6193
  return out;
6176
6194
  }
6177
6195
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6178
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6196
+ else if (isRecord$4(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6179
6197
  return out;
6180
6198
  }
6181
6199
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6230,7 +6248,7 @@ function rowId(row, idKey) {
6230
6248
  return null;
6231
6249
  }
6232
6250
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6233
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6251
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$4) : [];
6234
6252
  if (!Array.isArray(incoming)) {
6235
6253
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6236
6254
  return {
@@ -6246,7 +6264,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6246
6264
  const kept = /* @__PURE__ */ new Set();
6247
6265
  const rows = [];
6248
6266
  for (const row of incoming) {
6249
- if (!isRecord$1(row)) {
6267
+ if (!isRecord$4(row)) {
6250
6268
  rows.push(row);
6251
6269
  continue;
6252
6270
  }
@@ -6271,7 +6289,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6271
6289
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6272
6290
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6273
6291
  case "object": {
6274
- if (!isRecord$1(incoming)) {
6292
+ if (!isRecord$4(incoming)) {
6275
6293
  if (incoming === void 0) return KEEP;
6276
6294
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6277
6295
  return {
@@ -6279,7 +6297,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6279
6297
  value: incoming
6280
6298
  };
6281
6299
  }
6282
- const storedObj = isRecord$1(stored) ? stored : {};
6300
+ const storedObj = isRecord$4(stored) ? stored : {};
6283
6301
  return {
6284
6302
  kind: "value",
6285
6303
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6402,7 +6420,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6402
6420
  value: items
6403
6421
  };
6404
6422
  }
6405
- if (isRecord$1(v)) {
6423
+ if (isRecord$4(v)) {
6406
6424
  const out = {};
6407
6425
  for (const [k, child] of Object.entries(v)) {
6408
6426
  const s = substitute(child);
@@ -6434,7 +6452,7 @@ var SecretOverwriteRefusedError = class extends Error {
6434
6452
  this.name = "SecretOverwriteRefusedError";
6435
6453
  }
6436
6454
  };
6437
- function isRecord(value) {
6455
+ function isRecord$3(value) {
6438
6456
  return typeof value === "object" && value !== null && !Array.isArray(value);
6439
6457
  }
6440
6458
  function resolvedValue(pass, marker) {
@@ -6463,7 +6481,7 @@ function inArray(pass, incoming, stored) {
6463
6481
  return incoming.map((item, index) => {
6464
6482
  const twin = stored[index];
6465
6483
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
6466
- if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
6484
+ if (isRecord$3(item) && isRecord$3(twin)) return inArrayRow(pass, item, twin);
6467
6485
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
6468
6486
  return item;
6469
6487
  });
@@ -6474,7 +6492,7 @@ function inArrayRow(pass, incoming, stored) {
6474
6492
  const twin = stored[key];
6475
6493
  if (isSecretMarker(twin)) {
6476
6494
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
6477
- } else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
6495
+ } else if (isRecord$3(value) && isRecord$3(twin)) out[key] = inArrayRow(pass, value, twin);
6478
6496
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
6479
6497
  }
6480
6498
  return out;
@@ -6482,7 +6500,7 @@ function inArrayRow(pass, incoming, stored) {
6482
6500
  async function walk(pass, incoming, stored) {
6483
6501
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
6484
6502
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
6485
- if (!isRecord(incoming) || !isRecord(stored)) return incoming;
6503
+ if (!isRecord$3(incoming) || !isRecord$3(stored)) return incoming;
6486
6504
  const out = { ...incoming };
6487
6505
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
6488
6506
  return out;
@@ -6513,7 +6531,7 @@ async function restoreUnchangedSecrets(input) {
6513
6531
  function isJsonEqual(a, b) {
6514
6532
  if (Object.is(a, b)) return true;
6515
6533
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
6516
- if (isRecord(a) && isRecord(b)) {
6534
+ if (isRecord$3(a) && isRecord$3(b)) {
6517
6535
  const keys = Object.keys(a);
6518
6536
  if (keys.length !== Object.keys(b).length) return false;
6519
6537
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -6537,7 +6555,7 @@ function markerKeysOf(blob, owner) {
6537
6555
  }
6538
6556
  function nodeFromStored(value, owner) {
6539
6557
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
6540
- if (!isRecord(value)) return null;
6558
+ if (!isRecord$3(value)) return null;
6541
6559
  const children = /* @__PURE__ */ new Map();
6542
6560
  for (const [key, child] of Object.entries(value)) {
6543
6561
  const node = nodeFromStored(child, owner);
@@ -6670,7 +6688,6 @@ function createHandle(raw, opts) {
6670
6688
  const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
6671
6689
  const readAddonStoreResult = raw.readAddonStoreResult;
6672
6690
  const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
6673
- const readDeviceStoreBatch = raw.readDeviceStoreBatch;
6674
6691
  const overrides = {
6675
6692
  readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
6676
6693
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
@@ -6694,12 +6711,12 @@ function createHandle(raw, opts) {
6694
6711
  };
6695
6712
  } } : {},
6696
6713
  readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
6697
- ...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
6698
- const rows = await readDeviceStoreBatch.call(raw, deviceIds);
6714
+ readDeviceStoreBatch: async (deviceIds) => {
6715
+ const rows = await raw.readDeviceStoreBatch(deviceIds);
6699
6716
  const out = /* @__PURE__ */ new Map();
6700
6717
  for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
6701
6718
  return out;
6702
- } } : {},
6719
+ },
6703
6720
  writeAddonStore: async (patch) => {
6704
6721
  await writeAddon(patch);
6705
6722
  },
@@ -7326,7 +7343,7 @@ var BaseAddon = class {
7326
7343
  if (!ctx) return;
7327
7344
  const addonId = ctx.id;
7328
7345
  setImmediate(() => {
7329
- ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
7346
+ ctx.api.addons.restartAddon.mutate({ addonId }).then(() => {
7330
7347
  ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
7331
7348
  }).catch((err) => {
7332
7349
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
@@ -7526,7 +7543,7 @@ var BaseAddon = class {
7526
7543
  return this._addonSecretTree;
7527
7544
  }
7528
7545
  deviceSecretTree() {
7529
- this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7546
+ this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
7530
7547
  return this._deviceSecretTree;
7531
7548
  }
7532
7549
  /**
@@ -7602,42 +7619,135 @@ var BaseAddon = class {
7602
7619
  this[timerOf] = timer;
7603
7620
  }
7604
7621
  /**
7605
- * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
7606
- * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
7607
- * swap, or any race where the SqliteSettingsBackend is between shutdown and
7608
- * re-initialize) doesn't propagate up into `initialize()` and leave the
7622
+ * Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
7623
+ * settings-store outage doesn't propagate up into `initialize()` and leave the
7609
7624
  * addon permanently broken.
7610
7625
  *
7611
- * Retry only the two known infra fingerprints. Anything else propagates so
7612
- * real bugs surface immediately. After the budget expires we fall back to
7613
- * `{}` (defaults) — the addon's first successful patch will rehydrate.
7626
+ * Two kinds of outage, two budgets:
7627
+ * - the store's own restart fingerprints (`SqliteSettingsBackend not
7628
+ * initialized`, `provider not available`): a short budget, then the addon
7629
+ * falls back to `{}` (defaults) - its first successful patch rehydrates;
7630
+ * - a TRANSPORT failure (the hub is restarting while this runner boots:
7631
+ * `discovery deadline exceeded`, `parent could not route`, a refused or
7632
+ * timed-out connection). Since D870 a runner's settings read THROWS instead
7633
+ * of answering `{}`, so without a budget a hub restart ends in a respawn
7634
+ * loop. A long, bounded budget; only after it the error propagates - the
7635
+ * addon never runs on defaults for a store it could not ask.
7636
+ * Anything else propagates immediately so real bugs surface.
7614
7637
  */
7615
7638
  async readAddonStoreWithRetry() {
7616
7639
  const settings = this.rawSettings();
7617
7640
  if (!settings) return {};
7618
- const delaysMs = [
7619
- 150,
7620
- 350,
7621
- 600,
7622
- 900
7623
- ];
7624
7641
  let lastErr;
7625
- for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
7642
+ for (let attempt = 0;; attempt++) try {
7626
7643
  const stored = await settings.readAddonStore() ?? {};
7627
7644
  this.settingsStoreReady = true;
7628
7645
  return stored;
7629
7646
  } catch (err) {
7630
7647
  lastErr = err;
7631
- const msg = err instanceof Error ? err.message : String(err);
7632
- if (!(msg.includes("SqliteSettingsBackend not initialized") || msg.includes("provider not available"))) throw err;
7633
- if (attempt === delaysMs.length) break;
7634
- await new Promise((r) => setTimeout(r, delaysMs[attempt]));
7648
+ const kind = classifyStoreError(err);
7649
+ if (kind === "permanent") throw err;
7650
+ const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
7651
+ if (delay === void 0) {
7652
+ if (kind === "transport") throw err;
7653
+ break;
7654
+ }
7655
+ await new Promise((r) => setTimeout(r, delay));
7635
7656
  }
7636
7657
  this.settingsStoreReady = false;
7637
7658
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
7638
7659
  return {};
7639
7660
  }
7640
7661
  };
7662
+ /** The settings store's own restart fingerprints. */
7663
+ var RESTART_RETRY_DELAYS_MS = [
7664
+ 150,
7665
+ 350,
7666
+ 600,
7667
+ 900
7668
+ ];
7669
+ /** A hub restarting under a booting runner: ~100 s in total. */
7670
+ var TRANSPORT_RETRY_DELAYS_MS = [
7671
+ 150,
7672
+ 350,
7673
+ 600,
7674
+ 900,
7675
+ 2e3,
7676
+ 5e3,
7677
+ 1e4,
7678
+ 2e4,
7679
+ 3e4,
7680
+ 3e4
7681
+ ];
7682
+ var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
7683
+ /** Node / socket error codes of a connection that did not happen or broke. */
7684
+ var TRANSPORT_CODES = new Set([
7685
+ "ECONNREFUSED",
7686
+ "ECONNRESET",
7687
+ "ETIMEDOUT",
7688
+ "EPIPE",
7689
+ "EHOSTUNREACH",
7690
+ "ENETUNREACH"
7691
+ ]);
7692
+ /** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
7693
+ var UNAVAILABLE_TRPC_CODES = new Set([
7694
+ "TIMEOUT",
7695
+ "SERVICE_UNAVAILABLE",
7696
+ "BAD_GATEWAY",
7697
+ "GATEWAY_TIMEOUT"
7698
+ ]);
7699
+ /** The exact phrases OUR transport raises when it cannot reach the hub. */
7700
+ var TRANSPORT_PHRASES = [
7701
+ "discovery deadline exceeded",
7702
+ "parent could not route child unowned cap call",
7703
+ "UDS request timed out after",
7704
+ "channel closed"
7705
+ ];
7706
+ /** Moleculer error `type`s of a call that could not be served right now. */
7707
+ var MOLECULER_TRANSIENT_TYPES = new Set([
7708
+ "REQUEST_TIMEOUT",
7709
+ "SERVICE_NOT_FOUND",
7710
+ "SERVICE_NOT_AVAILABLE",
7711
+ "REQUEST_REJECTED",
7712
+ "BROKER_DISCONNECTED"
7713
+ ]);
7714
+ function stringProp(value, key) {
7715
+ if (typeof value !== "object" || value === null) return void 0;
7716
+ const found = Reflect.get(value, key);
7717
+ return typeof found === "string" ? found : void 0;
7718
+ }
7719
+ /** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
7720
+ function errorCode(err) {
7721
+ const out = {};
7722
+ const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
7723
+ const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
7724
+ const node = stringProp(err, "code") ?? stringProp(cause, "code");
7725
+ if (node !== void 0) out.node = node;
7726
+ const trpc = stringProp(data, "code");
7727
+ if (trpc !== void 0) out.trpc = trpc;
7728
+ return out;
7729
+ }
7730
+ /**
7731
+ * Is a settings read failure worth retrying, and with which budget? Only
7732
+ * EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
7733
+ * one of the exact phrases our own transport raises. A message that merely
7734
+ * contains "timed out" or "unreachable" is not evidence of anything, and
7735
+ * `settings store not wired` is a wiring bug that retrying cannot fix.
7736
+ */
7737
+ function classifyStoreError(err) {
7738
+ const message = err instanceof Error ? err.message : String(err);
7739
+ if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
7740
+ const code = errorCode(err);
7741
+ if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
7742
+ if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
7743
+ if (typeof err === "object" && err !== null) {
7744
+ if (Reflect.get(err, "retryable") === true) return "transport";
7745
+ const type = stringProp(err, "type");
7746
+ if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
7747
+ }
7748
+ if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
7749
+ return "permanent";
7750
+ }
7641
7751
  /**
7642
7752
  * Collect the keys of every field marked `perNode: true`, recursing into
7643
7753
  * layout containers (`group` fields and `sub-tabs` tabs) the same way
@@ -7727,6 +7837,156 @@ var PeerBytesTicketSchema = object({
7727
7837
  */
7728
7838
  declaredBytes: number().int().nonnegative().nullable()
7729
7839
  });
7840
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
7841
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
7842
+ var RECORD_DATABASES = ["settings", "events"];
7843
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
7844
+ var RECORD_CLASSES = [
7845
+ "config",
7846
+ "ledger",
7847
+ "audit",
7848
+ "mirror",
7849
+ "ephemeral"
7850
+ ];
7851
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
7852
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
7853
+ var RECORD_BATCH_MAX = 1e3;
7854
+ var RECORD_QUERY_MAX = 1e3;
7855
+ function defOf(schema) {
7856
+ const zodBag = Reflect.get(schema, "_zod");
7857
+ if (typeof zodBag !== "object" || zodBag === null) return {};
7858
+ const def = Reflect.get(zodBag, "def");
7859
+ if (typeof def !== "object" || def === null) return {};
7860
+ return def;
7861
+ }
7862
+ function declaredHere(schema) {
7863
+ return globalRegistry.get(schema)?.secret === true;
7864
+ }
7865
+ /** Wrapper kinds whose `innerType` is the field itself. */
7866
+ var WRAPPERS = new Set([
7867
+ "optional",
7868
+ "nullable",
7869
+ "default",
7870
+ "prefault",
7871
+ "catch",
7872
+ "readonly",
7873
+ "nonoptional"
7874
+ ]);
7875
+ /**
7876
+ * The schema layers that make up ONE field: the schema itself and every
7877
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
7878
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
7879
+ * `.transform` on `in`).
7880
+ */
7881
+ function layersOf(schema) {
7882
+ const out = [];
7883
+ const queue = [schema];
7884
+ while (queue.length > 0) {
7885
+ const s = queue.shift();
7886
+ if (!s || out.includes(s)) continue;
7887
+ out.push(s);
7888
+ const def = defOf(s);
7889
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
7890
+ if (def.type === "pipe") {
7891
+ if (def.in) queue.push(def.in);
7892
+ if (def.out) queue.push(def.out);
7893
+ }
7894
+ }
7895
+ return out;
7896
+ }
7897
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
7898
+ function isZodSecret(schema) {
7899
+ return layersOf(schema).some(declaredHere);
7900
+ }
7901
+ /**
7902
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
7903
+ * element of this array" (`connection.password`, `rows[].token`). A declared
7904
+ * object or array is reported as one path and not descended into — everything
7905
+ * under it is secret.
7906
+ */
7907
+ function collectZodSecretPaths(schema, prefix = "") {
7908
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
7909
+ const paths = [];
7910
+ for (const layer of layersOf(schema)) {
7911
+ const def = defOf(layer);
7912
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
7913
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
7914
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
7915
+ else if (def.type === "intersection") {
7916
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
7917
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
7918
+ }
7919
+ }
7920
+ return [...new Set(paths)];
7921
+ }
7922
+ /**
7923
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
7924
+ * Zod row schema that describes it, and the helper that turns the two into the
7925
+ * JSON the engine stores.
7926
+ *
7927
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
7928
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
7929
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
7930
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
7931
+ * never a field name (D879).
7932
+ */
7933
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
7934
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
7935
+ var RecordIndexSchema = object({
7936
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
7937
+ fields: array(RecordFieldPathSchema).min(1).max(4),
7938
+ unique: boolean().optional()
7939
+ }).strict();
7940
+ var RecordRetentionSchema = union([
7941
+ object({
7942
+ ttlMs: number().int().positive(),
7943
+ from: _enum(["at", "write"])
7944
+ }).strict(),
7945
+ object({
7946
+ maxRows: number().int().positive().optional(),
7947
+ maxRowsPerDevice: number().int().positive().optional()
7948
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
7949
+ object({
7950
+ owner: string().min(1),
7951
+ reason: string().min(1)
7952
+ }).strict(),
7953
+ object({ none: string().min(1) }).strict()
7954
+ ]);
7955
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
7956
+ var EntryDescriptorSchema = object({
7957
+ title: string().min(1),
7958
+ /** The record body field shown as the entry's name. */
7959
+ nameField: string().min(1),
7960
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
7961
+ fields: record(string(), unknown())
7962
+ }).strict();
7963
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
7964
+ var RecordKindDeclarationSchema = object({
7965
+ database: _enum(RECORD_DATABASES).default("settings"),
7966
+ class: _enum(RECORD_CLASSES),
7967
+ writeTrigger: string().min(1),
7968
+ device: _enum([
7969
+ "required",
7970
+ "optional",
7971
+ "none"
7972
+ ]).default("none"),
7973
+ at: _enum(["required", "none"]).default("none"),
7974
+ indexes: array(RecordIndexSchema).max(8).default([]),
7975
+ retention: RecordRetentionSchema,
7976
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
7977
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
7978
+ /** Derived from the Zod schema; never written by hand. */
7979
+ secretPaths: array(string().min(1)).default([]),
7980
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
7981
+ secretArrayKeys: record(string(), string()).default({}),
7982
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
7983
+ adoptsFrom: string().min(1).optional(),
7984
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
7985
+ transactFamily: string().min(1).optional(),
7986
+ entry: EntryDescriptorSchema.optional()
7987
+ }).strict();
7988
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
7989
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7730
7990
  /** Shared Zod schemas used across streaming capabilities. */
7731
7991
  var CamProfileSchema = _enum([
7732
7992
  "high",
@@ -8191,69 +8451,6 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
8191
8451
  kind: "mutation",
8192
8452
  auth: "admin"
8193
8453
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
8194
- function defOf(schema) {
8195
- return schema._zod?.def ?? {};
8196
- }
8197
- function declaredHere(schema) {
8198
- return globalRegistry.get(schema)?.secret === true;
8199
- }
8200
- /** Wrapper kinds whose `innerType` is the field itself. */
8201
- var WRAPPERS = new Set([
8202
- "optional",
8203
- "nullable",
8204
- "default",
8205
- "prefault",
8206
- "catch",
8207
- "readonly",
8208
- "nonoptional"
8209
- ]);
8210
- /**
8211
- * The schema layers that make up ONE field: the schema itself and every
8212
- * wrapper below it (optional / default / nullable / readonly / catch), plus
8213
- * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
8214
- * `.transform` on `in`).
8215
- */
8216
- function layersOf(schema) {
8217
- const out = [];
8218
- const queue = [schema];
8219
- while (queue.length > 0) {
8220
- const s = queue.shift();
8221
- if (!s || out.includes(s)) continue;
8222
- out.push(s);
8223
- const def = defOf(s);
8224
- if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
8225
- if (def.type === "pipe") {
8226
- if (def.in) queue.push(def.in);
8227
- if (def.out) queue.push(def.out);
8228
- }
8229
- }
8230
- return out;
8231
- }
8232
- /** True when any layer of this field declares `.meta({ secret: true })`. */
8233
- function isZodSecret(schema) {
8234
- return layersOf(schema).some(declaredHere);
8235
- }
8236
- /**
8237
- * Every declared secret path in a config schema: dotted keys, `[]` for "each
8238
- * element of this array" (`connection.password`, `rows[].token`). A declared
8239
- * object or array is reported as one path and not descended into — everything
8240
- * under it is secret.
8241
- */
8242
- function collectZodSecretPaths(schema, prefix = "") {
8243
- if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
8244
- const paths = [];
8245
- for (const layer of layersOf(schema)) {
8246
- const def = defOf(layer);
8247
- if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
8248
- else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
8249
- else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
8250
- else if (def.type === "intersection") {
8251
- if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
8252
- if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
8253
- }
8254
- }
8255
- return [...new Set(paths)];
8256
- }
8257
8454
  object({
8258
8455
  code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
8259
8456
  params: record(string(), union([string(), number()])).optional()
@@ -8273,7 +8470,7 @@ function userError(code, params, englishFallback) {
8273
8470
  return new CamstackError(code, params, englishFallback);
8274
8471
  }
8275
8472
  //#endregion
8276
- //#region ../types/dist/err-msg-DLerKiVO.mjs
8473
+ //#region ../types/dist/err-msg-BXKzRBwg.mjs
8277
8474
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
8278
8475
  DeviceType["Camera"] = "camera";
8279
8476
  DeviceType["Hub"] = "hub";
@@ -8365,6 +8562,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
8365
8562
  * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
8366
8563
  * integrations sharing the same food/desiccant/hopper surface. */
8367
8564
  DeviceType["PetFeeder"] = "pet-feeder";
8565
+ /** Built-in dishwasher — program lifecycle, door / remote-start gates,
8566
+ * salt and rinse-aid levels. Installed with the `dishwasher` cap.
8567
+ * Sources: native Bosch Home Connect, reusable by similar integrations. */
8568
+ DeviceType["Dishwasher"] = "dishwasher";
8368
8569
  return DeviceType;
8369
8570
  }({});
8370
8571
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -8542,6 +8743,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8542
8743
  /** Virtual HA toggle (input_boolean.*) — distinguishable from a
8543
8744
  * real Switch device for UI rendering / export adapters. */
8544
8745
  DeviceRole["BinaryHelper"] = "binary-helper";
8746
+ /** A smart plug: a `switch` whose source says it is an outlet (HA
8747
+ * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
8748
+ DeviceRole["Outlet"] = "outlet";
8545
8749
  /** Generic motion / occupancy / moving event source. Distinct from
8546
8750
  * the camera accessory PirSensor role: that one is a camera child;
8547
8751
  * this is a standalone HA / 3rd-party motion sensor. */
@@ -8619,7 +8823,7 @@ function errMsg(err) {
8619
8823
  return String(err);
8620
8824
  }
8621
8825
  //#endregion
8622
- //#region ../types/dist/composition-EQ9Ok0Ee.mjs
8826
+ //#region ../types/dist/composition-CB6PMT9p.mjs
8623
8827
  /**
8624
8828
  * The ffmpeg build every CamStack node downloads, per platform and arch.
8625
8829
  *
@@ -11843,11 +12047,10 @@ var ClipModelMetaSchema = object({
11843
12047
  /**
11844
12048
  * The `vector-store` index this model's vectors live in. ONE feature space
11845
12049
  * per index: two models share an index only when their vectors are ranked
11846
- * against each other, which for CLIP means never across families. MobileCLIP
11847
- * S1 and S2 share `object-clip` for history (separated by the row's
11848
- * `modelId`); any other model gets its own.
12050
+ * against each other, which for CLIP means never across families. Every
12051
+ * model gets its own.
11849
12052
  */
11850
- vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
12053
+ vectorIndex: string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
11851
12054
  /**
11852
12055
  * The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
11853
12056
  * must be unique per tokenizer: every model's siblings land in ONE flat
@@ -13026,8 +13229,13 @@ var AlertSeveritySchema = _enum([
13026
13229
  "info",
13027
13230
  "success",
13028
13231
  "warning",
13029
- "error"
13232
+ "error",
13233
+ "critical"
13030
13234
  ]);
13235
+ var AlertActionSchema = object({
13236
+ label: string(),
13237
+ href: string().optional()
13238
+ });
13031
13239
  var AlertStatusSchema = _enum([
13032
13240
  "active",
13033
13241
  "in-progress",
@@ -13045,6 +13253,7 @@ var AlertSchema = object({
13045
13253
  severity: AlertSeveritySchema,
13046
13254
  title: string(),
13047
13255
  message: string(),
13256
+ action: AlertActionSchema.optional(),
13048
13257
  status: AlertStatusSchema,
13049
13258
  progress: number().optional(),
13050
13259
  read: boolean(),
@@ -15580,6 +15789,41 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
15580
15789
  keyField: string()
15581
15790
  }).optional()
15582
15791
  })) });
15792
+ /**
15793
+ * The report of a one-shot "move this owner's plaintext secrets into the
15794
+ * keychain" run (D878). COUNTS only - never a value, never a ref.
15795
+ *
15796
+ * The owner runs it on its own rows, through its own write path; an operator
15797
+ * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
15798
+ * Dry run (`apply: false`) reports what WOULD move and changes nothing.
15799
+ */
15800
+ var RawSecretMigrationInputSchema = object({
15801
+ /** `false` (the default of the script) = report only. */
15802
+ apply: boolean() });
15803
+ var RawSecretMigrationReportSchema = object({
15804
+ apply: boolean(),
15805
+ /** Rows that can carry a secret (a profile, an enrolment). */
15806
+ rows: number().int(),
15807
+ /** Rows whose secret was plaintext when the run started. */
15808
+ raw: number().int(),
15809
+ /** Rows that already held a keychain marker when the run started. */
15810
+ markers: number().int(),
15811
+ /** Plaintext rows moved by THIS run (always 0 on a dry run). */
15812
+ migrated: number().int(),
15813
+ /** Plaintext rows left in place because the move or its read-back failed. */
15814
+ failed: number().int(),
15815
+ /** After the run: rows still holding plaintext. */
15816
+ remainingRaw: number().int(),
15817
+ /** After the run: markers the keychain could not resolve right now. */
15818
+ unresolvedMarkers: number().int(),
15819
+ /**
15820
+ * A second, redundant copy of the secrets' rows that the run found (and, on
15821
+ * `apply`, deleted after verifying the first). Owners with a single copy omit it.
15822
+ */
15823
+ redundantCopies: number().int().optional(),
15824
+ /** True when nothing is raw and every marker resolves. */
15825
+ verified: boolean()
15826
+ });
15583
15827
  /** Where a block runs. The operator chooses — a block driving a device on an
15584
15828
  * agent is the reason placement is not fixed to the hub. */
15585
15829
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -15806,6 +16050,9 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
15806
16050
  }), SettingsUpdateResultSchema, {
15807
16051
  kind: "mutation",
15808
16052
  auth: "admin"
16053
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
16054
+ kind: "mutation",
16055
+ auth: "admin"
15809
16056
  }), method(object({}), object({ libs: array(object({
15810
16057
  filePath: string(),
15811
16058
  content: string()
@@ -16069,6 +16316,347 @@ id: union([string(), number()]) }), {
16069
16316
  auth: "admin"
16070
16317
  });
16071
16318
  /**
16319
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16320
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16321
+ * (operator intent, D870) and device-history (numbers over time, D850).
16322
+ *
16323
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16324
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16325
+ * that with the addon id closed over). It is deliberately NOT in any input
16326
+ * schema, so a session can never supply it, and a call with no stamp is refused
16327
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16328
+ * addons go through the owner's capability.
16329
+ *
16330
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16331
+ * never `[]`. Secret fields are never on the wire: a read shows the
16332
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16333
+ * resolves itself, and a write may carry only a keychain marker bound to the
16334
+ * row's own ref.
16335
+ *
16336
+ * Internal: addons reach it through `ctx.records`, never directly.
16337
+ */
16338
+ var RecordIdSchema = string().min(1).max(256);
16339
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16340
+ var RecordBodySchema = record(string(), unknown());
16341
+ var RecordInputSchema = object({
16342
+ id: RecordIdSchema,
16343
+ /** The device this row belongs to (D865 removal, per-device reads). */
16344
+ deviceId: number().int().optional(),
16345
+ /** The domain clock, ms: observed / created / opened. */
16346
+ at: number().int().optional(),
16347
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16348
+ expiresAt: number().int().optional(),
16349
+ data: RecordBodySchema
16350
+ });
16351
+ var RecordViewSchema = object({
16352
+ id: string(),
16353
+ deviceId: number().int().nullable(),
16354
+ at: number().nullable(),
16355
+ expiresAt: number().nullable(),
16356
+ rev: number().int(),
16357
+ updatedAt: number(),
16358
+ data: RecordBodySchema
16359
+ });
16360
+ /** Declared index fields only. Anything else does not compile, by design. */
16361
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16362
+ string(),
16363
+ number(),
16364
+ boolean(),
16365
+ object({ in: array(union([
16366
+ string(),
16367
+ number(),
16368
+ boolean()
16369
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16370
+ object({
16371
+ gt: union([string(), number()]).optional(),
16372
+ gte: union([string(), number()]).optional(),
16373
+ lt: union([string(), number()]).optional(),
16374
+ lte: union([string(), number()]).optional()
16375
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16376
+ ]));
16377
+ var KindShape = { kind: RecordKindNameSchema };
16378
+ var TimeWindowShape = {
16379
+ deviceId: number().int().optional(),
16380
+ atFrom: number().optional(),
16381
+ atTo: number().optional()
16382
+ };
16383
+ var RecordQueryInputSchema = object({
16384
+ ...KindShape,
16385
+ ...TimeWindowShape,
16386
+ where: RecordWhereSchema.optional(),
16387
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16388
+ order: _enum(["at", "id"]).optional(),
16389
+ desc: boolean().optional(),
16390
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16391
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16392
+ cursor: string().min(1).optional()
16393
+ });
16394
+ var RecordQueryResultSchema = object({
16395
+ records: array(RecordViewSchema),
16396
+ nextCursor: string().nullable()
16397
+ });
16398
+ var RecordKindStateSchema = _enum([
16399
+ "created",
16400
+ "unchanged",
16401
+ "updated"
16402
+ ]);
16403
+ var DeclareKindResultSchema = object({
16404
+ kindId: number().int(),
16405
+ state: RecordKindStateSchema,
16406
+ createdIndexes: array(string()),
16407
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16408
+ adoptionPending: object({
16409
+ legacyTable: string(),
16410
+ legacyRows: number().int()
16411
+ }).nullable()
16412
+ });
16413
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16414
+ var SecretRefsList = array(string());
16415
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16416
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16417
+ kind: "mutation",
16418
+ auth: "admin"
16419
+ }), method(object({
16420
+ ...KindShape,
16421
+ id: RecordIdSchema
16422
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16423
+ ...KindShape,
16424
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16425
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16426
+ ...KindShape,
16427
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16428
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16429
+ ...KindShape,
16430
+ record: RecordInputSchema,
16431
+ /** Compare-and-set. `0` means "the row must not exist". */
16432
+ ifRev: number().int().min(0).optional()
16433
+ }), object({
16434
+ rev: number().int(),
16435
+ releasedRefs: SecretRefsList
16436
+ }), {
16437
+ kind: "mutation",
16438
+ auth: "admin"
16439
+ }), method(object({
16440
+ ...KindShape,
16441
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16442
+ }), object({
16443
+ count: number().int(),
16444
+ releasedRefs: SecretRefsList
16445
+ }), {
16446
+ kind: "mutation",
16447
+ auth: "admin"
16448
+ }), method(object({
16449
+ ...KindShape,
16450
+ id: RecordIdSchema,
16451
+ data: RecordBodySchema,
16452
+ at: number().int().nullable().optional(),
16453
+ expiresAt: number().int().nullable().optional(),
16454
+ ifRev: number().int().min(1).optional()
16455
+ }), object({
16456
+ rev: number().int(),
16457
+ releasedRefs: SecretRefsList
16458
+ }), {
16459
+ kind: "mutation",
16460
+ auth: "admin"
16461
+ }), method(object({
16462
+ ...KindShape,
16463
+ id: RecordIdSchema
16464
+ }), object({
16465
+ deleted: boolean(),
16466
+ secretRefs: SecretRefsList
16467
+ }), {
16468
+ kind: "mutation",
16469
+ auth: "admin"
16470
+ }), method(object({
16471
+ ...KindShape,
16472
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16473
+ }), object({
16474
+ deleted: number().int(),
16475
+ secretRefs: SecretRefsList
16476
+ }), {
16477
+ kind: "mutation",
16478
+ auth: "admin"
16479
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16480
+ ...KindShape,
16481
+ ...TimeWindowShape,
16482
+ where: RecordWhereSchema.optional()
16483
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16484
+ ...KindShape,
16485
+ deviceId: number().int().optional(),
16486
+ from: number(),
16487
+ to: number(),
16488
+ bucketMs: number().int().positive()
16489
+ }), object({ buckets: array(object({
16490
+ bucketStart: number(),
16491
+ count: number().int()
16492
+ })) }), { auth: "admin" }), method(object({
16493
+ ...KindShape,
16494
+ op: _enum([
16495
+ "sum",
16496
+ "min",
16497
+ "max",
16498
+ "count"
16499
+ ]),
16500
+ field: RecordFieldPathSchema.optional(),
16501
+ groupBy: RecordFieldPathSchema.optional(),
16502
+ where: RecordWhereSchema.optional()
16503
+ }), object({ rows: array(object({
16504
+ group: union([
16505
+ string(),
16506
+ number(),
16507
+ _null()
16508
+ ]),
16509
+ value: number().nullable()
16510
+ })) }), { auth: "admin" }), method(object({
16511
+ ...KindShape,
16512
+ deviceId: number().int().optional(),
16513
+ atBefore: number().optional(),
16514
+ where: RecordWhereSchema.optional()
16515
+ }), object({
16516
+ deleted: number().int(),
16517
+ secretRefs: SecretRefsList
16518
+ }), {
16519
+ kind: "mutation",
16520
+ auth: "admin"
16521
+ }), method(object({
16522
+ deviceId: number().int(),
16523
+ kinds: array(RecordKindNameSchema).optional()
16524
+ }), object({
16525
+ deleted: record(string(), number().int()),
16526
+ secretRefs: SecretRefsList
16527
+ }), {
16528
+ kind: "mutation",
16529
+ auth: "admin"
16530
+ }), method(object(KindShape), object({ id: number().int() }), {
16531
+ kind: "mutation",
16532
+ auth: "admin"
16533
+ });
16534
+ /** One table of the settings database. */
16535
+ var StorageTableSchema = object({
16536
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
16537
+ name: string(),
16538
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
16539
+ owner: string().nullable(),
16540
+ rows: number().int().nonnegative(),
16541
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
16542
+ bytes: number().int().nonnegative().nullable(),
16543
+ /** Declared by an addon since this engine process started (a running addon claims it). */
16544
+ declaredThisBoot: boolean()
16545
+ });
16546
+ /** One declared record kind (D881) as System -> Data shows it. */
16547
+ var StorageKindSchema = object({
16548
+ owner: string(),
16549
+ kind: string(),
16550
+ database: _enum(["settings", "events"]),
16551
+ class: string(),
16552
+ state: _enum([
16553
+ "declared",
16554
+ "orphaned",
16555
+ "dropped"
16556
+ ]),
16557
+ /** `null` when the caller asked for no counts (`counts: false`). */
16558
+ rows: number().int().nonnegative().nullable(),
16559
+ /** Rows x the average size of a sample; null for an empty kind. */
16560
+ bytesEstimate: number().int().nonnegative().nullable(),
16561
+ writeTrigger: string(),
16562
+ retention: RecordRetentionSchema,
16563
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16564
+ entry: boolean(),
16565
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16566
+ declaration: RecordKindDeclarationSchema
16567
+ });
16568
+ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16569
+ collection: string().min(1),
16570
+ expectRows: number().int().nonnegative()
16571
+ }), object({
16572
+ dropped: literal(true),
16573
+ rows: number().int().nonnegative()
16574
+ }), {
16575
+ kind: "mutation",
16576
+ auth: "admin"
16577
+ }), method(object({
16578
+ owner: string().min(1).optional(),
16579
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16580
+ counts: boolean().optional()
16581
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16582
+ owner: string().min(1),
16583
+ kind: RecordKindNameSchema
16584
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16585
+ owner: string().min(1),
16586
+ kind: RecordKindNameSchema,
16587
+ records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
16588
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16589
+ complete: boolean().optional()
16590
+ }).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
16591
+ kind: "mutation",
16592
+ auth: "admin"
16593
+ }), method(object({
16594
+ collection: string().min(1),
16595
+ cursor: string().optional(),
16596
+ limit: number().int().min(1).max(1e3).optional()
16597
+ }), object({
16598
+ rows: array(object({
16599
+ id: string(),
16600
+ data: record(string(), unknown())
16601
+ })),
16602
+ nextCursor: string().nullable()
16603
+ }), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
16604
+ /**
16605
+ * record-entries - the ONE admin surface for every list of user-created entries
16606
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16607
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16608
+ *
16609
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16610
+ * the entry body with `secret: true` on every credential field, so a password
16611
+ * field is derived from the schema and never from a name. `putEntry` takes the
16612
+ * redaction token for an untouched secret (the stored value is kept), a string
16613
+ * for a new one, and the clear instruction to remove one. A read never carries
16614
+ * a secret value, and a locked keychain refuses the write with
16615
+ * `records/secret-unavailable` instead of storing plaintext.
16616
+ *
16617
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
16618
+ */
16619
+ var EntryKindInfoSchema = object({
16620
+ owner: string(),
16621
+ kind: RecordKindNameSchema,
16622
+ title: string(),
16623
+ nameField: string(),
16624
+ /** JSON Schema of the body; `secret: true` marks a password field. */
16625
+ fields: record(string(), unknown()),
16626
+ secretPaths: array(string()),
16627
+ rows: number().int().nonnegative()
16628
+ });
16629
+ var EntryViewSchema = object({
16630
+ id: RecordIdSchema,
16631
+ name: string(),
16632
+ rev: number().int(),
16633
+ updatedAt: number(),
16634
+ /** Secret fields hold the redaction token. */
16635
+ data: RecordBodySchema
16636
+ });
16637
+ var EntryAddress = {
16638
+ owner: string().min(1),
16639
+ kind: RecordKindNameSchema
16640
+ };
16641
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
16642
+ ...EntryAddress,
16643
+ id: RecordIdSchema.optional(),
16644
+ data: RecordBodySchema,
16645
+ ifRev: number().int().min(1).optional()
16646
+ }), object({
16647
+ id: string(),
16648
+ rev: number().int()
16649
+ }), {
16650
+ kind: "mutation",
16651
+ auth: "admin"
16652
+ }), method(object({
16653
+ ...EntryAddress,
16654
+ id: RecordIdSchema
16655
+ }), object({ deleted: boolean() }), {
16656
+ kind: "mutation",
16657
+ auth: "admin"
16658
+ });
16659
+ /**
16072
16660
  * `keychain` — the hub's encrypted store of secret values (D787).
16073
16661
  *
16074
16662
  * Settings blobs never hold a secret: they hold a marker
@@ -16609,6 +17197,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
16609
17197
  kind: "mutation",
16610
17198
  auth: "admin",
16611
17199
  caller: "required"
17200
+ }), method(object({
17201
+ ref: string().min(1),
17202
+ value: string().min(1)
17203
+ }), object({
17204
+ ref: string(),
17205
+ version: number().int()
17206
+ }), {
17207
+ kind: "mutation",
17208
+ auth: "admin",
17209
+ caller: "required"
16612
17210
  }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
16613
17211
  deleted: array(string()).readonly(),
16614
17212
  kept: array(object({
@@ -39287,6 +39885,9 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
39287
39885
  }), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
39288
39886
  kind: "mutation",
39289
39887
  auth: "admin"
39888
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
39889
+ kind: "mutation",
39890
+ auth: "admin"
39290
39891
  }), method(ProfileRefInputSchema, _void(), {
39291
39892
  kind: "mutation",
39292
39893
  auth: "admin"
@@ -49796,6 +50397,41 @@ var ServerRollbackInfoSchema = object({
49796
50397
  atMs: number(),
49797
50398
  reason: string()
49798
50399
  });
50400
+ /**
50401
+ * The runner boot check (D877): the runners this node PLANNED (hub: one per
50402
+ * `resolveRunnerId` over its forked addons; agent: the runners its process
50403
+ * service holds, because only the hub plans) against the states the process
50404
+ * service reports. Kept in memory, recomputed by the same one-shot check after
50405
+ * every boot, served on `getServerPackageStatus`.
50406
+ *
50407
+ * `failed` is the D6 breaker's terminal state, `refused` a deterministic Init
50408
+ * refusal (an addon that said "I will not start, and here is why"), `missing` a
50409
+ * planned runner the process service has no entry for.
50410
+ */
50411
+ var RunnerRefusalSchema = object({
50412
+ runnerId: string(),
50413
+ addonIds: array(string()),
50414
+ reason: string()
50415
+ });
50416
+ var RunnerBootCheckSchema = object({
50417
+ checkedAtMs: number(),
50418
+ /** Runners planned for this node. */
50419
+ expected: number(),
50420
+ /** Planned runners whose process is `running`. */
50421
+ running: number(),
50422
+ failed: array(string()),
50423
+ refused: array(RunnerRefusalSchema),
50424
+ missing: array(string()),
50425
+ /**
50426
+ * Runners still on their way: `starting`, or `crashed` waiting on a backoff
50427
+ * respawn. The check is FINAL only when this is empty; until then nothing is
50428
+ * pushed and the verdict is re-evaluated on the next runner state change.
50429
+ * Optional for version skew (absent = settled).
50430
+ */
50431
+ pending: array(string()).optional(),
50432
+ /** True when the plan is the hub's (`missing` is then meaningful); false on an agent. */
50433
+ planKnown: boolean()
50434
+ });
49799
50435
  var ServerPackageStatusSchema = object({
49800
50436
  /** Root package name (`@camstack/server` on the hub). */
49801
50437
  packageName: string(),
@@ -49858,7 +50494,14 @@ var ServerPackageStatusSchema = object({
49858
50494
  * for version skew: an older provider's payload simply omits it, and an
49859
50495
  * absent wrapper is unknown — never `native`.
49860
50496
  */
49861
- wrapper: WrapperIdentitySchema.optional()
50497
+ wrapper: WrapperIdentitySchema.optional(),
50498
+ /**
50499
+ * What this node PLANNED to run against what its process service reports
50500
+ * (D877). Absent until the one-shot boot check has run (~60 s after boot) and
50501
+ * on a provider that predates it. Absent is "not checked yet", never "all
50502
+ * well": a consumer that needs the answer treats it as pending.
50503
+ */
50504
+ runners: RunnerBootCheckSchema.optional()
49862
50505
  });
49863
50506
  var ServerUpdateCheckResultSchema = object({
49864
50507
  packageName: string(),
@@ -49909,6 +50552,13 @@ var ServerUpdateOutcomeSchema = _enum([
49909
50552
  "refused",
49910
50553
  "failed"
49911
50554
  ]);
50555
+ /** One addon the pre-flight found the target version would refuse (D877). */
50556
+ var UpdateBlockerSchema = object({
50557
+ addonId: string(),
50558
+ reason: string(),
50559
+ /** What the operator does about it. */
50560
+ remedy: string()
50561
+ });
49912
50562
  var ServerUpdateActionResultSchema = object({
49913
50563
  accepted: boolean(),
49914
50564
  targetVersion: string().nullable(),
@@ -49926,14 +50576,27 @@ var ServerUpdateActionResultSchema = object({
49926
50576
  * The failure itself, verbatim enough to act on (the npm output for a
49927
50577
  * staging install). Non-null only for `failed`.
49928
50578
  */
49929
- error: string().nullable().optional()
50579
+ error: string().nullable().optional(),
50580
+ /**
50581
+ * The addons the target version would refuse to start on this node's live
50582
+ * store (D877), present when the pre-flight refused the update
50583
+ * (`reason: 'addon-would-refuse'`). Optional for version skew.
50584
+ */
50585
+ blockers: array(UpdateBlockerSchema).optional()
49930
50586
  });
49931
50587
  method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
49932
50588
  kind: "mutation",
49933
50589
  auth: "admin"
49934
- }), method(object({
49935
- /** Explicit target version; omitted = latest from the registry. */
49936
- version: string().optional() }), ServerUpdateActionResultSchema, {
50590
+ }), method(object({
50591
+ /** Explicit target version; omitted = latest from the registry. */
50592
+ version: string().optional(),
50593
+ /**
50594
+ * Apply even though the pre-flight (D877) found addons the target would
50595
+ * refuse to start. Off by default: those addons stay down until the
50596
+ * remedy is run, which is the incident this gate exists to prevent.
50597
+ */
50598
+ acknowledgeRefusals: boolean().optional()
50599
+ }), ServerUpdateActionResultSchema, {
49937
50600
  kind: "mutation",
49938
50601
  auth: "admin",
49939
50602
  timeoutMs: 16 * 6e4
@@ -52483,7 +53146,9 @@ var ManifestShapeSchema = object({
52483
53146
  var AddonProcessSchema = object({
52484
53147
  pid: number().optional(),
52485
53148
  mode: string(),
52486
- state: string()
53149
+ state: string(),
53150
+ /** Why the runner is `refused` (an addon's own words), when it is (D877). */
53151
+ reason: string().optional()
52487
53152
  });
52488
53153
  /**
52489
53154
  * Per-addon health snapshot from the kernel's AddonHealthMonitor.
@@ -53251,7 +53916,8 @@ var batteryCapability = {
53251
53916
  DeviceType.Button,
53252
53917
  DeviceType.Switch,
53253
53918
  DeviceType.PetFeeder,
53254
- DeviceType.Container
53919
+ DeviceType.Container,
53920
+ DeviceType.Thermostat
53255
53921
  ],
53256
53922
  methods: {
53257
53923
  /**
@@ -53872,6 +54538,12 @@ var ClimateControlStatusSchema = object({
53872
54538
  /** Horizontal louver swing on/off. Null when the device has no
53873
54539
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
53874
54540
  swingHorizontal: boolean().nullable(),
54541
+ /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
54542
+ minTemp: number().nullable().optional(),
54543
+ /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
54544
+ maxTemp: number().nullable().optional(),
54545
+ /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
54546
+ tempStep: number().positive().nullable().optional(),
53875
54547
  /** Ms epoch when the slice was last updated (push or command). */
53876
54548
  lastFetchedAt: number()
53877
54549
  });
@@ -54726,6 +55398,125 @@ onStatusChanged: { data: object({
54726
55398
  * whether persisting is worth a SQLite commit. */
54727
55399
  volatileStateFields: ["lastChangedAt"]
54728
55400
  };
55401
+ /**
55402
+ * Smart-dishwasher cap — program lifecycle, door / remote-start gates,
55403
+ * consumable levels (salt, rinse aid) and common program options.
55404
+ *
55405
+ * Sources: native Bosch Home Connect (`dishwasher` device type). Reusable
55406
+ * by any integration that exposes the same program / option surface.
55407
+ *
55408
+ * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55409
+ * provider refreshes the slice on an interval and eagerly after commands.
55410
+ */
55411
+ var DishwasherStateSchema = _enum([
55412
+ "idle",
55413
+ "running",
55414
+ "paused",
55415
+ "finished",
55416
+ "error",
55417
+ "unavailable"
55418
+ ]);
55419
+ var DishwasherConsumableLevelSchema = _enum([
55420
+ "ok",
55421
+ "low",
55422
+ "empty"
55423
+ ]);
55424
+ var DishwasherStatusSchema = object({
55425
+ state: DishwasherStateSchema,
55426
+ /** Active program id/name, or null when none selected / unknown. */
55427
+ program: string().nullable(),
55428
+ /** Program tokens the hardware accepts — drives the UI selector. */
55429
+ availablePrograms: array(string()),
55430
+ /** Minutes remaining on the active cycle, or null when not running. */
55431
+ remainingMinutes: number().int().nonnegative().nullable(),
55432
+ /** Cycle completion 0..100, or null when not applicable. */
55433
+ progressPercent: number().min(0).max(100).nullable(),
55434
+ /** True when the door is reported open. */
55435
+ doorOpen: boolean(),
55436
+ /** True when remote start is allowed (door closed, power on, etc.). */
55437
+ remoteStartAllowed: boolean(),
55438
+ /** Main power / switched-on state. */
55439
+ powerOn: boolean(),
55440
+ saltLevel: DishwasherConsumableLevelSchema.nullable(),
55441
+ rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55442
+ halfLoad: boolean(),
55443
+ hygienePlus: boolean(),
55444
+ errorCode: number().nullable(),
55445
+ errorLabel: string().nullable(),
55446
+ lastFetchedAt: number()
55447
+ });
55448
+ var dishwasherCapability = {
55449
+ name: "dishwasher",
55450
+ scope: "device",
55451
+ deviceNative: true,
55452
+ mode: "singleton",
55453
+ deviceTypes: [DeviceType.Dishwasher],
55454
+ methods: {
55455
+ start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55456
+ kind: "mutation",
55457
+ auth: "protected"
55458
+ }),
55459
+ pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55460
+ kind: "mutation",
55461
+ auth: "protected"
55462
+ }),
55463
+ stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55464
+ kind: "mutation",
55465
+ auth: "protected"
55466
+ }),
55467
+ setProgram: method(object({
55468
+ deviceId: number().int().nonnegative(),
55469
+ program: string().min(1)
55470
+ }), _void(), {
55471
+ kind: "mutation",
55472
+ auth: "protected"
55473
+ }),
55474
+ setPower: method(object({
55475
+ deviceId: number().int().nonnegative(),
55476
+ on: boolean()
55477
+ }), _void(), {
55478
+ kind: "mutation",
55479
+ auth: "protected"
55480
+ }),
55481
+ setHalfLoad: method(object({
55482
+ deviceId: number().int().nonnegative(),
55483
+ on: boolean()
55484
+ }), _void(), {
55485
+ kind: "mutation",
55486
+ auth: "protected"
55487
+ }),
55488
+ setHygienePlus: method(object({
55489
+ deviceId: number().int().nonnegative(),
55490
+ on: boolean()
55491
+ }), _void(), {
55492
+ kind: "mutation",
55493
+ auth: "protected"
55494
+ }),
55495
+ setOption: method(object({
55496
+ deviceId: number().int().nonnegative(),
55497
+ key: string().min(1),
55498
+ value: union([
55499
+ boolean(),
55500
+ string(),
55501
+ number()
55502
+ ])
55503
+ }), _void(), {
55504
+ kind: "mutation",
55505
+ auth: "protected"
55506
+ })
55507
+ },
55508
+ status: {
55509
+ schema: DishwasherStatusSchema,
55510
+ kind: "poll"
55511
+ },
55512
+ runtimeState: DishwasherStatusSchema,
55513
+ durability: "session",
55514
+ history: { fields: { progressPercent: {
55515
+ kind: "gauge",
55516
+ unit: "%",
55517
+ deadband: 2
55518
+ } } }
55519
+ };
54729
55520
  var DoorbellStatusSchema = object({
54730
55521
  /** Ms epoch of the last press. null = never observed since this provider started. */
54731
55522
  lastPressedAt: number().nullable(),
@@ -55528,6 +56319,32 @@ var gasCapability = {
55528
56319
  * whether persisting is worth a SQLite commit. */
55529
56320
  volatileStateFields: ["lastChangedAt"]
55530
56321
  };
56322
+ var HeatingValveStatusSchema = object({
56323
+ /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
56324
+ position: number().min(0).max(100).nullable(),
56325
+ /** Ms epoch when the slice was last updated (push or poll). */
56326
+ lastFetchedAt: number()
56327
+ });
56328
+ var heatingValveCapability = {
56329
+ name: "heating-valve",
56330
+ scope: "device",
56331
+ deviceNative: true,
56332
+ mode: "singleton",
56333
+ deviceTypes: [DeviceType.Thermostat],
56334
+ methods: {},
56335
+ status: {
56336
+ schema: HeatingValveStatusSchema,
56337
+ kind: "push"
56338
+ },
56339
+ runtimeState: HeatingValveStatusSchema,
56340
+ durability: "session",
56341
+ history: { fields: { position: {
56342
+ kind: "gauge",
56343
+ unit: "%",
56344
+ deadband: 1
56345
+ } } },
56346
+ volatileStateFields: ["lastFetchedAt"]
56347
+ };
55531
56348
  /**
55532
56349
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
55533
56350
  * an on/off actuator with an optional target-humidity setpoint and an
@@ -56660,7 +57477,19 @@ var TlsStatusSchema = object({
56660
57477
  sans: array(string()),
56661
57478
  caCertPem: string().nullable(),
56662
57479
  reissueError: string().nullable(),
56663
- restartRequired: boolean()
57480
+ restartRequired: boolean(),
57481
+ /** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
57482
+ caMissing: boolean(),
57483
+ /** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
57484
+ localCaConstrained: boolean().nullable(),
57485
+ /** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
57486
+ caReplacedAt: string().nullable(),
57487
+ /** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
57488
+ storedUpload: object({
57489
+ leafFingerprintSha256: string(),
57490
+ validTo: string(),
57491
+ hasCa: boolean()
57492
+ }).nullable()
56664
57493
  });
56665
57494
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
56666
57495
  /**
@@ -56716,6 +57545,9 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
56716
57545
  }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
56717
57546
  kind: "mutation",
56718
57547
  auth: "admin"
57548
+ }), method(_void(), TlsStatusSchema, {
57549
+ kind: "mutation",
57550
+ auth: "admin"
56719
57551
  });
56720
57552
  var LockControlStatusSchema = object({
56721
57553
  /** Lifecycle state of the lock. `jammed` means the motor reported
@@ -63209,7 +64041,11 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
63209
64041
  kind: "mutation",
63210
64042
  auth: "admin",
63211
64043
  access: "delete"
63212
- }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(object({
64044
+ }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
64045
+ kind: "mutation",
64046
+ auth: "admin",
64047
+ access: "create"
64048
+ }), method(object({
63213
64049
  userId: string(),
63214
64050
  code: string()
63215
64051
  }), object({ valid: boolean() }), {
@@ -64929,6 +65765,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
64929
65765
  dayNight: dayNightCapability,
64930
65766
  deviceDiscovery: deviceDiscoveryCapability,
64931
65767
  deviceStatus: deviceStatusCapability,
65768
+ dishwasher: dishwasherCapability,
64932
65769
  doorbell: doorbellCapability,
64933
65770
  enumSensor: enumSensorCapability,
64934
65771
  eventEmitter: eventEmitterCapability,
@@ -64936,6 +65773,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
64936
65773
  featureProbe: featureProbeCapability,
64937
65774
  flood: floodCapability,
64938
65775
  gas: gasCapability,
65776
+ heatingValve: heatingValveCapability,
64939
65777
  humidifier: humidifierCapability,
64940
65778
  humiditySensor: humiditySensorCapability,
64941
65779
  image: imageCapability,
@@ -65021,13 +65859,14 @@ var BaseDevice = class {
65021
65859
  get state() {
65022
65860
  if (!this._stateProxyCache) {
65023
65861
  const cache = {};
65024
- const handler = { get: (_target, key) => {
65862
+ const handler = { get: (target, key) => {
65025
65863
  const k = key;
65026
- if (k in cache) return cache[k];
65864
+ const existing = Reflect.get(target, k);
65865
+ if (existing !== void 0) return existing;
65027
65866
  const cap = DEVICE_LOCAL_STATE_CAPS[k];
65028
65867
  if (!cap) return void 0;
65029
65868
  const proxy = this.sliceProxy(cap);
65030
- cache[k] = proxy;
65869
+ Reflect.set(target, k, proxy);
65031
65870
  return proxy;
65032
65871
  } };
65033
65872
  this._stateProxyCache = new Proxy(cache, handler);
@@ -65226,7 +66065,7 @@ var BaseDevice = class {
65226
66065
  async updateSourceInfo(patch) {
65227
66066
  const next = mergeSourceInfo(this.sourceInfo, patch);
65228
66067
  this._sourceInfoCache = Object.freeze({ ...next });
65229
- const action = this.ctx.api?.deviceManager?.setMetadata;
66068
+ const action = this.ctx.api.deviceManager?.setMetadata;
65230
66069
  if (action) try {
65231
66070
  await action.mutate({
65232
66071
  deviceId: this.id,
@@ -65261,7 +66100,7 @@ var BaseDevice = class {
65261
66100
  * device boot on a meta refresh.
65262
66101
  */
65263
66102
  async refreshFeatures() {
65264
- const action = this.ctx.api?.deviceManager?.registerDevice;
66103
+ const action = this.ctx.api.deviceManager?.registerDevice;
65265
66104
  if (!action) return;
65266
66105
  try {
65267
66106
  await action.mutate({
@@ -65660,6 +66499,12 @@ var BaseDeviceProvider = class extends BaseAddon {
65660
66499
  provider: this
65661
66500
  }];
65662
66501
  }
66502
+ /** Flatten `super.onInitialize()` whether it returned an array or an envelope. */
66503
+ providerRegistrationsFromSuper(result) {
66504
+ if (Array.isArray(result)) return result;
66505
+ if (result !== void 0 && result.providers !== void 0) return [...result.providers];
66506
+ return [];
66507
+ }
65663
66508
  async onShutdown() {
65664
66509
  this._restoreShuttingDown = true;
65665
66510
  this.cancelRestoreRetries();
@@ -66186,7 +67031,7 @@ var BaseDeviceProvider = class extends BaseAddon {
66186
67031
  return toDeviceSummary(device, this.addonId);
66187
67032
  }
66188
67033
  };
66189
- 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;
67034
+ 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;
66190
67035
  new Set(Object.values(DeviceType));
66191
67036
  Object.freeze({
66192
67037
  "accessories.getStatus": {
@@ -67335,6 +68180,12 @@ Object.freeze({
67335
68180
  addonId: null,
67336
68181
  access: "view"
67337
68182
  },
68183
+ "coreBlocks.migrateRawSecrets": {
68184
+ capName: "core-blocks",
68185
+ capScope: "system",
68186
+ addonId: null,
68187
+ access: "create"
68188
+ },
67338
68189
  "coreBlocks.restart": {
67339
68190
  capName: "core-blocks",
67340
68191
  capScope: "system",
@@ -68601,6 +69452,60 @@ Object.freeze({
68601
69452
  addonId: null,
68602
69453
  access: "view"
68603
69454
  },
69455
+ "dishwasher.getStatus": {
69456
+ capName: "dishwasher",
69457
+ capScope: "device",
69458
+ addonId: null,
69459
+ access: "view"
69460
+ },
69461
+ "dishwasher.pause": {
69462
+ capName: "dishwasher",
69463
+ capScope: "device",
69464
+ addonId: null,
69465
+ access: "create"
69466
+ },
69467
+ "dishwasher.setHalfLoad": {
69468
+ capName: "dishwasher",
69469
+ capScope: "device",
69470
+ addonId: null,
69471
+ access: "create"
69472
+ },
69473
+ "dishwasher.setHygienePlus": {
69474
+ capName: "dishwasher",
69475
+ capScope: "device",
69476
+ addonId: null,
69477
+ access: "create"
69478
+ },
69479
+ "dishwasher.setOption": {
69480
+ capName: "dishwasher",
69481
+ capScope: "device",
69482
+ addonId: null,
69483
+ access: "create"
69484
+ },
69485
+ "dishwasher.setPower": {
69486
+ capName: "dishwasher",
69487
+ capScope: "device",
69488
+ addonId: null,
69489
+ access: "create"
69490
+ },
69491
+ "dishwasher.setProgram": {
69492
+ capName: "dishwasher",
69493
+ capScope: "device",
69494
+ addonId: null,
69495
+ access: "create"
69496
+ },
69497
+ "dishwasher.start": {
69498
+ capName: "dishwasher",
69499
+ capScope: "device",
69500
+ addonId: null,
69501
+ access: "create"
69502
+ },
69503
+ "dishwasher.stop": {
69504
+ capName: "dishwasher",
69505
+ capScope: "device",
69506
+ addonId: null,
69507
+ access: "create"
69508
+ },
68604
69509
  "doorbell.getStatus": {
68605
69510
  capName: "doorbell",
68606
69511
  capScope: "device",
@@ -68811,6 +69716,12 @@ Object.freeze({
68811
69716
  addonId: null,
68812
69717
  access: "view"
68813
69718
  },
69719
+ "heatingValve.getStatus": {
69720
+ capName: "heating-valve",
69721
+ capScope: "device",
69722
+ addonId: null,
69723
+ access: "view"
69724
+ },
68814
69725
  "humidifier.getStatus": {
68815
69726
  capName: "humidifier",
68816
69727
  capScope: "device",
@@ -69021,6 +69932,12 @@ Object.freeze({
69021
69932
  addonId: null,
69022
69933
  access: "create"
69023
69934
  },
69935
+ "keychainAdmin.importSecret": {
69936
+ capName: "keychain-admin",
69937
+ capScope: "system",
69938
+ addonId: null,
69939
+ access: "create"
69940
+ },
69024
69941
  "keychainAdmin.listAudit": {
69025
69942
  capName: "keychain-admin",
69026
69943
  capScope: "system",
@@ -69189,6 +70106,12 @@ Object.freeze({
69189
70106
  addonId: null,
69190
70107
  access: "view"
69191
70108
  },
70109
+ "llm.migrateRawSecrets": {
70110
+ capName: "llm",
70111
+ capScope: "system",
70112
+ addonId: null,
70113
+ access: "create"
70114
+ },
69192
70115
  "llm.resolveModelRef": {
69193
70116
  capName: "llm",
69194
70117
  capScope: "system",
@@ -69417,6 +70340,12 @@ Object.freeze({
69417
70340
  addonId: null,
69418
70341
  access: "create"
69419
70342
  },
70343
+ "localNetwork.useStoredUploadedCertificate": {
70344
+ capName: "local-network",
70345
+ capScope: "system",
70346
+ addonId: null,
70347
+ access: "create"
70348
+ },
69420
70349
  "lockControl.getStatus": {
69421
70350
  capName: "lock-control",
69422
70351
  capScope: "device",
@@ -72069,6 +72998,30 @@ Object.freeze({
72069
72998
  addonId: null,
72070
72999
  access: "create"
72071
73000
  },
73001
+ "recordEntries.deleteEntry": {
73002
+ capName: "record-entries",
73003
+ capScope: "system",
73004
+ addonId: null,
73005
+ access: "delete"
73006
+ },
73007
+ "recordEntries.listEntries": {
73008
+ capName: "record-entries",
73009
+ capScope: "system",
73010
+ addonId: null,
73011
+ access: "view"
73012
+ },
73013
+ "recordEntries.listEntryKinds": {
73014
+ capName: "record-entries",
73015
+ capScope: "system",
73016
+ addonId: null,
73017
+ access: "view"
73018
+ },
73019
+ "recordEntries.putEntry": {
73020
+ capName: "record-entries",
73021
+ capScope: "system",
73022
+ addonId: null,
73023
+ access: "create"
73024
+ },
72072
73025
  "recording.getAvailability": {
72073
73026
  capName: "recording",
72074
73027
  capScope: "device",
@@ -72369,6 +73322,102 @@ Object.freeze({
72369
73322
  addonId: null,
72370
73323
  access: "view"
72371
73324
  },
73325
+ "records.aggregate": {
73326
+ capName: "records",
73327
+ capScope: "system",
73328
+ addonId: null,
73329
+ access: "view"
73330
+ },
73331
+ "records.allocateId": {
73332
+ capName: "records",
73333
+ capScope: "system",
73334
+ addonId: null,
73335
+ access: "create"
73336
+ },
73337
+ "records.count": {
73338
+ capName: "records",
73339
+ capScope: "system",
73340
+ addonId: null,
73341
+ access: "view"
73342
+ },
73343
+ "records.declareKinds": {
73344
+ capName: "records",
73345
+ capScope: "system",
73346
+ addonId: null,
73347
+ access: "create"
73348
+ },
73349
+ "records.delete": {
73350
+ capName: "records",
73351
+ capScope: "system",
73352
+ addonId: null,
73353
+ access: "delete"
73354
+ },
73355
+ "records.deleteDevice": {
73356
+ capName: "records",
73357
+ capScope: "system",
73358
+ addonId: null,
73359
+ access: "delete"
73360
+ },
73361
+ "records.deleteMany": {
73362
+ capName: "records",
73363
+ capScope: "system",
73364
+ addonId: null,
73365
+ access: "delete"
73366
+ },
73367
+ "records.deleteWhere": {
73368
+ capName: "records",
73369
+ capScope: "system",
73370
+ addonId: null,
73371
+ access: "delete"
73372
+ },
73373
+ "records.get": {
73374
+ capName: "records",
73375
+ capScope: "system",
73376
+ addonId: null,
73377
+ access: "view"
73378
+ },
73379
+ "records.getMany": {
73380
+ capName: "records",
73381
+ capScope: "system",
73382
+ addonId: null,
73383
+ access: "view"
73384
+ },
73385
+ "records.histogram": {
73386
+ capName: "records",
73387
+ capScope: "system",
73388
+ addonId: null,
73389
+ access: "view"
73390
+ },
73391
+ "records.patch": {
73392
+ capName: "records",
73393
+ capScope: "system",
73394
+ addonId: null,
73395
+ access: "create"
73396
+ },
73397
+ "records.put": {
73398
+ capName: "records",
73399
+ capScope: "system",
73400
+ addonId: null,
73401
+ access: "create"
73402
+ },
73403
+ "records.putMany": {
73404
+ capName: "records",
73405
+ capScope: "system",
73406
+ addonId: null,
73407
+ access: "create"
73408
+ },
73409
+ "records.query": {
73410
+ capName: "records",
73411
+ capScope: "system",
73412
+ addonId: null,
73413
+ access: "view"
73414
+ },
73415
+ "records.secretRefs": {
73416
+ capName: "records",
73417
+ capScope: "system",
73418
+ addonId: null,
73419
+ access: "view"
73420
+ },
72372
73421
  "sceneMonitor.captureReference": {
72373
73422
  capName: "scene-monitor",
72374
73423
  capScope: "device",
@@ -72801,6 +73850,48 @@ Object.freeze({
72801
73850
  addonId: null,
72802
73851
  access: "create"
72803
73852
  },
73853
+ "storageAdmin.adoptRecords": {
73854
+ capName: "storage-admin",
73855
+ capScope: "system",
73856
+ addonId: null,
73857
+ access: "create"
73858
+ },
73859
+ "storageAdmin.dropCollection": {
73860
+ capName: "storage-admin",
73861
+ capScope: "system",
73862
+ addonId: null,
73863
+ access: "delete"
73864
+ },
73865
+ "storageAdmin.isAdoptedLegacyTable": {
73866
+ capName: "storage-admin",
73867
+ capScope: "system",
73868
+ addonId: null,
73869
+ access: "view"
73870
+ },
73871
+ "storageAdmin.listKinds": {
73872
+ capName: "storage-admin",
73873
+ capScope: "system",
73874
+ addonId: null,
73875
+ access: "view"
73876
+ },
73877
+ "storageAdmin.listTables": {
73878
+ capName: "storage-admin",
73879
+ capScope: "system",
73880
+ addonId: null,
73881
+ access: "view"
73882
+ },
73883
+ "storageAdmin.readLegacyCollection": {
73884
+ capName: "storage-admin",
73885
+ capScope: "system",
73886
+ addonId: null,
73887
+ access: "view"
73888
+ },
73889
+ "storageAdmin.readRecords": {
73890
+ capName: "storage-admin",
73891
+ capScope: "system",
73892
+ addonId: null,
73893
+ access: "view"
73894
+ },
72804
73895
  "storageEvictable.evict": {
72805
73896
  capName: "storage-evictable",
72806
73897
  capScope: "system",
@@ -73713,6 +74804,12 @@ Object.freeze({
73713
74804
  addonId: null,
73714
74805
  access: "view"
73715
74806
  },
74807
+ "userManagement.migrateRawSecrets": {
74808
+ capName: "user-management",
74809
+ capScope: "system",
74810
+ addonId: null,
74811
+ access: "create"
74812
+ },
73716
74813
  "userManagement.oauthExchangeCode": {
73717
74814
  capName: "user-management",
73718
74815
  capScope: "system",
@@ -74212,7 +75309,7 @@ Object.freeze({
74212
75309
  access: "create"
74213
75310
  }
74214
75311
  });
74215
- 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;
75312
+ 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;
74216
75313
  DeviceFeature.BatteryOperated;
74217
75314
  Object.freeze({
74218
75315
  "accessories.getStatus": [{
@@ -75036,6 +76133,51 @@ Object.freeze({
75036
76133
  form: "single",
75037
76134
  optional: false
75038
76135
  }],
76136
+ "dishwasher.getStatus": [{
76137
+ name: "deviceId",
76138
+ form: "single",
76139
+ optional: false
76140
+ }],
76141
+ "dishwasher.pause": [{
76142
+ name: "deviceId",
76143
+ form: "single",
76144
+ optional: false
76145
+ }],
76146
+ "dishwasher.setHalfLoad": [{
76147
+ name: "deviceId",
76148
+ form: "single",
76149
+ optional: false
76150
+ }],
76151
+ "dishwasher.setHygienePlus": [{
76152
+ name: "deviceId",
76153
+ form: "single",
76154
+ optional: false
76155
+ }],
76156
+ "dishwasher.setOption": [{
76157
+ name: "deviceId",
76158
+ form: "single",
76159
+ optional: false
76160
+ }],
76161
+ "dishwasher.setPower": [{
76162
+ name: "deviceId",
76163
+ form: "single",
76164
+ optional: false
76165
+ }],
76166
+ "dishwasher.setProgram": [{
76167
+ name: "deviceId",
76168
+ form: "single",
76169
+ optional: false
76170
+ }],
76171
+ "dishwasher.start": [{
76172
+ name: "deviceId",
76173
+ form: "single",
76174
+ optional: false
76175
+ }],
76176
+ "dishwasher.stop": [{
76177
+ name: "deviceId",
76178
+ form: "single",
76179
+ optional: false
76180
+ }],
75039
76181
  "doorbell.getStatus": [{
75040
76182
  name: "deviceId",
75041
76183
  form: "single",
@@ -75105,6 +76247,11 @@ Object.freeze({
75105
76247
  form: "single",
75106
76248
  optional: false
75107
76249
  }],
76250
+ "heatingValve.getStatus": [{
76251
+ name: "deviceId",
76252
+ form: "single",
76253
+ optional: false
76254
+ }],
75108
76255
  "humidifier.getStatus": [{
75109
76256
  name: "deviceId",
75110
76257
  form: "single",
@@ -76389,6 +77536,37 @@ Object.freeze({
76389
77536
  form: "single",
76390
77537
  optional: false
76391
77538
  }],
77539
+ "records.count": [{
77540
+ name: "deviceId",
77541
+ form: "single",
77542
+ optional: true
77543
+ }],
77544
+ "records.deleteDevice": [{
77545
+ name: "deviceId",
77546
+ form: "single",
77547
+ optional: false
77548
+ }],
77549
+ "records.deleteWhere": [{
77550
+ name: "deviceId",
77551
+ form: "single",
77552
+ optional: true
77553
+ }],
77554
+ "records.histogram": [{
77555
+ name: "deviceId",
77556
+ form: "single",
77557
+ optional: true
77558
+ }],
77559
+ "records.putMany": [{
77560
+ name: "records",
77561
+ form: "object-array",
77562
+ optional: false,
77563
+ itemField: "deviceId"
77564
+ }],
77565
+ "records.query": [{
77566
+ name: "deviceId",
77567
+ form: "single",
77568
+ optional: true
77569
+ }],
76392
77570
  "sceneMonitor.captureReference": [{
76393
77571
  name: "deviceId",
76394
77572
  form: "single",
@@ -76505,6 +77683,17 @@ Object.freeze({
76505
77683
  form: "single",
76506
77684
  optional: false
76507
77685
  }],
77686
+ "storageAdmin.adoptRecords": [{
77687
+ name: "records",
77688
+ form: "object-array",
77689
+ optional: false,
77690
+ itemField: "deviceId"
77691
+ }],
77692
+ "storageAdmin.readRecords": [{
77693
+ name: "deviceId",
77694
+ form: "single",
77695
+ optional: true
77696
+ }],
76508
77697
  "streamBroker.acquireEgressTranscode": [{
76509
77698
  name: "deviceId",
76510
77699
  form: "single",
@@ -82803,7 +83992,7 @@ var WyzeProviderAddon = class extends BaseDeviceProvider {
82803
83992
  }
82804
83993
  async onInitialize() {
82805
83994
  applyWyzeCloudTlsTrust();
82806
- const regs = await super.onInitialize();
83995
+ const regs = this.providerRegistrationsFromSuper(await super.onInitialize());
82807
83996
  this.clients = new WyzeClientRegistry({
82808
83997
  dataDir: this.ctx.dataDir,
82809
83998
  logger: this.ctx.logger