@camstack/addon-provider-homeassistant 1.2.172 → 1.2.601

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.
@@ -1,5 +1,5 @@
1
1
  require("node:crypto");
2
- //#region ../types/dist/event-category-C4hVnRo8.mjs
2
+ //#region ../types/dist/event-category-BvOFi6PY.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -63,6 +63,24 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
63
63
  * consumes this category and maps it to the `addon-crash-loop` kind.
64
64
  */
65
65
  EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
66
+ /**
67
+ * A runner whose addon refused to start with a typed reason (D877) - parked
68
+ * in `refused`, never counted by the crash breaker, retried on operator
69
+ * action. One event per refusal.
70
+ */
71
+ EventCategory["AddonRunnerRefused"] = "addon.runner-refused";
72
+ /**
73
+ * A runner settled on a state (D877): `running` (READY), `crashed`, `failed` or
74
+ * `refused`. In-process telemetry for the boot check (re-evaluate while any
75
+ * runner is still pending) and the alert centre (close a recovered runner).
76
+ */
77
+ EventCategory["ProcessStateChanged"] = "process.state-changed";
78
+ /**
79
+ * The node's one-shot runner boot check (D877): planned runners against the
80
+ * process service, `degraded` when any is failed, refused or missing. The
81
+ * alert centre turns it into one alert and a direct critical push.
82
+ */
83
+ EventCategory["SystemRunnerCheck"] = "system.runner-check";
66
84
  EventCategory["AddonError"] = "addon.error";
67
85
  EventCategory["AddonPageReady"] = "addon.page-ready";
