@camstack/addon-export-hap 1.2.189 → 1.2.190

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.
@@ -825,7 +825,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
825
825
  return EventCategory;
826
826
  }({});
827
827
  //#endregion
828
- //#region ../types/dist/device-type-BOWLtoOt.mjs
828
+ //#region ../types/dist/device-type-D1fH5kaC.mjs
829
829
  /**
830
830
  import { errMsg } from '@camstack/types'
831
831
  * Extract a human-readable message from an unknown error value.
@@ -1014,6 +1014,9 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1014
1014
  DeviceFeature["CoverPositionable"] = "cover-positionable";
1015
1015
  /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
1016
1016
  DeviceFeature["CoverTilt"] = "cover-tilt";
1017
+ /** Cover has a real stop: `stop` halts the travel in place. Gates the stop
1018
+ * control in exporters; a provider whose `stop` is a no-op never declares it. */
1019
+ DeviceFeature["CoverStoppable"] = "cover-stoppable";
1017
1020
  /** Valve exposes intermediate position control (0..100). Gates the
1018
1021
  * position slider / drag surface UI. */
1019
1022
  DeviceFeature["ValvePositionable"] = "valve-positionable";
@@ -1053,6 +1056,12 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1053
1056
  DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
1054
1057
  /** Media player exposes stop distinct from pause. */
1055
1058
  DeviceFeature["MediaPlayerStop"] = "media-player-stop";
1059
+ /** Media player exposes volume up / down in steps (an infrared TV has no level). */
1060
+ DeviceFeature["MediaPlayerVolumeStep"] = "media-player-volume-step";
1061
+ /** Media player exposes channel up / down in steps. */
1062
+ DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
1063
+ /** Media player exposes power on / off. */
1064
+ DeviceFeature["MediaPlayerPower"] = "media-player-power";
1056
1065
  /** Alarm panel requires a PIN code on arm/disarm. */
1057
1066
  DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
