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