68
86
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -4105,6 +4123,12 @@ var numberProcessor = (schema, ctx, _json, _params) => {
4105
4123
  var booleanProcessor = (_schema, _ctx, json, _params) => {
4106
4124
  json.type = "boolean";
4107
4125
  };
4126
+ var bigintProcessor = (_schema, ctx, _json, _params) => {
4127
+ if (ctx.unrepresentable === "throw") throw new Error("BigInt cannot be represented in JSON Schema");
4128
+ };
4129
+ var symbolProcessor = (_schema, ctx, _json, _params) => {
4130
+ if (ctx.unrepresentable === "throw") throw new Error("Symbols cannot be represented in JSON Schema");
4131
+ };
4108
4132
  var nullProcessor = (_schema, ctx, json, _params) => {
4109
4133
  if (ctx.target === "openapi-3.0") {
4110
4134
  json.type = "string";
@@ -4112,12 +4136,17 @@ var nullProcessor = (_schema, ctx, json, _params) => {
4112
4136
  json.enum = [null];
4113
4137
  } else json.type = "null";
4114
4138
  };
4139
+ var undefinedProcessor = (_schema, ctx, _json, _params) => {
4140
+ if (ctx.unrepresentable === "throw") throw new Error("Undefined cannot be represented in JSON Schema");
4141
+ };
4115
4142
  var voidProcessor = (_schema, ctx, _json, _params) => {
4116
4143
  if (ctx.unrepresentable === "throw") throw new Error("Void cannot be represented in JSON Schema");
4117
4144
  };
4118
4145
  var neverProcessor = (_schema, _ctx, json, _params) => {
4119
4146
  json.not = {};
4120
4147
  };
4148
+ var anyProcessor = (_schema, _ctx, _json, _params) => {};
4149
+ var unknownProcessor = (_schema, _ctx, _json, _params) => {};
4121
4150
  var dateProcessor = (_schema, ctx, _json, _params) => {
4122
4151
  if (ctx.unrepresentable === "throw") throw new Error("Date cannot be represented in JSON Schema");
4123
4152
  };
@@ -4149,12 +4178,53 @@ var literalProcessor = (schema, ctx, json, _params) => {
4149
4178
  json.enum = vals;
4150
4179
  }
4151
4180
  };
4181
+ var nanProcessor = (_schema, ctx, _json, _params) => {
4182
+ if (ctx.unrepresentable === "throw") throw new Error("NaN cannot be represented in JSON Schema");
4183
+ };
4184
+ var templateLiteralProcessor = (schema, _ctx, json, _params) => {
4185
+ const _json = json;
4186
+ const pattern = schema._zod.pattern;
4187
+ if (!pattern) throw new Error("Pattern not found in template literal");
4188
+ _json.type = "string";
4189
+ _json.pattern = pattern.source;
4190
+ };
4191
+ var fileProcessor = (schema, _ctx, json, _params) => {
4192
+ const _json = json;
4193
+ const file = {
4194
+ type: "string",
4195
+ format: "binary",
4196
+ contentEncoding: "binary"
4197
+ };
4198
+ const { minimum, maximum, mime } = schema._zod.bag;
4199
+ if (minimum !== void 0) file.minLength = minimum;
4200
+ if (maximum !== void 0) file.maxLength = maximum;
4201
+ if (mime) if (mime.length === 1) {
4202
+ file.contentMediaType = mime[0];
4203
+ Object.assign(_json, file);
4204
+ } else {
4205
+ Object.assign(_json, file);
4206
+ _json.anyOf = mime.map((m) => ({ contentMediaType: m }));
4207
+ }
4208
+ else Object.assign(_json, file);
4209
+ };
4210
+ var successProcessor = (_schema, _ctx, json, _params) => {
4211
+ json.type = "boolean";
4212
+ };
4152
4213
  var customProcessor = (_schema, ctx, _json, _params) => {
4153
4214
  if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
4154
4215
  };
4216
+ var functionProcessor = (_schema, ctx, _json, _params) => {
4217
+ if (ctx.unrepresentable === "throw") throw new Error("Function types cannot be represented in JSON Schema");
4218
+ };
4155
4219
  var transformProcessor = (_schema, ctx, _json, _params) => {
4156
4220
  if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
4157
4221
  };
4222
+ var mapProcessor = (_schema, ctx, _json, _params) => {
4223
+ if (ctx.unrepresentable === "throw") throw new Error("Map cannot be represented in JSON Schema");
4224
+ };
4225
+ var setProcessor = (_schema, ctx, _json, _params) => {
4226
+ if (ctx.unrepresentable === "throw") throw new Error("Set cannot be represented in JSON Schema");
4227
+ };
4158
4228
  var arrayProcessor = (schema, ctx, _json, params) => {
4159
4229
  const json = _json;
4160
4230
  const def = schema._zod.def;
@@ -4359,6 +4429,12 @@ var readonlyProcessor = (schema, ctx, json, params) => {
4359
4429
  seen.ref = def.innerType;
4360
4430
  json.readOnly = true;
4361
4431
  };
4432
+ var promiseProcessor = (schema, ctx, _json, params) => {
4433
+ const def = schema._zod.def;
4434
+ process(def.innerType, ctx, params);
4435
+ const seen = ctx.seen.get(schema);
4436
+ seen.ref = def.innerType;
4437
+ };
4362
4438
  var optionalProcessor = (schema, ctx, _json, params) => {
4363
4439
  const def = schema._zod.def;
4364
4440
  process(def.innerType, ctx, params);
@@ -4371,6 +4447,81 @@ var lazyProcessor = (schema, ctx, _json, params) => {
4371
4447
  const seen = ctx.seen.get(schema);
4372
4448
  seen.ref = innerType;
4373
4449
  };
4450
+ var allProcessors = {
4451
+ string: stringProcessor,
4452
+ number: numberProcessor,
4453
+ boolean: booleanProcessor,
4454
+ bigint: bigintProcessor,
4455
+ symbol: symbolProcessor,
4456
+ null: nullProcessor,
4457
+ undefined: undefinedProcessor,
4458
+ void: voidProcessor,
4459
+ never: neverProcessor,
4460
+ any: anyProcessor,
4461
+ unknown: unknownProcessor,
4462
+ date: dateProcessor,
4463
+ enum: enumProcessor,
4464
+ literal: literalProcessor,
4465
+ nan: nanProcessor,
4466
+ template_literal: templateLiteralProcessor,
4467
+ file: fileProcessor,
4468
+ success: successProcessor,
4469
+ custom: customProcessor,
4470
+ function: functionProcessor,
4471
+ transform: transformProcessor,
4472
+ map: mapProcessor,
4473
+ set: setProcessor,
4474
+ array: arrayProcessor,
4475
+ object: objectProcessor,
4476
+ union: unionProcessor,
4477
+ intersection: intersectionProcessor,
4478
+ tuple: tupleProcessor,
4479
+ record: recordProcessor,
4480
+ nullable: nullableProcessor,
4481
+ nonoptional: nonoptionalProcessor,
4482
+ default: defaultProcessor,
4483
+ prefault: prefaultProcessor,
4484
+ catch: catchProcessor,
4485
+ pipe: pipeProcessor,
4486
+ readonly: readonlyProcessor,
4487
+ promise: promiseProcessor,
4488
+ optional: optionalProcessor,
4489
+ lazy: lazyProcessor
4490
+ };
4491
+ function toJSONSchema(input, params) {
4492
+ if ("_idmap" in input) {
4493
+ const registry = input;
4494
+ const ctx = initializeContext({
4495
+ ...params,
4496
+ processors: allProcessors
4497
+ });
4498
+ const defs = {};
4499
+ for (const entry of registry._idmap.entries()) {
4500
+ const [_, schema] = entry;
4501
+ process(schema, ctx);
4502
+ }
4503
+ const schemas = {};
4504
+ ctx.external = {
4505
+ registry,
4506
+ uri: params?.uri,
4507
+ defs
4508
+ };
4509
+ for (const entry of registry._idmap.entries()) {
4510
+ const [key, schema] = entry;
4511
+ extractDefs(ctx, schema);
4512
+ schemas[key] = finalize(ctx, schema);
4513
+ }
4514
+ if (Object.keys(defs).length > 0) schemas.__shared = { [ctx.target === "draft-2020-12" ? "$defs" : "definitions"]: defs };
4515
+ return { schemas };
4516
+ }
4517
+ const ctx = initializeContext({
4518
+ ...params,
4519
+ processors: allProcessors
4520
+ });
4521
+ process(input, ctx);
4522
+ extractDefs(ctx, input);
4523
+ return finalize(ctx, input);
4524
+ }
4374
4525
  //#endregion
4375
4526
  //#region ../../node_modules/zod/v4/classic/iso.js
4376
4527
  var ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
@@ -5387,7 +5538,7 @@ var ZodIssueCode = {
5387
5538
  var ZodFirstPartyTypeKind;
5388
5539
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5389
5540
  //#endregion
5390
- //#region ../types/dist/sleep-DRqxtc0C.mjs
5541
+ //#region ../types/dist/sleep-bZIhUvjd.mjs
5391
5542
  /**
5392
5543
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5393
5544
  * window to float samples (D455).
@@ -5504,7 +5655,7 @@ function isKeychainStoredField(field) {
5504
5655
  var SECRET_CLEAR = { $secretClear: true };
5505
5656
  /** The `'***'` token D634 redaction writes for non-admins. */
5506
5657
  var LEGACY_DEVICE_REDACTION = "***";
5507
- function isRecord$2(value) {
5658
+ function isRecord$5(value) {
5508
5659
  return typeof value === "object" && value !== null && !Array.isArray(value);
5509
5660
  }
5510
5661
  function makeSecretMarker(ref) {
@@ -5515,12 +5666,12 @@ function makeSecretMarker(ref) {
5515
5666
  }
5516
5667
  /** A stored marker: an object whose `$secret` is a non-empty string. */
5517
5668
  function isSecretMarker(value) {
5518
- if (!isRecord$2(value)) return false;
5669
+ if (!isRecord$5(value)) return false;
5519
5670
  const ref = value["$secret"];
5520
5671
  return typeof ref === "string" && ref.length > 0;
5521
5672
  }
5522
5673
  function isSecretClear(value) {
5523
- return isRecord$2(value) && value["$secretClear"] === true;
5674
+ return isRecord$5(value) && value["$secretClear"] === true;
5524
5675
  }
5525
5676
  /**
5526
5677
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6130,7 +6281,7 @@ var KeychainWriteRefusedError = class extends Error {
6130
6281
  }
6131
6282
  };
6132
6283
  var KEEP = { kind: "keep" };
6133
- function isRecord$1(value) {
6284
+ function isRecord$4(value) {
6134
6285
  return typeof value === "object" && value !== null && !Array.isArray(value);
6135
6286
  }
6136
6287
  function defaultMintId() {
@@ -6143,7 +6294,7 @@ function collectSecretMarkerRefs(value, out = []) {
6143
6294
  return out;
6144
6295
  }
6145
6296
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6146
- else if (isRecord$1(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6297
+ else if (isRecord$4(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6147
6298
  return out;
6148
6299
  }
6149
6300
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6198,7 +6349,7 @@ function rowId(row, idKey) {
6198
6349
  return null;
6199
6350
  }
6200
6351
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6201
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$1) : [];
6352
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$4) : [];
6202
6353
  if (!Array.isArray(incoming)) {
6203
6354
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6204
6355
  return {
@@ -6214,7 +6365,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6214
6365
  const kept = /* @__PURE__ */ new Set();
6215
6366
  const rows = [];
6216
6367
  for (const row of incoming) {
6217
- if (!isRecord$1(row)) {
6368
+ if (!isRecord$4(row)) {
6218
6369
  rows.push(row);
6219
6370
  continue;
6220
6371
  }
@@ -6239,7 +6390,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6239
6390
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6240
6391
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6241
6392
  case "object": {
6242
- if (!isRecord$1(incoming)) {
6393
+ if (!isRecord$4(incoming)) {
6243
6394
  if (incoming === void 0) return KEEP;
6244
6395
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6245
6396
  return {
@@ -6247,7 +6398,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6247
6398
  value: incoming
6248
6399
  };
6249
6400
  }
6250
- const storedObj = isRecord$1(stored) ? stored : {};
6401
+ const storedObj = isRecord$4(stored) ? stored : {};
6251
6402
  return {
6252
6403
  kind: "value",
6253
6404
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6370,7 +6521,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6370
6521
  value: items
6371
6522
  };
6372
6523
  }
6373
- if (isRecord$1(v)) {
6524
+ if (isRecord$4(v)) {
6374
6525
  const out = {};
6375
6526
  for (const [k, child] of Object.entries(v)) {
6376
6527
  const s = substitute(child);
@@ -6402,7 +6553,7 @@ var SecretOverwriteRefusedError = class extends Error {
6402
6553
  this.name = "SecretOverwriteRefusedError";
6403
6554
  }
6404
6555
  };
6405
- function isRecord(value) {
6556
+ function isRecord$3(value) {
6406
6557
  return typeof value === "object" && value !== null && !Array.isArray(value);
6407
6558
  }
6408
6559
  function resolvedValue(pass, marker) {
@@ -6431,7 +6582,7 @@ function inArray(pass, incoming, stored) {
6431
6582
  return incoming.map((item, index) => {
6432
6583
  const twin = stored[index];
6433
6584
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
6434
- if (isRecord(item) && isRecord(twin)) return inArrayRow(pass, item, twin);
6585
+ if (isRecord$3(item) && isRecord$3(twin)) return inArrayRow(pass, item, twin);
6435
6586
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
6436
6587
  return item;
6437
6588
  });
@@ -6442,7 +6593,7 @@ function inArrayRow(pass, incoming, stored) {
6442
6593
  const twin = stored[key];
6443
6594
  if (isSecretMarker(twin)) {
6444
6595
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
6445
- } else if (isRecord(value) && isRecord(twin)) out[key] = inArrayRow(pass, value, twin);
6596
+ } else if (isRecord$3(value) && isRecord$3(twin)) out[key] = inArrayRow(pass, value, twin);
6446
6597
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
6447
6598
  }
6448
6599
  return out;
@@ -6450,7 +6601,7 @@ function inArrayRow(pass, incoming, stored) {
6450
6601
  async function walk(pass, incoming, stored) {
6451
6602
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
6452
6603
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
6453
- if (!isRecord(incoming) || !isRecord(stored)) return incoming;
6604
+ if (!isRecord$3(incoming) || !isRecord$3(stored)) return incoming;
6454
6605
  const out = { ...incoming };
6455
6606
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
6456
6607
  return out;
@@ -6481,7 +6632,7 @@ async function restoreUnchangedSecrets(input) {
6481
6632
  function isJsonEqual(a, b) {
6482
6633
  if (Object.is(a, b)) return true;
6483
6634
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
6484
- if (isRecord(a) && isRecord(b)) {
6635
+ if (isRecord$3(a) && isRecord$3(b)) {
6485
6636
  const keys = Object.keys(a);
6486
6637
  if (keys.length !== Object.keys(b).length) return false;
6487
6638
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -6505,7 +6656,7 @@ function markerKeysOf(blob, owner) {
6505
6656
  }
6506
6657
  function nodeFromStored(value, owner) {
6507
6658
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
6508
- if (!isRecord(value)) return null;
6659
+ if (!isRecord$3(value)) return null;
6509
6660
  const children = /* @__PURE__ */ new Map();
6510
6661
  for (const [key, child] of Object.entries(value)) {
6511
6662
  const node = nodeFromStored(child, owner);
@@ -6638,7 +6789,6 @@ function createHandle(raw, opts) {
6638
6789
  const writeAddon = (patch) => write("addon", opts.addonTree(), void 0, patch, () => readStoredAddonBlob(raw), (p) => raw.writeAddonStore(p));
6639
6790
  const readAddonStoreResult = raw.readAddonStoreResult;
6640
6791
  const readAddonStoreKeyResult = raw.readAddonStoreKeyResult;
6641
- const readDeviceStoreBatch = raw.readDeviceStoreBatch;
6642
6792
  const overrides = {
6643
6793
  readAddonStore: async () => resolveRead("addon", await raw.readAddonStore()),
6644
6794
  ...readAddonStoreResult !== void 0 ? { readAddonStoreResult: async () => {
@@ -6662,12 +6812,12 @@ function createHandle(raw, opts) {
6662
6812
  };
6663
6813
  } } : {},
6664
6814
  readDeviceStore: async (deviceId) => resolveRead(`device:${deviceId}`, await raw.readDeviceStore(deviceId)),
6665
- ...readDeviceStoreBatch !== void 0 ? { readDeviceStoreBatch: async (deviceIds) => {
6666
- const rows = await readDeviceStoreBatch.call(raw, deviceIds);
6815
+ readDeviceStoreBatch: async (deviceIds) => {
6816
+ const rows = await raw.readDeviceStoreBatch(deviceIds);
6667
6817
  const out = /* @__PURE__ */ new Map();
6668
6818
  for (const [deviceId, blob] of rows) out.set(deviceId, await resolveRead(`device:${deviceId}`, blob));
6669
6819
  return out;
6670
- } } : {},
6820
+ },
6671
6821
  writeAddonStore: async (patch) => {
6672
6822
  await writeAddon(patch);
6673
6823
  },
@@ -7294,7 +7444,7 @@ var BaseAddon = class {
7294
7444
  if (!ctx) return;
7295
7445
  const addonId = ctx.id;
7296
7446
  setImmediate(() => {
7297
- ctx.api.addons?.restartAddon?.mutate({ addonId }).then(() => {
7447
+ ctx.api.addons.restartAddon.mutate({ addonId }).then(() => {
7298
7448
  ctx.logger.info("addon auto-restart triggered by restart-required setting change", { meta: { changedFields: patchKeys.filter((k) => restartKeys.has(k)) } });
7299
7449
  }).catch((err) => {
7300
7450
  ctx.logger.error("addon auto-restart failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
@@ -7494,7 +7644,7 @@ var BaseAddon = class {
7494
7644
  return this._addonSecretTree;
7495
7645
  }
7496
7646
  deviceSecretTree() {
7497
- this._deviceSecretTree ??= secretTreeFromSchema(this.deviceSettingsSchema());
7647
+ this._deviceSecretTree ??= mergeSecretStatePaths(secretTreeFromSchema(this.deviceSettingsSchema()), this.secretStatePaths);
7498
7648
  return this._deviceSecretTree;
7499
7649
  }
7500
7650
  /**
@@ -7570,42 +7720,135 @@ var BaseAddon = class {
7570
7720
  this[timerOf] = timer;
7571
7721
  }
7572
7722
  /**
7573
- * Wrap `ctx.settings.readAddonStore()` with a short retry budget so a
7574
- * transient settings-store outage (mid-restart of sqlite-settings, tsx-watch
7575
- * swap, or any race where the SqliteSettingsBackend is between shutdown and
7576
- * re-initialize) doesn't propagate up into `initialize()` and leave the
7723
+ * Wrap `ctx.settings.readAddonStore()` with a retry budget so a transient
7724
+ * settings-store outage doesn't propagate up into `initialize()` and leave the
7577
7725
  * addon permanently broken.
7578
7726
  *
7579
- * Retry only the two known infra fingerprints. Anything else propagates so
7580
- * real bugs surface immediately. After the budget expires we fall back to
7581
- * `{}` (defaults) — the addon's first successful patch will rehydrate.
7727
+ * Two kinds of outage, two budgets:
7728
+ * - the store's own restart fingerprints (`SqliteSettingsBackend not
7729
+ * initialized`, `provider not available`): a short budget, then the addon
7730
+ * falls back to `{}` (defaults) - its first successful patch rehydrates;
7731
+ * - a TRANSPORT failure (the hub is restarting while this runner boots:
7732
+ * `discovery deadline exceeded`, `parent could not route`, a refused or
7733
+ * timed-out connection). Since D870 a runner's settings read THROWS instead
7734
+ * of answering `{}`, so without a budget a hub restart ends in a respawn
7735
+ * loop. A long, bounded budget; only after it the error propagates - the
7736
+ * addon never runs on defaults for a store it could not ask.
7737
+ * Anything else propagates immediately so real bugs surface.
7582
7738
  */
7583
7739
  async readAddonStoreWithRetry() {
7584
7740
  const settings = this.rawSettings();
7585
7741
  if (!settings) return {};
7586
- const delaysMs = [
7587
- 150,
7588
- 350,
7589
- 600,
7590
- 900
7591
- ];
7592
7742
  let lastErr;
7593
- for (let attempt = 0; attempt <= delaysMs.length; attempt++) try {
7743
+ for (let attempt = 0;; attempt++) try {
7594
7744
  const stored = await settings.readAddonStore() ?? {};
7595
7745
  this.settingsStoreReady = true;
7596
7746
  return stored;
7597
7747
  } catch (err) {
7598
7748
  lastErr = err;
7599
- const msg = err instanceof Error ? err.message : String(err);
7600
- if (!(msg.includes("SqliteSettingsBackend not initialized") || msg.includes("provider not available"))) throw err;
7601
- if (attempt === delaysMs.length) break;
7602
- await new Promise((r) => setTimeout(r, delaysMs[attempt]));
7749
+ const kind = classifyStoreError(err);
7750
+ if (kind === "permanent") throw err;
7751
+ const delay = (kind === "transport" ? TRANSPORT_RETRY_DELAYS_MS : RESTART_RETRY_DELAYS_MS)[attempt];
7752
+ if (delay === void 0) {
7753
+ if (kind === "transport") throw err;
7754
+ break;
7755
+ }
7756
+ await new Promise((r) => setTimeout(r, delay));
7603
7757
  }
7604
7758
  this.settingsStoreReady = false;
7605
7759
  this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults", { meta: { error: lastErr instanceof Error ? lastErr.message : String(lastErr) } });
7606
7760
  return {};
7607
7761
  }
7608
7762
  };
7763
+ /** The settings store's own restart fingerprints. */
7764
+ var RESTART_RETRY_DELAYS_MS = [
7765
+ 150,
7766
+ 350,
7767
+ 600,
7768
+ 900
7769
+ ];
7770
+ /** A hub restarting under a booting runner: ~100 s in total. */
7771
+ var TRANSPORT_RETRY_DELAYS_MS = [
7772
+ 150,
7773
+ 350,
7774
+ 600,
7775
+ 900,
7776
+ 2e3,
7777
+ 5e3,
7778
+ 1e4,
7779
+ 2e4,
7780
+ 3e4,
7781
+ 3e4
7782
+ ];
7783
+ var RESTART_FINGERPRINTS = ["SqliteSettingsBackend not initialized", "provider not available"];
7784
+ /** Node / socket error codes of a connection that did not happen or broke. */
7785
+ var TRANSPORT_CODES = new Set([
7786
+ "ECONNREFUSED",
7787
+ "ECONNRESET",
7788
+ "ETIMEDOUT",
7789
+ "EPIPE",
7790
+ "EHOSTUNREACH",
7791
+ "ENETUNREACH"
7792
+ ]);
7793
+ /** tRPC error codes that mean "the other side is not answering now", not "your call is wrong". */
7794
+ var UNAVAILABLE_TRPC_CODES = new Set([
7795
+ "TIMEOUT",
7796
+ "SERVICE_UNAVAILABLE",
7797
+ "BAD_GATEWAY",
7798
+ "GATEWAY_TIMEOUT"
7799
+ ]);
7800
+ /** The exact phrases OUR transport raises when it cannot reach the hub. */
7801
+ var TRANSPORT_PHRASES = [
7802
+ "discovery deadline exceeded",
7803
+ "parent could not route child unowned cap call",
7804
+ "UDS request timed out after",
7805
+ "channel closed"
7806
+ ];
7807
+ /** Moleculer error `type`s of a call that could not be served right now. */
7808
+ var MOLECULER_TRANSIENT_TYPES = new Set([
7809
+ "REQUEST_TIMEOUT",
7810
+ "SERVICE_NOT_FOUND",
7811
+ "SERVICE_NOT_AVAILABLE",
7812
+ "REQUEST_REJECTED",
7813
+ "BROKER_DISCONNECTED"
7814
+ ]);
7815
+ function stringProp(value, key) {
7816
+ if (typeof value !== "object" || value === null) return void 0;
7817
+ const found = Reflect.get(value, key);
7818
+ return typeof found === "string" ? found : void 0;
7819
+ }
7820
+ /** The code an error carries: its own, its cause's, or a tRPC `data.code`. */
7821
+ function errorCode(err) {
7822
+ const out = {};
7823
+ const cause = typeof err === "object" && err !== null ? Reflect.get(err, "cause") : void 0;
7824
+ const data = typeof err === "object" && err !== null ? Reflect.get(err, "data") : void 0;
7825
+ const node = stringProp(err, "code") ?? stringProp(cause, "code");
7826
+ if (node !== void 0) out.node = node;
7827
+ const trpc = stringProp(data, "code");
7828
+ if (trpc !== void 0) out.trpc = trpc;
7829
+ return out;
7830
+ }
7831
+ /**
7832
+ * Is a settings read failure worth retrying, and with which budget? Only
7833
+ * EXPLICIT signals count: a socket error code, a tRPC "unavailable" code, or
7834
+ * one of the exact phrases our own transport raises. A message that merely
7835
+ * contains "timed out" or "unreachable" is not evidence of anything, and
7836
+ * `settings store not wired` is a wiring bug that retrying cannot fix.
7837
+ */
7838
+ function classifyStoreError(err) {
7839
+ const message = err instanceof Error ? err.message : String(err);
7840
+ if (RESTART_FINGERPRINTS.some((f) => message.includes(f))) return "restart";
7841
+ const code = errorCode(err);
7842
+ if (code.node !== void 0 && TRANSPORT_CODES.has(code.node)) return "transport";
7843
+ if (code.trpc !== void 0 && UNAVAILABLE_TRPC_CODES.has(code.trpc)) return "transport";
7844
+ if (typeof err === "object" && err !== null) {
7845
+ if (Reflect.get(err, "retryable") === true) return "transport";
7846
+ const type = stringProp(err, "type");
7847
+ if (type !== void 0 && MOLECULER_TRANSIENT_TYPES.has(type)) return "transport";
7848
+ }
7849
+ if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
7850
+ return "permanent";
7851
+ }
7609
7852
  /**
7610
7853
  * Collect the keys of every field marked `perNode: true`, recursing into
7611
7854
  * layout containers (`group` fields and `sub-tabs` tabs) the same way
@@ -7695,6 +7938,356 @@ var PeerBytesTicketSchema = object({
7695
7938
  */
7696
7939
  declaredBytes: number().int().nonnegative().nullable()
7697
7940
  });
7941
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
7942
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
7943
+ var RECORD_DATABASES = ["settings", "events"];
7944
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
7945
+ var RECORD_CLASSES = [
7946
+ "config",
7947
+ "ledger",
7948
+ "audit",
7949
+ "mirror",
7950
+ "ephemeral"
7951
+ ];
7952
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
7953
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
7954
+ var RECORD_BATCH_MAX = 1e3;
7955
+ var RECORD_QUERY_MAX = 1e3;
7956
+ /** A kind in the `settings` file may not bound itself above this (D447: high volume is `events`). */
7957
+ var RECORD_SETTINGS_MAX_ROWS = 5e4;
7958
+ var PREFIX = "records/";
7959
+ /** The base of every records failure. `detail` is the human part of the message. */
7960
+ var RecordsError = class extends Error {
7961
+ code;
7962
+ detail;
7963
+ constructor(code, detail) {
7964
+ super(`${PREFIX}${code}: ${detail}`);
7965
+ this.name = "RecordsError";
7966
+ this.code = code;
7967
+ this.detail = detail;
7968
+ }
7969
+ };
7970
+ /** The keychain could not store or serve a value: explicit, never an empty string. */
7971
+ var RecordSecretUnavailableError = class extends RecordsError {
7972
+ constructor(detail) {
7973
+ super("secret-unavailable", detail);
7974
+ this.name = "RecordSecretUnavailableError";
7975
+ }
7976
+ };
7977
+ var InvalidRecordError = class extends RecordsError {
7978
+ constructor(detail) {
7979
+ super("invalid-record", detail);
7980
+ this.name = "InvalidRecordError";
7981
+ }
7982
+ };
7983
+ /** A kind declaration the engine refuses (non-additive change, bad shape, wrong file). */
7984
+ var DeclarationRefusedError = class extends RecordsError {
7985
+ constructor(detail) {
7986
+ super("declaration-refused", detail);
7987
+ this.name = "DeclarationRefusedError";
7988
+ }
7989
+ };
7990
+ function defOf(schema) {
7991
+ const zodBag = Reflect.get(schema, "_zod");
7992
+ if (typeof zodBag !== "object" || zodBag === null) return {};
7993
+ const def = Reflect.get(zodBag, "def");
7994
+ if (typeof def !== "object" || def === null) return {};
7995
+ return def;
7996
+ }
7997
+ function declaredHere(schema) {
7998
+ return globalRegistry.get(schema)?.secret === true;
7999
+ }
8000
+ /** Wrapper kinds whose `innerType` is the field itself. */
8001
+ var WRAPPERS = new Set([
8002
+ "optional",
8003
+ "nullable",
8004
+ "default",
8005
+ "prefault",
8006
+ "catch",
8007
+ "readonly",
8008
+ "nonoptional"
8009
+ ]);
8010
+ /**
8011
+ * The schema layers that make up ONE field: the schema itself and every
8012
+ * wrapper below it (optional / default / nullable / readonly / catch), plus
8013
+ * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
8014
+ * `.transform` on `in`).
8015
+ */
8016
+ function layersOf(schema) {
8017
+ const out = [];
8018
+ const queue = [schema];
8019
+ while (queue.length > 0) {
8020
+ const s = queue.shift();
8021
+ if (!s || out.includes(s)) continue;
8022
+ out.push(s);
8023
+ const def = defOf(s);
8024
+ if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
8025
+ if (def.type === "pipe") {
8026
+ if (def.in) queue.push(def.in);
8027
+ if (def.out) queue.push(def.out);
8028
+ }
8029
+ }
8030
+ return out;
8031
+ }
8032
+ /** True when any layer of this field declares `.meta({ secret: true })`. */
8033
+ function isZodSecret(schema) {
8034
+ return layersOf(schema).some(declaredHere);
8035
+ }
8036
+ /**
8037
+ * Every declared secret path in a config schema: dotted keys, `[]` for "each
8038
+ * element of this array" (`connection.password`, `rows[].token`). A declared
8039
+ * object or array is reported as one path and not descended into — everything
8040
+ * under it is secret.
8041
+ */
8042
+ function collectZodSecretPaths(schema, prefix = "") {
8043
+ if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
8044
+ const paths = [];
8045
+ for (const layer of layersOf(schema)) {
8046
+ const def = defOf(layer);
8047
+ if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
8048
+ else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
8049
+ else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
8050
+ else if (def.type === "intersection") {
8051
+ if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
8052
+ if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
8053
+ }
8054
+ }
8055
+ return [...new Set(paths)];
8056
+ }
8057
+ /**
8058
+ * Secret fields of a record, addressed the way a Zod schema declares them
8059
+ * (`collectZodSecretPaths`): dotted keys, `[]` for "each element of this array"
8060
+ * (`auth.accessToken`, `headers[].value`).
8061
+ *
8062
+ * Array elements are matched by a DECLARED id key (`secretArrayKeys`:
8063
+ * `{ headers: 'name' }`), never by index, so reordering a list keeps every
8064
+ * keychain ref (the same rule as `arrayItemFieldPath`). The concrete path of a
8065
+ * leaf names its element: `headers[X-Api].value`.
8066
+ *
8067
+ * Pure and browser-safe. Nothing here mutates: every transform returns a new value.
8068
+ */
8069
+ /** The array prefixes (declared form, e.g. `headers` or `a.headers`) of a path. */
8070
+ function parseSecretPath(path) {
8071
+ if (path.length === 0) throw new InvalidRecordError("an empty secret path");
8072
+ return path.split(".").map((raw) => {
8073
+ const each = raw.endsWith("[]");
8074
+ const key = each ? raw.slice(0, -2) : raw;
8075
+ if (key.length === 0) throw new InvalidRecordError(`secret path "${path}" has an empty segment`);
8076
+ return {
8077
+ key,
8078
+ each
8079
+ };
8080
+ });
8081
+ }
8082
+ /** The declared array prefixes of `path` that need an id key (`headers`, `a.rows`). */
8083
+ function secretArrayPrefixes(path) {
8084
+ const segments = parseSecretPath(path);
8085
+ const prefixes = [];
8086
+ const walked = [];
8087
+ for (const segment of segments) {
8088
+ walked.push(segment.key);
8089
+ if (segment.each) prefixes.push(walked.join("."));
8090
+ }
8091
+ return prefixes;
8092
+ }
8093
+ /**
8094
+ * Record kinds (D881): the declaration an addon makes of one kind of fact, the
8095
+ * Zod row schema that describes it, and the helper that turns the two into the
8096
+ * JSON the engine stores.
8097
+ *
8098
+ * A kind is declared ONCE, next to the code that owns it, and the engine's
8099
+ * reconciler creates its indexes - nothing creates DDL at runtime from a write.
8100
+ * Everything the generic machinery needs (secret fields, the entry descriptor)
8101
+ * is DERIVED from the Zod schema: `.meta({ secret: true })` marks a credential,
8102
+ * never a field name (D879).
8103
+ */
8104
+ /** A JSON field path: `trackId`, `auth.accessToken`. Charset-restricted: it is rendered into DDL. */
8105
+ var RecordFieldPathSchema = string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}(\.[A-Za-z_][A-Za-z0-9_]{0,63}){0,3}$/);
8106
+ var RecordIndexSchema = object({
8107
+ name: string().regex(/^[a-z][a-z0-9_]{0,31}$/),
8108
+ fields: array(RecordFieldPathSchema).min(1).max(4),
8109
+ unique: boolean().optional()
8110
+ }).strict();
8111
+ var RecordRetentionSchema = union([
8112
+ object({
8113
+ ttlMs: number().int().positive(),
8114
+ from: _enum(["at", "write"])
8115
+ }).strict(),
8116
+ object({
8117
+ maxRows: number().int().positive().optional(),
8118
+ maxRowsPerDevice: number().int().positive().optional()
8119
+ }).strict().refine((r) => r.maxRows !== void 0 || r.maxRowsPerDevice !== void 0, { message: "name maxRows, maxRowsPerDevice or both" }),
8120
+ object({
8121
+ owner: string().min(1),
8122
+ reason: string().min(1)
8123
+ }).strict(),
8124
+ object({ none: string().min(1) }).strict()
8125
+ ]);
8126
+ /** The descriptor a generic entries UI reads (D881 "generic entries"). */
8127
+ var EntryDescriptorSchema = object({
8128
+ title: string().min(1),
8129
+ /** The record body field shown as the entry's name. */
8130
+ nameField: string().min(1),
8131
+ /** JSON Schema of the entry body; `secret: true` marks a password field. */
8132
+ fields: record(string(), unknown())
8133
+ }).strict();
8134
+ /** What crosses the wire and sits in the engine's catalog: JSON only, no Zod. */
8135
+ var RecordKindDeclarationSchema = object({
8136
+ database: _enum(RECORD_DATABASES).default("settings"),
8137
+ class: _enum(RECORD_CLASSES),
8138
+ writeTrigger: string().min(1),
8139
+ device: _enum([
8140
+ "required",
8141
+ "optional",
8142
+ "none"
8143
+ ]).default("none"),
8144
+ at: _enum(["required", "none"]).default("none"),
8145
+ indexes: array(RecordIndexSchema).max(8).default([]),
8146
+ retention: RecordRetentionSchema,
8147
+ deviceRemoval: _enum(["delete", "none"]).default("none"),
8148
+ maxDataBytes: number().int().positive().max(RECORD_MAX_DATA_BYTES).default(RECORD_DEFAULT_MAX_DATA_BYTES),
8149
+ /** Derived from the Zod schema; never written by hand. */
8150
+ secretPaths: array(string().min(1)).default([]),
8151
+ /** The id key of each array that carries a secret (`{ headers: 'name' }`). */
8152
+ secretArrayKeys: record(string(), string()).default({}),
8153
+ /** The legacy table this kind adopts from; the boot guard reads it (D853: no migration code). */
8154
+ adoptsFrom: string().min(1).optional(),
8155
+ /** Kinds that must agree through `transact` sit in one file under one family name. */
8156
+ transactFamily: string().min(1).optional(),
8157
+ entry: EntryDescriptorSchema.optional()
8158
+ }).strict();
8159
+ /** The kind names: lower-case, dash separated, short enough for an index name. */
8160
+ var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
8161
+ /** Cross-field rules a declaration must satisfy. Throws {@link DeclarationRefusedError}. */
8162
+ function assertValidDeclaration(name, decl) {
8163
+ const refuse = (why) => {
8164
+ throw new DeclarationRefusedError(`kind "${name}": ${why}`);
8165
+ };
8166
+ if (!RecordKindNameSchema.safeParse(name).success) refuse("the name must be lower-case-dashed");
8167
+ const seen = /* @__PURE__ */ new Set();
8168
+ for (const index of decl.indexes) {
8169
+ if (seen.has(index.name)) refuse(`index name "${index.name}" is declared twice`);
8170
+ seen.add(index.name);
8171
+ }
8172
+ const { retention } = decl;
8173
+ const hasSecrets = decl.secretPaths.length > 0;
8174
+ if ("ttlMs" in retention) {
8175
+ if (retention.from === "at" && decl.at !== "required") refuse("a ttl from \"at\" needs at: \"required\"");
8176
+ if (hasSecrets) refuse("a kind with secret fields cannot use engine TTL (its keychain values would be orphaned)");
8177
+ }
8178
+ if ("maxRows" in retention || "maxRowsPerDevice" in retention) {
8179
+ if (retention.maxRowsPerDevice !== void 0 && decl.device !== "required") refuse("maxRowsPerDevice needs device: \"required\"");
8180
+ if (decl.at !== "required") refuse("a row bound trims the oldest \"at\": it needs at: \"required\"");
8181
+ if (hasSecrets) refuse("a kind with secret fields cannot use an engine row bound");
8182
+ const bound = Math.max(retention.maxRows ?? 0, retention.maxRowsPerDevice ?? 0);
8183
+ if (decl.database === "settings" && bound > 5e4) refuse(`a row bound above ${RECORD_SETTINGS_MAX_ROWS} belongs in database: "events" (a big delete on the settings thread stalls every configuration read)`);
8184
+ }
8185
+ if (decl.deviceRemoval === "delete" && decl.device === "none") refuse("deviceRemoval: \"delete\" needs a device: \"required\" or \"optional\"");
8186
+ for (const path of decl.secretPaths) for (const prefix of secretArrayPrefixes(path)) if (decl.secretArrayKeys[prefix] === void 0) refuse(`secret path "${path}" crosses the array "${prefix}": declare its id key in secretArrayKeys`);
8187
+ }
8188
+ function bodyFieldsOf(schema) {
8189
+ return { ...toJSONSchema(schema, {
8190
+ unrepresentable: "any",
8191
+ io: "input"
8192
+ }) };
8193
+ }
8194
+ function isRecordLike(value) {
8195
+ return typeof value === "object" && value !== null && !Array.isArray(value);
8196
+ }
8197
+ /** Does every branch of the body schema carry `field`? (A discriminated union has several.) */
8198
+ function hasNameField(json, field) {
8199
+ const branches = json["oneOf"] ?? json["anyOf"];
8200
+ if (Array.isArray(branches)) return branches.length > 0 && branches.every((b) => isRecordLike(b) && hasNameField(b, field));
8201
+ const properties = json["properties"];
8202
+ return isRecordLike(properties) && Object.prototype.hasOwnProperty.call(properties, field);
8203
+ }
8204
+ /**
8205
+ * Declare the kinds of a package. The keys are the kind names. The result is
8206
+ * what `ctx.records.declare` sends to the engine and what `ctx.records.kind`
8207
+ * types its handle from.
8208
+ */
8209
+ function defineRecordKinds(specs) {
8210
+ const out = {};
8211
+ for (const [name, spec] of Object.entries(specs)) {
8212
+ const secretPaths = collectZodSecretPaths(spec.schema);
8213
+ const nameField = spec.entry?.nameField ?? "name";
8214
+ const fields = bodyFieldsOf(spec.schema);
8215
+ if (spec.entry !== void 0 && !hasNameField(fields, nameField)) throw new DeclarationRefusedError(`kind "${name}": an entry kind's schema needs a "${nameField}" field`);
8216
+ const parsed = RecordKindDeclarationSchema.parse({
8217
+ database: spec.database,
8218
+ class: spec.class,
8219
+ writeTrigger: spec.writeTrigger,
8220
+ device: spec.device,
8221
+ at: spec.at,
8222
+ indexes: spec.indexes === void 0 ? void 0 : [...spec.indexes],
8223
+ retention: spec.retention,
8224
+ deviceRemoval: spec.deviceRemoval,
8225
+ maxDataBytes: spec.maxDataBytes,
8226
+ secretPaths: [...secretPaths],
8227
+ secretArrayKeys: spec.secretArrayKeys === void 0 ? void 0 : { ...spec.secretArrayKeys },
8228
+ adoptsFrom: spec.adoptsFrom,
8229
+ transactFamily: spec.transactFamily,
8230
+ entry: spec.entry === void 0 ? void 0 : {
8231
+ title: spec.entry.title,
8232
+ nameField,
8233
+ fields
8234
+ }
8235
+ });
8236
+ assertValidDeclaration(name, parsed);
8237
+ out[name] = {
8238
+ name,
8239
+ schema: spec.schema,
8240
+ declaration: parsed
8241
+ };
8242
+ }
8243
+ return out;
8244
+ }
8245
+ /**
8246
+ * Entry kinds (D881): every list of user-created entries (notification
8247
+ * targets, brokers, LLM profiles) is ONE record kind with an id, a name and a
8248
+ * kind-specific body, and the admin UI lists/adds/edits/deletes all of them
8249
+ * through the `record-entries` capability with password fields derived from
8250
+ * the schema (`.meta({ secret: true })`).
8251
+ */
8252
+ /** The body of a plain entry: a name and the fields the kind adds. */
8253
+ function entryBody(shape) {
8254
+ return object({
8255
+ name: string().min(1),
8256
+ ...shape
8257
+ });
8258
+ }
8259
+ /**
8260
+ * Declare one entry kind. An entry is configuration: never trimmed by the
8261
+ * engine, never aged, belonging to no device.
8262
+ */
8263
+ function defineEntryKind(name, spec) {
8264
+ const defined = defineRecordKinds({ [name]: {
8265
+ schema: spec.schema,
8266
+ class: "config",
8267
+ writeTrigger: spec.writeTrigger ?? "an operator adds or edits an entry in the entries UI",
8268
+ retention: { none: "an entry goes only when the operator deletes it" },
8269
+ ...spec.database === void 0 ? {} : { database: spec.database },
8270
+ ...spec.indexes === void 0 ? {} : { indexes: spec.indexes },
8271
+ ...spec.secretArrayKeys === void 0 ? {} : { secretArrayKeys: spec.secretArrayKeys },
8272
+ ...spec.adoptsFrom === void 0 ? {} : { adoptsFrom: spec.adoptsFrom },
8273
+ entry: {
8274
+ title: spec.title,
8275
+ ...spec.nameField === void 0 ? {} : { nameField: spec.nameField }
8276
+ }
8277
+ } })[name];
8278
+ if (defined === void 0) throw new DeclarationRefusedError(`entry kind "${name}" was not built`);
8279
+ return defined;
8280
+ }
8281
+ /**
8282
+ * Legacy source for broker entry adoption (B2): brokers live in addon-settings
8283
+ * as one row `<addonId>.brokers` whose value is an array until records-adopt
8284
+ * copies them into the entry kind.
8285
+ */
8286
+ var SETTINGS_BROKERS_ADOPTS_PREFIX = "@settings-brokers/";
8287
+ /** The `adoptsFrom` value for an addon's broker entry kind. */
8288
+ function settingsBrokersAdoptsFrom(addonId) {
8289
+ return `${SETTINGS_BROKERS_ADOPTS_PREFIX}${addonId}`;
8290
+ }
7698
8291
  /** Shared Zod schemas used across streaming capabilities. */
7699
8292
  var CamProfileSchema = _enum([
7700
8293
  "high",
@@ -8218,75 +8811,12 @@ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(o
8218
8811
  kind: "mutation",
8219
8812
  auth: "admin"
8220
8813
  }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
8221
- function defOf(schema) {
8222
- return schema._zod?.def ?? {};
8223
- }
8224
- function declaredHere(schema) {
8225
- return globalRegistry.get(schema)?.secret === true;
8226
- }
8227
- /** Wrapper kinds whose `innerType` is the field itself. */
8228
- var WRAPPERS = new Set([
8229
- "optional",
8230
- "nullable",
8231
- "default",
8232
- "prefault",
8233
- "catch",
8234
- "readonly",
8235
- "nonoptional"
8236
- ]);
8237
- /**
8238
- * The schema layers that make up ONE field: the schema itself and every
8239
- * wrapper below it (optional / default / nullable / readonly / catch), plus
8240
- * both sides of a pipe (`z.preprocess` puts the real schema on `out`,
8241
- * `.transform` on `in`).
8242
- */
8243
- function layersOf(schema) {
8244
- const out = [];
8245
- const queue = [schema];
8246
- while (queue.length > 0) {
8247
- const s = queue.shift();
8248
- if (!s || out.includes(s)) continue;
8249
- out.push(s);
8250
- const def = defOf(s);
8251
- if (def.type !== void 0 && WRAPPERS.has(def.type) && def.innerType) queue.push(def.innerType);
8252
- if (def.type === "pipe") {
8253
- if (def.in) queue.push(def.in);
8254
- if (def.out) queue.push(def.out);
8255
- }
8256
- }
8257
- return out;
8258
- }
8259
- /** True when any layer of this field declares `.meta({ secret: true })`. */
8260
- function isZodSecret(schema) {
8261
- return layersOf(schema).some(declaredHere);
8262
- }
8263
- /**
8264
- * Every declared secret path in a config schema: dotted keys, `[]` for "each
8265
- * element of this array" (`connection.password`, `rows[].token`). A declared
8266
- * object or array is reported as one path and not descended into — everything
8267
- * under it is secret.
8268
- */
8269
- function collectZodSecretPaths(schema, prefix = "") {
8270
- if (isZodSecret(schema)) return prefix.length > 0 ? [prefix] : [];
8271
- const paths = [];
8272
- for (const layer of layersOf(schema)) {
8273
- const def = defOf(layer);
8274
- if (def.type === "object" && def.shape) for (const [key, child] of Object.entries(def.shape)) paths.push(...collectZodSecretPaths(child, prefix ? `${prefix}.${key}` : key));
8275
- else if (def.type === "array" && def.element) paths.push(...collectZodSecretPaths(def.element, `${prefix}[]`));
8276
- else if (def.type === "union" && def.options) for (const option of def.options) paths.push(...collectZodSecretPaths(option, prefix));
8277
- else if (def.type === "intersection") {
8278
- if (def.left) paths.push(...collectZodSecretPaths(def.left, prefix));
8279
- if (def.right) paths.push(...collectZodSecretPaths(def.right, prefix));
8280
- }
8281
- }
8282
- return [...new Set(paths)];
8283
- }
8284
8814
  object({
8285
8815
  code: string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/),
8286
8816
  params: record(string(), union([string(), number()])).optional()
8287
8817
  });
8288
8818
  //#endregion
8289
- //#region ../types/dist/err-msg-DLerKiVO.mjs
8819
+ //#region ../types/dist/err-msg--2RrYiLO.mjs
8290
8820
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
8291
8821
  DeviceType["Camera"] = "camera";
8292
8822
  DeviceType["Hub"] = "hub";
@@ -8555,6 +9085,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8555
9085
  /** Virtual HA toggle (input_boolean.*) — distinguishable from a
8556
9086
  * real Switch device for UI rendering / export adapters. */
8557
9087
  DeviceRole["BinaryHelper"] = "binary-helper";
9088
+ /** A smart plug: a `switch` whose source says it is an outlet (HA
9089
+ * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
9090
+ DeviceRole["Outlet"] = "outlet";
8558
9091
  /** Generic motion / occupancy / moving event source. Distinct from
8559
9092
  * the camera accessory PirSensor role: that one is a camera child;
8560
9093
  * this is a standalone HA / 3rd-party motion sensor. */
@@ -8632,7 +9165,7 @@ function errMsg(err) {
8632
9165
  return String(err);
8633
9166
  }
8634
9167
  //#endregion
8635
- //#region ../types/dist/composition-EQ9Ok0Ee.mjs
9168
+ //#region ../types/dist/composition-DOwQB_Ua.mjs
8636
9169
  /**
8637
9170
  * The ffmpeg build every CamStack node downloads, per platform and arch.
8638
9171
  *
@@ -11980,11 +12513,10 @@ var ClipModelMetaSchema = object({
11980
12513
  /**
11981
12514
  * The `vector-store` index this model's vectors live in. ONE feature space
11982
12515
  * per index: two models share an index only when their vectors are ranked
11983
- * against each other, which for CLIP means never across families. MobileCLIP
11984
- * S1 and S2 share `object-clip` for history (separated by the row's
11985
- * `modelId`); any other model gets its own.
12516
+ * against each other, which for CLIP means never across families. Every
12517
+ * model gets its own.
11986
12518
  */
11987
- vectorIndex: string().regex(/^object-clip(-[a-z0-9][a-z0-9-]*)?$/),
12519
+ vectorIndex: string().regex(/^object-clip-[a-z0-9][a-z0-9-]*$/),
11988
12520
  /**
11989
12521
  * The text encoder's tokenizer, a declared SIBLING file of its onnx. The name
11990
12522
  * must be unique per tokenizer: every model's siblings land in ONE flat
@@ -15785,6 +16317,41 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
15785
16317
  keyField: string()
15786
16318
  }).optional()
15787
16319
  })) });
16320
+ /**
16321
+ * The report of a one-shot "move this owner's plaintext secrets into the
16322
+ * keychain" run (D878). COUNTS only - never a value, never a ref.
16323
+ *
16324
+ * The owner runs it on its own rows, through its own write path; an operator
16325
+ * script (`scripts/hub/migrate-raw-secrets.ts`) calls the owner's cap method.
16326
+ * Dry run (`apply: false`) reports what WOULD move and changes nothing.
16327
+ */
16328
+ var RawSecretMigrationInputSchema = object({
16329
+ /** `false` (the default of the script) = report only. */
16330
+ apply: boolean() });
16331
+ var RawSecretMigrationReportSchema = object({
16332
+ apply: boolean(),
16333
+ /** Rows that can carry a secret (a profile, an enrolment). */
16334
+ rows: number().int(),
16335
+ /** Rows whose secret was plaintext when the run started. */
16336
+ raw: number().int(),
16337
+ /** Rows that already held a keychain marker when the run started. */
16338
+ markers: number().int(),
16339
+ /** Plaintext rows moved by THIS run (always 0 on a dry run). */
16340
+ migrated: number().int(),
16341
+ /** Plaintext rows left in place because the move or its read-back failed. */
16342
+ failed: number().int(),
16343
+ /** After the run: rows still holding plaintext. */
16344
+ remainingRaw: number().int(),
16345
+ /** After the run: markers the keychain could not resolve right now. */
16346
+ unresolvedMarkers: number().int(),
16347
+ /**
16348
+ * A second, redundant copy of the secrets' rows that the run found (and, on
16349
+ * `apply`, deleted after verifying the first). Owners with a single copy omit it.
16350
+ */
16351
+ redundantCopies: number().int().optional(),
16352
+ /** True when nothing is raw and every marker resolves. */
16353
+ verified: boolean()
16354
+ });
15788
16355
  /** Where a block runs. The operator chooses — a block driving a device on an
15789
16356
  * agent is the reason placement is not fixed to the hub. */
15790
16357
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -16011,6 +16578,9 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
16011
16578
  }), SettingsUpdateResultSchema, {
16012
16579
  kind: "mutation",
16013
16580
  auth: "admin"
16581
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
16582
+ kind: "mutation",
16583
+ auth: "admin"
16014
16584
  }), method(object({}), object({ libs: array(object({
16015
16585
  filePath: string(),
16016
16586
  content: string()
@@ -16274,6 +16844,347 @@ id: union([string(), number()]) }), {
16274
16844
  auth: "admin"
16275
16845
  });
16276
16846
  /**
16847
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
16848
+ * config documents, mirrors. The third storage API next to `ctx.settings`
16849
+ * (operator intent, D870) and device-history (numbers over time, D850).
16850
+ *
16851
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
16852
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
16853
+ * that with the addon id closed over). It is deliberately NOT in any input
16854
+ * schema, so a session can never supply it, and a call with no stamp is refused
16855
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
16856
+ * addons go through the owner's capability.
16857
+ *
16858
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16859
+ * never `[]`. Secret fields are never on the wire: a read shows the
16860
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
16861
+ * resolves itself, and a write may carry only a keychain marker bound to the
16862
+ * row's own ref.
16863
+ *
16864
+ * Internal: addons reach it through `ctx.records`, never directly.
16865
+ */
16866
+ var RecordIdSchema = string().min(1).max(256);
16867
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
16868
+ var RecordBodySchema = record(string(), unknown());
16869
+ var RecordInputSchema = object({
16870
+ id: RecordIdSchema,
16871
+ /** The device this row belongs to (D865 removal, per-device reads). */
16872
+ deviceId: number().int().optional(),
16873
+ /** The domain clock, ms: observed / created / opened. */
16874
+ at: number().int().optional(),
16875
+ /** Producer-set expiry, ms. Refused on a kind whose retention is an engine TTL. */
16876
+ expiresAt: number().int().optional(),
16877
+ data: RecordBodySchema
16878
+ });
16879
+ var RecordViewSchema = object({
16880
+ id: string(),
16881
+ deviceId: number().int().nullable(),
16882
+ at: number().nullable(),
16883
+ expiresAt: number().nullable(),
16884
+ rev: number().int(),
16885
+ updatedAt: number(),
16886
+ data: RecordBodySchema
16887
+ });
16888
+ /** Declared index fields only. Anything else does not compile, by design. */
16889
+ var RecordWhereSchema = record(RecordFieldPathSchema, union([
16890
+ string(),
16891
+ number(),
16892
+ boolean(),
16893
+ object({ in: array(union([
16894
+ string(),
16895
+ number(),
16896
+ boolean()
16897
+ ])).min(1).max(RECORD_BATCH_MAX) }),
16898
+ object({
16899
+ gt: union([string(), number()]).optional(),
16900
+ gte: union([string(), number()]).optional(),
16901
+ lt: union([string(), number()]).optional(),
16902
+ lte: union([string(), number()]).optional()
16903
+ }).refine((r) => Object.keys(r).length > 0, { message: "name at least one bound" })
16904
+ ]));
16905
+ var KindShape = { kind: RecordKindNameSchema };
16906
+ var TimeWindowShape = {
16907
+ deviceId: number().int().optional(),
16908
+ atFrom: number().optional(),
16909
+ atTo: number().optional()
16910
+ };
16911
+ var RecordQueryInputSchema = object({
16912
+ ...KindShape,
16913
+ ...TimeWindowShape,
16914
+ where: RecordWhereSchema.optional(),
16915
+ /** Without `where`: `at` (default for a kind with a clock) or `id`. With `where` the order is the index's. */
16916
+ order: _enum(["at", "id"]).optional(),
16917
+ desc: boolean().optional(),
16918
+ limit: number().int().min(1).max(RECORD_QUERY_MAX).default(100),
16919
+ /** Opaque keyset cursor from a previous answer. There is no offset. */
16920
+ cursor: string().min(1).optional()
16921
+ });
16922
+ var RecordQueryResultSchema = object({
16923
+ records: array(RecordViewSchema),
16924
+ nextCursor: string().nullable()
16925
+ });
16926
+ var RecordKindStateSchema = _enum([
16927
+ "created",
16928
+ "unchanged",
16929
+ "updated"
16930
+ ]);
16931
+ var DeclareKindResultSchema = object({
16932
+ kindId: number().int(),
16933
+ state: RecordKindStateSchema,
16934
+ createdIndexes: array(string()),
16935
+ /** The boot guard: the kind is empty while its legacy table still holds rows. */
16936
+ adoptionPending: object({
16937
+ legacyTable: string(),
16938
+ legacyRows: number().int()
16939
+ }).nullable()
16940
+ });
16941
+ /** Keychain refs a write released (the old marker is gone from the row): the owner deletes the values. */
16942
+ var SecretRefsList = array(string());
16943
+ var RecordSecretRefsSchema = record(string(), record(string(), string()));
16944
+ method(object({ kinds: record(RecordKindNameSchema, RecordKindDeclarationSchema) }), object({ kinds: record(string(), DeclareKindResultSchema) }), {
16945
+ kind: "mutation",
16946
+ auth: "admin"
16947
+ }), method(object({
16948
+ ...KindShape,
16949
+ id: RecordIdSchema
16950
+ }), RecordViewSchema.nullable(), { auth: "admin" }), method(object({
16951
+ ...KindShape,
16952
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16953
+ }), array(RecordViewSchema), { auth: "admin" }), method(object({
16954
+ ...KindShape,
16955
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
16956
+ }), RecordSecretRefsSchema, { auth: "admin" }), method(object({
16957
+ ...KindShape,
16958
+ record: RecordInputSchema,
16959
+ /** Compare-and-set. `0` means "the row must not exist". */
16960
+ ifRev: number().int().min(0).optional()
16961
+ }), object({
16962
+ rev: number().int(),
16963
+ releasedRefs: SecretRefsList
16964
+ }), {
16965
+ kind: "mutation",
16966
+ auth: "admin"
16967
+ }), method(object({
16968
+ ...KindShape,
16969
+ records: array(RecordInputSchema).min(1).max(RECORD_BATCH_MAX)
16970
+ }), object({
16971
+ count: number().int(),
16972
+ releasedRefs: SecretRefsList
16973
+ }), {
16974
+ kind: "mutation",
16975
+ auth: "admin"
16976
+ }), method(object({
16977
+ ...KindShape,
16978
+ id: RecordIdSchema,
16979
+ data: RecordBodySchema,
16980
+ at: number().int().nullable().optional(),
16981
+ expiresAt: number().int().nullable().optional(),
16982
+ ifRev: number().int().min(1).optional()
16983
+ }), object({
16984
+ rev: number().int(),
16985
+ releasedRefs: SecretRefsList
16986
+ }), {
16987
+ kind: "mutation",
16988
+ auth: "admin"
16989
+ }), method(object({
16990
+ ...KindShape,
16991
+ id: RecordIdSchema
16992
+ }), object({
16993
+ deleted: boolean(),
16994
+ secretRefs: SecretRefsList
16995
+ }), {
16996
+ kind: "mutation",
16997
+ auth: "admin"
16998
+ }), method(object({
16999
+ ...KindShape,
17000
+ ids: array(RecordIdSchema).min(1).max(RECORD_BATCH_MAX)
17001
+ }), object({
17002
+ deleted: number().int(),
17003
+ secretRefs: SecretRefsList
17004
+ }), {
17005
+ kind: "mutation",
17006
+ auth: "admin"
17007
+ }), method(RecordQueryInputSchema, RecordQueryResultSchema, { auth: "admin" }), method(object({
17008
+ ...KindShape,
17009
+ ...TimeWindowShape,
17010
+ where: RecordWhereSchema.optional()
17011
+ }), object({ count: number().int() }), { auth: "admin" }), method(object({
17012
+ ...KindShape,
17013
+ deviceId: number().int().optional(),
17014
+ from: number(),
17015
+ to: number(),
17016
+ bucketMs: number().int().positive()
17017
+ }), object({ buckets: array(object({
17018
+ bucketStart: number(),
17019
+ count: number().int()
17020
+ })) }), { auth: "admin" }), method(object({
17021
+ ...KindShape,
17022
+ op: _enum([
17023
+ "sum",
17024
+ "min",
17025
+ "max",
17026
+ "count"
17027
+ ]),
17028
+ field: RecordFieldPathSchema.optional(),
17029
+ groupBy: RecordFieldPathSchema.optional(),
17030
+ where: RecordWhereSchema.optional()
17031
+ }), object({ rows: array(object({
17032
+ group: union([
17033
+ string(),
17034
+ number(),
17035
+ _null()
17036
+ ]),
17037
+ value: number().nullable()
17038
+ })) }), { auth: "admin" }), method(object({
17039
+ ...KindShape,
17040
+ deviceId: number().int().optional(),
17041
+ atBefore: number().optional(),
17042
+ where: RecordWhereSchema.optional()
17043
+ }), object({
17044
+ deleted: number().int(),
17045
+ secretRefs: SecretRefsList
17046
+ }), {
17047
+ kind: "mutation",
17048
+ auth: "admin"
17049
+ }), method(object({
17050
+ deviceId: number().int(),
17051
+ kinds: array(RecordKindNameSchema).optional()
17052
+ }), object({
17053
+ deleted: record(string(), number().int()),
17054
+ secretRefs: SecretRefsList
17055
+ }), {
17056
+ kind: "mutation",
17057
+ auth: "admin"
17058
+ }), method(object(KindShape), object({ id: number().int() }), {
17059
+ kind: "mutation",
17060
+ auth: "admin"
17061
+ });
17062
+ /** One table of the settings database. */
17063
+ var StorageTableSchema = object({
17064
+ /** The table's full name, e.g. `recorder:addon-settings` or `addon-device-settings`. */
17065
+ name: string(),
17066
+ /** The owner prefix of a scoped name (`recorder` for `recorder:addon-settings`), else null. */
17067
+ owner: string().nullable(),
17068
+ rows: number().int().nonnegative(),
17069
+ /** Bytes the table's pages occupy (`dbstat`); null when the engine cannot measure. */
17070
+ bytes: number().int().nonnegative().nullable(),
17071
+ /** Declared by an addon since this engine process started (a running addon claims it). */
17072
+ declaredThisBoot: boolean()
17073
+ });
17074
+ /** One declared record kind (D881) as System -> Data shows it. */
17075
+ var StorageKindSchema = object({
17076
+ owner: string(),
17077
+ kind: string(),
17078
+ database: _enum(["settings", "events"]),
17079
+ class: string(),
17080
+ state: _enum([
17081
+ "declared",
17082
+ "orphaned",
17083
+ "dropped"
17084
+ ]),
17085
+ /** `null` when the caller asked for no counts (`counts: false`). */
17086
+ rows: number().int().nonnegative().nullable(),
17087
+ /** Rows x the average size of a sample; null for an empty kind. */
17088
+ bytesEstimate: number().int().nonnegative().nullable(),
17089
+ writeTrigger: string(),
17090
+ retention: RecordRetentionSchema,
17091
+ /** `true` when the kind is an entry kind (the generic entries UI lists it). */
17092
+ entry: boolean(),
17093
+ /** The whole declaration, secret paths and entry descriptor included (the entries service builds its handle from it). */
17094
+ declaration: RecordKindDeclarationSchema
17095
+ });
17096
+ method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
17097
+ collection: string().min(1),
17098
+ expectRows: number().int().nonnegative()
17099
+ }), object({
17100
+ dropped: literal(true),
17101
+ rows: number().int().nonnegative()
17102
+ }), {
17103
+ kind: "mutation",
17104
+ auth: "admin"
17105
+ }), method(object({
17106
+ owner: string().min(1).optional(),
17107
+ /** `false` skips the per-kind row count (a catalog read only). Default true. */
17108
+ counts: boolean().optional()
17109
+ }), object({ kinds: array(StorageKindSchema) }), { auth: "admin" }), method(RecordQueryInputSchema.extend({
17110
+ owner: string().min(1),
17111
+ kind: RecordKindNameSchema
17112
+ }), RecordQueryResultSchema, { auth: "admin" }), method(object({
17113
+ owner: string().min(1),
17114
+ kind: RecordKindNameSchema,
17115
+ records: array(RecordInputSchema).max(RECORD_BATCH_MAX),
17116
+ /** The LAST batch: the copy is complete, the boot guard stops asking. */
17117
+ complete: boolean().optional()
17118
+ }).refine((input) => input.records.length > 0 || input.complete === true, { message: "records must be non-empty unless complete is true" }), object({ adopted: number().int() }), {
17119
+ kind: "mutation",
17120
+ auth: "admin"
17121
+ }), method(object({
17122
+ collection: string().min(1),
17123
+ cursor: string().optional(),
17124
+ limit: number().int().min(1).max(1e3).optional()
17125
+ }), object({
17126
+ rows: array(object({
17127
+ id: string(),
17128
+ data: record(string(), unknown())
17129
+ })),
17130
+ nextCursor: string().nullable()
17131
+ }), { auth: "admin" }), method(object({ collection: string().min(1) }), object({ adopted: boolean() }), { auth: "admin" });
17132
+ /**
17133
+ * record-entries - the ONE admin surface for every list of user-created entries
17134
+ * (D881): notification targets, brokers, LLM profiles, anything an addon
17135
+ * declares as an ENTRY kind (`entry: { title }` in `defineRecordKinds`).
17136
+ *
17137
+ * The UI is generic. `listEntryKinds` hands it, per kind, the JSON Schema of
17138
+ * the entry body with `secret: true` on every credential field, so a password
17139
+ * field is derived from the schema and never from a name. `putEntry` takes the
17140
+ * redaction token for an untouched secret (the stored value is kept), a string
17141
+ * for a new one, and the clear instruction to remove one. A read never carries
17142
+ * a secret value, and a locked keychain refuses the write with
17143
+ * `records/secret-unavailable` instead of storing plaintext.
17144
+ *
17145
+ * Hub-only, served in-process (it acts for each entry's owner on the keychain).
17146
+ */
17147
+ var EntryKindInfoSchema = object({
17148
+ owner: string(),
17149
+ kind: RecordKindNameSchema,
17150
+ title: string(),
17151
+ nameField: string(),
17152
+ /** JSON Schema of the body; `secret: true` marks a password field. */
17153
+ fields: record(string(), unknown()),
17154
+ secretPaths: array(string()),
17155
+ rows: number().int().nonnegative()
17156
+ });
17157
+ var EntryViewSchema = object({
17158
+ id: RecordIdSchema,
17159
+ name: string(),
17160
+ rev: number().int(),
17161
+ updatedAt: number(),
17162
+ /** Secret fields hold the redaction token. */
17163
+ data: RecordBodySchema
17164
+ });
17165
+ var EntryAddress = {
17166
+ owner: string().min(1),
17167
+ kind: RecordKindNameSchema
17168
+ };
17169
+ method(object({}), object({ kinds: array(EntryKindInfoSchema) }), { auth: "admin" }), method(object({ ...EntryAddress }), object({ entries: array(EntryViewSchema) }), { auth: "admin" }), method(object({
17170
+ ...EntryAddress,
17171
+ id: RecordIdSchema.optional(),
17172
+ data: RecordBodySchema,
17173
+ ifRev: number().int().min(1).optional()
17174
+ }), object({
17175
+ id: string(),
17176
+ rev: number().int()
17177
+ }), {
17178
+ kind: "mutation",
17179
+ auth: "admin"
17180
+ }), method(object({
17181
+ ...EntryAddress,
17182
+ id: RecordIdSchema
17183
+ }), object({ deleted: boolean() }), {
17184
+ kind: "mutation",
17185
+ auth: "admin"
17186
+ });
17187
+ /**
16277
17188
  * `keychain` — the hub's encrypted store of secret values (D787).
16278
17189
  *
16279
17190
  * Settings blobs never hold a secret: they hold a marker
@@ -16814,6 +17725,16 @@ method(object({}), KeychainStatusSchema, { auth: "admin" }), method(object({}),
16814
17725
  kind: "mutation",
16815
17726
  auth: "admin",
16816
17727
  caller: "required"
17728
+ }), method(object({
17729
+ ref: string().min(1),
17730
+ value: string().min(1)
17731
+ }), object({
17732
+ ref: string(),
17733
+ version: number().int()
17734
+ }), {
17735
+ kind: "mutation",
17736
+ auth: "admin",
17737
+ caller: "required"
16817
17738
  }), method(object({ refs: array(string().min(1)).max(1e3) }), object({
16818
17739
  deleted: array(string()).readonly(),
16819
17740
  kept: array(object({
@@ -39709,6 +40630,9 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
39709
40630
  }), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
39710
40631
  kind: "mutation",
39711
40632
  auth: "admin"
40633
+ }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
40634
+ kind: "mutation",
40635
+ auth: "admin"
39712
40636
  }), method(ProfileRefInputSchema, _void(), {
39713
40637
  kind: "mutation",
39714
40638
  auth: "admin"
@@ -50256,6 +51180,41 @@ var ServerRollbackInfoSchema = object({
50256
51180
  atMs: number(),
50257
51181
  reason: string()
50258
51182
  });
51183
+ /**
51184
+ * The runner boot check (D877): the runners this node PLANNED (hub: one per
51185
+ * `resolveRunnerId` over its forked addons; agent: the runners its process
51186
+ * service holds, because only the hub plans) against the states the process
51187
+ * service reports. Kept in memory, recomputed by the same one-shot check after
51188
+ * every boot, served on `getServerPackageStatus`.
51189
+ *
51190
+ * `failed` is the D6 breaker's terminal state, `refused` a deterministic Init
51191
+ * refusal (an addon that said "I will not start, and here is why"), `missing` a
51192
+ * planned runner the process service has no entry for.
51193
+ */
51194
+ var RunnerRefusalSchema = object({
51195
+ runnerId: string(),
51196
+ addonIds: array(string()),
51197
+ reason: string()
51198
+ });
51199
+ var RunnerBootCheckSchema = object({
51200
+ checkedAtMs: number(),
51201
+ /** Runners planned for this node. */
51202
+ expected: number(),
51203
+ /** Planned runners whose process is `running`. */
51204
+ running: number(),
51205
+ failed: array(string()),
51206
+ refused: array(RunnerRefusalSchema),
51207
+ missing: array(string()),
51208
+ /**
51209
+ * Runners still on their way: `starting`, or `crashed` waiting on a backoff
51210
+ * respawn. The check is FINAL only when this is empty; until then nothing is
51211
+ * pushed and the verdict is re-evaluated on the next runner state change.
51212
+ * Optional for version skew (absent = settled).
51213
+ */
51214
+ pending: array(string()).optional(),
51215
+ /** True when the plan is the hub's (`missing` is then meaningful); false on an agent. */
51216
+ planKnown: boolean()
51217
+ });
50259
51218
  var ServerPackageStatusSchema = object({
50260
51219
  /** Root package name (`@camstack/server` on the hub). */
50261
51220
  packageName: string(),
@@ -50318,7 +51277,14 @@ var ServerPackageStatusSchema = object({
50318
51277
  * for version skew: an older provider's payload simply omits it, and an
50319
51278
  * absent wrapper is unknown — never `native`.
50320
51279
  */
50321
- wrapper: WrapperIdentitySchema.optional()
51280
+ wrapper: WrapperIdentitySchema.optional(),
51281
+ /**
51282
+ * What this node PLANNED to run against what its process service reports
51283
+ * (D877). Absent until the one-shot boot check has run (~60 s after boot) and
51284
+ * on a provider that predates it. Absent is "not checked yet", never "all
51285
+ * well": a consumer that needs the answer treats it as pending.
51286
+ */
51287
+ runners: RunnerBootCheckSchema.optional()
50322
51288
  });
50323
51289
  var ServerUpdateCheckResultSchema = object({
50324
51290
  packageName: string(),
@@ -50369,6 +51335,13 @@ var ServerUpdateOutcomeSchema = _enum([
50369
51335
  "refused",
50370
51336
  "failed"
50371
51337
  ]);
51338
+ /** One addon the pre-flight found the target version would refuse (D877). */
51339
+ var UpdateBlockerSchema = object({
51340
+ addonId: string(),
51341
+ reason: string(),
51342
+ /** What the operator does about it. */
51343
+ remedy: string()
51344
+ });
50372
51345
  var ServerUpdateActionResultSchema = object({
50373
51346
  accepted: boolean(),
50374
51347
  targetVersion: string().nullable(),
@@ -50386,14 +51359,27 @@ var ServerUpdateActionResultSchema = object({
50386
51359
  * The failure itself, verbatim enough to act on (the npm output for a
50387
51360
  * staging install). Non-null only for `failed`.
50388
51361
  */
50389
- error: string().nullable().optional()
51362
+ error: string().nullable().optional(),
51363
+ /**
51364
+ * The addons the target version would refuse to start on this node's live
51365
+ * store (D877), present when the pre-flight refused the update
51366
+ * (`reason: 'addon-would-refuse'`). Optional for version skew.
51367
+ */
51368
+ blockers: array(UpdateBlockerSchema).optional()
50390
51369
  });
50391
51370
  method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), ServerUpdateCheckResultSchema, {
50392
51371
  kind: "mutation",
50393
51372
  auth: "admin"
50394
- }), method(object({
50395
- /** Explicit target version; omitted = latest from the registry. */
50396
- version: string().optional() }), ServerUpdateActionResultSchema, {
51373
+ }), method(object({
51374
+ /** Explicit target version; omitted = latest from the registry. */
51375
+ version: string().optional(),
51376
+ /**
51377
+ * Apply even though the pre-flight (D877) found addons the target would
51378
+ * refuse to start. Off by default: those addons stay down until the
51379
+ * remedy is run, which is the incident this gate exists to prevent.
51380
+ */
51381
+ acknowledgeRefusals: boolean().optional()
51382
+ }), ServerUpdateActionResultSchema, {
50397
51383
  kind: "mutation",
50398
51384
  auth: "admin",
50399
51385
  timeoutMs: 16 * 6e4
@@ -52911,7 +53897,9 @@ var ManifestShapeSchema = object({
52911
53897
  var AddonProcessSchema = object({
52912
53898
  pid: number().optional(),
52913
53899
  mode: string(),
52914
- state: string()
53900
+ state: string(),
53901
+ /** Why the runner is `refused` (an addon's own words), when it is (D877). */
53902
+ reason: string().optional()
52915
53903
  });
52916
53904
  /**
52917
53905
  * Per-addon health snapshot from the kernel's AddonHealthMonitor.
@@ -54327,6 +55315,12 @@ var ClimateControlStatusSchema = object({
54327
55315
  /** Horizontal louver swing on/off. Null when the device has no
54328
55316
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
54329
55317
  swingHorizontal: boolean().nullable(),
55318
+ /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
55319
+ minTemp: number().nullable().optional(),
55320
+ /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
55321
+ maxTemp: number().nullable().optional(),
55322
+ /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
55323
+ tempStep: number().positive().nullable().optional(),
54330
55324
  /** Ms epoch when the slice was last updated (push or command). */
54331
55325
  lastFetchedAt: number()
54332
55326
  });
@@ -57107,7 +58101,19 @@ var TlsStatusSchema = object({
57107
58101
  sans: array(string()),
57108
58102
  caCertPem: string().nullable(),
57109
58103
  reissueError: string().nullable(),
57110
- restartRequired: boolean()
58104
+ restartRequired: boolean(),
58105
+ /** An uploaded certificate is served but no CA is kept for it and it is not publicly signed (D873). */
58106
+ caMissing: boolean(),
58107
+ /** Does the hub's own generated CA carry a critical name constraint? `null` while it has none. */
58108
+ localCaConstrained: boolean().nullable(),
58109
+ /** ISO time the generated CA was replaced by a constrained one; devices must re-download it. */
58110
+ caReplacedAt: string().nullable(),
58111
+ /** The uploaded certificate kept on disk, selectable again after "Revert to generated". */
58112
+ storedUpload: object({
58113
+ leafFingerprintSha256: string(),
58114
+ validTo: string(),
58115
+ hasCa: boolean()
58116
+ }).nullable()
57111
58117
  });
57112
58118
  method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(object({
57113
58119
  /**
@@ -57163,6 +58169,9 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
57163
58169
  }), method(_void(), object({ pem: string() })), method(_void(), TlsStatusSchema, {
57164
58170
  kind: "mutation",
57165
58171
  auth: "admin"
58172
+ }), method(_void(), TlsStatusSchema, {
58173
+ kind: "mutation",
58174
+ auth: "admin"
57166
58175
  });
57167
58176
  var LockControlStatusSchema = object({
57168
58177
  /** Lifecycle state of the lock. `jammed` means the motor reported
@@ -63656,7 +64665,11 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
63656
64665
  kind: "mutation",
63657
64666
  auth: "admin",
63658
64667
  access: "delete"
63659
- }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(object({
64668
+ }), method(object({ userId: string() }), TotpStatusSchema, { auth: "admin" }), method(RawSecretMigrationInputSchema, RawSecretMigrationReportSchema, {
64669
+ kind: "mutation",
64670
+ auth: "admin",
64671
+ access: "create"
64672
+ }), method(object({
63660
64673
  userId: string(),
63661
64674
  code: string()
63662
64675
  }), object({ valid: boolean() }), {
@@ -65468,13 +66481,14 @@ var BaseDevice = class {
65468
66481
  get state() {
65469
66482
  if (!this._stateProxyCache) {
65470
66483
  const cache = {};
65471
- const handler = { get: (_target, key) => {
66484
+ const handler = { get: (target, key) => {
65472
66485
  const k = key;
65473
- if (k in cache) return cache[k];
66486
+ const existing = Reflect.get(target, k);
66487
+ if (existing !== void 0) return existing;
65474
66488
  const cap = DEVICE_LOCAL_STATE_CAPS[k];
65475
66489
  if (!cap) return void 0;
65476
66490
  const proxy = this.sliceProxy(cap);
65477
- cache[k] = proxy;
66491
+ Reflect.set(target, k, proxy);
65478
66492
  return proxy;
65479
66493
  } };
65480
66494
  this._stateProxyCache = new Proxy(cache, handler);
@@ -65673,7 +66687,7 @@ var BaseDevice = class {
65673
66687
  async updateSourceInfo(patch) {
65674
66688
  const next = mergeSourceInfo(this.sourceInfo, patch);
65675
66689
  this._sourceInfoCache = Object.freeze({ ...next });
65676
- const action = this.ctx.api?.deviceManager?.setMetadata;
66690
+ const action = this.ctx.api.deviceManager?.setMetadata;
65677
66691
  if (action) try {
65678
66692
  await action.mutate({
65679
66693
  deviceId: this.id,
@@ -65708,7 +66722,7 @@ var BaseDevice = class {
65708
66722
  * device boot on a meta refresh.
65709
66723
  */
65710
66724
  async refreshFeatures() {
65711
- const action = this.ctx.api?.deviceManager?.registerDevice;
66725
+ const action = this.ctx.api.deviceManager?.registerDevice;
65712
66726
  if (!action) return;
65713
66727
  try {
65714
66728
  await action.mutate({
@@ -67782,6 +68796,12 @@ Object.freeze({
67782
68796
  addonId: null,
67783
68797
  access: "view"
67784
68798
  },
68799
+ "coreBlocks.migrateRawSecrets": {
68800
+ capName: "core-blocks",
68801
+ capScope: "system",
68802
+ addonId: null,
68803
+ access: "create"
68804
+ },
67785
68805
  "coreBlocks.restart": {
67786
68806
  capName: "core-blocks",
67787
68807
  capScope: "system",
@@ -69468,6 +70488,12 @@ Object.freeze({
69468
70488
  addonId: null,
69469
70489
  access: "create"
69470
70490
  },
70491
+ "keychainAdmin.importSecret": {
70492
+ capName: "keychain-admin",
70493
+ capScope: "system",
70494
+ addonId: null,
70495
+ access: "create"
70496
+ },
69471
70497
  "keychainAdmin.listAudit": {
69472
70498
  capName: "keychain-admin",
69473
70499
  capScope: "system",
@@ -69636,6 +70662,12 @@ Object.freeze({
69636
70662
  addonId: null,
69637
70663
  access: "view"
69638
70664
  },
70665
+ "llm.migrateRawSecrets": {
70666
+ capName: "llm",
70667
+ capScope: "system",
70668
+ addonId: null,
70669
+ access: "create"
70670
+ },
69639
70671
  "llm.resolveModelRef": {
69640
70672
  capName: "llm",
69641
70673
  capScope: "system",
@@ -69864,6 +70896,12 @@ Object.freeze({
69864
70896
  addonId: null,
69865
70897
  access: "create"
69866
70898
  },
70899
+ "localNetwork.useStoredUploadedCertificate": {
70900
+ capName: "local-network",
70901
+ capScope: "system",
70902
+ addonId: null,
70903
+ access: "create"
70904
+ },
69867
70905
  "lockControl.getStatus": {
69868
70906
  capName: "lock-control",
69869
70907
  capScope: "device",
@@ -72516,6 +73554,30 @@ Object.freeze({
72516
73554
  addonId: null,
72517
73555
  access: "create"
72518
73556
  },
73557
+ "recordEntries.deleteEntry": {
73558
+ capName: "record-entries",
73559
+ capScope: "system",
73560
+ addonId: null,
73561
+ access: "delete"
73562
+ },
73563
+ "recordEntries.listEntries": {
73564
+ capName: "record-entries",
73565
+ capScope: "system",
73566
+ addonId: null,
73567
+ access: "view"
73568
+ },
73569
+ "recordEntries.listEntryKinds": {
73570
+ capName: "record-entries",
73571
+ capScope: "system",
73572
+ addonId: null,
73573
+ access: "view"
73574
+ },
73575
+ "recordEntries.putEntry": {
73576
+ capName: "record-entries",
73577
+ capScope: "system",
73578
+ addonId: null,
73579
+ access: "create"
73580
+ },
72519
73581
  "recording.getAvailability": {
72520
73582
  capName: "recording",
72521
73583
  capScope: "device",
@@ -72816,6 +73878,102 @@ Object.freeze({
72816
73878
  addonId: null,
72817
73879
  access: "view"
72818
73880
  },
73881
+ "records.aggregate": {
73882
+ capName: "records",
73883
+ capScope: "system",
73884
+ addonId: null,
73885
+ access: "view"
73886
+ },
73887
+ "records.allocateId": {
73888
+ capName: "records",
73889
+ capScope: "system",
73890
+ addonId: null,
73891
+ access: "create"
73892
+ },
73893
+ "records.count": {
73894
+ capName: "records",
73895
+ capScope: "system",
73896
+ addonId: null,
73897
+ access: "view"
73898
+ },
73899
+ "records.declareKinds": {
73900
+ capName: "records",
73901
+ capScope: "system",
73902
+ addonId: null,
73903
+ access: "create"
73904
+ },
73905
+ "records.delete": {
73906
+ capName: "records",
73907
+ capScope: "system",
73908
+ addonId: null,
73909
+ access: "delete"
73910
+ },
73911
+ "records.deleteDevice": {
73912
+ capName: "records",
73913
+ capScope: "system",
73914
+ addonId: null,
73915
+ access: "delete"
73916
+ },
73917
+ "records.deleteMany": {
73918
+ capName: "records",
73919
+ capScope: "system",
73920
+ addonId: null,
73921
+ access: "delete"
73922
+ },
73923
+ "records.deleteWhere": {
73924
+ capName: "records",
73925
+ capScope: "system",
73926
+ addonId: null,
73927
+ access: "delete"
73928
+ },
73929
+ "records.get": {
73930
+ capName: "records",
73931
+ capScope: "system",
73932
+ addonId: null,
73933
+ access: "view"
73934
+ },
73935
+ "records.getMany": {
73936
+ capName: "records",
73937
+ capScope: "system",
73938
+ addonId: null,
73939
+ access: "view"
73940
+ },
73941
+ "records.histogram": {
73942
+ capName: "records",
73943
+ capScope: "system",
73944
+ addonId: null,
73945
+ access: "view"
73946
+ },
73947
+ "records.patch": {
73948
+ capName: "records",
73949
+ capScope: "system",
73950
+ addonId: null,
73951
+ access: "create"
73952
+ },
73953
+ "records.put": {
73954
+ capName: "records",
73955
+ capScope: "system",
73956
+ addonId: null,
73957
+ access: "create"
73958
+ },
73959
+ "records.putMany": {
73960
+ capName: "records",
73961
+ capScope: "system",
73962
+ addonId: null,
73963
+ access: "create"
73964
+ },
73965
+ "records.query": {
73966
+ capName: "records",
73967
+ capScope: "system",
73968
+ addonId: null,
73969
+ access: "view"
73970
+ },
73971
+ "records.secretRefs": {
73972
+ capName: "records",
73973
+ capScope: "system",
73974
+ addonId: null,
73975
+ access: "view"
73976
+ },
72819
73977
  "sceneMonitor.captureReference": {
72820
73978
  capName: "scene-monitor",
72821
73979
  capScope: "device",
@@ -73248,6 +74406,48 @@ Object.freeze({
73248
74406
  addonId: null,
73249
74407
  access: "create"
73250
74408
  },
74409
+ "storageAdmin.adoptRecords": {
74410
+ capName: "storage-admin",
74411
+ capScope: "system",
74412
+ addonId: null,
74413
+ access: "create"
74414
+ },
74415
+ "storageAdmin.dropCollection": {
74416
+ capName: "storage-admin",
74417
+ capScope: "system",
74418
+ addonId: null,
74419
+ access: "delete"
74420
+ },
74421
+ "storageAdmin.isAdoptedLegacyTable": {
74422
+ capName: "storage-admin",
74423
+ capScope: "system",
74424
+ addonId: null,
74425
+ access: "view"
74426
+ },
74427
+ "storageAdmin.listKinds": {
74428
+ capName: "storage-admin",
74429
+ capScope: "system",
74430
+ addonId: null,
74431
+ access: "view"
74432
+ },
74433
+ "storageAdmin.listTables": {
74434
+ capName: "storage-admin",
74435
+ capScope: "system",
74436
+ addonId: null,
74437
+ access: "view"
74438
+ },
74439
+ "storageAdmin.readLegacyCollection": {
74440
+ capName: "storage-admin",
74441
+ capScope: "system",
74442
+ addonId: null,
74443
+ access: "view"
74444
+ },
74445
+ "storageAdmin.readRecords": {
74446
+ capName: "storage-admin",
74447
+ capScope: "system",
74448
+ addonId: null,
74449
+ access: "view"
74450
+ },
73251
74451
  "storageEvictable.evict": {
73252
74452
  capName: "storage-evictable",
73253
74453
  capScope: "system",
@@ -74160,6 +75360,12 @@ Object.freeze({
74160
75360
  addonId: null,
74161
75361
  access: "view"
74162
75362
  },
75363
+ "userManagement.migrateRawSecrets": {
75364
+ capName: "user-management",
75365
+ capScope: "system",
75366
+ addonId: null,
75367
+ access: "create"
75368
+ },
74163
75369
  "userManagement.oauthExchangeCode": {
74164
75370
  capName: "user-management",
74165
75371
  capScope: "system",
@@ -76836,6 +78042,37 @@ Object.freeze({
76836
78042
  form: "single",
76837
78043
  optional: false
76838
78044
  }],
78045
+ "records.count": [{
78046
+ name: "deviceId",
78047
+ form: "single",
78048
+ optional: true
78049
+ }],
78050
+ "records.deleteDevice": [{
78051
+ name: "deviceId",
78052
+ form: "single",
78053
+ optional: false
78054
+ }],
78055
+ "records.deleteWhere": [{
78056
+ name: "deviceId",
78057
+ form: "single",
78058
+ optional: true
78059
+ }],
78060
+ "records.histogram": [{
78061
+ name: "deviceId",
78062
+ form: "single",
78063
+ optional: true
78064
+ }],
78065
+ "records.putMany": [{
78066
+ name: "records",
78067
+ form: "object-array",
78068
+ optional: false,
78069
+ itemField: "deviceId"
78070
+ }],
78071
+ "records.query": [{
78072
+ name: "deviceId",
78073
+ form: "single",
78074
+ optional: true
78075
+ }],
76839
78076
  "sceneMonitor.captureReference": [{
76840
78077
  name: "deviceId",
76841
78078
  form: "single",
@@ -76952,6 +78189,17 @@ Object.freeze({
76952
78189
  form: "single",
76953
78190
  optional: false
76954
78191
  }],
78192
+ "storageAdmin.adoptRecords": [{
78193
+ name: "records",
78194
+ form: "object-array",
78195
+ optional: false,
78196
+ itemField: "deviceId"
78197
+ }],
78198
+ "storageAdmin.readRecords": [{
78199
+ name: "deviceId",
78200
+ form: "single",
78201
+ optional: true
78202
+ }],
76955
78203
  "streamBroker.acquireEgressTranscode": [{
76956
78204
  name: "deviceId",
76957
78205
  form: "single",
@@ -78751,6 +79999,12 @@ Object.defineProperty(exports, "MediaPlayerRepeatSchema", {
78751
79999
  return MediaPlayerRepeatSchema;
78752
80000
  }
78753
80001
  });
80002
+ Object.defineProperty(exports, "RecordSecretUnavailableError", {
80003
+ enumerable: true,
80004
+ get: function() {
80005
+ return RecordSecretUnavailableError;
80006
+ }
80007
+ });
78754
80008
  Object.defineProperty(exports, "TargetSchema", {
78755
80009
  enumerable: true,
78756
80010
  get: function() {
@@ -78913,6 +80167,18 @@ Object.defineProperty(exports, "createEvent", {
78913
80167
  return createEvent;
78914
80168
  }
78915
80169
  });
80170
+ Object.defineProperty(exports, "defineEntryKind", {
80171
+ enumerable: true,
80172
+ get: function() {
80173
+ return defineEntryKind;
80174
+ }
80175
+ });
80176
+ Object.defineProperty(exports, "defineRecordKinds", {
80177
+ enumerable: true,
80178
+ get: function() {
80179
+ return defineRecordKinds;
80180
+ }
80181
+ });
78916
80182
  Object.defineProperty(exports, "deviceAdminLinkCapability", {
78917
80183
  enumerable: true,
78918
80184
  get: function() {
@@ -78937,6 +80203,12 @@ Object.defineProperty(exports, "discriminatedUnion", {
78937
80203
  return discriminatedUnion;
78938
80204
  }
78939
80205
  });
80206
+ Object.defineProperty(exports, "entryBody", {
80207
+ enumerable: true,
80208
+ get: function() {
80209
+ return entryBody;
80210
+ }
80211
+ });
78940
80212
  Object.defineProperty(exports, "enumSensorCapability", {
78941
80213
  enumerable: true,
78942
80214
  get: function() {
@@ -79111,6 +80383,12 @@ Object.defineProperty(exports, "scriptRunnerCapability", {
79111
80383
  return scriptRunnerCapability;
79112
80384
  }
79113
80385
  });
80386
+ Object.defineProperty(exports, "settingsBrokersAdoptsFrom", {
80387
+ enumerable: true,
80388
+ get: function() {
80389
+ return settingsBrokersAdoptsFrom;
80390
+ }
80391
+ });
79114
80392
  Object.defineProperty(exports, "smokeCapability", {
79115
80393
  enumerable: true,
79116
80394
  get: function() {