1058
1067
  /** Presence device carries GPS coordinates (lat/lng/accuracy) in
@@ -5879,7 +5888,7 @@ var ZodIssueCode = {
5879
5888
  var ZodFirstPartyTypeKind;
5880
5889
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5881
5890
  //#endregion
5882
- //#region ../types/dist/sleep-_4vKNWxb.mjs
5891
+ //#region ../types/dist/sleep-BKClVk0K.mjs
5883
5892
  /**
5884
5893
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5885
5894
  * window to float samples (D455).
@@ -5958,6 +5967,22 @@ function buildAlawTable() {
5958
5967
  }
5959
5968
  buildUlawTable();
5960
5969
  buildAlawTable();
5970
+ /**
5971
+ * An addon whose own migrations did not apply refuses to initialise (D987). The error is typed
5972
+ * so a runner hosting several addons can tell "this addon is blocked" from a crash and keep its
5973
+ * co-located siblings running. Recognised by NAME and shape, never `instanceof`: a forked addon
5974
+ * bundles its own copy of this module, so the class the runner sees is not the one that threw.
5975
+ */
5976
+ var MIGRATIONS_BLOCKED_ERROR_NAME = "AddonMigrationsBlockedError";
5977
+ var AddonMigrationsBlockedError = class extends Error {
5978
+ /** The ledger ids that did not apply and block the owner. */
5979
+ migrationIds;
5980
+ constructor(migrationIds) {
5981
+ super(`migration(s) ${migrationIds.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
5982
+ this.name = MIGRATIONS_BLOCKED_ERROR_NAME;
5983
+ this.migrationIds = migrationIds;
5984
+ }
5985
+ };
5961
5986
  /** Is this field's stored value a credential? */
5962
5987
  function isSecretConfigField(field) {
5963
5988
  if (field.type === "password") return true;
@@ -5996,7 +6021,7 @@ function isKeychainStoredField(field) {
5996
6021
  var SECRET_CLEAR = { $secretClear: true };
5997
6022
  /** The `'***'` token D634 redaction writes for non-admins. */
5998
6023
  var LEGACY_DEVICE_REDACTION = "***";
5999
- function isRecord$6(value) {
6024
+ function isRecord$7(value) {
6000
6025
  return typeof value === "object" && value !== null && !Array.isArray(value);
6001
6026
  }
6002
6027
  function makeSecretMarker(ref) {
@@ -6007,12 +6032,12 @@ function makeSecretMarker(ref) {
6007
6032
  }
6008
6033
  /** A stored marker: an object whose `$secret` is a non-empty string. */
6009
6034
  function isSecretMarker(value) {
6010
- if (!isRecord$6(value)) return false;
6035
+ if (!isRecord$7(value)) return false;
6011
6036
  const ref = value["$secret"];
6012
6037
  return typeof ref === "string" && ref.length > 0;
6013
6038
  }
6014
6039
  function isSecretClear(value) {
6015
- return isRecord$6(value) && value["$secretClear"] === true;
6040
+ return isRecord$7(value) && value["$secretClear"] === true;
6016
6041
  }
6017
6042
  /**
6018
6043
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6395,6 +6420,53 @@ function emitReadiness(bus, params) {
6395
6420
  ts
6396
6421
  }));
6397
6422
  }
6423
+ /** Why a catalogue entry is not a runnable body of its declared kind. */
6424
+ var AddonMigrationDefinitionError = class extends Error {
6425
+ id;
6426
+ constructor(id, message) {
6427
+ super(`${id}: ${message}`);
6428
+ this.id = id;
6429
+ this.name = "AddonMigrationDefinitionError";
6430
+ }
6431
+ };
6432
+ /**
6433
+ * Bind a catalogue to the addon's ports. Throws {@link AddonMigrationDefinitionError} when
6434
+ * an entry's `bodyKind` does not match the body it carries, or is `sql` (a hub-only
6435
+ * body). A throwing body never escapes `execute`: it is reported as a failed result.
6436
+ */
6437
+ function defineAddonMigrations(catalogue, ports) {
6438
+ return catalogue.map((entry) => {
6439
+ const { meta } = entry;
6440
+ if ("plan" in entry) {
6441
+ if (meta.bodyKind !== "plan") throw new AddonMigrationDefinitionError(meta.id, `carries a plan body but declares "${meta.bodyKind}"`);
6442
+ return {
6443
+ meta,
6444
+ execute: () => guarded(async () => ({
6445
+ kind: "plan",
6446
+ plan: await entry.plan(ports)
6447
+ }))
6448
+ };
6449
+ }
6450
+ if (meta.bodyKind !== "procedure") throw new AddonMigrationDefinitionError(meta.id, `carries a procedure body but declares "${meta.bodyKind}"`);
6451
+ return {
6452
+ meta,
6453
+ execute: () => guarded(async () => ({
6454
+ kind: "procedure",
6455
+ result: await entry.procedure(ports)
6456
+ }))
6457
+ };
6458
+ });
6459
+ }
6460
+ async function guarded(work) {
6461
+ try {
6462
+ return await work();
6463
+ } catch (err) {
6464
+ return {
6465
+ kind: "failed",
6466
+ error: errMsg$17(err)
6467
+ };
6468
+ }
6469
+ }
6398
6470
  var NOT_RUN = {
6399
6471
  declared: false,
6400
6472
  snapshot: null,
@@ -6718,7 +6790,7 @@ var KeychainWriteRefusedError = class extends Error {
6718
6790
  }
6719
6791
  };
6720
6792
  var KEEP = { kind: "keep" };
6721
- function isRecord$5(value) {
6793
+ function isRecord$6(value) {
6722
6794
  return typeof value === "object" && value !== null && !Array.isArray(value);
6723
6795
  }
6724
6796
  function defaultMintId() {
@@ -6731,7 +6803,7 @@ function collectSecretMarkerRefs(value, out = []) {
6731
6803
  return out;
6732
6804
  }
6733
6805
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6734
- else if (isRecord$5(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6806
+ else if (isRecord$6(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6735
6807
  return out;
6736
6808
  }
6737
6809
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6786,7 +6858,7 @@ function rowId(row, idKey) {
6786
6858
  return null;
6787
6859
  }
6788
6860
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6789
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$5) : [];
6861
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$6) : [];
6790
6862
  if (!Array.isArray(incoming)) {
6791
6863
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6792
6864
  return {
@@ -6802,7 +6874,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6802
6874
  const kept = /* @__PURE__ */ new Set();
6803
6875
  const rows = [];
6804
6876
  for (const row of incoming) {
6805
- if (!isRecord$5(row)) {
6877
+ if (!isRecord$6(row)) {
6806
6878
  rows.push(row);
6807
6879
  continue;
6808
6880
  }
@@ -6827,7 +6899,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6827
6899
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6828
6900
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6829
6901
  case "object": {
6830
- if (!isRecord$5(incoming)) {
6902
+ if (!isRecord$6(incoming)) {
6831
6903
  if (incoming === void 0) return KEEP;
6832
6904
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6833
6905
  return {
@@ -6835,7 +6907,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6835
6907
  value: incoming
6836
6908
  };
6837
6909
  }
6838
- const storedObj = isRecord$5(stored) ? stored : {};
6910
+ const storedObj = isRecord$6(stored) ? stored : {};
6839
6911
  return {
6840
6912
  kind: "value",
6841
6913
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6958,7 +7030,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6958
7030
  value: items
6959
7031
  };
6960
7032
  }
6961
- if (isRecord$5(v)) {
7033
+ if (isRecord$6(v)) {
6962
7034
  const out = {};
6963
7035
  for (const [k, child] of Object.entries(v)) {
6964
7036
  const s = substitute(child);
@@ -6990,7 +7062,7 @@ var SecretOverwriteRefusedError = class extends Error {
6990
7062
  this.name = "SecretOverwriteRefusedError";
6991
7063
  }
6992
7064
  };
6993
- function isRecord$4(value) {
7065
+ function isRecord$5(value) {
6994
7066
  return typeof value === "object" && value !== null && !Array.isArray(value);
6995
7067
  }
6996
7068
  function resolvedValue(pass, marker) {
@@ -7019,7 +7091,7 @@ function inArray(pass, incoming, stored) {
7019
7091
  return incoming.map((item, index) => {
7020
7092
  const twin = stored[index];
7021
7093
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
7022
- if (isRecord$4(item) && isRecord$4(twin)) return inArrayRow(pass, item, twin);
7094
+ if (isRecord$5(item) && isRecord$5(twin)) return inArrayRow(pass, item, twin);
7023
7095
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
7024
7096
  return item;
7025
7097
  });
@@ -7030,7 +7102,7 @@ function inArrayRow(pass, incoming, stored) {
7030
7102
  const twin = stored[key];
7031
7103
  if (isSecretMarker(twin)) {
7032
7104
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
7033
- } else if (isRecord$4(value) && isRecord$4(twin)) out[key] = inArrayRow(pass, value, twin);
7105
+ } else if (isRecord$5(value) && isRecord$5(twin)) out[key] = inArrayRow(pass, value, twin);
7034
7106
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
7035
7107
  }
7036
7108
  return out;
@@ -7038,7 +7110,7 @@ function inArrayRow(pass, incoming, stored) {
7038
7110
  async function walk(pass, incoming, stored) {
7039
7111
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
7040
7112
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
7041
- if (!isRecord$4(incoming) || !isRecord$4(stored)) return incoming;
7113
+ if (!isRecord$5(incoming) || !isRecord$5(stored)) return incoming;
7042
7114
  const out = { ...incoming };
7043
7115
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
7044
7116
  return out;
@@ -7069,7 +7141,7 @@ async function restoreUnchangedSecrets(input) {
7069
7141
  function isJsonEqual(a, b) {
7070
7142
  if (Object.is(a, b)) return true;
7071
7143
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
7072
- if (isRecord$4(a) && isRecord$4(b)) {
7144
+ if (isRecord$5(a) && isRecord$5(b)) {
7073
7145
  const keys = Object.keys(a);
7074
7146
  if (keys.length !== Object.keys(b).length) return false;
7075
7147
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -7093,7 +7165,7 @@ function markerKeysOf(blob, owner) {
7093
7165
  }
7094
7166
  function nodeFromStored(value, owner) {
7095
7167
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
7096
- if (!isRecord$4(value)) return null;
7168
+ if (!isRecord$5(value)) return null;
7097
7169
  const children = /* @__PURE__ */ new Map();
7098
7170
  for (const [key, child] of Object.entries(value)) {
7099
7171
  const node = nodeFromStored(child, owner);
@@ -7564,7 +7636,7 @@ var BaseAddon = class {
7564
7636
  startMigration: (input) => api.startMigration.mutate(input),
7565
7637
  finishMigration: (input) => api.finishMigration.mutate(input)
7566
7638
  }, migrations, this.ctx.logger);
7567
- if (report.blockOwner.length > 0) throw new Error(`migration(s) ${report.blockOwner.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
7639
+ if (report.blockOwner.length > 0) throw new AddonMigrationsBlockedError(report.blockOwner);
7568
7640
  return report;
7569
7641
  }
7570
7642
  /**
@@ -7712,6 +7784,44 @@ var BaseAddon = class {
7712
7784
  return null;
7713
7785
  }
7714
7786
  /**
7787
+ * D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
7788
+ * provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
7789
+ * declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
7790
+ * {@link nodeSettingsSchema} and of {@link deviceDefaultsSchema} are disjoint, and a key never
7791
+ * contains `@` (guard `check-scoped-settings-declared`). SHAPE only: values are read by scope.
7792
+ */
7793
+ async clusterSettingsSchema(_cap) {
7794
+ return null;
7795
+ }
7796
+ /**
7797
+ * D986: the form shape of the settings one capability owns PER NODE, or `null`. Stored as
7798
+ * `addon-settings` rows `<addonId>.<field>@<nodeId>` carrying `nodeId` in the row data, so a
7799
+ * forgotten node's rows go in one central delete.
7800
+ */
7801
+ async nodeSettingsSchema(_cap) {
7802
+ return null;
7803
+ }
7804
+ /**
7805
+ * D986: the form shape of the FLEET DEFAULTS of the per-device settings one capability owns,
7806
+ * or `null`. Stored as `addon-settings` rows `<addonId>.<field>`; a device resolves its value
7807
+ * as device row, then this default, then the schema default (`resolveDeviceSettings`).
7808
+ */
7809
+ async deviceDefaultsSchema(_cap) {
7810
+ return null;
7811
+ }
7812
+ /**
7813
+ * The host's read of the scoped declarations: the schema one capability declares for `scope`,
7814
+ * or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
7815
+ * host asks this method.
7816
+ */
7817
+ async getScopedSettingsSchema(scope, cap) {
7818
+ switch (scope) {
7819
+ case "cluster": return this.clusterSettingsSchema(cap);
7820
+ case "node": return this.nodeSettingsSchema(cap);
7821
+ case "device-defaults": return this.deviceDefaultsSchema(cap);
7822
+ }
7823
+ }
7824
+ /**
7715
7825
  * What the create wizard and the integration edit page render for one instance: the addon's
7716
7826
  * per-instance schema when it declares one, else its global schema (what they always showed).
7717
7827
  */
@@ -8505,6 +8615,21 @@ function normalizeAddonInitResult(result) {
8505
8615
  if (Array.isArray(result)) return { providers: result };
8506
8616
  return result;
8507
8617
  }
8618
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8619
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
8620
+ var RECORD_DATABASES = ["settings", "events"];
8621
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8622
+ var RECORD_CLASSES = [
8623
+ "config",
8624
+ "ledger",
8625
+ "audit",
8626
+ "mirror",
8627
+ "ephemeral"
8628
+ ];
8629
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8630
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8631
+ var RECORD_BATCH_MAX = 1e3;
8632
+ var RECORD_QUERY_MAX = 1e3;
8508
8633
  /**
8509
8634
  * The share-view scope kinds a share-link token can carry. The hub mints
8510
8635
  * and validates them (`ShareViewGrantSchema` builds its
@@ -8529,21 +8654,6 @@ var PeerBytesTicketSchema = object({
8529
8654
  */
8530
8655
  declaredBytes: number().int().nonnegative().nullable()
8531
8656
  });
8532
- /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8533
- /** The files a kind may live in. `history` is device-history's (D850), never records. */
8534
- var RECORD_DATABASES = ["settings", "events"];
8535
- /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8536
- var RECORD_CLASSES = [
8537
- "config",
8538
- "ledger",
8539
- "audit",
8540
- "mirror",
8541
- "ephemeral"
8542
- ];
8543
- var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8544
- var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8545
- var RECORD_BATCH_MAX = 1e3;
8546
- var RECORD_QUERY_MAX = 1e3;
8547
8657
  /**
8548
8658
  * Record kinds (D881): the declaration an addon makes of one kind of fact, the
8549
8659
  * Zod row schema that describes it, and the helper that turns the two into the
@@ -9321,6 +9431,7 @@ var CAP_NAMES = Object.freeze([
9321
9431
  "backup",
9322
9432
  "battery",
9323
9433
  "binary",
9434
+ "board-key-source",
9324
9435
  "brightness",
9325
9436
  "broker",
9326
9437
  "button",
@@ -9363,6 +9474,7 @@ var CAP_NAMES = Object.freeze([
9363
9474
  "device-status",
9364
9475
  "dishwasher",
9365
9476
  "display-palette",
9477
+ "do-not-disturb",
9366
9478
  "doorbell",
9367
9479
  "embedding-encoder",
9368
9480
  "enum-sensor",
@@ -9383,6 +9495,7 @@ var CAP_NAMES = Object.freeze([
9383
9495
  "humidity-sensor",
9384
9496
  "image",
9385
9497
  "image-settings",
9498
+ "integration-instances",
9386
9499
  "integrations",
9387
9500
  "intercom",
9388
9501
  "ir-transmitter",
@@ -9440,6 +9553,7 @@ var CAP_NAMES = Object.freeze([
9440
9553
  "privacy-mask",
9441
9554
  "ptz",
9442
9555
  "ptz-autotrack",
9556
+ "pump-cycle",
9443
9557
  "reboot",
9444
9558
  "record-entries",
9445
9559
  "recording",
@@ -10122,6 +10236,10 @@ Object.freeze({
10122
10236
  "valueType": "string"
10123
10237
  }
10124
10238
  ],
10239
+ "do-not-disturb": [{
10240
+ "path": "enabled",
10241
+ "valueType": "boolean"
10242
+ }],
10125
10243
  "doorbell": [{
10126
10244
  "path": "lastPressedAt",
10127
10245
  "valueType": "number"
@@ -10728,18 +10846,6 @@ Object.freeze({
10728
10846
  "path": "pumpRunning",
10729
10847
  "valueType": "boolean"
10730
10848
  },
10731
- {
10732
- "path": "pumpIntervalEnabled",
10733
- "valueType": "boolean"
10734
- },
10735
- {
10736
- "path": "pumpOnTime",
10737
- "valueType": "number"
10738
- },
10739
- {
10740
- "path": "pumpOffTime",
10741
- "valueType": "number"
10742
- },
10743
10849
  {
10744
10850
  "path": "lastDrink",
10745
10851
  "valueType": "number"
@@ -10863,6 +10969,20 @@ Object.freeze({
10863
10969
  "valueType": "number"
10864
10970
  }
10865
10971
  ],
10972
+ "pump-cycle": [
10973
+ {
10974
+ "path": "enabled",
10975
+ "valueType": "boolean"
10976
+ },
10977
+ {
10978
+ "path": "onTime",
10979
+ "valueType": "number"
10980
+ },
10981
+ {
10982
+ "path": "offTime",
10983
+ "valueType": "number"
10984
+ }
10985
+ ],
10866
10986
  "recording-archive": [
10867
10987
  {
10868
10988
  "path": "deviceId",
@@ -11312,7 +11432,7 @@ object({
11312
11432
  params: record(string(), union([string(), number()])).optional()
11313
11433
  });
11314
11434
  //#endregion
11315
- //#region ../types/dist/composition-kKKOdFIG.mjs
11435
+ //#region ../types/dist/composition-BodkvOV0.mjs
11316
11436
  var AUDIO_ENCODER_BY_CODEC = {
11317
11437
  opus: "libopus",
11318
11438
  aac: "aac",
@@ -13044,7 +13164,14 @@ var CompositionForwardCommandSchema = object({
13044
13164
  method: string().min(1),
13045
13165
  args: record(string().min(1), CompositionForwardArgSchema).optional()
13046
13166
  });
13047
- var CompositionCommandTargetSchema = discriminatedUnion("kind", [CompositionForwardCommandSchema, CompositionCodeSourceSchema]);
13167
+ var CompositionCommandTargetSchema = discriminatedUnion("kind", [
13168
+ CompositionForwardCommandSchema,
13169
+ CompositionCodeSourceSchema,
13170
+ object({
13171
+ kind: literal("extension"),
13172
+ target: literal("remote")
13173
+ })
13174
+ ]);
13048
13175
  /** An item key inside an item-array cap (`consumables.items[<key>]`). */
13049
13176
  var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
13050
13177
  /**
@@ -13121,6 +13248,73 @@ var NodeColorIdSchema = _enum([
13121
13248
  "node-g",
13122
13249
  "node-h"
13123
13250
  ]);
13251
+ //#endregion
13252
+ //#region ../types/dist/index.mjs
13253
+ var SMTP_INBOUND_DEFAULT_PORT = 2525;
13254
+ var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
13255
+ var SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
13256
+ /** The text excerpt a message carries on the bus. */
13257
+ var SMTP_INBOUND_TEXT_MAX_CHARS = 4096;
13258
+ var PortSchema = number().int().min(1).max(65535);
13259
+ /** A recipient local-part: what stands before the `@`. */
13260
+ var SmtpRecipientSchema = string().min(1).max(64).regex(/^[A-Za-z0-9._+-]+$/);
13261
+ object({
13262
+ port: PortSchema.default(SMTP_INBOUND_DEFAULT_PORT),
13263
+ bindHost: string().min(1).default("0.0.0.0"),
13264
+ domain: string().min(1).default(SMTP_INBOUND_DEFAULT_DOMAIN),
13265
+ requireAuth: boolean().default(true),
13266
+ username: string().default(""),
13267
+ password: string().default("").meta({ secret: true }),
13268
+ starttls: boolean().default(false),
13269
+ maxMessageBytes: number().int().positive().default(SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES)
13270
+ });
13271
+ object({
13272
+ host: string().min(1).nullable(),
13273
+ hostReason: string().nullable(),
13274
+ port: PortSchema,
13275
+ domain: string().min(1),
13276
+ requireAuth: boolean(),
13277
+ username: string(),
13278
+ password: string(),
13279
+ starttls: boolean()
13280
+ });
13281
+ object({
13282
+ recipients: array(SmtpRecipientSchema).min(1),
13283
+ /**
13284
+ * Who is subscribing. A second `subscribe` with the same id REPLACES that subscriber's
13285
+ * recipients (the way a consumer that restarted, or lost a device, declares its set again);
13286
+ * a recipient held by another subscriber is refused with `smtp-inbound/recipient-claimed`.
13287
+ * Absent, the subscriber is anonymous and unique.
13288
+ */
13289
+ subscriberId: string().min(1).max(64).optional()
13290
+ });
13291
+ var SmtpInboundAttachmentSchema = object({
13292
+ filename: string(),
13293
+ contentType: string(),
13294
+ bytes: number().int().nonnegative()
13295
+ });
13296
+ /** The payload of one `broker.message` (the key is the recipient local-part). */
13297
+ var SmtpInboundMessageSchema = object({
13298
+ /** Monotonic per mailbox; a gap tells a consumer it missed an event. */
13299
+ seq: number().int().positive(),
13300
+ messageId: string(),
13301
+ receivedAt: number().int().nonnegative(),
13302
+ from: string(),
13303
+ to: string(),
13304
+ subject: string(),
13305
+ text: string().max(SMTP_INBOUND_TEXT_MAX_CHARS),
13306
+ attachments: array(SmtpInboundAttachmentSchema)
13307
+ });
13308
+ object({
13309
+ /** The newest seq issued so far (0 before any mail). */
13310
+ lastSeq: number().int().nonnegative(),
13311
+ /** The oldest seq still retained; messages below it are gone. */
13312
+ oldestSeq: number().int().nonnegative(),
13313
+ messages: array(object({
13314
+ key: string(),
13315
+ message: SmtpInboundMessageSchema
13316
+ }))
13317
+ });
13124
13318
  new Set([
13125
13319
  "track",
13126
13320
  "face",
@@ -14285,6 +14479,16 @@ var MigrationPlanSchema = object({ edits: array(discriminatedUnion("op", [
14285
14479
  precondition: PreconditionSchema
14286
14480
  })
14287
14481
  ])) });
14482
+ /** `JSON.stringify` with object keys sorted, so equal values spell the same. */
14483
+ function canonicalJson(value) {
14484
+ if (Array.isArray(value)) return `[${value.map((item) => canonicalJson(item)).join(",")}]`;
14485
+ if (typeof value === "object" && value !== null) return `{${Object.entries(value).filter(([, item]) => item !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, item]) => `${JSON.stringify(key)}:${canonicalJson(item)}`).join(",")}}`;
14486
+ return JSON.stringify(value) ?? "null";
14487
+ }
14488
+ /** The precondition string for a value a plan read (`null` when it read nothing). */
14489
+ function preconditionOf(value) {
14490
+ return canonicalJson(value ?? null);
14491
+ }
14288
14492
  /**
14289
14493
  * What a `procedure` body reports. `already-done` means the rerun observed the
14290
14494
  * work finished (a crash between the work and the ledger row, or a manual fix)
@@ -16299,8 +16503,18 @@ var LogChannelDescriptorSchema = object({
16299
16503
  * the operator narrows to one camera, sees nothing, and concludes the code
16300
16504
  * path was never taken.
16301
16505
  */
16302
- perDevice: boolean()
16303
- });
16506
+ perDevice: boolean(),
16507
+ /**
16508
+ * What the channel is FOR, so the UI can list the channels an addon offers.
16509
+ *
16510
+ * - `diagnostic` (the default): a per-component diagnostic armed from the
16511
+ * Levels page, emitted at its declared level.
16512
+ * - `debug`: a `debug.<channel>` dump watched live for a short window
16513
+ * (`ctx.debug`). Always per-device, and its lines are denied by the log
16514
+ * ring unless somebody is watching that device.
16515
+ */
16516
+ kind: _enum(["diagnostic", "debug"]).default("diagnostic")
16517
+ }).refine((d) => d.kind !== "debug" || d.name.startsWith("debug.") && d.perDevice, { message: "a debug channel is named debug.<channel> and is per-device" });
16304
16518
  /**
16305
16519
  * An armed window over one channel, as the document hands it to a mirror.
16306
16520
  *
@@ -19607,24 +19821,52 @@ var APPLIANCE_CAP_VOCABULARY = {
19607
19821
  args: { on: false }
19608
19822
  },
19609
19823
  {
19610
- id: "petFountain.intervalOn",
19611
- method: "setPumpInterval",
19824
+ id: "petFountain.resetDailyConsumption",
19825
+ method: "resetDailyConsumption",
19826
+ label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
19827
+ phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
19828
+ icon: "rotate-ccw"
19829
+ }
19830
+ ],
19831
+ state: [{
19832
+ kind: "boolean",
19833
+ field: "empty",
19834
+ label: t("Tank empty", "Serbatoio vuoto"),
19835
+ whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
19836
+ whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
19837
+ icon: "droplet"
19838
+ }, {
19839
+ kind: "numeric",
19840
+ field: "waterLevel",
19841
+ quantity: t("the water level", "il livello dell’acqua"),
19842
+ label: t("Water level", "Livello dell’acqua"),
19843
+ unit: "%",
19844
+ icon: "droplets"
19845
+ }]
19846
+ },
19847
+ "pump-cycle": {
19848
+ scope: "device",
19849
+ noun: t("Pump cycle", "Ciclo della pompa"),
19850
+ actions: [
19851
+ {
19852
+ id: "pumpCycle.on",
19853
+ method: "setEnabled",
19612
19854
  label: t("Pump cycle on", "Ciclo pompa attivo"),
19613
19855
  phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
19614
19856
  icon: "timer",
19615
19857
  args: { on: true }
19616
19858
  },
19617
19859
  {
19618
- id: "petFountain.intervalOff",
19619
- method: "setPumpInterval",
19860
+ id: "pumpCycle.off",
19861
+ method: "setEnabled",
19620
19862
  label: t("Pump cycle off", "Ciclo pompa spento"),
19621
19863
  phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
19622
19864
  icon: "timer-off",
19623
19865
  args: { on: false }
19624
19866
  },
19625
19867
  {
19626
- id: "petFountain.pumpOnMinutes",
19627
- method: "setPumpOnMinutes",
19868
+ id: "pumpCycle.onMinutes",
19869
+ method: "setOnMinutes",
19628
19870
  label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
19629
19871
  phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
19630
19872
  icon: "timer",
@@ -19640,8 +19882,8 @@ var APPLIANCE_CAP_VOCABULARY = {
19640
19882
  }]
19641
19883
  },
19642
19884
  {
19643
- id: "petFountain.pumpOffMinutes",
19644
- method: "setPumpOffMinutes",
19885
+ id: "pumpCycle.offMinutes",
19886
+ method: "setOffMinutes",
19645
19887
  label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
19646
19888
  phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
19647
19889
  icon: "timer-off",
@@ -19655,35 +19897,63 @@ var APPLIANCE_CAP_VOCABULARY = {
19655
19897
  unit: "min"
19656
19898
  }
19657
19899
  }]
19658
- },
19659
- {
19660
- id: "petFountain.resetDailyConsumption",
19661
- method: "resetDailyConsumption",
19662
- label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
19663
- phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
19664
- icon: "rotate-ccw"
19665
19900
  }
19666
19901
  ],
19667
19902
  state: [{
19668
19903
  kind: "boolean",
19669
- field: "empty",
19670
- label: t("Tank empty", "Serbatoio vuoto"),
19671
- whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
19672
- whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
19673
- icon: "droplet"
19674
- }, {
19675
- kind: "numeric",
19676
- field: "waterLevel",
19677
- quantity: t("the water level", "il livello dell’acqua"),
19678
- label: t("Water level", "Livello dell’acqua"),
19679
- unit: "%",
19680
- icon: "droplets"
19904
+ field: "enabled",
19905
+ label: t("Pump cycle", "Ciclo pompa"),
19906
+ whenTrue: t("When {device} starts running its pump on a cycle", "Quando {device} inizia a far lavorare la pompa a ciclo"),
19907
+ whenFalse: t("When {device} runs its pump continuously", "Quando {device} fa lavorare la pompa in continuo"),
19908
+ icon: "timer"
19681
19909
  }]
19682
19910
  },
19683
19911
  "media-player": {
19684
19912
  scope: "device",
19685
19913
  noun: t("Media player", "Lettore multimediale"),
19686
19914
  actions: [
19915
+ {
19916
+ id: "media.turnOn",
19917
+ method: "turnOn",
19918
+ label: t("Turn on", "Accendi"),
19919
+ phrase: t("Turn on {device}", "Accendi {device}"),
19920
+ icon: "power"
19921
+ },
19922
+ {
19923
+ id: "media.turnOff",
19924
+ method: "turnOff",
19925
+ label: t("Turn off", "Spegni"),
19926
+ phrase: t("Turn off {device}", "Spegni {device}"),
19927
+ icon: "power"
19928
+ },
19929
+ {
19930
+ id: "media.volumeUp",
19931
+ method: "volumeUp",
19932
+ label: t("Volume up", "Alza il volume"),
19933
+ phrase: t("Raise the volume of {device}", "Alza il volume di {device}"),
19934
+ icon: "volume-2"
19935
+ },
19936
+ {
19937
+ id: "media.volumeDown",
19938
+ method: "volumeDown",
19939
+ label: t("Volume down", "Abbassa il volume"),
19940
+ phrase: t("Lower the volume of {device}", "Abbassa il volume di {device}"),
19941
+ icon: "volume-2"
19942
+ },
19943
+ {
19944
+ id: "media.channelUp",
19945
+ method: "channelUp",
19946
+ label: t("Channel up", "Canale successivo"),
19947
+ phrase: t("Go to the next channel on {device}", "Passa al canale successivo su {device}"),
19948
+ icon: "skip-forward"
19949
+ },
19950
+ {
19951
+ id: "media.channelDown",
19952
+ method: "channelDown",
19953
+ label: t("Channel down", "Canale precedente"),
19954
+ phrase: t("Go to the previous channel on {device}", "Torna al canale precedente su {device}"),
19955
+ icon: "skip-back"
19956
+ },
19687
19957
  {
19688
19958
  id: "media.play",
19689
19959
  method: "play",
@@ -20363,6 +20633,33 @@ var APPLIANCE_CAP_VOCABULARY = {
20363
20633
  }
20364
20634
  ]
20365
20635
  },
20636
+ "do-not-disturb": {
20637
+ scope: "device",
20638
+ noun: t("Do not disturb", "Non disturbare"),
20639
+ actions: [{
20640
+ id: "dnd.on",
20641
+ method: "setEnabled",
20642
+ label: t("Do not disturb on", "Attiva Non disturbare"),
20643
+ phrase: t("Turn on Do not disturb on {device}", "Attiva Non disturbare su {device}"),
20644
+ icon: "bell-off",
20645
+ args: { enabled: true }
20646
+ }, {
20647
+ id: "dnd.off",
20648
+ method: "setEnabled",
20649
+ label: t("Do not disturb off", "Disattiva Non disturbare"),
20650
+ phrase: t("Turn off Do not disturb on {device}", "Disattiva Non disturbare su {device}"),
20651
+ icon: "bell",
20652
+ args: { enabled: false }
20653
+ }],
20654
+ state: [{
20655
+ kind: "boolean",
20656
+ field: "enabled",
20657
+ label: t("Do not disturb", "Non disturbare"),
20658
+ whenTrue: t("When Do not disturb turns on on {device}", "Quando {device} attiva Non disturbare"),
20659
+ whenFalse: t("When Do not disturb turns off on {device}", "Quando {device} disattiva Non disturbare"),
20660
+ icon: "bell-off"
20661
+ }]
20662
+ },
20366
20663
  update: {
20367
20664
  scope: "device",
20368
20665
  noun: t("Firmware update", "Aggiornamento firmware"),
@@ -21543,6 +21840,7 @@ var SYSTEM_CAP_VOCABULARY = {
21543
21840
  "audio-analyzer": system(PIPELINE),
21544
21841
  "audio-codec": system(INTERNAL),
21545
21842
  "auth-provider": system(IDENTITY),
21843
+ "board-key-source": system(INTERNAL),
21546
21844
  backup: system("system backups — run and restored from the Backups page"),
21547
21845
  broker: system("message-broker connections — configured, not actuated"),
21548
21846
  "calendar-source": system(INTERNAL),
@@ -21577,6 +21875,7 @@ var SYSTEM_CAP_VOCABULARY = {
21577
21875
  "load-contribution": system(INTERNAL),
21578
21876
  "local-network": system(NETWORK),
21579
21877
  "log-channels": system(INTERNAL),
21878
+ "integration-instances": system(INTERNAL),
21580
21879
  "log-destination": system(INTERNAL),
21581
21880
  "login-method": system(IDENTITY),
21582
21881
  "mesh-network": system(NETWORK),
@@ -42419,14 +42718,16 @@ var DeviceIsLeafSchema = object({
42419
42718
  });
42420
42719
  /**
42421
42720
  * True when the camera currently has a PARKED object matching `subjects` in at
42422
- * least one of `zones`. Reads the zone-analytics snapshot through the same
42721
+ * least one of `zones` (`minCount` of them, default one). Reads the zone-analytics snapshot through the same
42423
42722
  * mirror as every other state leaf, so a dropped event never decides it (D49).
42424
42723
  */
