@camstack/addon-provider-dreo 0.2.126 → 0.2.127

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.mjs CHANGED
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
37
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
38
38
  //#endregion
39
- //#region ../types/dist/event-category-C4hVnRo8.mjs
39
+ //#region ../types/dist/event-category-BvOFi6PY.mjs
40
40
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
41
41
  EventCategory["SystemBoot"] = "system.boot";
42
42
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -100,6 +100,24 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
100
100
  * consumes this category and maps it to the `addon-crash-loop` kind.
101
101
  */
102
102
  EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
103
+ /**
104
+ * A runner whose addon refused to start with a typed reason (D877) - parked
105
+ * in `refused`, never counted by the crash breaker, retried on operator
106
+ * action. One event per refusal.
107
+ */
108
+ EventCategory["AddonRunnerRefused"] = "addon.runner-refused";
109
+ /**
110
+ * A runner settled on a state (D877): `running` (READY), `crashed`, `failed` or
111
+ * `refused`. In-process telemetry for the boot check (re-evaluate while any
112
+ * runner is still pending) and the alert centre (close a recovered runner).
113
+ */
114
+ EventCategory["ProcessStateChanged"] = "process.state-changed";
115
+ /**
116
+ * The node's one-shot runner boot check (D877): planned runners against the
117
+ * process service, `degraded` when any is failed, refused or missing. The
118
+ * alert centre turns it into one alert and a direct critical push.
119
+ */
120
+ EventCategory["SystemRunnerCheck"] = "system.runner-check";
103
121
  EventCategory["AddonError"] = "addon.error";
104
122
  EventCategory["AddonPageReady"] = "addon.page-ready";