42425
42724
  var StationaryPresentLeafSchema = object({
42426
42725
  kind: literal("stationary-present"),
42427
42726
  deviceId: number().int().nonnegative(),
42428
42727
  subjects: array(StationarySubjectSchema).min(1).optional(),
42429
- zones: array(string().min(1)).min(1).optional()
42728
+ zones: array(string().min(1)).min(1).optional(),
42729
+ /** How many matching parked objects must be there; absent means one. */
42730
+ minCount: number().int().positive().optional()
42430
42731
  });
42431
42732
  /**
42432
42733
  * The escape hatch: the bounded expression engine over named device bindings.
@@ -42938,6 +43239,28 @@ function convertLegacyRecipe(legacy) {
42938
43239
  * it. The output type is always the new one.
42939
43240
  */
42940
43241
  var AutomationRecipeSchema = union([CurrentAutomationRecipeSchema, LegacyAutomationRecipeSchema.transform(convertLegacyRecipe)]);
43242
+ var DETECTION_DESCRIPTIONS = {
43243
+ deviceId: "the camera that saw it",
43244
+ className: "what it saw",
43245
+ trackId: "the track",
43246
+ score: "how sure the detector was",
43247
+ label: "the label it matched (a name, a plate), empty when none"
43248
+ };
43249
+ var STATIONARY_DESCRIPTIONS = {
43250
+ deviceId: "the camera that saw it",
43251
+ className: "what it saw",
43252
+ zones: "the zones it is in",
43253
+ phase: "appeared or departed",
43254
+ entryId: "the stopped object"
43255
+ };
43256
+ function describe$1(descriptions) {
43257
+ return Object.entries(descriptions).map(([name, description]) => ({
43258
+ name,
43259
+ description
43260
+ }));
43261
+ }
43262
+ describe$1(DETECTION_DESCRIPTIONS);
43263
+ describe$1(STATIONARY_DESCRIPTIONS);
42941
43264
  new Set(Object.values(COCO_TO_MACRO.mapping));
42942
43265
  /**
42943
43266
  * Schedulers (D983) — an entity that performs actions over the day.
@@ -43699,7 +44022,7 @@ var TargetKindCapsSchema = object({
43699
44022
  * the union is large and not meant for runtime validation here; the exported
43700
44023
  * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
43701
44024
  */
43702
- var ConfigSchemaPassthrough$3 = unknown();
44025
+ var ConfigSchemaPassthrough$4 = unknown();
43703
44026
  var TargetKindSchema = object({
43704
44027
  kind: string(),
43705
44028
  label: string(),
@@ -43736,7 +44059,7 @@ var TargetKindSchema = object({
43736
44059
  * its raster path, which is the safe default for an unknown image.
43737
44060
  */
43738
44061
  iconMediaType: string().optional(),
43739
- configSchema: ConfigSchemaPassthrough$3,
44062
+ configSchema: ConfigSchemaPassthrough$4,
43740
44063
  /**
43741
44064
  * The config keys that decide WHERE this kind's secrets are sent (server,
43742
44065
  * base URL, instance, chat, recipient). A save that changes any of them
@@ -46048,6 +46371,49 @@ object({
46048
46371
  lastChangedAt: number()
46049
46372
  });
46050
46373
  DeviceType.Sensor;
46374
+ /**
46375
+ * Why a board key could not be read. Typed so a caller reports the cause and
46376
+ * never treats "could not read" as "has no key" (D49).
46377
+ */
46378
+ var BoardKeyFailureReasonSchema = _enum([
46379
+ "unknown-source",
46380
+ "not-admin",
46381
+ "no-builder",
46382
+ "no-ingress-url",
46383
+ "unreachable",
46384
+ "unknown-board",
46385
+ "no-encryption-key",
46386
+ "unreadable-config"
46387
+ ]);
46388
+ var BoardKeySourceSchema = object({
46389
+ sourceId: string(),
46390
+ name: string()
46391
+ });
46392
+ var BoardKeyBoardSchema = object({
46393
+ /** The builder's file name, e.g. `kitchen.yaml`: the handle `getBoardKey` takes. */
46394
+ configuration: string(),
46395
+ /** The node name the builder gives the board. */
46396
+ name: string(),
46397
+ /** The address the builder knows the board by, when it has one. */
46398
+ address: string().nullable()
46399
+ });
46400
+ var BoardKeyFailureSchema = object({
46401
+ ok: literal(false),
46402
+ reason: BoardKeyFailureReasonSchema,
46403
+ detail: string().optional()
46404
+ });
46405
+ var ListBoardsResultSchema = discriminatedUnion("ok", [object({
46406
+ ok: literal(true),
46407
+ boards: array(BoardKeyBoardSchema).readonly()
46408
+ }), BoardKeyFailureSchema]);
46409
+ var GetBoardKeyResultSchema = discriminatedUnion("ok", [object({
46410
+ ok: literal(true),
46411
+ key: string()
46412
+ }), BoardKeyFailureSchema]);
46413
+ method(_void(), array(BoardKeySourceSchema).readonly(), { auth: "admin" }), method(object({ sourceId: string().min(1) }), ListBoardsResultSchema, { auth: "admin" }), method(object({
46414
+ sourceId: string().min(1),
46415
+ configuration: string().min(1)
46416
+ }), GetBoardKeyResultSchema, { auth: "admin" });
46051
46417
  object({
46052
46418
  /** Current level as 0..100 inclusive. Firmware-reported. */
46053
46419
  level: number().min(0).max(100).meta(readingMeta("percentage")),
@@ -48141,6 +48507,188 @@ DeviceType.Control, method(object({
48141
48507
  kind: "mutation",
48142
48508
  auth: "protected"
48143
48509
  });
48510
+ /**
48511
+ * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
48512
+ * Apple TV, Spotify, Roku, generic OTT receivers, …) on
48513
+ * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
48514
+ * surface — those use `DeviceType.Camera` + the broker pipeline.
48515
+ *
48516
+ * The cap declares a wide method surface; not every backend supports
48517
+ * every method. Drivers signal sub-capability via the
48518
+ * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
48519
+ * corresponding method) so the UI gates buttons without a slice
48520
+ * fetch — same pattern as `PanTiltZoom` for cameras.
48521
+ */
48522
+ var MediaPlayerStateSchema = _enum([
48523
+ "off",
48524
+ "on",
48525
+ "idle",
48526
+ "playing",
48527
+ "paused",
48528
+ "buffering",
48529
+ "standby"
48530
+ ]);
48531
+ var MediaPlayerRepeatSchema = _enum([
48532
+ "off",
48533
+ "all",
48534
+ "one"
48535
+ ]);
48536
+ var MediaInfoSchema = object({
48537
+ /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
48538
+ * `podcast`, …). */
48539
+ type: string(),
48540
+ /** Human-readable title. */
48541
+ title: string(),
48542
+ /** Optional artist / channel / station label. */
48543
+ artist: string().optional(),
48544
+ /** Optional album / season / show name. */
48545
+ album: string().optional(),
48546
+ /** Optional cover-art / thumbnail URL. */
48547
+ imageUrl: string().optional()
48548
+ });
48549
+ /**
48550
+ * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
48551
+ * the device said so. `assumed`: the driver has no feedback (infrared) and
48552
+ * tracks what it last SENT; it moves only after a send was accepted, and a
48553
+ * human at the real remote makes it wrong. A UI shows an assumed value as a
48554
+ * guess, never as a reading.
48555
+ */
48556
+ var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
48557
+ /** The fields of a media-player status a driver can only guess. */
48558
+ var MediaPlayerAssumedFieldSchema = _enum([
48559
+ "state",
48560
+ "volumeLevel",
48561
+ "isMuted",
48562
+ "source"
48563
+ ]);
48564
+ var MediaPlayerStatusSchema = object({
48565
+ /** Playback lifecycle state. */
48566
+ state: MediaPlayerStateSchema,
48567
+ /**
48568
+ * Whether the state fields are readings or the driver's own bookkeeping.
48569
+ * A slice written before this field existed parses as `reported`.
48570
+ */
48571
+ stateSource: MediaPlayerStateSourceSchema.default("reported"),
48572
+ /**
48573
+ * Which fields are the driver's own guess. `stateSource` is `assumed` when
48574
+ * this is not empty; a field not listed here is a reading even then (power
48575
+ * from a running-state source, mute guessed from the last send).
48576
+ */
48577
+ assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
48578
+ /** Volume as 0..100 inclusive. Null when the device has no volume
48579
+ * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
48580
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
48581
+ /** Mute toggle distinct from volume=0. Null when no mute surface.
48582
+ * Pair with `DeviceFeature.MediaPlayerMute`. */
48583
+ isMuted: boolean().nullable(),
48584
+ /** Active source / input. Empty when no source surface. */
48585
+ source: string(),
48586
+ /** Selectable sources. Empty when no source surface.
48587
+ * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
48588
+ availableSources: array(string()),
48589
+ /** Currently-playing media info. Null when nothing is playing. */
48590
+ currentMedia: MediaInfoSchema.nullable(),
48591
+ /** Current playback position in ms. Null when not seekable or
48592
+ * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
48593
+ position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
48594
+ /** Total duration of the current media in ms. Null when unknown
48595
+ * (live stream) or nothing is playing. */
48596
+ duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
48597
+ /** Shuffle toggle. Null when no shuffle surface.
48598
+ * Pair with `DeviceFeature.MediaPlayerShuffle`. */
48599
+ shuffle: boolean().nullable(),
48600
+ /** Repeat mode. Null when no repeat surface.
48601
+ * Pair with `DeviceFeature.MediaPlayerRepeat`. */
48602
+ repeat: MediaPlayerRepeatSchema.nullable(),
48603
+ /** Ms epoch when the slice was last updated. */
48604
+ lastChangedAt: number()
48605
+ });
48606
+ var stepInput = object({
48607
+ deviceId: number().int().nonnegative(),
48608
+ /** How many presses: the caller's count (Alexa `volumeSteps`, `channelCount`). */
48609
+ steps: number().int().min(1).max(50).default(1)
48610
+ });
48611
+ var deviceOnly = object({ deviceId: number().int().nonnegative() });
48612
+ DeviceType.MediaPlayer, method(deviceOnly, _void(), {
48613
+ kind: "mutation",
48614
+ auth: "protected"
48615
+ }), method(deviceOnly, _void(), {
48616
+ kind: "mutation",
48617
+ auth: "protected"
48618
+ }), method(stepInput, _void(), {
48619
+ kind: "mutation",
48620
+ auth: "protected"
48621
+ }), method(stepInput, _void(), {
48622
+ kind: "mutation",
48623
+ auth: "protected"
48624
+ }), method(stepInput, _void(), {
48625
+ kind: "mutation",
48626
+ auth: "protected"
48627
+ }), method(stepInput, _void(), {
48628
+ kind: "mutation",
48629
+ auth: "protected"
48630
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48631
+ kind: "mutation",
48632
+ auth: "protected"
48633
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48634
+ kind: "mutation",
48635
+ auth: "protected"
48636
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48637
+ kind: "mutation",
48638
+ auth: "protected"
48639
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48640
+ kind: "mutation",
48641
+ auth: "protected"
48642
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48643
+ kind: "mutation",
48644
+ auth: "protected"
48645
+ }), method(object({
48646
+ deviceId: number().int().nonnegative(),
48647
+ position: number().int().nonnegative()
48648
+ }), _void(), {
48649
+ kind: "mutation",
48650
+ auth: "protected"
48651
+ }), method(object({
48652
+ deviceId: number().int().nonnegative(),
48653
+ volumeLevel: number().min(0).max(100)
48654
+ }), _void(), {
48655
+ kind: "mutation",
48656
+ auth: "protected"
48657
+ }), method(object({
48658
+ deviceId: number().int().nonnegative(),
48659
+ muted: boolean()
48660
+ }), _void(), {
48661
+ kind: "mutation",
48662
+ auth: "protected"
48663
+ }), method(object({
48664
+ deviceId: number().int().nonnegative(),
48665
+ shuffle: boolean()
48666
+ }), _void(), {
48667
+ kind: "mutation",
48668
+ auth: "protected"
48669
+ }), method(object({
48670
+ deviceId: number().int().nonnegative(),
48671
+ repeat: MediaPlayerRepeatSchema
48672
+ }), _void(), {
48673
+ kind: "mutation",
48674
+ auth: "protected"
48675
+ }), method(object({
48676
+ deviceId: number().int().nonnegative(),
48677
+ source: string().min(1)
48678
+ }), _void(), {
48679
+ kind: "mutation",
48680
+ auth: "protected"
48681
+ }), method(object({
48682
+ deviceId: number().int().nonnegative(),
48683
+ /** Media identifier / URL. */
48684
+ mediaId: string().min(1),
48685
+ /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
48686
+ * passes it through to the upstream service. */
48687
+ mediaType: string().min(1)
48688
+ }), _void(), {
48689
+ kind: "mutation",
48690
+ auth: "protected"
48691
+ });
48144
48692
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater;
48145
48693
  var NUMBER = {
48146
48694
  kind: "fixed",
@@ -50204,6 +50752,45 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
50204
50752
  auth: "admin"
50205
50753
  });
50206
50754
  /**
50755
+ * What the passive listener of `local-network` saw on the wire, before any
50756
+ * provider classified it. Device-manager turns an observation into the hits
50757
+ * of the providers whose declared discovery modes it matches.
50758
+ */
50759
+ var DiscoveryObservationSchema = discriminatedUnion("kind", [object({
50760
+ kind: literal("mdns"),
50761
+ /** Normalised DNS-SD service type, e.g. `_esphomelib._tcp`. */
50762
+ serviceType: string(),
50763
+ instance: string(),
50764
+ host: string(),
50765
+ /** The A record address when the announcement carried one. */
50766
+ address: string().nullable(),
50767
+ port: number().int(),
50768
+ txt: record(string(), string())
50769
+ }), object({
50770
+ kind: literal("ssdp"),
50771
+ /** Sender address of the datagram. */
50772
+ host: string(),
50773
+ port: number().int(),
50774
+ /** `NT` of a NOTIFY, `ST` of a search response. */
50775
+ target: string(),
50776
+ headers: record(string(), string())
50777
+ })]);
50778
+ object({
50779
+ addonId: string(),
50780
+ candidate: DiscoveryCandidateSchema,
50781
+ firstSeenAt: number(),
50782
+ lastSeenAt: number(),
50783
+ dismissed: boolean()
50784
+ });
50785
+ var DiscoveryProposalSchema = object({
50786
+ id: string(),
50787
+ addonId: string(),
50788
+ candidate: DiscoveryCandidateSchema,
50789
+ firstSeenAt: number(),
50790
+ lastSeenAt: number(),
50791
+ dismissed: boolean()
50792
+ });
50793
+ /**
50207
50794
  * Device Manager capability — hub-side singleton that unifies device persistence,
50208
50795
  * live registry access, and all management operations into a single tRPC surface.
50209
50796
  *
@@ -50932,6 +51519,19 @@ method(object({
50932
51519
  }), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
50933
51520
  kind: "mutation",
50934
51521
  auth: "admin"
51522
+ }), method(object({}), object({ proposals: array(DiscoveryProposalSchema).readonly() }), { auth: "admin" }), method(object({ id: string() }), object({ dismissed: boolean() }), {
51523
+ kind: "mutation",
51524
+ auth: "admin"
51525
+ }), method(object({ observations: array(DiscoveryObservationSchema).max(512) }), object({ proposed: number().int() }), {
51526
+ kind: "mutation",
51527
+ auth: "admin"
51528
+ }), method(object({}), object({
51529
+ providers: number().int(),
51530
+ proposed: number().int()
51531
+ }), {
51532
+ kind: "mutation",
51533
+ auth: "admin",
51534
+ timeoutMs: 12e4
50935
51535
  }), method(object({ addonId: string() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string() }), unknown(), { auth: "admin" }), method(object({
50936
51536
  deviceId: number(),
50937
51537
  key: string(),
@@ -51759,7 +52359,7 @@ object({
51759
52359
  /** Ms epoch of the last value received from the appliance; 0 = never. */
51760
52360
  lastFetchedAt: number()
51761
52361
  });
51762
- var DeviceIdSchema$1 = number().int().nonnegative();
52362
+ var DeviceIdSchema$2 = number().int().nonnegative();
51763
52363
  /** A value a program option or setting can take. */
51764
52364
  var DishwasherValueSchema = union([
51765
52365
  boolean(),
@@ -51823,77 +52423,77 @@ var DishwasherOptionsSchema = object({
51823
52423
  options: array(DishwasherOptionDescriptorSchema)
51824
52424
  });
51825
52425
  DeviceType.Dishwasher, method(object({
51826
- deviceId: DeviceIdSchema$1,
52426
+ deviceId: DeviceIdSchema$2,
51827
52427
  program: string().min(1).optional(),
51828
52428
  options: record(string(), DishwasherValueSchema).optional()
51829
52429
  }), _void(), {
51830
52430
  kind: "mutation",
51831
52431
  auth: "protected"
51832
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52432
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51833
52433
  kind: "mutation",
51834
52434
  auth: "protected"
51835
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52435
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51836
52436
  kind: "mutation",
51837
52437
  auth: "protected"
51838
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52438
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51839
52439
  kind: "mutation",
51840
52440
  auth: "protected"
51841
52441
  }), method(object({
51842
- deviceId: DeviceIdSchema$1,
52442
+ deviceId: DeviceIdSchema$2,
51843
52443
  program: string().min(1)
51844
52444
  }), _void(), {
51845
52445
  kind: "mutation",
51846
52446
  auth: "protected"
51847
52447
  }), method(object({
51848
- deviceId: DeviceIdSchema$1,
52448
+ deviceId: DeviceIdSchema$2,
51849
52449
  on: boolean()
51850
52450
  }), _void(), {
51851
52451
  kind: "mutation",
51852
52452
  auth: "protected"
51853
52453
  }), method(object({
51854
- deviceId: DeviceIdSchema$1,
52454
+ deviceId: DeviceIdSchema$2,
51855
52455
  on: boolean()
51856
52456
  }), _void(), {
51857
52457
  kind: "mutation",
51858
52458
  auth: "protected"
51859
52459
  }), method(object({
51860
- deviceId: DeviceIdSchema$1,
52460
+ deviceId: DeviceIdSchema$2,
51861
52461
  on: boolean()
51862
52462
  }), _void(), {
51863
52463
  kind: "mutation",
51864
52464
  auth: "protected"
51865
52465
  }), method(object({
51866
- deviceId: DeviceIdSchema$1,
52466
+ deviceId: DeviceIdSchema$2,
51867
52467
  on: boolean()
51868
52468
  }), _void(), {
51869
52469
  kind: "mutation",
51870
52470
  auth: "protected"
51871
52471
  }), method(object({
51872
- deviceId: DeviceIdSchema$1,
52472
+ deviceId: DeviceIdSchema$2,
51873
52473
  on: boolean()
51874
52474
  }), _void(), {
51875
52475
  kind: "mutation",
51876
52476
  auth: "protected"
51877
52477
  }), method(object({
51878
- deviceId: DeviceIdSchema$1,
52478
+ deviceId: DeviceIdSchema$2,
51879
52479
  on: boolean()
51880
52480
  }), _void(), {
51881
52481
  kind: "mutation",
51882
52482
  auth: "protected"
51883
52483
  }), method(object({
51884
- deviceId: DeviceIdSchema$1,
52484
+ deviceId: DeviceIdSchema$2,
51885
52485
  on: boolean()
51886
52486
  }), _void(), {
51887
52487
  kind: "mutation",
51888
52488
  auth: "protected"
51889
52489
  }), method(object({
51890
- deviceId: DeviceIdSchema$1,
52490
+ deviceId: DeviceIdSchema$2,
51891
52491
  key: string().min(1),
51892
52492
  value: DishwasherValueSchema
51893
52493
  }), _void(), {
51894
52494
  kind: "mutation",
51895
52495
  auth: "protected"
51896
- }), method(object({ deviceId: DeviceIdSchema$1 }), DishwasherOptionsSchema, { auth: "protected" });
52496
+ }), method(object({ deviceId: DeviceIdSchema$2 }), DishwasherOptionsSchema, { auth: "protected" });
51897
52497
  /**
51898
52498
  * Palette entry ids (D939). Audio is the one gradient; `audio-*` leaves are
51899
52499
  * not entries. `heatmapScrub` is a mark, not an event kind.
@@ -52297,6 +52897,19 @@ method(_void(), paletteResultSchema, {
52297
52897
  kind: "mutation",
52298
52898
  auth: "admin"
52299
52899
  });
52900
+ object({
52901
+ /** True while Do Not Disturb is on; null when unknown. */
52902
+ enabled: boolean().nullable().meta({ label: "Do not disturb" }),
52903
+ /** Ms epoch of the last read or write that set `enabled`. */
52904
+ lastChangedAt: number()
52905
+ });
52906
+ DeviceType.MediaPlayer, method(object({
52907
+ deviceId: number().int(),
52908
+ enabled: boolean()
52909
+ }), _void(), {
52910
+ kind: "mutation",
52911
+ auth: "protected"
52912
+ });
52300
52913
  DeviceType.Camera;
52301
52914
  object({
52302
52915
  /** Ms epoch of the last press. null = never observed since this provider started. */
@@ -53595,6 +54208,89 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
53595
54208
  auth: "admin"
53596
54209
  });
53597
54210
  /**
54211
+ * `integration-instances` - the connection of an addon that holds ONE or SEVERAL
54212
+ * (an account, a relay, a destination) as typed records (D985, D986). The addon's
54213
+ * own function page reads and writes them (Logging for Loki); the Integrations
54214
+ * page lists only the integrations that bring devices (D996).
54215
+ *
54216
+ * A collection of providers: each addon that holds connections registers one and a
54217
+ * caller reaches a provider with the pinned `addonId`.
54218
+ *
54219
+ * Identity: the instance id is immutable and opaque to the caller. A record the
54220
+ * Loki migration made keeps the `integrations` registry id it was created under
54221
+ * (`int_NNNN`); a single instance made by its function page takes the addon id.
54222
+ * `name` is the editable label.
54223
+ *
54224
+ * Secrets: every field the instance kind marks `.meta({ secret: true })` reaches
54225
+ * the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
54226
+ * or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
54227
+ * clears it.
54228
+ */
54229
+ var ConfigSchemaPassthrough$3 = custom();
54230
+ var IntegrationInstanceIdSchema = string().min(1);
54231
+ var IntegrationInstanceDescriptionSchema = object({
54232
+ /** `single`: at most one instance can exist (Loki). `multiple`: an account each. */
54233
+ instanceMode: _enum(["single", "multiple"]),
54234
+ /** What the instance is, for the UI (`destination`, `relay`, `account`). */
54235
+ kind: string(),
54236
+ /** True when `testInstance` really probes the remote. */
54237
+ canTest: boolean()
54238
+ });
54239
+ var IntegrationInstanceStatusSchema = object({
54240
+ state: _enum([
54241
+ "ok",
54242
+ "off",
54243
+ "error",
54244
+ "unknown"
54245
+ ]),
54246
+ detail: string().optional()
54247
+ });
54248
+ var IntegrationInstanceSchema = object({
54249
+ id: IntegrationInstanceIdSchema,
54250
+ name: string(),
54251
+ /** The addon's own rule (an URL is present, a client id is present...). */
54252
+ configured: boolean(),
54253
+ /**
54254
+ * The instance's own on/off switch (D996): always present, derived from the record body
54255
+ * (`enabled !== false`, so a row written before the field existed is on).
54256
+ */
54257
+ enabled: boolean(),
54258
+ /** Values for the instance form; a secret is a `SecretFieldView`, never text. */
54259
+ formValues: record(string(), unknown()),
54260
+ status: IntegrationInstanceStatusSchema.optional()
54261
+ });
54262
+ var IntegrationInstancePatchSchema = object({
54263
+ id: IntegrationInstanceIdSchema,
54264
+ name: string().min(1).optional(),
54265
+ /** Omitted / '' / redaction token keeps a secret; `{ $secretClear: true }` clears it. */
54266
+ values: record(string(), unknown())
54267
+ });
54268
+ method(_void(), IntegrationInstanceDescriptionSchema, { auth: "admin" }), method(object({ id: IntegrationInstanceIdSchema.nullable() }), ConfigSchemaPassthrough$3, { auth: "admin" }), method(_void(), array(IntegrationInstanceSchema).readonly(), { auth: "admin" }), method(object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }), method(object({
54269
+ id: IntegrationInstanceIdSchema,
54270
+ name: string().min(1)
54271
+ }), object({ id: string() }), {
54272
+ kind: "mutation",
54273
+ auth: "admin"
54274
+ }), method(IntegrationInstancePatchSchema, object({ ok: literal(true) }), {
54275
+ kind: "mutation",
54276
+ auth: "admin"
54277
+ }), method(object({
54278
+ id: IntegrationInstanceIdSchema,
54279
+ enabled: boolean()
54280
+ }), object({ ok: literal(true) }), {
54281
+ kind: "mutation",
54282
+ auth: "admin"
54283
+ }), method(object({ id: IntegrationInstanceIdSchema }), object({ ok: literal(true) }), {
54284
+ kind: "mutation",
54285
+ auth: "admin"
54286
+ }), optionalMethod(object({
54287
+ id: IntegrationInstanceIdSchema.nullable(),
54288
+ values: record(string(), unknown())
54289
+ }), TestConnectionResultSchema$1, {
54290
+ kind: "mutation",
54291
+ auth: "admin"
54292
+ });
54293
+ /**
53598
54294
  * Two-way audio / talk-back cap. Clients open a WebRTC audio-only
53599
54295
  * session (server-initiated offer pattern, identical to the main
53600
54296
  * video WebRTC flow) and the browser captures the mic; the server
@@ -54183,6 +54879,14 @@ var LlmGenerateBaseInputSchema = object({
54183
54879
  topP: number().min(0).max(1).optional(),
54184
54880
  /** Per-call override of the profile default (top-k sampling). */