105
123
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -5424,7 +5442,7 @@ var ZodIssueCode = {
5424
5442
  var ZodFirstPartyTypeKind;
5425
5443
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5426
5444
  //#endregion
5427
- //#region ../types/dist/sleep-DRqxtc0C.mjs
5445
+ //#region ../types/dist/sleep-BOjuyoPC.mjs
5428
5446
  /**
5429
5447
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5430
5448
  * window to float samples (D455).
@@ -5541,7 +5559,7 @@ function isKeychainStoredField(field) {
5541
5559
  var SECRET_CLEAR = { $secretClear: true };
5542
5560
  /** The `'***'` token D634 redaction writes for non-admins. */
5543
5561
  var LEGACY_DEVICE_REDACTION = "***";
5544
- function isRecord$2(value) {
5562
+ function isRecord$5(value) {
5545
5563
  return typeof value === "object" && value !== null && !Array.isArray(value);
5546
5564
  }
5547
5565
  function makeSecretMarker(ref) {
@@ -5552,12 +5570,12 @@ function makeSecretMarker(ref) {
5552
5570
  }
5553
5571
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5554
5572
  function isSecretMarker(value) {
5555
- if (!isRecord$2(value)) return false;
5573
+ if (!isRecord$5(value)) return false;
5556
5574
  const ref = value["$secret"];
5557
5575
  return typeof ref === "string" && ref.length > 0;
5558
5576
  }
5559
5577
  function isSecretClear(value) {
5560
- return isRecord$2(value) && value["$secretClear"] === true;
5578
+ return isRecord$5(value) && value["$secretClear"] === true;
5561
5579
  }
5562
5580
  /**
5563
5581
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6167,7 +6185,7 @@ var KeychainWriteRefusedError = class extends Error {
6167
6185
  }
6168
6186
  };
6169
6187
  var KEEP = { kind: "keep" };
6170
- function isRecord$1(value) {
6188
+ function isRecord$4(value) {
6171
6189
  return typeof value === "object" && value !== null && !Array.isArray(value);
6172
6190
  }
6173
6191
  function defaultMintId() {
@@ -6180,7 +6198,7 @@ function collectSecretMarkerRefs(value, out = []) {
6180
6198
  return out;
6181
6199
  }
6182
6200
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6183
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6201
+ else if (isRecord$4(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6184
6202
  return out;
6185
6203
  }
6186
6204
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6235,7 +6253,7 @@ function rowId(row, idKey) {
6235
6253
  return null;
6236
6254
  }
6237
6255
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6238
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6256
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$4) : [];
6239
6257
  if (!Array.isArray(incoming)) {
6240
6258
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6241
6259
  return {
@@ -6251,7 +6269,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6251
6269
  const kept = /* @__PURE__ */ new Set();
6252
6270
  const rows = [];
6253
6271
  for (const row of incoming) {
6254
- if (!isRecord$1(row)) {
6272
+ if (!isRecord$4(row)) {
6255
6273
  rows.push(row);
6256
6274
  continue;
6257
6275
  }
@@ -6276,7 +6294,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6276
6294
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6277
6295
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6278
6296
  case "object": {
6279
- if (!isRecord$1(incoming)) {
6297
+ if (!isRecord$4(incoming)) {
6280
6298
  if (incoming === void 0) return KEEP;
6281
6299
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6282
6300
  return {
@@ -6284,7 +6302,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6284
6302
  value: incoming
6285
6303
  };
6286
6304
  }
6287
- const storedObj = isRecord$1(stored) ? stored : {};
6305
+ const storedObj = isRecord$4(stored) ? stored : {};
6288
6306
  return {
6289
6307
  kind: "value",
6290
6308
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6407,7 +6425,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6407
6425
  value: items
6408
6426
  };
6409
6427
  }
6410
- if (isRecord$1(v)) {
6428
+ if (isRecord$4(v)) {
6411
6429
  const out = {};
6412
6430
  for (const [k, child] of Object.entries(v)) {
6413
6431
  const s = substitute(child);
@@ -6439,7 +6457,7 @@ var SecretOverwriteRefusedError = class extends Error {
6439
6457
  this.name = "SecretOverwriteRefusedError";
6440
6458
  }
6441
6459
  };
6442
- function isRecord(value) {
6460
+ function isRecord$3(value) {
6443
6461
  return typeof value === "object" && value !== null && !Array.isArray(value);
6444
6462
  }
6445
6463
  function resolvedValue(pass, marker) {
@@ -6468,7 +6486,7 @@ function inArray(pass, incoming, stored) {
6468
6486
  return incoming.map((item, index) => {
6469
6487
  const twin = stored[index];
6470
6488
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
6471
- if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
6489
+ if (isRecord$3(item) && isRecord$3(twin)) return inArrayRow(pass, item, twin);
6472
6490
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
6473
6491
  return item;
6474
6492
  });
@@ -6479,7 +6497,7 @@ function inArrayRow(pass, incoming, stored) {
6479
6497
  const twin = stored[key];
6480
6498
  if (isSecretMarker(twin)) {
6481
6499
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
6482
- } else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
6500
+ } else if (isRecord$3(value) && isRecord$3(twin)) out[key] = inArrayRow(pass, value, twin);
6483
6501
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
6484
6502
  }
6485
6503
  return out;
@@ -6487,7 +6505,7 @@ function inArrayRow(pass, incoming, stored) {
6487
6505
  async function walk(pass, incoming, stored) {
6488
6506
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
6489
6507
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
6490
- if (!isRecord(incoming) || !isRecord(stored)) return incoming;
6508
+ if (!isRecord$3(incoming) || !isRecord$3(stored)) return incoming;
6491
6509
  const out = { ...incoming };
6492
6510
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
6493
6511
  return out;
@@ -6518,7 +6536,7 @@ async function restoreUnchangedSecrets(input) {
6518
6536
  function isJsonEqual(a, b) {
6519
6537
  if (Object.is(a, b)) return true;
6520
6538
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
6521
- if (isRecord(a) && isRecord(b)) {
6539
+ if (isRecord$3(a) && isRecord$3(b)) {
6522
6540
  const keys = Object.keys(a);
6523
6541
  if (keys.length !== Object.keys(b).length) return false;
6524
6542
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -6542,7 +6560,7 @@ function markerKeysOf(blob, owner) {
6542
6560
  }
6543
6561
  function nodeFromStored(value, owner) {
6544
6562
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
6545
- if (!isRecord(value)) return null;
6563
+ if (!isRecord$3(value)) return null;
6546
6564
  const children = /* @__PURE__ */ new Map();
6547
6565
  for (const [key, child] of Object.entries(value)) {
6548
6566
  const node = nodeFromStored(child, owner);
@@ -6675,7 +6693,6 @@ function createHandle(raw, opts) {
6675
6693
  const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
6676
6694
  const readAddonStoreResult = raw.readAddonStoreResult;
6677
6695
  const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
6678
- const readDeviceStoreBatch = raw.readDeviceStoreBatch;
6679
6696
  const overrides = {
6680
6697
  readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
6681
6698
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
@@ -6699,12 +6716,12 @@ function createHandle(raw, opts) {
6699
6716
  };
6700
6717
  } } : {},
6701
6718
  readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
6702
- ...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
6703
- const rows = await readDeviceStoreBatch.call(raw, deviceIds);
6719
+ readDeviceStoreBatch: async (deviceIds) => {
6720
+ const rows = await raw.readDeviceStoreBatch(deviceIds);
6704
6721
  const out = /* @__PURE__ */ new Map();
6705
6722
  for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
6706
6723
  return out;
6707
- } } : {},
6724
+ },
6708
6725
  writeAddonStore: async (patch) => {
6709
6726
  await writeAddon(patch);
6710
6727
  },
@@ -7331,7 +7348,7 @@ var BaseAddon = class {
7331
7348
  if (!ctx) return;
7332
7349
  const addonId = ctx.id;
7333
7350
  setImmediate(() => {
7334
- ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
7351
+ ctx.api.addons.restartAddon.mutate({ addonId }).then(() => {
7335
7352
  ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
7336
7353
  }).catch((err) => {
7337
7354
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
@@ -7531,7 +7548,7 @@ var BaseAddon = class {
7531
7548
  return this._addonSecretTree;
7532
7549
  }
7533
7550
  deviceSecretTree() {
7534
- this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7551
+ this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
7535
7552
  return this._deviceSecretTree;
7536
7553
  }
7537
7554
  /**
@@ -7607,42 +7624,135 @@ var BaseAddon = class {
7607
7624
  this[timerOf] = timer;
7608
7625
  }
7609
7626
  /**
7610
- * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
7611
- * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
7612
- * swap, or any race where the SqliteSettingsBackend is between shutdown and
7613
- * re-initialize) doesn't propagate up into `initialize()` and leave the
7627
+ * Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
7628
+ * settings-store outage doesn't propagate up into `initialize()` and leave the
7614
7629
  * addon permanently broken.
7615
7630
  *
7616
- * Retry only the two known infra fingerprints. Anything else propagates so
7617
- * real bugs surface immediately. After the budget expires we fall back to
7618
- * `{}` (defaults) — the addon's first successful patch will rehydrate.
7631
+ * Two kinds of outage, two budgets:
7632
+ * - the store's own restart fingerprints (`SqliteSettingsBackend not
7633
+ * initialized`, `provider not available`): a short budget, then the addon
7634
+ * falls back to `{}` (defaults) - its first successful patch rehydrates;
7635
+ * - a TRANSPORT failure (the hub is restarting while this runner boots:
7636
+ * `discovery deadline exceeded`, `parent could not route`, a refused or
7637
+ * timed-out connection). Since D870 a runner's settings read THROWS instead
7638
+ * of answering `{}`, so without a budget a hub restart ends in a respawn
7639
+ * loop. A long, bounded budget; only after it the error propagates - the
7640
+ * addon never runs on defaults for a store it could not ask.
7641
+ * Anything else propagates immediately so real bugs surface.
7619
7642
  */
7620
7643
  async readAddonStoreWithRetry() {
7621
7644
  const settings = this.rawSettings();
7622
7645
  if (!settings) return {};
7623
- const delaysMs = [
7624
- 150,
7625
- 350,
7626
- 600,
7627
- 900
7628
- ];
7629
7646
  let lastErr;
7630
- for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
7647
+ for (let attempt = 0;; attempt++) try {
7631
7648
  const stored = await settings.readAddonStore() ?? {};
7632
7649
  this.settingsStoreReady = true;
7633
7650
  return stored;
7634
7651
  } catch (err) {
7635
7652
  lastErr = err;
7636
- const msg = err instanceof Error ? err.message : String(err);
7637
- if (!(msg.includes("SqliteSettingsBackend not initialized") || msg.includes("provider not available"))) throw err;
7638
- if (attempt === delaysMs.length) break;
7639
- await new Promise((r) => setTimeout(r, delaysMs[attempt]));
7653
+ const kind = classifyStoreError(err);
7654
+ if (kind === "permanent") throw err;
7655
+ const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
7656
+ if (delay === void 0) {
7657
+ if (kind === "transport") throw err;
7658
+ break;
7659
+ }
7660
+ await new Promise((r) => setTimeout(r, delay));
7640
7661
  }
7641
7662
  this.settingsStoreReady = false;
7642
7663
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
7643
7664
  return {};
7644
7665
  }
7645
7666
  };
7667
+ /** The settings store's own restart fingerprints. */
7668
+ var RESTART_RETRY_DELAYS_MS = [
7669
+ 150,
7670
+ 350,
7671
+ 600,
7672
+ 900
7673
+ ];
7674
+ /** A hub restarting under a booting runner: ~100 s in total. */
7675
+ var TRANSPORT_RETRY_DELAYS_MS = [
7676
+ 150,
7677
+ 350,
7678
+ 600,
7679
+ 900,
7680
+ 2e3,
7681
+ 5e3,
7682
+ 1e4,
7683
+ 2e4,
7684
+ 3e4,
7685
+ 3e4
7686
+ ];
7687
+ var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
7688
+ /** Node / socket error codes of a connection that did not happen or broke. */
7689
+ var TRANSPORT_CODES = new Set([
7690
+ "ECONNREFUSED",
7691
+ "ECONNRESET",
7692
+ "ETIMEDOUT",
7693
+ "EPIPE",
7694
+ "EHOSTUNREACH",
7695
+ "ENETUNREACH"
7696
+ ]);
7697
+ /** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
7698
+ var UNAVAILABLE_TRPC_CODES = new Set([
7699
+ "TIMEOUT",
7700
+ "SERVICE_UNAVAILABLE",
7701
+ "BAD_GATEWAY",
7702
+ "GATEWAY_TIMEOUT"
7703
+ ]);
7704
+ /** The exact phrases OUR transport raises when it cannot reach the hub. */
7705
+ var TRANSPORT_PHRASES = [
7706
+ "discovery deadline exceeded",
7707
+ "parent could not route child unowned cap call",
7708
+ "UDS request timed out after",
7709
+ "channel closed"
7710
+ ];
7711
+ /** Moleculer error `type`s of a call that could not be served right now. */
7712
+ var MOLECULER_TRANSIENT_TYPES = new Set([
7713
+ "REQUEST_TIMEOUT",
7714
+ "SERVICE_NOT_FOUND",
7715
+ "SERVICE_NOT_AVAILABLE",
7716
+ "REQUEST_REJECTED",
7717
+ "BROKER_DISCONNECTED"
7718
+ ]);
7719
+ function stringProp(value, key) {
7720
+ if (typeof value !== "object" || value === null) return void 0;
7721
+ const found = Reflect.get(value, key);
7722
+ return typeof found === "string" ? found : void 0;
7723
+ }
7724
+ /** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
7725
+ function errorCode(err) {
7726
+ const out = {};
7727
+ const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
7728
+ const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
7729
+ const node = stringProp(err, "code") ?? stringProp(cause, "code");
7730
+ if (node !== void 0) out.node = node;
7731
+ const trpc = stringProp(data, "code");
7732
+ if (trpc !== void 0) out.trpc = trpc;
7733
+ return out;
7734
+ }
7735
+ /**
7736
+ * Is a settings read failure worth retrying, and with which budget? Only
7737
+ * EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
7738
+ * one of the exact phrases our own transport raises. A message that merely
7739
+ * contains "timed out" or "unreachable" is not evidence of anything, and
7740
+ * `settings store not wired` is a wiring bug that retrying cannot fix.
7741
+ */
7742
+ function classifyStoreError(err) {
7743
+ const message = err instanceof Error ? err.message : String(err);
7744
+ if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
7745
+ const code = errorCode(err);
7746
+ if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
7747
+ if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
7748
+ if (typeof err === "object" && err !== null) {
7749
+ if (Reflect.get(err, "retryable") === true) return "transport";
7750
+ const type = stringProp(err, "type");
7751
+ if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
7752
+ }
7753
+ if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
7754
+ return "permanent";
7755
+ }
7646
7756
  /**
7647
7757
  * Collect the keys of every field marked `perNode: true`, recursing into
7648
7758
  * layout containers (`group` fields and `sub-tabs` tabs) the same way
@@ -7732,6 +7842,156 @@ var PeerBytesTicketSchema = object({
7732
7842
  */
7733
7843
  declaredBytes: number().int().nonnegative().nullable()
7734
7844
  });
7845
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
7846
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
7847
+ var RECORD_DATABASES = ["settings", "events"];
7848
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
7849
+ var RECORD_CLASSES = [
7850
+ "config",
7851
+ "ledger",
7852
+ "audit",
7853
+ "mirror",
7854
+ "ephemeral"
7855
+ ];
7856
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
7857
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
7858
+ var RECORD_BATCH_MAX = 1e3;
7859
+ var RECORD_QUERY_MAX = 1e3;
7860
+ function defOf(schema) {
7861
+ const zodBag = Reflect.get(schema, "_zod");
7862
+ if (typeof zodBag !== "object" || zodBag === null) return {};
7863
+ const def = Reflect.get(zodBag, "def");
7864
+ if (typeof def !== "object" || def === null) return {};
7865
+ return def;
7866
+ }
7867
+ function declaredHere(schema) {
7868
+ return globalRegistry.get(schema)?.secret === true;
7869
+ }
7870
+ /** Wrapper kinds whose `innerType` is the field itself. */
7871
+ var WRAPPERS = new Set([
7872
+ "optional",
7873
+ "nullable",
7874
+ "default",
7875
+ "prefault",
7876
+ "catch",
7877
+ "readonly",
7878
+ "nonoptional"
7879
+ ]);
7880
+ /**
7881
+ * The schema layers that make up ONE field: the schema itself and every
7882
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
7883
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
7884
+ * `.transform` on `in`).
7885
+ */
7886
+ function layersOf(schema) {
7887
+ const out = [];
7888
+ const queue = [schema];
7889
+ while (queue.length > 0) {
7890
+ const s = queue.shift();
7891
+ if (!s || out.includes(s)) continue;
7892
+ out.push(s);
7893
+ const def = defOf(s);
7894
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
7895
+ if (def.type === "pipe") {
7896
+ if (def.in) queue.push(def.in);
7897
+ if (def.out) queue.push(def.out);
7898
+ }
7899
+ }
7900
+ return out;
7901
+ }
7902
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
7903
+ function isZodSecret(schema) {
7904
+ return layersOf(schema).some(declaredHere);
7905
+ }
7906
+ /**
7907
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
7908
+ * element of this array" (`connection.password`, `rows[].token`). A declared
7909
+ * object or array is reported as one path and not descended into — everything
7910
+ * under it is secret.
7911
+ */
7912
+ function collectZodSecretPaths(schema, prefix = "") {
7913
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
7914
+ const paths = [];
7915
+ for (const layer of layersOf(schema)) {
7916
+ const def = defOf(layer);
7917
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
7918
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
7919
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
7920
+ else if (def.type === "intersection") {
7921
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
7922
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
7923
+ }
7924
+ }
7925
+ return [...new Set(paths)];
7926
+ }
7927
+ /**
7928
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
7929
+ * Zod row schema that describes it, and the helper that turns the two into the
7930
+ * JSON the engine stores.
7931
+ *
7932
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
7933
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
7934
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
7935
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
7936
+ * never a field name (D879).
7937
+ */
7938
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
7939
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
7940
+ var RecordIndexSchema = object({
7941
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
7942
+ fields: array(RecordFieldPathSchema).min(1).max(4),
7943
+ unique: boolean().optional()
7944
+ }).strict();
7945
+ var RecordRetentionSchema = union([
7946
+ object({
7947
+ ttlMs: number().int().positive(),
7948
+ from: _enum(["at", "write"])
7949
+ }).strict(),
7950
+ object({
7951
+ maxRows: number().int().positive().optional(),
7952
+ maxRowsPerDevice: number().int().positive().optional()
7953
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
7954
+ object({
7955
+ owner: string().min(1),
7956
+ reason: string().min(1)
7957
+ }).strict(),
7958
+ object({ none: string().min(1) }).strict()
7959
+ ]);
7960
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
7961
+ var EntryDescriptorSchema = object({
7962
+ title: string().min(1),
7963
+ /** The record body field shown as the entry's name. */
7964
+ nameField: string().min(1),
7965
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
7966
+ fields: record(string(), unknown())
7967
+ }).strict();
7968
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
7969
+ var RecordKindDeclarationSchema = object({
7970
+ database: _enum(RECORD_DATABASES).default("settings"),
7971
+ class: _enum(RECORD_CLASSES),
7972
+ writeTrigger: string().min(1),
7973
+ device: _enum([
7974
+ "required",
7975
+ "optional",
7976
+ "none"
7977
+ ]).default("none"),
7978
+ at: _enum(["required", "none"]).default("none"),
7979
+ indexes: array(RecordIndexSchema).max(8).default([]),
7980
+ retention: RecordRetentionSchema,
7981
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
7982
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
7983
+ /** Derived from the Zod schema; never written by hand. */
7984
+ secretPaths: array(string().min(1)).default([]),
7985
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
7986
+ secretArrayKeys: record(string(), string()).default({}),
7987
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
7988
+ adoptsFrom: string().min(1).optional(),
7989
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
7990
+ transactFamily: string().min(1).optional(),
7991
+ entry: EntryDescriptorSchema.optional()
7992
+ }).strict();
7993
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
7994
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
7735
7995
  /** Shared Zod schemas used across streaming capabilities. */
7736
7996
  var CamProfileSchema = _enum([
7737
7997
  "high",
@@ -8196,75 +8456,12 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
8196
8456
  kind: "mutation",
8197
8457
  auth: "admin"
8198
8458
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
8199
- function defOf(schema) {
8200
- return schema._zod?.def ?? {};
8201
- }
8202
- function declaredHere(schema) {
8203
- return globalRegistry.get(schema)?.secret === true;
8204
- }
8205
- /** Wrapper kinds whose `innerType` is the field itself. */
8206
- var WRAPPERS = new Set([
8207
- "optional",
8208
- "nullable",
8209
- "default",
8210
- "prefault",
8211
- "catch",
8212
- "readonly",
8213
- "nonoptional"
8214
- ]);
8215
- /**
8216
- * The schema layers that make up ONE field: the schema itself and every
8217
- * wrapper below it (optional / default / nullable / readonly / catch), plus
8218
- * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
8219
- * `.transform` on `in`).
8220
- */
8221
- function layersOf(schema) {
8222
- const out = [];
8223
- const queue = [schema];
8224
- while (queue.length > 0) {
8225
- const s = queue.shift();
8226
- if (!s || out.includes(s)) continue;
8227
- out.push(s);
8228
- const def = defOf(s);
8229
- if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
8230
- if (def.type === "pipe") {
8231
- if (def.in) queue.push(def.in);
8232
- if (def.out) queue.push(def.out);
8233
- }
8234
- }
8235
- return out;
8236
- }
8237
- /** True when any layer of this field declares `.meta({ secret: true })`. */
8238
- function isZodSecret(schema) {
8239
- return layersOf(schema).some(declaredHere);
8240
- }
8241
- /**
8242
- * Every declared secret path in a config schema: dotted keys, `[]` for "each
8243
- * element of this array" (`connection.password`, `rows[].token`). A declared
8244
- * object or array is reported as one path and not descended into — everything
8245
- * under it is secret.
8246
- */
8247
- function collectZodSecretPaths(schema, prefix = "") {
8248
- if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
8249
- const paths = [];
8250
- for (const layer of layersOf(schema)) {
8251
- const def = defOf(layer);
8252
- if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
8253
- else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
8254
- else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
8255
- else if (def.type === "intersection") {
8256
- if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
8257
- if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
8258
- }
8259
- }
8260
- return [...new Set(paths)];
8261
- }
8262
8459
  object({
8263
8460
  code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
8264
8461
  params: record(string(), union([string(), number()])).optional()
8265
8462
  });
8266
8463
  //#endregion
8267
- //#region ../types/dist/err-msg-DLerKiVO.mjs
8464
+ //#region ../types/dist/err-msg-BXKzRBwg.mjs
8268
8465
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
8269
8466
  DeviceType["Camera"] = "camera";
8270
8467
  DeviceType["Hub"] = "hub";
@@ -8356,6 +8553,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
8356
8553
  * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
8357
8554
  * integrations sharing the same food/desiccant/hopper surface. */
8358
8555
  DeviceType["PetFeeder"] = "pet-feeder";
8556
+ /** Built-in dishwasher — program lifecycle, door / remote-start gates,
8557
+ * salt and rinse-aid levels. Installed with the `dishwasher` cap.
8558
+ * Sources: native Bosch Home Connect, reusable by similar integrations. */
8559
+ DeviceType["Dishwasher"] = "dishwasher";
8359
8560
  return DeviceType;
8360
8561
  }({});
8361
8562
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -8533,6 +8734,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8533
8734
  /** Virtual HA toggle (input_boolean.*) — distinguishable from a
8534
8735
  * real Switch device for UI rendering / export adapters. */
8535
8736
  DeviceRole["BinaryHelper"] = "binary-helper";
8737
+ /** A smart plug: a `switch` whose source says it is an outlet (HA
8738
+ * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
8739
+ DeviceRole["Outlet"] = "outlet";
8536
8740
  /** Generic motion / occupancy / moving event source. Distinct from
8537
8741
  * the camera accessory PirSensor role: that one is a camera child;
8538
8742
  * this is a standalone HA / 3rd-party motion sensor. */
@@ -8610,7 +8814,7 @@ function errMsg(err) {
8610
8814
  return String(err);
8611
8815
  }
8612
8816
  //#endregion
8613
- //#region ../types/dist/composition-EQ9Ok0Ee.mjs
8817
+ //#region ../types/dist/composition-CB6PMT9p.mjs
8614
8818
  /**
8615
8819
  * The ffmpeg build every CamStack node downloads, per platform and arch.
8616
8820
  *
@@ -11814,11 +12018,10 @@ var ClipModelMetaSchema = object({
11814
12018
  /**
11815
12019
  * The `vector-store` index this model's vectors live in. ONE feature space
11816
12020
  * per index: two models share an index only when their vectors are ranked
11817
- * against each other, which for CLIP means never across families. MobileCLIP
11818
- * S1 and S2 share `object-clip` for history (separated by the row's
11819
- * `modelId`); any other model gets its own.
12021
+ * against each other, which for CLIP means never across families. Every
12022
+ * model gets its own.
11820
12023
  */
11821
- vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
12024
+ vectorIndex: string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
11822
12025
  /**
11823
12026
  * The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
11824
12027
  * must be unique per tokenizer: every model's siblings land in ONE flat
@@ -12997,8 +13200,13 @@ var AlertSeveritySchema = _enum([
12997
13200
  "info",
12998
13201
  "success",
12999
13202
  "warning",
13000
- "error"
13203
+ "error",
13204
+ "critical"
13001
13205
  ]);
13206
+ var AlertActionSchema = object({
13207
+ label: string(),
13208
+ href: string().optional()
13209
+ });
13002
13210
  var AlertStatusSchema = _enum([
13003
13211
  "active",
13004
13212
  "in-progress",
@@ -13016,6 +13224,7 @@ var AlertSchema = object({
13016
13224
  severity: AlertSeveritySchema,
13017
13225
  title: string(),
13018
13226
  message: string(),
13227
+ action: AlertActionSchema.optional(),
13019
13228
  status: AlertStatusSchema,
13020
13229
  progress: number().optional(),
13021
13230
  read: boolean(),
@@ -15551,6 +15760,41 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
15551
15760
  keyField: string()
15552
15761
  }).optional()
15553
15762
  })) });
15763
+ /**
15764
+ * The report of a one-shot "move this owner's plaintext secrets into the
15765
+ * keychain" run (D878). COUNTS only - never a value, never a ref.
15766
+ *
15767
+ * The owner runs it on its own rows, through its own write path; an operator
15768
+ * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
15769
+ * Dry run (`apply: false`) reports what WOULD move and changes nothing.
15770
+ */
15771
+ var RawSecretMigrationInputSchema = object({
15772
+ /** `false` (the default of the script) = report only. */
15773
+ apply: boolean() });
15774
+ var RawSecretMigrationReportSchema = object({
15775
+ apply: boolean(),
15776
+ /** Rows that can carry a secret (a profile, an enrolment). */
15777
+ rows: number().int(),
15778
+ /** Rows whose secret was plaintext when the run started. */
15779
+ raw: number().int(),
15780
+ /** Rows that already held a keychain marker when the run started. */
15781
+ markers: number().int(),
15782
+ /** Plaintext rows moved by THIS run (always 0 on a dry run). */
15783
+ migrated: number().int(),
15784
+ /** Plaintext rows left in place because the move or its read-back failed. */
15785
+ failed: number().int(),
15786
+ /** After the run: rows still holding plaintext. */
15787
+ remainingRaw: number().int(),
15788
+ /** After the run: markers the keychain could not resolve right now. */
15789
+ unresolvedMarkers: number().int(),
15790
+ /**
15791
+ * A second, redundant copy of the secrets' rows that the run found (and, on
15792
+ * `apply`, deleted after verifying the first). Owners with a single copy omit it.
15793
+ */
15794
+ redundantCopies: number().int().optional(),
15795
+ /** True when nothing is raw and every marker resolves. */
15796
+ verified: boolean()
15797
+ });
15554
15798
  /** Where a block runs. The operator chooses — a block driving a device on an
15555
15799
  * agent is the reason placement is not fixed to the hub. */
15556
15800
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -15777,6 +16021,9 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
15777
16021
  }), SettingsUpdateResultSchema, {
15778
16022
  kind: "mutation",
15779
16023
  auth: "admin"
16024
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
16025
+ kind: "mutation",
16026
+ auth: "admin"
15780
16027
  }), method(object({}), object({ libs: array(object({
15781
16028
  filePath: string(),
15782
16029
  content: string()
@@ -16040,6 +16287,347 @@ id: union([string(), number()]) }), {
16040
16287
  auth: "admin"
16041
16288
  });
16042
16289
  /**
16290
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16291
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16292
+ * (operator intent, D870) and device-history (numbers over time, D850).
16293
+ *
16294
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16295
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16296
+ * that with the addon id closed over). It is deliberately NOT in any input
16297
+ * schema, so a session can never supply it, and a call with no stamp is refused
16298
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16299
+ * addons go through the owner's capability.
16300
+ *
16301
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16302
+ * never `[]`. Secret fields are never on the wire: a read shows the
16303
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16304
+ * resolves itself, and a write may carry only a keychain marker bound to the
16305
+ * row's own ref.
16306
+ *
16307
+ * Internal: addons reach it through `ctx.records`, never directly.
16308
+ */
16309
+ var RecordIdSchema = string().min(1).max(256);
16310
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16311
+ var RecordBodySchema = record(string(), unknown());
16312
+ var RecordInputSchema = object({
16313
+ id: RecordIdSchema,
16314
+ /** The device this row belongs to (D865 removal, per-device reads). */
16315
+ deviceId: number().int().optional(),
16316
+ /** The domain clock, ms: observed / created / opened. */
16317
+ at: number().int().optional(),
16318
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16319
+ expiresAt: number().int().optional(),
16320
+ data: RecordBodySchema
16321
+ });
16322
+ var RecordViewSchema = object({
16323
+ id: string(),
16324
+ deviceId: number().int().nullable(),
16325
+ at: number().nullable(),
16326
+ expiresAt: number().nullable(),
16327
+ rev: number().int(),
16328
+ updatedAt: number(),
16329
+ data: RecordBodySchema
16330
+ });
16331
+ /** Declared index fields only. Anything else does not compile, by design. */
16332
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16333
+ string(),
16334
+ number(),
16335
+ boolean(),
16336
+ object({ in: array(union([
16337
+ string(),
16338
+ number(),
16339
+ boolean()
16340
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16341
+ object({
16342
+ gt: union([string(), number()]).optional(),
16343
+ gte: union([string(), number()]).optional(),
16344
+ lt: union([string(), number()]).optional(),
16345
+ lte: union([string(), number()]).optional()
16346
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16347
+ ]));
16348
+ var KindShape = { kind: RecordKindNameSchema };
16349
+ var TimeWindowShape = {
16350
+ deviceId: number().int().optional(),
16351
+ atFrom: number().optional(),
16352
+ atTo: number().optional()
16353
+ };
16354
+ var RecordQueryInputSchema = object({
16355
+ ...KindShape,
16356
+ ...TimeWindowShape,
16357
+ where: RecordWhereSchema.optional(),
16358
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16359
+ order: _enum(["at", "id"]).optional(),
16360
+ desc: boolean().optional(),
16361
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16362
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16363
+ cursor: string().min(1).optional()
16364
+ });
16365
+ var RecordQueryResultSchema = object({
16366
+ records: array(RecordViewSchema),
16367
+ nextCursor: string().nullable()
16368
+ });
16369
+ var RecordKindStateSchema = _enum([
16370
+ "created",
16371
+ "unchanged",
16372
+ "updated"
16373
+ ]);
16374
+ var DeclareKindResultSchema = object({
16375
+ kindId: number().int(),
16376
+ state: RecordKindStateSchema,
16377
+ createdIndexes: array(string()),
16378
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16379
+ adoptionPending: object({
16380
+ legacyTable: string(),
16381
+ legacyRows: number().int()
16382
+ }).nullable()
16383
+ });
16384
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16385
+ var SecretRefsList = array(string());
16386
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16387
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16388
+ kind: "mutation",
16389
+ auth: "admin"
16390
+ }), method(object({
16391
+ ...KindShape,
16392
+ id: RecordIdSchema
16393
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16394
+ ...KindShape,
16395
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16396
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16397
+ ...KindShape,
16398
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16399
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16400
+ ...KindShape,
16401
+ record: RecordInputSchema,
16402
+ /** Compare-and-set. `0` means "the row must not exist". */
16403
+ ifRev: number().int().min(0).optional()
16404
+ }), object({
16405
+ rev: number().int(),
16406
+ releasedRefs: SecretRefsList
16407
+ }), {
16408
+ kind: "mutation",
16409
+ auth: "admin"
16410
+ }), method(object({
16411
+ ...KindShape,
16412
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16413
+ }), object({
16414
+ count: number().int(),
16415
+ releasedRefs: SecretRefsList
16416
+ }), {
16417
+ kind: "mutation",
16418
+ auth: "admin"
16419
+ }), method(object({
16420
+ ...KindShape,
16421
+ id: RecordIdSchema,
16422
+ data: RecordBodySchema,
16423
+ at: number().int().nullable().optional(),
16424
+ expiresAt: number().int().nullable().optional(),
16425
+ ifRev: number().int().min(1).optional()
16426
+ }), object({
16427
+ rev: number().int(),
16428
+ releasedRefs: SecretRefsList
16429
+ }), {
16430
+ kind: "mutation",
16431
+ auth: "admin"
16432
+ }), method(object({
16433
+ ...KindShape,
16434
+ id: RecordIdSchema
16435
+ }), object({
16436
+ deleted: boolean(),
16437
+ secretRefs: SecretRefsList
16438
+ }), {
16439
+ kind: "mutation",
16440
+ auth: "admin"
16441
+ }), method(object({
16442
+ ...KindShape,
16443
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16444
+ }), object({
16445
+ deleted: number().int(),
16446
+ secretRefs: SecretRefsList
16447
+ }), {
16448
+ kind: "mutation",
16449
+ auth: "admin"
16450
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
16451
+ ...KindShape,
16452
+ ...TimeWindowShape,
16453
+ where: RecordWhereSchema.optional()
16454
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
16455
+ ...KindShape,
16456
+ deviceId: number().int().optional(),
16457
+ from: number(),
16458
+ to: number(),
16459
+ bucketMs: number().int().positive()
16460
+ }), object({ buckets: array(object({
16461
+ bucketStart: number(),
16462
+ count: number().int()
16463
+ })) }), { auth: "admin" }), method(object({
16464
+ ...KindShape,
16465
+ op: _enum([
16466
+ "sum",
16467
+ "min",
16468
+ "max",
16469
+ "count"
16470
+ ]),
16471
+ field: RecordFieldPathSchema.optional(),
16472
+ groupBy: RecordFieldPathSchema.optional(),
16473
+ where: RecordWhereSchema.optional()
16474
+ }), object({ rows: array(object({
16475
+ group: union([
16476
+ string(),
16477
+ number(),
16478
+ _null()
16479
+ ]),
16480
+ value: number().nullable()
16481
+ })) }), { auth: "admin" }), method(object({
16482
+ ...KindShape,
16483
+ deviceId: number().int().optional(),
16484
+ atBefore: number().optional(),
16485
+ where: RecordWhereSchema.optional()
16486
+ }), object({
16487
+ deleted: number().int(),
16488
+ secretRefs: SecretRefsList
16489
+ }), {
16490
+ kind: "mutation",
16491
+ auth: "admin"
16492
+ }), method(object({
16493
+ deviceId: number().int(),
16494
+ kinds: array(RecordKindNameSchema).optional()
16495
+ }), object({
16496
+ deleted: record(string(), number().int()),
16497
+ secretRefs: SecretRefsList
16498
+ }), {
16499
+ kind: "mutation",
16500
+ auth: "admin"
16501
+ }), method(object(KindShape), object({ id: number().int() }), {
16502
+ kind: "mutation",
16503
+ auth: "admin"
16504
+ });
16505
+ /** One table of the settings database. */
16506
+ var StorageTableSchema = object({
16507
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
16508
+ name: string(),
16509
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
16510
+ owner: string().nullable(),
16511
+ rows: number().int().nonnegative(),
16512
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
16513
+ bytes: number().int().nonnegative().nullable(),
16514
+ /** Declared by an addon since this engine process started (a running addon claims it). */
16515
+ declaredThisBoot: boolean()
16516
+ });
16517
+ /** One declared record kind (D881) as System -> Data shows it. */
16518
+ var StorageKindSchema = object({
16519
+ owner: string(),
16520
+ kind: string(),
16521
+ database: _enum(["settings", "events"]),
16522
+ class: string(),
16523
+ state: _enum([
16524
+ "declared",
16525
+ "orphaned",
16526
+ "dropped"
16527
+ ]),
16528
+ /** `null` when the caller asked for no counts (`counts: false`). */
16529
+ rows: number().int().nonnegative().nullable(),
16530
+ /** Rows x the average size of a sample; null for an empty kind. */
16531
+ bytesEstimate: number().int().nonnegative().nullable(),
16532
+ writeTrigger: string(),
16533
+ retention: RecordRetentionSchema,
16534
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
16535
+ entry: boolean(),
16536
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
16537
+ declaration: RecordKindDeclarationSchema
16538
+ });
16539
+ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
16540
+ collection: string().min(1),
16541
+ expectRows: number().int().nonnegative()
16542
+ }), object({
16543
+ dropped: literal(true),
16544
+ rows: number().int().nonnegative()
16545
+ }), {
16546
+ kind: "mutation",
16547
+ auth: "admin"
16548
+ }), method(object({
16549
+ owner: string().min(1).optional(),
16550
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
16551
+ counts: boolean().optional()
16552
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
16553
+ owner: string().min(1),
16554
+ kind: RecordKindNameSchema
16555
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
16556
+ owner: string().min(1),
16557
+ kind: RecordKindNameSchema,
16558
+ records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
16559
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
16560
+ complete: boolean().optional()
16561
+ }).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
16562
+ kind: "mutation",
16563
+ auth: "admin"
16564
+ }), method(object({
16565
+ collection: string().min(1),
16566
+ cursor: string().optional(),
16567
+ limit: number().int().min(1).max(1e3).optional()
16568
+ }), object({
16569
+ rows: array(object({
16570
+ id: string(),
16571
+ data: record(string(), unknown())
16572
+ })),
16573
+ nextCursor: string().nullable()
16574
+ }), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
16575
+ /**
16576
+ * record-entries - the ONE admin surface for every list of user-created entries
16577
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
16578
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
16579
+ *
16580
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
16581
+ * the entry body with `secret: true` on every credential field, so a password
16582
+ * field is derived from the schema and never from a name. `putEntry` takes the
16583
+ * redaction token for an untouched secret (the stored value is kept), a string
16584
+ * for a new one, and the clear instruction to remove one. A read never carries
16585
+ * a secret value, and a locked keychain refuses the write with
16586
+ * `records/secret-unavailable` instead of storing plaintext.
16587
+ *
16588
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
16589
+ */
16590
+ var EntryKindInfoSchema = object({
16591
+ owner: string(),
16592
+ kind: RecordKindNameSchema,
16593
+ title: string(),
16594
+ nameField: string(),
16595
+ /** JSON Schema of the body; `secret: true` marks a password field. */
16596
+ fields: record(string(), unknown()),
16597
+ secretPaths: array(string()),
16598
+ rows: number().int().nonnegative()
16599
+ });
16600
+ var EntryViewSchema = object({
16601
+ id: RecordIdSchema,
16602
+ name: string(),
16603
+ rev: number().int(),
16604
+ updatedAt: number(),
16605
+ /** Secret fields hold the redaction token. */
16606
+ data: RecordBodySchema
16607
+ });
16608
+ var EntryAddress = {
16609
+ owner: string().min(1),
16610
+ kind: RecordKindNameSchema
16611
+ };
16612
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
16613
+ ...EntryAddress,
16614
+ id: RecordIdSchema.optional(),
16615
+ data: RecordBodySchema,
16616
+ ifRev: number().int().min(1).optional()
16617
+ }), object({
16618
+ id: string(),
16619
+ rev: number().int()
16620
+ }), {
16621
+ kind: "mutation",
16622
+ auth: "admin"
16623
+ }), method(object({
16624
+ ...EntryAddress,
16625
+ id: RecordIdSchema
16626
+ }), object({ deleted: boolean() }), {
16627
+ kind: "mutation",
16628
+ auth: "admin"
16629
+ });
16630
+ /**
16043
16631
  * `keychain` — the hub's encrypted store of secret values (D787).
16044
16632
  *
16045
16633
  * Settings blobs never hold a secret: they hold a marker
@@ -16580,6 +17168,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
16580
17168
  kind: "mutation",
16581
17169
  auth: "admin",
16582
17170
  caller: "required"
17171
+ }), method(object({
17172
+ ref: string().min(1),
17173
+ value: string().min(1)
17174
+ }), object({
17175
+ ref: string(),
17176
+ version: number().int()
17177
+ }), {
17178
+ kind: "mutation",
17179
+ auth: "admin",
17180
+ caller: "required"
16583
17181
  }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
16584
17182
  deleted: array(string()).readonly(),
16585
17183
  kept: array(object({
@@ -39258,6 +39856,9 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
39258
39856
  }), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
39259
39857
  kind: "mutation",
39260
39858
  auth: "admin"
39859
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
39860
+ kind: "mutation",
39861
+ auth: "admin"
39261
39862
  }), method(ProfileRefInputSchema, _void(), {
39262
39863
  kind: "mutation",
39263
39864
  auth: "admin"
@@ -49767,6 +50368,41 @@ var ServerRollbackInfoSchema = object({
49767
50368
  atMs: number(),
49768
50369
  reason: string()
49769
50370
  });
50371
+ /**
50372
+ * The runner boot check (D877): the runners this node PLANNED (hub: one per
50373
+ * `resolveRunnerId` over its forked addons; agent: the runners its process
50374
+ * service holds, because only the hub plans) against the states the process
50375
+ * service reports. Kept in memory, recomputed by the same one-shot check after
50376
+ * every boot, served on `getServerPackageStatus`.
50377
+ *
50378
+ * `failed` is the D6 breaker's terminal state, `refused` a deterministic Init
50379
+ * refusal (an addon that said "I will not start, and here is why"), `missing` a
50380
+ * planned runner the process service has no entry for.
50381
+ */
50382
+ var RunnerRefusalSchema = object({
50383
+ runnerId: string(),
50384
+ addonIds: array(string()),
50385
+ reason: string()
50386
+ });
50387
+ var RunnerBootCheckSchema = object({
50388
+ checkedAtMs: number(),
50389
+ /** Runners planned for this node. */
50390
+ expected: number(),
50391
+ /** Planned runners whose process is `running`. */
50392
+ running: number(),
50393
+ failed: array(string()),
50394
+ refused: array(RunnerRefusalSchema),
50395
+ missing: array(string()),
50396
+ /**
50397
+ * Runners still on their way: `starting`, or `crashed` waiting on a backoff
50398
+ * respawn. The check is FINAL only when this is empty; until then nothing is
50399
+ * pushed and the verdict is re-evaluated on the next runner state change.
50400
+ * Optional for version skew (absent = settled).
50401
+ */
50402
+ pending: array(string()).optional(),
50403
+ /** True when the plan is the hub's (`missing` is then meaningful); false on an agent. */
50404
+ planKnown: boolean()
50405
+ });
49770
50406
  var ServerPackageStatusSchema = object({
49771
50407
  /** Root package name (`@camstack/server` on the hub). */
49772
50408
  packageName: string(),
@@ -49829,7 +50465,14 @@ var ServerPackageStatusSchema = object({
49829
50465
  * for version skew: an older provider's payload simply omits it, and an
49830
50466
  * absent wrapper is unknown — never `native`.
49831
50467
  */
49832
- wrapper: WrapperIdentitySchema.optional()
50468
+ wrapper: WrapperIdentitySchema.optional(),
50469
+ /**
50470
+ * What this node PLANNED to run against what its process service reports
50471
+ * (D877). Absent until the one-shot boot check has run (~60 s after boot) and
50472
+ * on a provider that predates it. Absent is "not checked yet", never "all
50473
+ * well": a consumer that needs the answer treats it as pending.
50474
+ */
50475
+ runners: RunnerBootCheckSchema.optional()
49833
50476
  });
49834
50477
  var ServerUpdateCheckResultSchema = object({
49835
50478
  packageName: string(),
@@ -49880,6 +50523,13 @@ var ServerUpdateOutcomeSchema = _enum([
49880
50523
  "refused",
49881
50524
  "failed"
49882
50525
  ]);
50526
+ /** One addon the pre-flight found the target version would refuse (D877). */
50527
+ var UpdateBlockerSchema = object({
50528
+ addonId: string(),
50529
+ reason: string(),
50530
+ /** What the operator does about it. */
50531
+ remedy: string()
50532
+ });
49883
50533
  var ServerUpdateActionResultSchema = object({
49884
50534
  accepted: boolean(),
49885
50535
  targetVersion: string().nullable(),
@@ -49897,14 +50547,27 @@ var ServerUpdateActionResultSchema = object({
49897
50547
  * The failure itself, verbatim enough to act on (the npm output for a
49898
50548
  * staging install). Non-null only for `failed`.
49899
50549
  */
49900
- error: string().nullable().optional()
50550
+ error: string().nullable().optional(),
50551
+ /**
50552
+ * The addons the target version would refuse to start on this node's live
50553
+ * store (D877), present when the pre-flight refused the update
50554
+ * (`reason: 'addon-would-refuse'`). Optional for version skew.
50555
+ */
50556
+ blockers: array(UpdateBlockerSchema).optional()
49901
50557
  });
49902
50558
  method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
49903
50559
  kind: "mutation",
49904
50560
  auth: "admin"
49905
- }), method(object({
49906
- /** Explicit target version; omitted = latest from the registry. */
49907
- version: string().optional() }), ServerUpdateActionResultSchema, {
50561
+ }), method(object({
50562
+ /** Explicit target version; omitted = latest from the registry. */
50563
+ version: string().optional(),
50564
+ /**
50565
+ * Apply even though the pre-flight (D877) found addons the target would
50566
+ * refuse to start. Off by default: those addons stay down until the
50567
+ * remedy is run, which is the incident this gate exists to prevent.
50568
+ */
50569
+ acknowledgeRefusals: boolean().optional()
50570
+ }), ServerUpdateActionResultSchema, {
49908
50571
  kind: "mutation",
49909
50572
  auth: "admin",
49910
50573
  timeoutMs: 16 * 6e4
@@ -52350,7 +53013,9 @@ var ManifestShapeSchema = object({
52350
53013
  var AddonProcessSchema = object({
52351
53014
  pid: number().optional(),
52352
53015
  mode: string(),
52353
- state: string()
53016
+ state: string(),
53017
+ /** Why the runner is `refused` (an addon's own words), when it is (D877). */
53018
+ reason: string().optional()
52354
53019
  });
52355
53020
  /**
52356
53021
  * Per-addon health snapshot from the kernel's AddonHealthMonitor.
@@ -53118,7 +53783,8 @@ var batteryCapability = {
53118
53783
  DeviceType.Button,
53119
53784
  DeviceType.Switch,
53120
53785
  DeviceType.PetFeeder,
53121
- DeviceType.Container
53786
+ DeviceType.Container,
53787
+ DeviceType.Thermostat
53122
53788
  ],
53123
53789
  methods: {
53124
53790
  /**
@@ -53739,6 +54405,12 @@ var ClimateControlStatusSchema = object({
53739
54405
  /** Horizontal louver swing on/off. Null when the device has no
53740
54406
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
53741
54407
  swingHorizontal: boolean().nullable(),
54408
+ /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
54409
+ minTemp: number().nullable().optional(),
54410
+ /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
54411
+ maxTemp: number().nullable().optional(),
54412
+ /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
54413
+ tempStep: number().positive().nullable().optional(),
53742
54414
  /** Ms epoch when the slice was last updated (push or command). */
53743
54415
  lastFetchedAt: number()
53744
54416
  });
@@ -54593,6 +55265,125 @@ onStatusChanged: { data: object({
54593
55265
  * whether persisting is worth a SQLite commit. */
54594
55266
  volatileStateFields: ["lastChangedAt"]
54595
55267
  };
55268
+ /**
55269
+ * Smart-dishwasher cap — program lifecycle, door / remote-start gates,
55270
+ * consumable levels (salt, rinse aid) and common program options.
55271
+ *
55272
+ * Sources: native Bosch Home Connect (`dishwasher` device type). Reusable
55273
+ * by any integration that exposes the same program / option surface.
55274
+ *
55275
+ * `kind: 'poll'` — cloud REST APIs typically have no push channel; the
55276
+ * provider refreshes the slice on an interval and eagerly after commands.
55277
+ */
55278
+ var DishwasherStateSchema = _enum([
55279
+ "idle",
55280
+ "running",
55281
+ "paused",
55282
+ "finished",
55283
+ "error",
55284
+ "unavailable"
55285
+ ]);
55286
+ var DishwasherConsumableLevelSchema = _enum([
55287
+ "ok",
55288
+ "low",
55289
+ "empty"
55290
+ ]);
55291
+ var DishwasherStatusSchema = object({
55292
+ state: DishwasherStateSchema,
55293
+ /** Active program id/name, or null when none selected / unknown. */
55294
+ program: string().nullable(),
55295
+ /** Program tokens the hardware accepts — drives the UI selector. */
55296
+ availablePrograms: array(string()),
55297
+ /** Minutes remaining on the active cycle, or null when not running. */
55298
+ remainingMinutes: number().int().nonnegative().nullable(),
55299
+ /** Cycle completion 0..100, or null when not applicable. */
55300
+ progressPercent: number().min(0).max(100).nullable(),
55301
+ /** True when the door is reported open. */
55302
+ doorOpen: boolean(),
55303
+ /** True when remote start is allowed (door closed, power on, etc.). */
55304
+ remoteStartAllowed: boolean(),
55305
+ /** Main power / switched-on state. */
55306
+ powerOn: boolean(),
55307
+ saltLevel: DishwasherConsumableLevelSchema.nullable(),
55308
+ rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55309
+ halfLoad: boolean(),
55310
+ hygienePlus: boolean(),
55311
+ errorCode: number().nullable(),
55312
+ errorLabel: string().nullable(),
55313
+ lastFetchedAt: number()
55314
+ });
55315
+ var dishwasherCapability = {
55316
+ name: "dishwasher",
55317
+ scope: "device",
55318
+ deviceNative: true,
55319
+ mode: "singleton",
55320
+ deviceTypes: [DeviceType.Dishwasher],
55321
+ methods: {
55322
+ start: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55323
+ kind: "mutation",
55324
+ auth: "protected"
55325
+ }),
55326
+ pause: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55327
+ kind: "mutation",
55328
+ auth: "protected"
55329
+ }),
55330
+ stop: method(object({ deviceId: number().int().nonnegative() }), _void(), {
55331
+ kind: "mutation",
55332
+ auth: "protected"
55333
+ }),
55334
+ setProgram: method(object({
55335
+ deviceId: number().int().nonnegative(),
55336
+ program: string().min(1)
55337
+ }), _void(), {
55338
+ kind: "mutation",
55339
+ auth: "protected"
55340
+ }),
55341
+ setPower: method(object({
55342
+ deviceId: number().int().nonnegative(),
55343
+ on: boolean()
55344
+ }), _void(), {
55345
+ kind: "mutation",
55346
+ auth: "protected"
55347
+ }),
55348
+ setHalfLoad: method(object({
55349
+ deviceId: number().int().nonnegative(),
55350
+ on: boolean()
55351
+ }), _void(), {
55352
+ kind: "mutation",
55353
+ auth: "protected"
55354
+ }),
55355
+ setHygienePlus: method(object({
55356
+ deviceId: number().int().nonnegative(),
55357
+ on: boolean()
55358
+ }), _void(), {
55359
+ kind: "mutation",
55360
+ auth: "protected"
55361
+ }),
55362
+ setOption: method(object({
55363
+ deviceId: number().int().nonnegative(),
55364
+ key: string().min(1),
55365
+ value: union([
55366
+ boolean(),
55367
+ string(),
55368
+ number()
55369
+ ])
55370
+ }), _void(), {
55371
+ kind: "mutation",
55372
+ auth: "protected"
55373
+ })
55374
+ },
55375
+ status: {
55376
+ schema: DishwasherStatusSchema,
55377
+ kind: "poll"
55378
+ },
55379
+ runtimeState: DishwasherStatusSchema,
55380
+ durability: "session",
55381
+ history: { fields: { progressPercent: {
55382
+ kind: "gauge",
55383
+ unit: "%",
55384
+ deadband: 2
55385
+ } } }
55386
+ };
54596
55387
  var DoorbellStatusSchema = object({
54597
55388
  /** Ms epoch of the last press. null = never observed since this provider started. */
54598
55389
  lastPressedAt: number().nullable(),
@@ -55395,6 +56186,32 @@ var gasCapability = {
55395
56186
  * whether persisting is worth a SQLite commit. */
55396
56187
  volatileStateFields: ["lastChangedAt"]
55397
56188
  };
56189
+ var HeatingValveStatusSchema = object({
56190
+ /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
56191
+ position: number().min(0).max(100).nullable(),
56192
+ /** Ms epoch when the slice was last updated (push or poll). */
56193
+ lastFetchedAt: number()
56194
+ });
56195
+ var heatingValveCapability = {
56196
+ name: "heating-valve",
56197
+ scope: "device",
56198
+ deviceNative: true,
56199
+ mode: "singleton",
56200
+ deviceTypes: [DeviceType.Thermostat],
56201
+ methods: {},
56202
+ status: {
56203
+ schema: HeatingValveStatusSchema,
56204
+ kind: "push"
56205
+ },
56206
+ runtimeState: HeatingValveStatusSchema,
56207
+ durability: "session",
56208
+ history: { fields: { position: {
56209
+ kind: "gauge",
56210
+ unit: "%",
56211
+ deadband: 1
56212
+ } } },
56213
+ volatileStateFields: ["lastFetchedAt"]
56214
+ };
55398
56215
  /**
55399
56216
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
55400
56217
  * an on/off actuator with an optional target-humidity setpoint and an
@@ -56527,7 +57344,19 @@ var TlsStatusSchema = object({
56527
57344
  sans: array(string()),
56528
57345
  caCertPem: string().nullable(),
56529
57346
  reissueError: string().nullable(),
56530
- restartRequired: boolean()
57347
+ restartRequired: boolean(),
57348
+ /** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
57349
+ caMissing: boolean(),
57350
+ /** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
57351
+ localCaConstrained: boolean().nullable(),
57352
+ /** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
57353
+ caReplacedAt: string().nullable(),
57354
+ /** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
57355
+ storedUpload: object({
57356
+ leafFingerprintSha256: string(),
57357
+ validTo: string(),
57358
+ hasCa: boolean()
57359
+ }).nullable()
56531
57360
  });
56532
57361
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
56533
57362
  /**
@@ -56583,6 +57412,9 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
56583
57412
  }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
56584
57413
  kind: "mutation",
56585
57414
  auth: "admin"
57415
+ }), method(_void(), TlsStatusSchema, {
57416
+ kind: "mutation",
57417
+ auth: "admin"
56586
57418
  });
56587
57419
  var LockControlStatusSchema = object({
56588
57420
  /** Lifecycle state of the lock. `jammed` means the motor reported
@@ -63076,7 +63908,11 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
63076
63908
  kind: "mutation",
63077
63909
  auth: "admin",
63078
63910
  access: "delete"
63079
- }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(object({
63911
+ }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
63912
+ kind: "mutation",
63913
+ auth: "admin",
63914
+ access: "create"
63915
+ }), method(object({
63080
63916
  userId: string(),
63081
63917
  code: string()
63082
63918
  }), object({ valid: boolean() }), {
@@ -64796,6 +65632,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
64796
65632
  dayNight: dayNightCapability,
64797
65633
  deviceDiscovery: deviceDiscoveryCapability,
64798
65634
  deviceStatus: deviceStatusCapability,
65635
+ dishwasher: dishwasherCapability,
64799
65636
  doorbell: doorbellCapability,
64800
65637
  enumSensor: enumSensorCapability,
64801
65638
  eventEmitter: eventEmitterCapability,
@@ -64803,6 +65640,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
64803
65640
  featureProbe: featureProbeCapability,
64804
65641
  flood: floodCapability,
64805
65642
  gas: gasCapability,
65643
+ heatingValve: heatingValveCapability,
64806
65644
  humidifier: humidifierCapability,
64807
65645
  humiditySensor: humiditySensorCapability,
64808
65646
  image: imageCapability,
@@ -64888,13 +65726,14 @@ var BaseDevice$1 = class {
64888
65726
  get state() {
64889
65727
  if (!this._stateProxyCache) {
64890
65728
  const cache = {};
64891
- const handler = { get: (_target, key) => {
65729
+ const handler = { get: (target, key) => {
64892
65730
  const k = key;
64893
- if (k in cache) return cache[k];
65731
+ const existing = Reflect.get(target, k);
65732
+ if (existing !== void 0) return existing;
64894
65733
  const cap = DEVICE_LOCAL_STATE_CAPS[k];
64895
65734
  if (!cap) return void 0;
64896
65735
  const proxy = this.sliceProxy(cap);
64897
- cache[k] = proxy;
65736
+ Reflect.set(target, k, proxy);
64898
65737
  return proxy;
64899
65738
  } };
64900
65739
  this._stateProxyCache = new Proxy(cache, handler);
@@ -65093,7 +65932,7 @@ var BaseDevice$1 = class {
65093
65932
  async updateSourceInfo(patch) {
65094
65933
  const next = mergeSourceInfo(this.sourceInfo, patch);
65095
65934
  this._sourceInfoCache = Object.freeze({ ...next });
65096
- const action = this.ctx.api?.deviceManager?.setMetadata;
65935
+ const action = this.ctx.api.deviceManager?.setMetadata;
65097
65936
  if (action) try {
65098
65937
  await action.mutate({
65099
65938
  deviceId: this.id,
@@ -65128,7 +65967,7 @@ var BaseDevice$1 = class {
65128
65967
  * device boot on a meta refresh.
65129
65968
  */
65130
65969
  async refreshFeatures() {
65131
- const action = this.ctx.api?.deviceManager?.registerDevice;
65970
+ const action = this.ctx.api.deviceManager?.registerDevice;
65132
65971
  if (!action) return;
65133
65972
  try {
65134
65973
  await action.mutate({
@@ -65527,6 +66366,12 @@ var BaseDeviceProvider = class extends BaseAddon {
65527
66366
  provider: this
65528
66367
  }];
65529
66368
  }
66369
+ /** Flatten `super.onInitialize()` whether it returned an array or an envelope. */
66370
+ providerRegistrationsFromSuper(result) {
66371
+ if (Array.isArray(result)) return result;
66372
+ if (result !== void 0 && result.providers !== void 0) return [...result.providers];
66373
+ return [];
66374
+ }
65530
66375
  async onShutdown() {
65531
66376
  this._restoreShuttingDown = true;
65532
66377
  this.cancelRestoreRetries();
@@ -66053,7 +66898,7 @@ var BaseDeviceProvider = class extends BaseAddon {
66053
66898
  return toDeviceSummary(device, this.addonId);
66054
66899
  }
66055
66900
  };
66056
- 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;
66901
+ 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;
66057
66902
  new Set(Object.values(DeviceType));
66058
66903
  Object.freeze({
66059
66904
  "accessories.getStatus": {
@@ -67202,6 +68047,12 @@ Object.freeze({
67202
68047
  addonId: null,
67203
68048
  access: "view"
67204
68049
  },
68050
+ "coreBlocks.migrateRawSecrets": {
68051
+ capName: "core-blocks",
68052
+ capScope: "system",
68053
+ addonId: null,
68054
+ access: "create"
68055
+ },
67205
68056
  "coreBlocks.restart": {
67206
68057
  capName: "core-blocks",
67207
68058
  capScope: "system",
@@ -68468,6 +69319,60 @@ Object.freeze({
68468
69319
  addonId: null,
68469
69320
  access: "view"
68470
69321
  },
69322
+ "dishwasher.getStatus": {
69323
+ capName: "dishwasher",
69324
+ capScope: "device",
69325
+ addonId: null,
69326
+ access: "view"
69327
+ },
69328
+ "dishwasher.pause": {
69329
+ capName: "dishwasher",
69330
+ capScope: "device",
69331
+ addonId: null,
69332
+ access: "create"
69333
+ },
69334
+ "dishwasher.setHalfLoad": {
69335
+ capName: "dishwasher",
69336
+ capScope: "device",
69337
+ addonId: null,
69338
+ access: "create"
69339
+ },
69340
+ "dishwasher.setHygienePlus": {
69341
+ capName: "dishwasher",
69342
+ capScope: "device",
69343
+ addonId: null,
69344
+ access: "create"
69345
+ },
69346
+ "dishwasher.setOption": {
69347
+ capName: "dishwasher",
69348
+ capScope: "device",
69349
+ addonId: null,
69350
+ access: "create"
69351
+ },
69352
+ "dishwasher.setPower": {
69353
+ capName: "dishwasher",
69354
+ capScope: "device",
69355
+ addonId: null,
69356
+ access: "create"
69357
+ },
69358
+ "dishwasher.setProgram": {
69359
+ capName: "dishwasher",
69360
+ capScope: "device",
69361
+ addonId: null,
69362
+ access: "create"
69363
+ },
69364
+ "dishwasher.start": {
69365
+ capName: "dishwasher",
69366
+ capScope: "device",
69367
+ addonId: null,
69368
+ access: "create"
69369
+ },
69370
+ "dishwasher.stop": {
69371
+ capName: "dishwasher",
69372
+ capScope: "device",
69373
+ addonId: null,
69374
+ access: "create"
69375
+ },
68471
69376
  "doorbell.getStatus": {
68472
69377
  capName: "doorbell",
68473
69378
  capScope: "device",
@@ -68678,6 +69583,12 @@ Object.freeze({
68678
69583
  addonId: null,
68679
69584
  access: "view"
68680
69585
  },
69586
+ "heatingValve.getStatus": {
69587
+ capName: "heating-valve",
69588
+ capScope: "device",
69589
+ addonId: null,
69590
+ access: "view"
69591
+ },
68681
69592
  "humidifier.getStatus": {
68682
69593
  capName: "humidifier",
68683
69594
  capScope: "device",
@@ -68888,6 +69799,12 @@ Object.freeze({
68888
69799
  addonId: null,
68889
69800
  access: "create"
68890
69801
  },
69802
+ "keychainAdmin.importSecret": {
69803
+ capName: "keychain-admin",
69804
+ capScope: "system",
69805
+ addonId: null,
69806
+ access: "create"
69807
+ },
68891
69808
  "keychainAdmin.listAudit": {
68892
69809
  capName: "keychain-admin",
68893
69810
  capScope: "system",
@@ -69056,6 +69973,12 @@ Object.freeze({
69056
69973
  addonId: null,
69057
69974
  access: "view"
69058
69975
  },
69976
+ "llm.migrateRawSecrets": {
69977
+ capName: "llm",
69978
+ capScope: "system",
69979
+ addonId: null,
69980
+ access: "create"
69981
+ },
69059
69982
  "llm.resolveModelRef": {
69060
69983
  capName: "llm",
69061
69984
  capScope: "system",
@@ -69284,6 +70207,12 @@ Object.freeze({
69284
70207
  addonId: null,
69285
70208
  access: "create"
69286
70209
  },
70210
+ "localNetwork.useStoredUploadedCertificate": {
70211
+ capName: "local-network",
70212
+ capScope: "system",
70213
+ addonId: null,
70214
+ access: "create"
70215
+ },
69287
70216
  "lockControl.getStatus": {
69288
70217
  capName: "lock-control",
69289
70218
  capScope: "device",
@@ -71936,6 +72865,30 @@ Object.freeze({
71936
72865
  addonId: null,
71937
72866
  access: "create"
71938
72867
  },
72868
+ "recordEntries.deleteEntry": {
72869
+ capName: "record-entries",
72870
+ capScope: "system",
72871
+ addonId: null,
72872
+ access: "delete"
72873
+ },
72874
+ "recordEntries.listEntries": {
72875
+ capName: "record-entries",
72876
+ capScope: "system",
72877
+ addonId: null,
72878
+ access: "view"
72879
+ },
72880
+ "recordEntries.listEntryKinds": {
72881
+ capName: "record-entries",
72882
+ capScope: "system",
72883
+ addonId: null,
72884
+ access: "view"
72885
+ },
72886
+ "recordEntries.putEntry": {
72887
+ capName: "record-entries",
72888
+ capScope: "system",
72889
+ addonId: null,
72890
+ access: "create"
72891
+ },
71939
72892
  "recording.getAvailability": {
71940
72893
  capName: "recording",
71941
72894
  capScope: "device",
@@ -72236,6 +73189,102 @@ Object.freeze({
72236
73189
  addonId: null,
72237
73190
  access: "view"
72238
73191
  },
73192
+ "records.aggregate": {
73193
+ capName: "records",
73194
+ capScope: "system",
73195
+ addonId: null,
73196
+ access: "view"
73197
+ },
73198
+ "records.allocateId": {
73199
+ capName: "records",
73200
+ capScope: "system",
73201
+ addonId: null,
73202
+ access: "create"
73203
+ },
73204
+ "records.count": {
73205
+ capName: "records",
73206
+ capScope: "system",
73207
+ addonId: null,
73208
+ access: "view"
73209
+ },
73210
+ "records.declareKinds": {
73211
+ capName: "records",
73212
+ capScope: "system",
73213
+ addonId: null,
73214
+ access: "create"
73215
+ },
73216
+ "records.delete": {
73217
+ capName: "records",
73218
+ capScope: "system",
73219
+ addonId: null,
73220
+ access: "delete"
73221
+ },
73222
+ "records.deleteDevice": {
73223
+ capName: "records",
73224
+ capScope: "system",
73225
+ addonId: null,
73226
+ access: "delete"
73227
+ },
73228
+ "records.deleteMany": {
73229
+ capName: "records",
73230
+ capScope: "system",
73231
+ addonId: null,
73232
+ access: "delete"
73233
+ },
73234
+ "records.deleteWhere": {
73235
+ capName: "records",
73236
+ capScope: "system",
73237
+ addonId: null,
73238
+ access: "delete"
73239
+ },
73240
+ "records.get": {
73241
+ capName: "records",
73242
+ capScope: "system",
73243
+ addonId: null,
73244
+ access: "view"
73245
+ },
73246
+ "records.getMany": {
73247
+ capName: "records",
73248
+ capScope: "system",
73249
+ addonId: null,
73250
+ access: "view"
73251
+ },
73252
+ "records.histogram": {
73253
+ capName: "records",
73254
+ capScope: "system",
73255
+ addonId: null,
73256
+ access: "view"
73257
+ },
73258
+ "records.patch": {
73259
+ capName: "records",
73260
+ capScope: "system",
73261
+ addonId: null,
73262
+ access: "create"
73263
+ },
73264
+ "records.put": {
73265
+ capName: "records",
73266
+ capScope: "system",
73267
+ addonId: null,
73268
+ access: "create"
73269
+ },
73270
+ "records.putMany": {
73271
+ capName: "records",
73272
+ capScope: "system",
73273
+ addonId: null,
73274
+ access: "create"
73275
+ },
73276
+ "records.query": {
73277
+ capName: "records",
73278
+ capScope: "system",
73279
+ addonId: null,
73280
+ access: "view"
73281
+ },
73282
+ "records.secretRefs": {
73283
+ capName: "records",
73284
+ capScope: "system",
73285
+ addonId: null,
73286
+ access: "view"
73287
+ },
72239
73288
  "sceneMonitor.captureReference": {
72240
73289
  capName: "scene-monitor",
72241
73290
  capScope: "device",
@@ -72668,6 +73717,48 @@ Object.freeze({
72668
73717
  addonId: null,
72669
73718
  access: "create"
72670
73719
  },
73720
+ "storageAdmin.adoptRecords": {
73721
+ capName: "storage-admin",
73722
+ capScope: "system",
73723
+ addonId: null,
73724
+ access: "create"
73725
+ },
73726
+ "storageAdmin.dropCollection": {
73727
+ capName: "storage-admin",
73728
+ capScope: "system",
73729
+ addonId: null,
73730
+ access: "delete"
73731
+ },
73732
+ "storageAdmin.isAdoptedLegacyTable": {
73733
+ capName: "storage-admin",
73734
+ capScope: "system",
73735
+ addonId: null,
73736
+ access: "view"
73737
+ },
73738
+ "storageAdmin.listKinds": {
73739
+ capName: "storage-admin",
73740
+ capScope: "system",
73741
+ addonId: null,
73742
+ access: "view"
73743
+ },
73744
+ "storageAdmin.listTables": {
73745
+ capName: "storage-admin",
73746
+ capScope: "system",
73747
+ addonId: null,
73748
+ access: "view"
73749
+ },
73750
+ "storageAdmin.readLegacyCollection": {
73751
+ capName: "storage-admin",
73752
+ capScope: "system",
73753
+ addonId: null,
73754
+ access: "view"
73755
+ },
73756
+ "storageAdmin.readRecords": {
73757
+ capName: "storage-admin",
73758
+ capScope: "system",
73759
+ addonId: null,
73760
+ access: "view"
73761
+ },
72671
73762
  "storageEvictable.evict": {
72672
73763
  capName: "storage-evictable",
72673
73764
  capScope: "system",
@@ -73580,6 +74671,12 @@ Object.freeze({
73580
74671
  addonId: null,
73581
74672
  access: "view"
73582
74673
  },
74674
+ "userManagement.migrateRawSecrets": {
74675
+ capName: "user-management",
74676
+ capScope: "system",
74677
+ addonId: null,
74678
+ access: "create"
74679
+ },
73583
74680
  "userManagement.oauthExchangeCode": {
73584
74681
  capName: "user-management",
73585
74682
  capScope: "system",
@@ -74079,7 +75176,7 @@ Object.freeze({
74079
75176
  access: "create"
74080
75177
  }
74081
75178
  });
74082
- 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;
75179
+ 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;
74083
75180
  DeviceFeature.BatteryOperated;
74084
75181
  Object.freeze({
74085
75182
  "accessories.getStatus": [{
@@ -74903,6 +76000,51 @@ Object.freeze({
74903
76000
  form: "single",
74904
76001
  optional: false
74905
76002
  }],
76003
+ "dishwasher.getStatus": [{
76004
+ name: "deviceId",
76005
+ form: "single",
76006
+ optional: false
76007
+ }],
76008
+ "dishwasher.pause": [{
76009
+ name: "deviceId",
76010
+ form: "single",
76011
+ optional: false
76012
+ }],
76013
+ "dishwasher.setHalfLoad": [{
76014
+ name: "deviceId",
76015
+ form: "single",
76016
+ optional: false
76017
+ }],
76018
+ "dishwasher.setHygienePlus": [{
76019
+ name: "deviceId",
76020
+ form: "single",
76021
+ optional: false
76022
+ }],
76023
+ "dishwasher.setOption": [{
76024
+ name: "deviceId",
76025
+ form: "single",
76026
+ optional: false
76027
+ }],
76028
+ "dishwasher.setPower": [{
76029
+ name: "deviceId",
76030
+ form: "single",
76031
+ optional: false
76032
+ }],
76033
+ "dishwasher.setProgram": [{
76034
+ name: "deviceId",
76035
+ form: "single",
76036
+ optional: false
76037
+ }],
76038
+ "dishwasher.start": [{
76039
+ name: "deviceId",
76040
+ form: "single",
76041
+ optional: false
76042
+ }],
76043
+ "dishwasher.stop": [{
76044
+ name: "deviceId",
76045
+ form: "single",
76046
+ optional: false
76047
+ }],
74906
76048
  "doorbell.getStatus": [{
74907
76049
  name: "deviceId",
74908
76050
  form: "single",
@@ -74972,6 +76114,11 @@ Object.freeze({
74972
76114
  form: "single",
74973
76115
  optional: false
74974
76116
  }],
76117
+ "heatingValve.getStatus": [{
76118
+ name: "deviceId",
76119
+ form: "single",
76120
+ optional: false
76121
+ }],
74975
76122
  "humidifier.getStatus": [{
74976
76123
  name: "deviceId",
74977
76124
  form: "single",
@@ -76256,6 +77403,37 @@ Object.freeze({
76256
77403
  form: "single",
76257
77404
  optional: false
76258
77405
  }],
77406
+ "records.count": [{
77407
+ name: "deviceId",
77408
+ form: "single",
77409
+ optional: true
77410
+ }],
77411
+ "records.deleteDevice": [{
77412
+ name: "deviceId",
77413
+ form: "single",
77414
+ optional: false
77415
+ }],
77416
+ "records.deleteWhere": [{
77417
+ name: "deviceId",
77418
+ form: "single",
77419
+ optional: true
77420
+ }],
77421
+ "records.histogram": [{
77422
+ name: "deviceId",
77423
+ form: "single",
77424
+ optional: true
77425
+ }],
77426
+ "records.putMany": [{
77427
+ name: "records",
77428
+ form: "object-array",
77429
+ optional: false,
77430
+ itemField: "deviceId"
77431
+ }],
77432
+ "records.query": [{
77433
+ name: "deviceId",
77434
+ form: "single",
77435
+ optional: true
77436
+ }],
76259
77437
  "sceneMonitor.captureReference": [{
76260
77438
  name: "deviceId",
76261
77439
  form: "single",
@@ -76372,6 +77550,17 @@ Object.freeze({
76372
77550
  form: "single",
76373
77551
  optional: false
76374
77552
  }],
77553
+ "storageAdmin.adoptRecords": [{
77554
+ name: "records",
77555
+ form: "object-array",
77556
+ optional: false,
77557
+ itemField: "deviceId"
77558
+ }],
77559
+ "storageAdmin.readRecords": [{
77560
+ name: "deviceId",
77561
+ form: "single",
77562
+ optional: true
77563
+ }],
76375
77564
  "streamBroker.acquireEgressTranscode": [{
76376
77565
  name: "deviceId",
76377
77566
  form: "single",
@@ -84088,7 +85277,7 @@ var DreoProviderAddon = class extends BaseDeviceProvider {
84088
85277
  super({});
84089
85278
  }
84090
85279
  async onInitialize() {
84091
- const regs = await super.onInitialize();
85280
+ const regs = this.providerRegistrationsFromSuper(await super.onInitialize());
84092
85281
  this.clients = new DreoClientRegistry(this.ctx.logger);
84093
85282
  this.clients.setOnConnected((integrationId) => {
84094
85283
  this.ctx.logger.info("Dreo: integration connected", { meta: { integrationId } });