54185
54881
  topK: number().int().positive().optional(),
54882
+ /** Per-call override of `profile.reasoningEffort`. Sent only to a kind whose
54883
+ * descriptor offers the field; a kind that does not never sends it. */
54884
+ reasoningEffort: _enum([
54885
+ "off",
54886
+ "low",
54887
+ "medium",
54888
+ "high"
54889
+ ]).optional(),
54186
54890
  /** Per-call override of `profile.timeoutMs` — the total generation bound. */
54187
54891
  timeoutMs: number().int().positive().optional(),
54188
54892
  /** Per-call override; beats both the consumer table and the profile. */
@@ -54474,7 +55178,10 @@ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind i
54474
55178
  var LlmModelFeaturesSchema = object({
54475
55179
  vision: boolean(),
54476
55180
  tools: boolean(),
54477
- streaming: boolean()
55181
+ streaming: boolean(),
55182
+ /** Whether the model thinks before it answers. `null` = the endpoint does not
55183
+ * say; an editor then still offers the switch (unknown is not "no"). */
55184
+ reasoning: boolean().nullable().optional()
54478
55185
  });
54479
55186
  /** One model a provider offers. `features` overrides the kind's defaults, per field. */
54480
55187
  var LlmModelInfoSchema = object({
@@ -55565,164 +56272,6 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
55565
56272
  ]);
55566
56273
  method(_void(), array(LoginMethodContributionSchema).readonly());
55567
56274
  /**
55568
- * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
55569
- * Apple TV, Spotify, Roku, generic OTT receivers, …) on
55570
- * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
55571
- * surface — those use `DeviceType.Camera` + the broker pipeline.
55572
- *
55573
- * The cap declares a wide method surface; not every backend supports
55574
- * every method. Drivers signal sub-capability via the
55575
- * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
55576
- * corresponding method) so the UI gates buttons without a slice
55577
- * fetch — same pattern as `PanTiltZoom` for cameras.
55578
- */
55579
- var MediaPlayerStateSchema = _enum([
55580
- "off",
55581
- "on",
55582
- "idle",
55583
- "playing",
55584
- "paused",
55585
- "buffering",
55586
- "standby"
55587
- ]);
55588
- var MediaPlayerRepeatSchema = _enum([
55589
- "off",
55590
- "all",
55591
- "one"
55592
- ]);
55593
- var MediaInfoSchema = object({
55594
- /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
55595
- * `podcast`, …). */
55596
- type: string(),
55597
- /** Human-readable title. */
55598
- title: string(),
55599
- /** Optional artist / channel / station label. */
55600
- artist: string().optional(),
55601
- /** Optional album / season / show name. */
55602
- album: string().optional(),
55603
- /** Optional cover-art / thumbnail URL. */
55604
- imageUrl: string().optional()
55605
- });
55606
- /**
55607
- * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
55608
- * the device said so. `assumed`: the driver has no feedback (infrared) and
55609
- * tracks what it last SENT; it moves only after a send was accepted, and a
55610
- * human at the real remote makes it wrong. A UI shows an assumed value as a
55611
- * guess, never as a reading.
55612
- */
55613
- var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
55614
- /** The fields of a media-player status a driver can only guess. */
55615
- var MediaPlayerAssumedFieldSchema = _enum([
55616
- "state",
55617
- "volumeLevel",
55618
- "isMuted",
55619
- "source"
55620
- ]);
55621
- object({
55622
- /** Playback lifecycle state. */
55623
- state: MediaPlayerStateSchema,
55624
- /**
55625
- * Whether the state fields are readings or the driver's own bookkeeping.
55626
- * A slice written before this field existed parses as `reported`.
55627
- */
55628
- stateSource: MediaPlayerStateSourceSchema.default("reported"),
55629
- /**
55630
- * Which fields are the driver's own guess. `stateSource` is `assumed` when
55631
- * this is not empty; a field not listed here is a reading even then (power
55632
- * from a running-state source, mute guessed from the last send).
55633
- */
55634
- assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
55635
- /** Volume as 0..100 inclusive. Null when the device has no volume
55636
- * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
55637
- volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
55638
- /** Mute toggle distinct from volume=0. Null when no mute surface.
55639
- * Pair with `DeviceFeature.MediaPlayerMute`. */
55640
- isMuted: boolean().nullable(),
55641
- /** Active source / input. Empty when no source surface. */
55642
- source: string(),
55643
- /** Selectable sources. Empty when no source surface.
55644
- * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
55645
- availableSources: array(string()),
55646
- /** Currently-playing media info. Null when nothing is playing. */
55647
- currentMedia: MediaInfoSchema.nullable(),
55648
- /** Current playback position in ms. Null when not seekable or
55649
- * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
55650
- position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
55651
- /** Total duration of the current media in ms. Null when unknown
55652
- * (live stream) or nothing is playing. */
55653
- duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
55654
- /** Shuffle toggle. Null when no shuffle surface.
55655
- * Pair with `DeviceFeature.MediaPlayerShuffle`. */
55656
- shuffle: boolean().nullable(),
55657
- /** Repeat mode. Null when no repeat surface.
55658
- * Pair with `DeviceFeature.MediaPlayerRepeat`. */
55659
- repeat: MediaPlayerRepeatSchema.nullable(),
55660
- /** Ms epoch when the slice was last updated. */
55661
- lastChangedAt: number()
55662
- });
55663
- DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }), _void(), {
55664
- kind: "mutation",
55665
- auth: "protected"
55666
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55667
- kind: "mutation",
55668
- auth: "protected"
55669
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55670
- kind: "mutation",
55671
- auth: "protected"
55672
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55673
- kind: "mutation",
55674
- auth: "protected"
55675
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55676
- kind: "mutation",
55677
- auth: "protected"
55678
- }), method(object({
55679
- deviceId: number().int().nonnegative(),
55680
- position: number().int().nonnegative()
55681
- }), _void(), {
55682
- kind: "mutation",
55683
- auth: "protected"
55684
- }), method(object({
55685
- deviceId: number().int().nonnegative(),
55686
- volumeLevel: number().min(0).max(100)
55687
- }), _void(), {
55688
- kind: "mutation",
55689
- auth: "protected"
55690
- }), method(object({
55691
- deviceId: number().int().nonnegative(),
55692
- muted: boolean()
55693
- }), _void(), {
55694
- kind: "mutation",
55695
- auth: "protected"
55696
- }), method(object({
55697
- deviceId: number().int().nonnegative(),
55698
- shuffle: boolean()
55699
- }), _void(), {
55700
- kind: "mutation",
55701
- auth: "protected"
55702
- }), method(object({
55703
- deviceId: number().int().nonnegative(),
55704
- repeat: MediaPlayerRepeatSchema
55705
- }), _void(), {
55706
- kind: "mutation",
55707
- auth: "protected"
55708
- }), method(object({
55709
- deviceId: number().int().nonnegative(),
55710
- source: string().min(1)
55711
- }), _void(), {
55712
- kind: "mutation",
55713
- auth: "protected"
55714
- }), method(object({
55715
- deviceId: number().int().nonnegative(),
55716
- /** Media identifier / URL. */
55717
- mediaId: string().min(1),
55718
- /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
55719
- * passes it through to the upstream service. */
55720
- mediaType: string().min(1)
55721
- }), _void(), {
55722
- kind: "mutation",
55723
- auth: "protected"
55724
- });
55725
- /**
55726
56275
  * mesh-network — collection cap for mesh-VPN providers.
55727
56276
  *
55728
56277
  * Different shape from `network-access` (public tunnels):
@@ -63616,7 +64165,14 @@ var NcMediaPolicySchema = object({
63616
64165
  */
63617
64166
  profile: CamProfileSchema.optional(),
63618
64167
  /** See {@link NcLinkedCameraModeSchema}. */
63619
- linkedCameras: NcLinkedCameraModeSchema.optional()
64168
+ linkedCameras: NcLinkedCameraModeSchema.optional(),
64169
+ /**
64170
+ * Sensor rules only: may this rule wake a SLEEPING battery camera to take
64171
+ * the linked still it attaches (D998)? Absent means yes, an explicit `false`
64172
+ * opts out. Deliberately not a Zod default: a rule that never chose keeps
64173
+ * following the hub's. One bounded wake per event; nothing is attached later.
64174
+ */
64175
+ wakeSleepingCamera: boolean().optional()
63620
64176
  });
63621
64177
  /**
63622
64178
  * Cooldown GRANULARITY over the subject's class — how much a fired
@@ -64008,6 +64564,21 @@ var NcTemplateVarKindSchema = _enum([
64008
64564
  "sound",
64009
64565
  "system"
64010
64566
  ]);
64567
+ /**
64568
+ * The default title/body a rule of one SITUATION is delivered with when the
64569
+ * operator wrote no template — served so an editor can pre-fill it (and the
64570
+ * operator can rebuild it from placeholders) instead of starting from a blank
64571
+ * box that, once saved, silently replaces it. `id` names the situation inside
64572
+ * a rule `kind`: `appliance-cycle` is a `sensor` rule whose device is an
64573
+ * appliance finishing a cycle. Texts are raw templates (`{{var}}` intact), in
64574
+ * the hub's current language and with its overrides applied.
64575
+ */
64576
+ var NcTemplateDefaultSchema = object({
64577
+ id: _enum(["appliance-cycle"]),
64578
+ kind: NcRuleKindSchema,
64579
+ title: string(),
64580
+ body: string()
64581
+ });
64011
64582
  /** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
64012
64583
  var NcTemplateFamilySchema = _enum([
64013
64584
  "rule",
@@ -64863,7 +65434,11 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
64863
65434
  }), method(object({}), object({
64864
65435
  catalog: array(NcConditionDescriptorSchema),
64865
65436
  taxonomy: NcTaxonomySchema.optional()
64866
- })), method(object({}), object({ vars: array(NcTemplateVarDescriptorSchema) })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
65437
+ })), method(object({}), object({
65438
+ vars: array(NcTemplateVarDescriptorSchema),
65439
+ /** Per-situation default texts; absent on a hub that predates them. */
65440
+ defaults: array(NcTemplateDefaultSchema)
65441
+ })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
64867
65442
  kind: "mutation",
64868
65443
  access: "view"
64869
65444
  }), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), NcRuleLastRunsSchema, { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
@@ -65611,52 +66186,27 @@ object({
65611
66186
  empty: boolean().nullable(),
65612
66187
  /** True while the pump is running. Null while unknown. */
65613
66188
  pumpRunning: boolean().nullable(),
65614
- /** True when the pump works on an on/off duty cycle rather than continuously. */
65615
- pumpIntervalEnabled: boolean().nullable(),
65616
- /** How long the pump runs per cycle, in seconds. */
65617
- pumpOnTime: number().min(0).nullable().meta(readingMeta("duration")),
65618
- /** How long the pump rests per cycle, in seconds. */
65619
- pumpOffTime: number().min(0).nullable().meta(readingMeta("duration")),
65620
66189
  /** Water drunk in the last drink, in litres. */
65621
66190
  lastDrink: number().min(0).nullable().meta(readingMeta("volume")),
65622
66191
  /** Water drunk in the current hour, in litres. */
65623
66192
  currentHourDrink: number().min(0).nullable().meta(readingMeta("volume")),
65624
66193
  /** Water drunk over the last 24 hours (rolling), in litres. */
65625
66194
  last24hDrink: number().min(0).nullable().meta(readingMeta("volume")),
65626
- /** Water drunk since local midnight, in litres. */
66195
+ /** Water drunk since local midnight, in litres. Null when the fountain has no such sensor. */
65627
66196
  todayDrink: number().min(0).nullable().meta(readingMeta("volume")),
65628
66197
  /** Decoded fault message. Null means healthy; a non-null string is an active fault. */
65629
66198
  error: string().nullable(),
65630
66199
  /** Ms epoch when the slice was last refreshed. */
65631
66200
  lastFetchedAt: number()
65632
66201
  });
65633
- var DeviceIdSchema = number().int().nonnegative();
65634
- var MinutesSchema = number().int().min(0);
66202
+ var DeviceIdSchema$1 = number().int().nonnegative();
65635
66203
  DeviceType.PetFountain, method(object({
65636
- deviceId: DeviceIdSchema,
65637
- on: boolean()
65638
- }), _void(), {
65639
- kind: "mutation",
65640
- auth: "protected"
65641
- }), method(object({
65642
- deviceId: DeviceIdSchema,
66204
+ deviceId: DeviceIdSchema$1,
65643
66205
  on: boolean()
65644
66206
  }), _void(), {
65645
66207
  kind: "mutation",
65646
66208
  auth: "protected"
65647
- }), method(object({
65648
- deviceId: DeviceIdSchema,
65649
- minutes: MinutesSchema
65650
- }), _void(), {
65651
- kind: "mutation",
65652
- auth: "protected"
65653
- }), method(object({
65654
- deviceId: DeviceIdSchema,
65655
- minutes: MinutesSchema
65656
- }), _void(), {
65657
- kind: "mutation",
65658
- auth: "protected"
65659
- }), method(object({ deviceId: DeviceIdSchema }), _void(), {
66209
+ }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
65660
66210
  kind: "mutation",
65661
66211
  auth: "protected"
65662
66212
  });
@@ -67616,6 +68166,37 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
67616
68166
  deviceId: number(),
67617
68167
  status: PtzAutotrackStatusSchema
67618
68168
  });
68169
+ object({
68170
+ /** True when the pump works on the on/off cycle, false when it runs continuously. Null while unknown. */
68171
+ enabled: boolean().nullable(),
68172
+ /** How long the pump runs per cycle, in seconds. Null while unknown. */
68173
+ onTime: number().min(0).nullable().meta(readingMeta("duration")),
68174
+ /** How long the pump rests per cycle, in seconds. Null while unknown. */
68175
+ offTime: number().min(0).nullable().meta(readingMeta("duration")),
68176
+ /** Ms epoch when the slice was last refreshed. */
68177
+ lastFetchedAt: number()
68178
+ });
68179
+ var DeviceIdSchema = number().int().nonnegative();
68180
+ var MinutesSchema = number().int().min(0);
68181
+ DeviceType.PetFountain, method(object({
68182
+ deviceId: DeviceIdSchema,
68183
+ on: boolean()
68184
+ }), _void(), {
68185
+ kind: "mutation",
68186
+ auth: "protected"
68187
+ }), method(object({
68188
+ deviceId: DeviceIdSchema,
68189
+ minutes: MinutesSchema
68190
+ }), _void(), {
68191
+ kind: "mutation",
68192
+ auth: "protected"
68193
+ }), method(object({
68194
+ deviceId: DeviceIdSchema,
68195
+ minutes: MinutesSchema
68196
+ }), _void(), {
68197
+ kind: "mutation",
68198
+ auth: "protected"
68199
+ });
67619
68200
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, DeviceType.Gateway, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
67620
68201
  kind: "mutation",
67621
68202
  auth: "admin"
@@ -70522,7 +71103,13 @@ var RemoteMediaCommandSchema = _enum([
70522
71103
  "next",
70523
71104
  "previous",
70524
71105
  "setMute",
70525
- "selectSource"
71106
+ "selectSource",
71107
+ "turnOn",
71108
+ "turnOff",
71109
+ "volumeUp",
71110
+ "volumeDown",
71111
+ "channelUp",
71112
+ "channelDown"
70526
71113
  ]);
70527
71114
  /** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
70528
71115
  var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
@@ -70543,7 +71130,7 @@ method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.e
70543
71130
  }), RemoteSendResultSchema, {
70544
71131
  kind: "mutation",
70545
71132
  auth: "protected"
70546
- }), method(deviceInput.extend({
71133
+ }), method(deviceInput, MediaPlayerStatusSchema.nullable(), { auth: "protected" }), method(deviceInput.extend({
70547
71134
  command: RemoteMediaCommandSchema,
70548
71135
  muted: boolean().optional(),
70549
71136
  source: string().optional(),
@@ -71415,9 +72002,17 @@ var ServerUpdateActionResultSchema = object({
71415
72002
  */
71416
72003
  requiredAddonUpdates: array(RequiredAddonUpdateSchema).optional()
71417
72004
  });
71418
- var LaunchOverridesSchema = object({
71419
- /** The persisted heap ceiling in MB, or `null` when none is set. */
71420
- heapMb: number().int().nullable() });
72005
+ var LaunchOverridesSchema = object({
72006
+ /** The persisted heap ceiling in MB, or `null` when none is set. */
72007
+ heapMb: number().int().nullable(),
72008
+ /** The persisted hub-main RSS budget in MB, or `null` when none is set. */
72009
+ rssBudgetMb: number().int().nullable()
72010
+ });
72011
+ var SetLaunchOverridesInputSchema = object({
72012
+ heapMb: number().int().min(512).max(65536).nullable(),
72013
+ /** Omitted keeps the stored budget; `null` clears it. */
72014
+ rssBudgetMb: number().int().min(512).max(65536).nullable().optional()
72015
+ });
71421
72016
  var SetLaunchOverridesResultSchema = LaunchOverridesSchema.extend({
71422
72017
  /** Always true: the override is read at launch, not by the running process. */
71423
72018
  restartRequired: boolean() });
@@ -71446,7 +72041,7 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
71446
72041
  }), method(_void(), ServerUpdateActionResultSchema, {
71447
72042
  kind: "mutation",
71448
72043
  auth: "admin"
71449
- }), method(_void(), LaunchOverridesSchema, { auth: "admin" }), method(object({ heapMb: number().int().min(512).max(65536).nullable() }), SetLaunchOverridesResultSchema, {
72044
+ }), method(_void(), LaunchOverridesSchema, { auth: "admin" }), method(SetLaunchOverridesInputSchema, SetLaunchOverridesResultSchema, {
71450
72045
  kind: "mutation",
71451
72046
  auth: "admin"
71452
72047
  });
@@ -71478,7 +72073,16 @@ DeviceType.Sensor;
71478
72073
  * future fields without breaking the existing call sites.
71479
72074
  */
71480
72075
  var EmailAddressSchema = email();
72076
+ /**
72077
+ * Which relay of a multi-relay provider answers (D996). Absent = the provider's first / default
72078
+ * relay, so a caller written before relays existed keeps working unchanged. A provider with one
72079
+ * fixed relay ignores it. This is the integration instance id (`int_NNNN`), NOT the addon id: the
72080
+ * collection pin `addonId` still picks the provider, `instanceId` picks the relay inside it.
72081
+ */
72082
+ var InstanceIdSchema = string().min(1).optional();
72083
+ var RelayPinSchema = object({ instanceId: InstanceIdSchema });
71481
72084
  var SendEmailInputSchema = object({
72085
+ instanceId: InstanceIdSchema,
71482
72086
  to: union([EmailAddressSchema, array(EmailAddressSchema).min(1)]),
71483
72087
  cc: array(EmailAddressSchema).optional(),
71484
72088
  bcc: array(EmailAddressSchema).optional(),
@@ -71514,11 +72118,11 @@ method(SendEmailInputSchema, SendEmailResultSchema, {
71514
72118
  kind: "mutation",
71515
72119
  auth: "admin",
71516
72120
  access: "create"
71517
- }), method(_void(), SmtpStatusSchema, {
72121
+ }), method(RelayPinSchema, SmtpStatusSchema, {
71518
72122
  kind: "mutation",
71519
72123
  auth: "admin",
71520
72124
  access: "view"
71521
- }), method(_void(), SmtpStatusSchema, { auth: "admin" });
72125
+ }), method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" });
71522
72126
  /**
71523
72127
  * A single device snapshot returned as base64 JPEG/PNG.
71524
72128
  *
@@ -71550,10 +72154,12 @@ DeviceType.Camera, method(object({
71550
72154
  * even when the cache is well within the device's
71551
72155
  * `snapshotMaxAgeS` window.
71552
72156
  *
71553
- * **`force` is an OPERATOR signal, not a freshness preference.** On a
72157
+ * **`force` is a demand with a named principal, not a freshness
72158
+ * preference** — an operator button, the scheduled refresh (D847), or a
72159
+ * notification rule that left the camera's wake allowed (D998). On a
71554
72160
  * battery camera it is the one thing that walks past the wrapper's
71555
- * sleep gate and wakes the camera, so a background caller — a poller,
71556
- * an event handler, a thumbnail — must NEVER set it. Every such caller
72161
+ * sleep gate and wakes the camera, so a poller, a thumbnail or a
72162
+ * prestream must NEVER set it. Every such caller
71557
72163
  * gets the cached frame, which on a sleeping battery camera is the
71558
72164
  * correct answer: stale but honest beats woken.
71559
72165
  */
@@ -72361,7 +72967,11 @@ object({
72361
72967
  });
72362
72968
  Object.values(DeviceType), method(_void(), array(StreamSignalSchema).readonly());
72363
72969
  object({
72364
- on: boolean().meta({ label: "On" }),
72970
+ /**
72971
+ * `null` = the device has never reported its state (a measurement that
72972
+ * has not happened is unknown, never `false`).
72973
+ */
72974
+ on: boolean().nullable().meta({ label: "On" }),
72365
72975
  /** Ms epoch of the last state change. Useful for UI "X minutes ago". */
72366
72976
  lastChangedAt: number()
72367
72977
  });
@@ -72373,7 +72983,7 @@ DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceTyp
72373
72983
  auth: "protected"
72374
72984
  }), object({
72375
72985
  deviceId: number(),
72376
- on: boolean(),
72986
+ on: boolean().nullable(),
72377
72987
  lastChangedAt: number()
72378
72988
  });
72379
72989
  /** C0 controls, DEL and the C1 range: none of them belongs in a name. */
@@ -72904,6 +73514,40 @@ var LoggingSettingsStateSchema = object({
72904
73514
  opsLogRetentionDays: number().int().min(0),
72905
73515
  persisted: boolean()
72906
73516
  });
73517
+ /**
73518
+ * Debug WATCH — a short, per-device window over `debug.<channel>` lines.
73519
+ *
73520
+ * `start` opens (or re-arms) a 10 minute window; `rearm` extends a LIVE one
73521
+ * and never revives a lapsed one; `stop` closes it; `list` only reads. No
73522
+ * chain of re-arms outlives 60 minutes from the first start. The hub holds the
73523
+ * watches in memory and pushes the interest to every node, so a watch lapses
73524
+ * by itself and survives nothing — a restart is a stop.
73525
+ */
73526
+ var DebugWatchInputSchema = object({
73527
+ action: _enum([
73528
+ "list",
73529
+ "start",
73530
+ "rearm",
73531
+ "stop"
73532
+ ]),
73533
+ /** Full channel names, `debug.<channel>`, each declared with `kind: 'debug'`. */
73534
+ channels: array(string().min(1)).readonly().default([]),
73535
+ /** Numeric device ids. Required (non-empty) for `start`. */
73536
+ deviceIds: array(number().int()).readonly().default([])
73537
+ });
73538
+ var DebugWatchStateSchema = object({
73539
+ channel: string(),
73540
+ deviceIds: array(number().int()).readonly(),
73541
+ startedAtMs: number(),
73542
+ untilMs: number(),
73543
+ capAtMs: number()
73544
+ });
73545
+ var DebugWatchResultSchema = object({
73546
+ nowMs: number(),
73547
+ watches: array(DebugWatchStateSchema).readonly(),
73548
+ /** Channels a `rearm` found already lapsed: nothing was revived. */
73549
+ lapsed: array(string()).readonly()
73550
+ });
72907
73551
  method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
72908
73552
  kind: "mutation",
72909
73553
  auth: "admin"
@@ -72919,6 +73563,9 @@ method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_
72919
73563
  }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(_void(), array(ReportedFailureContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
72920
73564
  kind: "mutation",
72921
73565
  auth: "admin"
73566
+ }), method(DebugWatchInputSchema, DebugWatchResultSchema, {
73567
+ kind: "mutation",
73568
+ auth: "admin"
72922
73569
  });
72923
73570
  object({
72924
73571
  /** True when the device's tamper switch / case-open contact is
@@ -75360,6 +76007,7 @@ function buildDescriptor(capName, kind) {
75360
76007
  * contributes one entry per bound cap present in this map.
75361
76008
  */
75362
76009
  var EVENT_KIND_BY_CAP = Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
76010
+ DeviceFeature.MediaPlayerPower, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious;
75363
76011
  var btn = (idSuffix, row, col, init) => ({
75364
76012
  idSuffix,
75365
76013
  row,
@@ -75486,7 +76134,7 @@ discriminatedUnion("kind", [object({
75486
76134
  kind: literal("pronto"),
75487
76135
  code: string()
75488
76136
  })]);
75489
- DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
76137
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverStoppable, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
75490
76138
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
75491
76139
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
75492
76140
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
@@ -76467,6 +77115,27 @@ Object.freeze({
76467
77115
  access: "view",
76468
77116
  role: "viewer"
76469
77117
  },
77118
+ "boardKeySource.getBoardKey": {
77119
+ capName: "board-key-source",
77120
+ capScope: "system",
77121
+ addonId: null,
77122
+ access: "view",
77123
+ role: "admin"
77124
+ },
77125
+ "boardKeySource.listBoards": {
77126
+ capName: "board-key-source",
77127
+ capScope: "system",
77128
+ addonId: null,
77129
+ access: "view",
77130
+ role: "admin"
77131
+ },
77132
+ "boardKeySource.listSources": {
77133
+ capName: "board-key-source",
77134
+ capScope: "system",
77135
+ addonId: null,
77136
+ access: "view",
77137
+ role: "admin"
77138
+ },
76470
77139
  "brightness.getStatus": {
76471
77140
  capName: "brightness",
76472
77141
  capScope: "device",
@@ -77804,6 +78473,13 @@ Object.freeze({
77804
78473
  access: "view",
77805
78474
  role: "admin"
77806
78475
  },
78476
+ "deviceManager.dismissDiscoveryProposal": {
78477
+ capName: "device-manager",
78478
+ capScope: "system",
78479
+ addonId: null,
78480
+ access: "create",
78481
+ role: "admin"
78482
+ },
77807
78483
  "deviceManager.enable": {
77808
78484
  capName: "device-manager",
77809
78485
  capScope: "system",
@@ -77986,6 +78662,13 @@ Object.freeze({
77986
78662
  access: "view",
77987
78663
  role: "viewer"
77988
78664
  },
78665
+ "deviceManager.listDiscoveryProposals": {
78666
+ capName: "device-manager",
78667
+ capScope: "system",
78668
+ addonId: null,
78669
+ access: "view",
78670
+ role: "admin"
78671
+ },
77989
78672
  "deviceManager.listLocationDescriptions": {
77990
78673
  capName: "device-manager",
77991
78674
  capScope: "system",
@@ -78140,6 +78823,13 @@ Object.freeze({
78140
78823
  access: "create",
78141
78824
  role: "admin"
78142
78825
  },
78826
+ "deviceManager.reportDiscoveryObservations": {
78827
+ capName: "device-manager",
78828
+ capScope: "system",
78829
+ addonId: null,
78830
+ access: "create",
78831
+ role: "admin"
78832
+ },
78143
78833
  "deviceManager.runDeviceAction": {
78144
78834
  capName: "device-manager",
78145
78835
  capScope: "system",
@@ -78147,6 +78837,13 @@ Object.freeze({
78147
78837
  access: "create",
78148
78838
  role: "admin"
78149
78839
  },
78840
+ "deviceManager.runDiscoverySweep": {
78841
+ capName: "device-manager",
78842
+ capScope: "system",
78843
+ addonId: null,
78844
+ access: "create",
78845
+ role: "admin"
78846
+ },
78150
78847
  "deviceManager.setChildLayout": {
78151
78848
  capName: "device-manager",
78152
78849
  capScope: "system",
@@ -78700,6 +79397,20 @@ Object.freeze({
78700
79397
  access: "create",
78701
79398
  role: "admin"
78702
79399
  },
79400
+ "doNotDisturb.getStatus": {
79401
+ capName: "do-not-disturb",
79402
+ capScope: "device",
79403
+ addonId: null,
79404
+ access: "view",
79405
+ role: "viewer"
79406
+ },
79407
+ "doNotDisturb.setEnabled": {
79408
+ capName: "do-not-disturb",
79409
+ capScope: "device",
79410
+ addonId: null,
79411
+ access: "create",
79412
+ role: "viewer"
79413
+ },
78703
79414
  "doorbell.getStatus": {
78704
79415
  capName: "doorbell",
78705
79416
  capScope: "device",
@@ -79064,6 +79775,69 @@ Object.freeze({
79064
79775
  access: "create",
79065
79776
  role: "admin"
79066
79777
  },
79778
+ "integrationInstances.createInstance": {
79779
+ capName: "integration-instances",
79780
+ capScope: "system",
79781
+ addonId: null,
79782
+ access: "create",
79783
+ role: "admin"
79784
+ },
79785
+ "integrationInstances.deleteInstance": {
79786
+ capName: "integration-instances",
79787
+ capScope: "system",
79788
+ addonId: null,
79789
+ access: "delete",
79790
+ role: "admin"
79791
+ },
79792
+ "integrationInstances.describe": {
79793
+ capName: "integration-instances",
79794
+ capScope: "system",
79795
+ addonId: null,
79796
+ access: "view",
79797
+ role: "admin"
79798
+ },
79799
+ "integrationInstances.getInstance": {
79800
+ capName: "integration-instances",
79801
+ capScope: "system",
79802
+ addonId: null,
79803
+ access: "view",
79804
+ role: "admin"
79805
+ },
79806
+ "integrationInstances.instanceFormSchema": {
79807
+ capName: "integration-instances",
79808
+ capScope: "system",
79809
+ addonId: null,
79810
+ access: "view",
79811
+ role: "admin"
79812
+ },
79813
+ "integrationInstances.listInstances": {
79814
+ capName: "integration-instances",
79815
+ capScope: "system",
79816
+ addonId: null,
79817
+ access: "view",
79818
+ role: "admin"
79819
+ },
79820
+ "integrationInstances.setInstanceEnabled": {
79821
+ capName: "integration-instances",
79822
+ capScope: "system",
79823
+ addonId: null,
79824
+ access: "create",
79825
+ role: "admin"
79826
+ },
79827
+ "integrationInstances.testInstance": {
79828
+ capName: "integration-instances",
79829
+ capScope: "system",
79830
+ addonId: null,
79831
+ access: "create",
79832
+ role: "admin"
79833
+ },
79834
+ "integrationInstances.updateInstance": {
79835
+ capName: "integration-instances",
79836
+ capScope: "system",
79837
+ addonId: null,
79838
+ access: "create",
79839
+ role: "admin"
79840
+ },
79067
79841
  "integrations.create": {
79068
79842
  capName: "integrations",
79069
79843
  capScope: "system",
@@ -79848,6 +80622,20 @@ Object.freeze({
79848
80622
  access: "view",
79849
80623
  role: "admin"
79850
80624
  },
80625
+ "mediaPlayer.channelDown": {
80626
+ capName: "media-player",
80627
+ capScope: "device",
80628
+ addonId: null,
80629
+ access: "create",
80630
+ role: "viewer"
80631
+ },
80632
+ "mediaPlayer.channelUp": {
80633
+ capName: "media-player",
80634
+ capScope: "device",
80635
+ addonId: null,
80636
+ access: "create",
80637
+ role: "viewer"
80638
+ },
79851
80639
  "mediaPlayer.getStatus": {
79852
80640
  capName: "media-player",
79853
80641
  capScope: "device",
@@ -79939,6 +80727,34 @@ Object.freeze({
79939
80727
  access: "create",
79940
80728
  role: "viewer"
79941
80729
  },
80730
+ "mediaPlayer.turnOff": {
80731
+ capName: "media-player",
80732
+ capScope: "device",
80733
+ addonId: null,
80734
+ access: "create",
80735
+ role: "viewer"
80736
+ },
80737
+ "mediaPlayer.turnOn": {
80738
+ capName: "media-player",
80739
+ capScope: "device",
80740
+ addonId: null,
80741
+ access: "create",
80742
+ role: "viewer"
80743
+ },
80744
+ "mediaPlayer.volumeDown": {
80745
+ capName: "media-player",
80746
+ capScope: "device",
80747
+ addonId: null,
80748
+ access: "create",
80749
+ role: "viewer"
80750
+ },
80751
+ "mediaPlayer.volumeUp": {
80752
+ capName: "media-player",
80753
+ capScope: "device",
80754
+ addonId: null,
80755
+ access: "create",
80756
+ role: "viewer"
80757
+ },
79942
80758
  "meshNetwork.getStatus": {
79943
80759
  capName: "mesh-network",
79944
80760
  capScope: "system",
@@ -81185,27 +82001,6 @@ Object.freeze({
81185
82001
  access: "create",
81186
82002
  role: "viewer"
81187
82003
  },
81188
- "petFountain.setPumpInterval": {
81189
- capName: "pet-fountain",
81190
- capScope: "device",
81191
- addonId: null,
81192
- access: "create",
81193
- role: "viewer"
81194
- },
81195
- "petFountain.setPumpOffMinutes": {
81196
- capName: "pet-fountain",
81197
- capScope: "device",
81198
- addonId: null,
81199
- access: "create",
81200
- role: "viewer"
81201
- },
81202
- "petFountain.setPumpOnMinutes": {
81203
- capName: "pet-fountain",
81204
- capScope: "device",
81205
- addonId: null,
81206
- access: "create",
81207
- role: "viewer"
81208
- },
81209
82004
  "pipelineAnalytics.addRetrainFrameFromRecording": {
81210
82005
  capName: "pipeline-analytics",
81211
82006
  capScope: "device",
@@ -82984,6 +83779,34 @@ Object.freeze({
82984
83779
  access: "create",
82985
83780
  role: "admin"
82986
83781
  },
83782
+ "pumpCycle.getStatus": {
83783
+ capName: "pump-cycle",
83784
+ capScope: "device",
83785
+ addonId: null,
83786
+ access: "view",
83787
+ role: "viewer"
83788
+ },
83789
+ "pumpCycle.setEnabled": {
83790
+ capName: "pump-cycle",
83791
+ capScope: "device",
83792
+ addonId: null,
83793
+ access: "create",
83794
+ role: "viewer"
83795
+ },
83796
+ "pumpCycle.setOffMinutes": {
83797
+ capName: "pump-cycle",
83798
+ capScope: "device",
83799
+ addonId: null,
83800
+ access: "create",
83801
+ role: "viewer"
83802
+ },
83803
+ "pumpCycle.setOnMinutes": {
83804
+ capName: "pump-cycle",
83805
+ capScope: "device",
83806
+ addonId: null,
83807
+ access: "create",
83808
+ role: "viewer"
83809
+ },
82987
83810
  "reboot.reboot": {
82988
83811
  capName: "reboot",
82989
83812
  capScope: "device",
@@ -83488,6 +84311,13 @@ Object.freeze({
83488
84311
  access: "create",
83489
84312
  role: "admin"
83490
84313
  },
84314
+ "remote.getAssumedStatus": {
84315
+ capName: "remote",
84316
+ capScope: "system",
84317
+ addonId: null,
84318
+ access: "view",
84319
+ role: "admin"
84320
+ },
83491
84321
  "remote.getConfig": {
83492
84322
  capName: "remote",
83493
84323
  capScope: "system",
@@ -84720,6 +85550,13 @@ Object.freeze({
84720
85550
  access: "create",
84721
85551
  role: "viewer"
84722
85552
  },
85553
+ "system.debugWatch": {
85554
+ capName: "system",
85555
+ capScope: "system",
85556
+ addonId: null,
85557
+ access: "create",
85558
+ role: "admin"
85559
+ },
84723
85560
  "system.detectSiteLocation": {
84724
85561
  capName: "system",
84725
85562
  capScope: "system",
@@ -86913,6 +87750,16 @@ Object.freeze({
86913
87750
  form: "single",
86914
87751
  optional: false
86915
87752
  }],
87753
+ "doNotDisturb.getStatus": [{
87754
+ name: "deviceId",
87755
+ form: "single",
87756
+ optional: false
87757
+ }],
87758
+ "doNotDisturb.setEnabled": [{
87759
+ name: "deviceId",
87760
+ form: "single",
87761
+ optional: false
87762
+ }],
86916
87763
  "doorbell.getStatus": [{
86917
87764
  name: "deviceId",
86918
87765
  form: "single",
@@ -87162,6 +88009,16 @@ Object.freeze({
87162
88009
  form: "single",
87163
88010
  optional: true
87164
88011
  }],
88012
+ "mediaPlayer.channelDown": [{
88013
+ name: "deviceId",
88014
+ form: "single",
88015
+ optional: false
88016
+ }],
88017
+ "mediaPlayer.channelUp": [{
88018
+ name: "deviceId",
88019
+ form: "single",
88020
+ optional: false
88021
+ }],
87165
88022
  "mediaPlayer.getStatus": [{
87166
88023
  name: "deviceId",
87167
88024
  form: "single",
@@ -87227,6 +88084,26 @@ Object.freeze({
87227
88084
  form: "single",
87228
88085
  optional: false
87229
88086
  }],
88087
+ "mediaPlayer.turnOff": [{
88088
+ name: "deviceId",
88089
+ form: "single",
88090
+ optional: false
88091
+ }],
88092
+ "mediaPlayer.turnOn": [{
88093
+ name: "deviceId",
88094
+ form: "single",
88095
+ optional: false
88096
+ }],
88097
+ "mediaPlayer.volumeDown": [{
88098
+ name: "deviceId",
88099
+ form: "single",
88100
+ optional: false
88101
+ }],
88102
+ "mediaPlayer.volumeUp": [{
88103
+ name: "deviceId",
88104
+ form: "single",
88105
+ optional: false
88106
+ }],
87230
88107
  "meter.getStatus": [{
87231
88108
  name: "deviceId",
87232
88109
  form: "single",
@@ -87536,21 +88413,6 @@ Object.freeze({
87536
88413
  form: "single",
87537
88414
  optional: false
87538
88415
  }],
87539
- "petFountain.setPumpInterval": [{
87540
- name: "deviceId",
87541
- form: "single",
87542
- optional: false
87543
- }],
87544
- "petFountain.setPumpOffMinutes": [{
87545
- name: "deviceId",
87546
- form: "single",
87547
- optional: false
87548
- }],
87549
- "petFountain.setPumpOnMinutes": [{
87550
- name: "deviceId",
87551
- form: "single",
87552
- optional: false
87553
- }],
87554
88416
  "pipelineAnalytics.addRetrainFrameFromRecording": [{
87555
88417
  name: "deviceId",
87556
88418
  form: "single",
@@ -88186,6 +89048,26 @@ Object.freeze({
88186
89048
  form: "single",
88187
89049
  optional: false
88188
89050
  }],
89051
+ "pumpCycle.getStatus": [{
89052
+ name: "deviceId",
89053
+ form: "single",
89054
+ optional: false
89055
+ }],
89056
+ "pumpCycle.setEnabled": [{
89057
+ name: "deviceId",
89058
+ form: "single",
89059
+ optional: false
89060
+ }],
89061
+ "pumpCycle.setOffMinutes": [{
89062
+ name: "deviceId",
89063
+ form: "single",
89064
+ optional: false
89065
+ }],
89066
+ "pumpCycle.setOnMinutes": [{
89067
+ name: "deviceId",
89068
+ form: "single",
89069
+ optional: false
89070
+ }],
88189
89071
  "reboot.reboot": [{
88190
89072
  name: "deviceId",
88191
89073
  form: "single",
@@ -88387,6 +89269,11 @@ Object.freeze({
88387
89269
  form: "single",
88388
89270
  optional: true
88389
89271
  }],
89272
+ "remote.getAssumedStatus": [{
89273
+ name: "deviceId",
89274
+ form: "single",
89275
+ optional: false
89276
+ }],
88390
89277
  "remote.getConfig": [{
88391
89278
  name: "deviceId",
88392
89279
  form: "single",
@@ -88653,6 +89540,11 @@ Object.freeze({
88653
89540
  form: "single",
88654
89541
  optional: false
88655
89542
  }],
89543
+ "system.debugWatch": [{
89544
+ name: "deviceIds",
89545
+ form: "array",
89546
+ optional: true
89547
+ }],
88656
89548
  "tamper.getStatus": [{
88657
89549
  name: "deviceId",
88658
89550
  form: "single",
@@ -89637,6 +90529,7 @@ var STATE_SUMMARY_VARS = [
89637
90529
  [...RULE_TEXT],
89638
90530
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
89639
90531
  ([...RULE_TEXT], [...COMBINED_ALARM]),
90532
+ ([...RULE_TEXT], [...COMBINED_ALARM]),
89640
90533
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
89641
90534
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
89642
90535
  ([...RULE_TEXT], [...CONSUMABLE]),
@@ -137575,6 +138468,111 @@ function carryForward(base, existing, keys) {
137575
138468
  return out;
137576
138469
  }
137577
138470
  //#endregion
138471
+ //#region src/migrations/hub-node-fields.ts
138472
+ /**
138473
+ * Fields stored once for the cluster that are facts of ONE node become node settings (D986): a
138474
+ * node's row is `<addonId>.<key>@<nodeId>` carrying `nodeId`, and a node never falls back to a
138475
+ * bare row. This owner is placed `hub-only`, so the one node that ever held a value is the hub:
138476
+ * each bare row is COPIED to `<key>@hub`. The bare row stays for a release (a copy, not a move),
138477
+ * and a value already on the node row is never overwritten (a seed never overwrites).
138478
+ *
138479
+ * A keychain marker is copied verbatim: it names the owner and the secret, not the row that
138480
+ * points at it. Idempotent: with every bare row copied the plan is empty.
138481
+ */
138482
+ /** The canonical settings table: one row per key, id `<addonId>.<key>`. */
138483
+ var ADDON_SETTINGS_TABLE = "addon-settings";
138484
+ var nodeKeyOf = (key) => `${key}@hub`;
138485
+ async function planHubNodeFields(addonId, keys, ports) {
138486
+ const stored = await ports.readStored([...keys, ...keys.map(nodeKeyOf)]);
138487
+ const pending = keys.filter((key) => key in stored && !(nodeKeyOf(key) in stored));
138488
+ if (pending.length === 0) return { edits: [] };
138489
+ const rowId = (key) => `${addonId}.${nodeKeyOf(key)}`;
138490
+ return { edits: [{
138491
+ op: "setKeys",
138492
+ scope: ADDON_SETTINGS_TABLE,
138493
+ values: Object.fromEntries(pending.map((key) => [rowId(key), {
138494
+ addonId,
138495
+ key: nodeKeyOf(key),
138496
+ value: stored[key],
138497
+ nodeId: "hub"
138498
+ }])),
138499
+ precondition: preconditionOf(Object.fromEntries(pending.map((key) => [rowId(key), null])))
138500
+ }] };
138501
+ }
138502
+ /**
138503
+ * The port's read over an addon's three-way key read: each of `keys` that has a row, raw. A key
138504
+ * the store could not answer for throws, so the migration fails instead of treating a failed read
138505
+ * as "nothing to copy".
138506
+ */
138507
+ async function readRawKeys(read, addonId, keys) {
138508
+ const found = {};
138509
+ for (const key of keys) {
138510
+ const answer = await read(key);
138511
+ if (answer.kind === "unreadable") throw new Error(`${addonId}: the setting ${key} cannot be read (${answer.reason})`);
138512
+ if (answer.kind === "present") found[key] = answer.value;
138513
+ }
138514
+ return found;
138515
+ }
138516
+ //#endregion
138517
+ //#region src/migrations/fixed-pin-to-keychain.ts
138518
+ /**
138519
+ * The fixed HomeKit setup code pairs a controller with the bridge: a credential. It was a plain
138520
+ * text setting, stored inline in the settings row; it is a `password` field now (D783), and a
138521
+ * password lives in the keychain with a marker in the row. This procedure moves a stored inline
138522
+ * code there, through the operator write path (the one that stores an inline value of a
138523
+ * pre-keychain addon as a keychain secret).
138524
+ *
138525
+ * Idempotent: an absent, empty or already marker-backed code is `already-done`, so a crash
138526
+ * between the keychain write and the ledger row costs nothing on the rerun.
138527
+ */
138528
+ async function moveFixedPinToKeychain(ports) {
138529
+ const stored = (await ports.readStored(["fixedPin"]))["fixedPin"];
138530
+ if (typeof stored !== "string" || stored === "" || isSecretMarker(stored)) return {
138531
+ outcome: "already-done",
138532
+ summary: { moved: false }
138533
+ };
138534
+ await ports.storeFixedPin(stored);
138535
+ return {
138536
+ outcome: "done",
138537
+ summary: { moved: true }
138538
+ };
138539
+ }
138540
+ //#endregion
138541
+ //#region src/migrations/index.ts
138542
+ var EXPORT_HAP_ID = "export-hap";
138543
+ /** The `export-hap` catalogue (D987): offered to the engine when the addon initialises. */
138544
+ var ADDON_MIGRATIONS = [{
138545
+ meta: {
138546
+ id: "export-hap/2026-11-03-interface-name-per-node",
138547
+ owner: EXPORT_HAP_ID,
138548
+ level: "addon-state",
138549
+ seq: 1,
138550
+ dependsOn: [],
138551
+ store: "settings",
138552
+ scope: "per-node",
138553
+ onFailure: "tolerate",
138554
+ bodyKind: "plan",
138555
+ description: "Copy the bare network interface setting to its hub node row; the bare row stays for a release",
138556
+ fixtureMark: "the bridge name the migration does not know"
138557
+ },
138558
+ plan: (ports) => planHubNodeFields(EXPORT_HAP_ID, ["interfaceName"], ports)
138559
+ }, {
138560
+ meta: {
138561
+ id: "export-hap/2026-11-03-fixed-pin-to-keychain",
138562
+ owner: EXPORT_HAP_ID,
138563
+ level: "addon-state",
138564
+ seq: 2,
138565
+ dependsOn: [],
138566
+ store: "settings",
138567
+ scope: "cluster",
138568
+ onFailure: "tolerate",
138569
+ bodyKind: "procedure",
138570
+ description: "Move the fixed setup code from an inline setting into the keychain, where a password field keeps it",
138571
+ fixtureMark: "the bridge name the migration does not know"
138572
+ },
138573
+ procedure: moveFixedPinToKeychain
138574
+ }];
138575
+ //#endregion
137578
138576
  //#region src/hap-setup-uri.ts
137579
138577
  function errMsg$15(e) {
137580
138578
  return e instanceof Error ? e.message : String(e);
@@ -157022,6 +158020,7 @@ var ExportHapAddon = class extends BaseAddon {
157022
158020
  super({ ...DEFAULT_CONFIG });
157023
158021
  }
157024
158022
  async onInitialize() {
158023
+ await this.migrateSettings();
157025
158024
  const identity = await this.ensureIdentity();
157026
158025
  this.pincode = identity.pincode;
157027
158026
  this.bind = this.config.interfaceName || void 0;
@@ -157630,6 +158629,37 @@ var ExportHapAddon = class extends BaseAddon {
157630
158629
  return null;
157631
158630
  }
157632
158631
  }
158632
+ /** The one declaration of the bind-interface field, shared by the node form and the global form. */
158633
+ interfaceNameField() {
158634
+ return this.field({
158635
+ type: "text",
158636
+ key: "interfaceName",
158637
+ perNode: true,
158638
+ label: "Network interface",
158639
+ description: "Optional. Restrict mDNS advertisement and HAP bind to this node's interface (e.g. \"en0\"). Leave blank to advertise on all interfaces.",
158640
+ default: DEFAULT_CONFIG.interfaceName,
158641
+ requiresRestart: true,
158642
+ placement: { tab: "advanced" }
158643
+ });
158644
+ }
158645
+ async nodeSettingsSchema(cap) {
158646
+ return cap === "device-export" ? this.schema({ sections: [{
158647
+ id: "export-hap-node",
158648
+ title: "HomeKit Export",
158649
+ fields: [this.interfaceNameField()]
158650
+ }] }) : null;
158651
+ }
158652
+ /**
158653
+ * Copy the bare `interfaceName` to its hub node row and move an inline `fixedPin` into the
158654
+ * keychain (D986, D987). Re-resolves the config when either landed, so this boot binds the
158655
+ * value the migration wrote.
158656
+ */
158657
+ async migrateSettings() {
158658
+ if ((await this.runMigrations(defineAddonMigrations(ADDON_MIGRATIONS, {
158659
+ readStored: (keys) => readRawKeys((key) => this.readStoredGlobalKey(key), "export-hap", keys),
158660
+ storeFixedPin: (pin) => this.updateGlobalSettingsAsOperator({ fixedPin: pin })
158661
+ }))).applied.length > 0) await this.resolveConfig();
158662
+ }
157633
158663
  globalSettingsSchema() {
157634
158664
  return this.schema({ sections: [{
157635
158665
  id: "export-hap",
@@ -157647,24 +158677,15 @@ var ExportHapAddon = class extends BaseAddon {
157647
158677
  placement: { tab: "advanced" }
157648
158678
  }),
157649
158679
  this.field({
157650
- type: "text",
158680
+ type: "password",
157651
158681
  key: "fixedPin",
157652
- secret: true,
157653
158682
  label: "Fixed setup code (XXX-XX-XXX)",
157654
158683
  description: "Optional. Leave blank to use the auto-generated code persisted on first boot. Useful for CI replay.",
157655
158684
  default: DEFAULT_CONFIG.fixedPin,
157656
158685
  requiresRestart: true,
157657
158686
  placement: { tab: "advanced" }
157658
158687
  }),
157659
- this.field({
157660
- type: "text",
157661
- key: "interfaceName",
157662
- label: "Network interface",
157663
- description: "Optional. Restrict mDNS advertisement and HAP bind to a specific interface (e.g. \"en0\"). Leave blank to advertise on all interfaces.",
157664
- default: DEFAULT_CONFIG.interfaceName,
157665
- requiresRestart: true,
157666
- placement: { tab: "advanced" }
157667
- }),
158688
+ this.interfaceNameField(),
157668
158689
  this.field({
157669
158690
  type: "number",
157670
158691
  key: "clipRetentionDays",