@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.
@@ -835,7 +835,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
835
835
  return EventCategory;
836
836
  }({});
837
837
  //#endregion
838
- //#region ../types/dist/device-type-BOWLtoOt.mjs
838
+ //#region ../types/dist/device-type-D1fH5kaC.mjs
839
839
  /**
840
840
  import { errMsg } from '@camstack/types'
841
841
  * Extract a human-readable message from an unknown error value.
@@ -1024,6 +1024,9 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1024
1024
  DeviceFeature["CoverPositionable"] = "cover-positionable";
1025
1025
  /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
1026
1026
  DeviceFeature["CoverTilt"] = "cover-tilt";
1027
+ /** Cover has a real stop: `stop` halts the travel in place. Gates the stop
1028
+ * control in exporters; a provider whose `stop` is a no-op never declares it. */
1029
+ DeviceFeature["CoverStoppable"] = "cover-stoppable";
1027
1030
  /** Valve exposes intermediate position control (0..100). Gates the
1028
1031
  * position slider / drag surface UI. */
1029
1032
  DeviceFeature["ValvePositionable"] = "valve-positionable";
@@ -1063,6 +1066,12 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1063
1066
  DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
1064
1067
  /** Media player exposes stop distinct from pause. */
1065
1068
  DeviceFeature["MediaPlayerStop"] = "media-player-stop";
1069
+ /** Media player exposes volume up / down in steps (an infrared TV has no level). */
1070
+ DeviceFeature["MediaPlayerVolumeStep"] = "media-player-volume-step";
1071
+ /** Media player exposes channel up / down in steps. */
1072
+ DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
1073
+ /** Media player exposes power on / off. */
1074
+ DeviceFeature["MediaPlayerPower"] = "media-player-power";
1066
1075
  /** Alarm panel requires a PIN code on arm/disarm. */
1067
1076
  DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
1068
1077
  /** Presence device carries GPS coordinates (lat/lng/accuracy) in
@@ -5889,7 +5898,7 @@ var ZodIssueCode = {
5889
5898
  var ZodFirstPartyTypeKind;
5890
5899
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5891
5900
  //#endregion
5892
- //#region ../types/dist/sleep-_4vKNWxb.mjs
5901
+ //#region ../types/dist/sleep-BKClVk0K.mjs
5893
5902
  /**
5894
5903
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5895
5904
  * window to float samples (D455).
@@ -5968,6 +5977,22 @@ function buildAlawTable() {
5968
5977
  }
5969
5978
  buildUlawTable();
5970
5979
  buildAlawTable();
5980
+ /**
5981
+ * An addon whose own migrations did not apply refuses to initialise (D987). The error is typed
5982
+ * so a runner hosting several addons can tell "this addon is blocked" from a crash and keep its
5983
+ * co-located siblings running. Recognised by NAME and shape, never `instanceof`: a forked addon
5984
+ * bundles its own copy of this module, so the class the runner sees is not the one that threw.
5985
+ */
5986
+ var MIGRATIONS_BLOCKED_ERROR_NAME = "AddonMigrationsBlockedError";
5987
+ var AddonMigrationsBlockedError = class extends Error {
5988
+ /** The ledger ids that did not apply and block the owner. */
5989
+ migrationIds;
5990
+ constructor(migrationIds) {
5991
+ super(`migration(s) ${migrationIds.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
5992
+ this.name = MIGRATIONS_BLOCKED_ERROR_NAME;
5993
+ this.migrationIds = migrationIds;
5994
+ }
5995
+ };
5971
5996
  /** Is this field's stored value a credential? */
5972
5997
  function isSecretConfigField(field) {
5973
5998
  if (field.type === "password") return true;
@@ -6006,7 +6031,7 @@ function isKeychainStoredField(field) {
6006
6031
  var SECRET_CLEAR = { $secretClear: true };
6007
6032
  /** The `'***'` token D634 redaction writes for non-admins. */
6008
6033
  var LEGACY_DEVICE_REDACTION = "***";
6009
- function isRecord$6(value) {
6034
+ function isRecord$7(value) {
6010
6035
  return typeof value === "object" && value !== null && !Array.isArray(value);
6011
6036
  }
6012
6037
  function makeSecretMarker(ref) {
@@ -6017,12 +6042,12 @@ function makeSecretMarker(ref) {
6017
6042
  }
6018
6043
  /** A stored marker: an object whose `$secret` is a non-empty string. */
6019
6044
  function isSecretMarker(value) {
6020
- if (!isRecord$6(value)) return false;
6045
+ if (!isRecord$7(value)) return false;
6021
6046
  const ref = value["$secret"];
6022
6047
  return typeof ref === "string" && ref.length > 0;
6023
6048
  }
6024
6049
  function isSecretClear(value) {
6025
- return isRecord$6(value) && value["$secretClear"] === true;
6050
+ return isRecord$7(value) && value["$secretClear"] === true;
6026
6051
  }
6027
6052
  /**
6028
6053
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6405,6 +6430,53 @@ function emitReadiness(bus, params) {
6405
6430
  ts
6406
6431
  }));
6407
6432
  }
6433
+ /** Why a catalogue entry is not a runnable body of its declared kind. */
6434
+ var AddonMigrationDefinitionError = class extends Error {
6435
+ id;
6436
+ constructor(id, message) {
6437
+ super(`${id}: ${message}`);
6438
+ this.id = id;
6439
+ this.name = "AddonMigrationDefinitionError";
6440
+ }
6441
+ };
6442
+ /**
6443
+ * Bind a catalogue to the addon's ports. Throws {@link AddonMigrationDefinitionError} when
6444
+ * an entry's `bodyKind` does not match the body it carries, or is `sql` (a hub-only
6445
+ * body). A throwing body never escapes `execute`: it is reported as a failed result.
6446
+ */
6447
+ function defineAddonMigrations(catalogue, ports) {
6448
+ return catalogue.map((entry) => {
6449
+ const { meta } = entry;
6450
+ if ("plan" in entry) {
6451
+ if (meta.bodyKind !== "plan") throw new AddonMigrationDefinitionError(meta.id, `carries a plan body but declares "${meta.bodyKind}"`);
6452
+ return {
6453
+ meta,
6454
+ execute: () => guarded(async () => ({
6455
+ kind: "plan",
6456
+ plan: await entry.plan(ports)
6457
+ }))
6458
+ };
6459
+ }
6460
+ if (meta.bodyKind !== "procedure") throw new AddonMigrationDefinitionError(meta.id, `carries a procedure body but declares "${meta.bodyKind}"`);
6461
+ return {
6462
+ meta,
6463
+ execute: () => guarded(async () => ({
6464
+ kind: "procedure",
6465
+ result: await entry.procedure(ports)
6466
+ }))
6467
+ };
6468
+ });
6469
+ }
6470
+ async function guarded(work) {
6471
+ try {
6472
+ return await work();
6473
+ } catch (err) {
6474
+ return {
6475
+ kind: "failed",
6476
+ error: errMsg$17(err)
6477
+ };
6478
+ }
6479
+ }
6408
6480
  var NOT_RUN = {
6409
6481
  declared: false,
6410
6482
  snapshot: null,
@@ -6728,7 +6800,7 @@ var KeychainWriteRefusedError = class extends Error {
6728
6800
  }
6729
6801
  };
6730
6802
  var KEEP = { kind: "keep" };
6731
- function isRecord$5(value) {
6803
+ function isRecord$6(value) {
6732
6804
  return typeof value === "object" && value !== null && !Array.isArray(value);
6733
6805
  }
6734
6806
  function defaultMintId() {
@@ -6741,7 +6813,7 @@ function collectSecretMarkerRefs(value, out = []) {
6741
6813
  return out;
6742
6814
  }
6743
6815
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6744
- else if (isRecord$5(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6816
+ else if (isRecord$6(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6745
6817
  return out;
6746
6818
  }
6747
6819
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6796,7 +6868,7 @@ function rowId(row, idKey) {
6796
6868
  return null;
6797
6869
  }
6798
6870
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6799
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$5) : [];
6871
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$6) : [];
6800
6872
  if (!Array.isArray(incoming)) {
6801
6873
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6802
6874
  return {
@@ -6812,7 +6884,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6812
6884
  const kept = /* @__PURE__ */ new Set();
6813
6885
  const rows = [];
6814
6886
  for (const row of incoming) {
6815
- if (!isRecord$5(row)) {
6887
+ if (!isRecord$6(row)) {
6816
6888
  rows.push(row);
6817
6889
  continue;
6818
6890
  }
@@ -6837,7 +6909,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6837
6909
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6838
6910
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6839
6911
  case "object": {
6840
- if (!isRecord$5(incoming)) {
6912
+ if (!isRecord$6(incoming)) {
6841
6913
  if (incoming === void 0) return KEEP;
6842
6914
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6843
6915
  return {
@@ -6845,7 +6917,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6845
6917
  value: incoming
6846
6918
  };
6847
6919
  }
6848
- const storedObj = isRecord$5(stored) ? stored : {};
6920
+ const storedObj = isRecord$6(stored) ? stored : {};
6849
6921
  return {
6850
6922
  kind: "value",
6851
6923
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6968,7 +7040,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6968
7040
  value: items
6969
7041
  };
6970
7042
  }
6971
- if (isRecord$5(v)) {
7043
+ if (isRecord$6(v)) {
6972
7044
  const out = {};
6973
7045
  for (const [k, child] of Object.entries(v)) {
6974
7046
  const s = substitute(child);
@@ -7000,7 +7072,7 @@ var SecretOverwriteRefusedError = class extends Error {
7000
7072
  this.name = "SecretOverwriteRefusedError";
7001
7073
  }
7002
7074
  };
7003
- function isRecord$4(value) {
7075
+ function isRecord$5(value) {
7004
7076
  return typeof value === "object" && value !== null && !Array.isArray(value);
7005
7077
  }
7006
7078
  function resolvedValue(pass, marker) {
@@ -7029,7 +7101,7 @@ function inArray(pass, incoming, stored) {
7029
7101
  return incoming.map((item, index) => {
7030
7102
  const twin = stored[index];
7031
7103
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
7032
- if (isRecord$4(item) && isRecord$4(twin)) return inArrayRow(pass, item, twin);
7104
+ if (isRecord$5(item) && isRecord$5(twin)) return inArrayRow(pass, item, twin);
7033
7105
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
7034
7106
  return item;
7035
7107
  });
@@ -7040,7 +7112,7 @@ function inArrayRow(pass, incoming, stored) {
7040
7112
  const twin = stored[key];
7041
7113
  if (isSecretMarker(twin)) {
7042
7114
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
7043
- } else if (isRecord$4(value) && isRecord$4(twin)) out[key] = inArrayRow(pass, value, twin);
7115
+ } else if (isRecord$5(value) && isRecord$5(twin)) out[key] = inArrayRow(pass, value, twin);
7044
7116
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
7045
7117
  }
7046
7118
  return out;
@@ -7048,7 +7120,7 @@ function inArrayRow(pass, incoming, stored) {
7048
7120
  async function walk(pass, incoming, stored) {
7049
7121
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
7050
7122
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
7051
- if (!isRecord$4(incoming) || !isRecord$4(stored)) return incoming;
7123
+ if (!isRecord$5(incoming) || !isRecord$5(stored)) return incoming;
7052
7124
  const out = { ...incoming };
7053
7125
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
7054
7126
  return out;
@@ -7079,7 +7151,7 @@ async function restoreUnchangedSecrets(input) {
7079
7151
  function isJsonEqual(a, b) {
7080
7152
  if (Object.is(a, b)) return true;
7081
7153
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
7082
- if (isRecord$4(a) && isRecord$4(b)) {
7154
+ if (isRecord$5(a) && isRecord$5(b)) {
7083
7155
  const keys = Object.keys(a);
7084
7156
  if (keys.length !== Object.keys(b).length) return false;
7085
7157
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -7103,7 +7175,7 @@ function markerKeysOf(blob, owner) {
7103
7175
  }
7104
7176
  function nodeFromStored(value, owner) {
7105
7177
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
7106
- if (!isRecord$4(value)) return null;
7178
+ if (!isRecord$5(value)) return null;
7107
7179
  const children = /* @__PURE__ */ new Map();
7108
7180
  for (const [key, child] of Object.entries(value)) {
7109
7181
  const node = nodeFromStored(child, owner);
@@ -7574,7 +7646,7 @@ var BaseAddon = class {
7574
7646
  startMigration: (input) => api.startMigration.mutate(input),
7575
7647
  finishMigration: (input) => api.finishMigration.mutate(input)
7576
7648
  }, migrations, this.ctx.logger);
7577
- 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`);
7649
+ if (report.blockOwner.length > 0) throw new AddonMigrationsBlockedError(report.blockOwner);
7578
7650
  return report;
7579
7651
  }
7580
7652
  /**
@@ -7722,6 +7794,44 @@ var BaseAddon = class {
7722
7794
  return null;
7723
7795
  }
7724
7796
  /**
7797
+ * D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
7798
+ * provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
7799
+ * declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
7800
+ * {@link nodeSettingsSchema} and of {@link deviceDefaultsSchema} are disjoint, and a key never
7801
+ * contains `@` (guard `check-scoped-settings-declared`). SHAPE only: values are read by scope.
7802
+ */
7803
+ async clusterSettingsSchema(_cap) {
7804
+ return null;
7805
+ }
7806
+ /**
7807
+ * D986: the form shape of the settings one capability owns PER NODE, or `null`. Stored as
7808
+ * `addon-settings` rows `<addonId>.<field>@<nodeId>` carrying `nodeId` in the row data, so a
7809
+ * forgotten node's rows go in one central delete.
7810
+ */
7811
+ async nodeSettingsSchema(_cap) {
7812
+ return null;
7813
+ }
7814
+ /**
7815
+ * D986: the form shape of the FLEET DEFAULTS of the per-device settings one capability owns,
7816
+ * or `null`. Stored as `addon-settings` rows `<addonId>.<field>`; a device resolves its value
7817
+ * as device row, then this default, then the schema default (`resolveDeviceSettings`).
7818
+ */
7819
+ async deviceDefaultsSchema(_cap) {
7820
+ return null;
7821
+ }
7822
+ /**
7823
+ * The host's read of the scoped declarations: the schema one capability declares for `scope`,
7824
+ * or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
7825
+ * host asks this method.
7826
+ */
7827
+ async getScopedSettingsSchema(scope, cap) {
7828
+ switch (scope) {
7829
+ case "cluster": return this.clusterSettingsSchema(cap);
7830
+ case "node": return this.nodeSettingsSchema(cap);
7831
+ case "device-defaults": return this.deviceDefaultsSchema(cap);
7832
+ }
7833
+ }
7834
+ /**
7725
7835
  * What the create wizard and the integration edit page render for one instance: the addon's
7726
7836
  * per-instance schema when it declares one, else its global schema (what they always showed).
7727
7837
  */
@@ -8515,6 +8625,21 @@ function normalizeAddonInitResult(result) {
8515
8625
  if (Array.isArray(result)) return { providers: result };
8516
8626
  return result;
8517
8627
  }
8628
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8629
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
8630
+ var RECORD_DATABASES = ["settings", "events"];
8631
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8632
+ var RECORD_CLASSES = [
8633
+ "config",
8634
+ "ledger",
8635
+ "audit",
8636
+ "mirror",
8637
+ "ephemeral"
8638
+ ];
8639
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8640
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8641
+ var RECORD_BATCH_MAX = 1e3;
8642
+ var RECORD_QUERY_MAX = 1e3;
8518
8643
  /**
8519
8644
  * The share-view scope kinds a share-link token can carry. The hub mints
8520
8645
  * and validates them (`ShareViewGrantSchema` builds its
@@ -8539,21 +8664,6 @@ var PeerBytesTicketSchema = object({
8539
8664
  */
8540
8665
  declaredBytes: number().int().nonnegative().nullable()
8541
8666
  });
8542
- /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8543
- /** The files a kind may live in. `history` is device-history's (D850), never records. */
8544
- var RECORD_DATABASES = ["settings", "events"];
8545
- /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8546
- var RECORD_CLASSES = [
8547
- "config",
8548
- "ledger",
8549
- "audit",
8550
- "mirror",
8551
- "ephemeral"
8552
- ];
8553
- var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8554
- var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8555
- var RECORD_BATCH_MAX = 1e3;
8556
- var RECORD_QUERY_MAX = 1e3;
8557
8667
  /**
8558
8668
  * Record kinds (D881): the declaration an addon makes of one kind of fact, the
8559
8669
  * Zod row schema that describes it, and the helper that turns the two into the
@@ -9331,6 +9441,7 @@ var CAP_NAMES = Object.freeze([
9331
9441
  "backup",
9332
9442
  "battery",
9333
9443
  "binary",
9444
+ "board-key-source",
9334
9445
  "brightness",
9335
9446
  "broker",
9336
9447
  "button",
@@ -9373,6 +9484,7 @@ var CAP_NAMES = Object.freeze([
9373
9484
  "device-status",
9374
9485
  "dishwasher",
9375
9486
  "display-palette",
9487
+ "do-not-disturb",
9376
9488
  "doorbell",
9377
9489
  "embedding-encoder",
9378
9490
  "enum-sensor",
@@ -9393,6 +9505,7 @@ var CAP_NAMES = Object.freeze([
9393
9505
  "humidity-sensor",
9394
9506
  "image",
9395
9507
  "image-settings",
9508
+ "integration-instances",
9396
9509
  "integrations",
9397
9510
  "intercom",
9398
9511
  "ir-transmitter",
@@ -9450,6 +9563,7 @@ var CAP_NAMES = Object.freeze([
9450
9563
  "privacy-mask",
9451
9564
  "ptz",
9452
9565
  "ptz-autotrack",
9566
+ "pump-cycle",
9453
9567
  "reboot",
9454
9568
  "record-entries",
9455
9569
  "recording",
@@ -10132,6 +10246,10 @@ Object.freeze({
10132
10246
  "valueType": "string"
10133
10247
  }
10134
10248
  ],
10249
+ "do-not-disturb": [{
10250
+ "path": "enabled",
10251
+ "valueType": "boolean"
10252
+ }],
10135
10253
  "doorbell": [{
10136
10254
  "path": "lastPressedAt",
10137
10255
  "valueType": "number"
@@ -10738,18 +10856,6 @@ Object.freeze({
10738
10856
  "path": "pumpRunning",
10739
10857
  "valueType": "boolean"
10740
10858
  },
10741
- {
10742
- "path": "pumpIntervalEnabled",
10743
- "valueType": "boolean"
10744
- },
10745
- {
10746
- "path": "pumpOnTime",
10747
- "valueType": "number"
10748
- },
10749
- {
10750
- "path": "pumpOffTime",
10751
- "valueType": "number"
10752
- },
10753
10859
  {
10754
10860
  "path": "lastDrink",
10755
10861
  "valueType": "number"
@@ -10873,6 +10979,20 @@ Object.freeze({
10873
10979
  "valueType": "number"
10874
10980
  }
10875
10981
  ],
10982
+ "pump-cycle": [
10983
+ {
10984
+ "path": "enabled",
10985
+ "valueType": "boolean"
10986
+ },
10987
+ {
10988
+ "path": "onTime",
10989
+ "valueType": "number"
10990
+ },
10991
+ {
10992
+ "path": "offTime",
10993
+ "valueType": "number"
10994
+ }
10995
+ ],
10876
10996
  "recording-archive": [
10877
10997
  {
10878
10998
  "path": "deviceId",
@@ -11322,7 +11442,7 @@ object({
11322
11442
  params: record(string(), union([string(), number()])).optional()
11323
11443
  });
11324
11444
  //#endregion
11325
- //#region ../types/dist/composition-kKKOdFIG.mjs
11445
+ //#region ../types/dist/composition-BodkvOV0.mjs
11326
11446
  var AUDIO_ENCODER_BY_CODEC = {
11327
11447
  opus: "libopus",
11328
11448
  aac: "aac",
@@ -13054,7 +13174,14 @@ var CompositionForwardCommandSchema = object({
13054
13174
  method: string().min(1),
13055
13175
  args: record(string().min(1), CompositionForwardArgSchema).optional()
13056
13176
  });
13057
- var CompositionCommandTargetSchema = discriminatedUnion("kind", [CompositionForwardCommandSchema, CompositionCodeSourceSchema]);
13177
+ var CompositionCommandTargetSchema = discriminatedUnion("kind", [
13178
+ CompositionForwardCommandSchema,
13179
+ CompositionCodeSourceSchema,
13180
+ object({
13181
+ kind: literal("extension"),
13182
+ target: literal("remote")
13183
+ })
13184
+ ]);
13058
13185
  /** An item key inside an item-array cap (`consumables.items[<key>]`). */
13059
13186
  var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
13060
13187
  /**
@@ -13131,6 +13258,73 @@ var NodeColorIdSchema = _enum([
13131
13258
  "node-g",
13132
13259
  "node-h"
13133
13260
  ]);
13261
+ //#endregion
13262
+ //#region ../types/dist/index.mjs
13263
+ var SMTP_INBOUND_DEFAULT_PORT = 2525;
13264
+ var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
13265
+ var SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
13266
+ /** The text excerpt a message carries on the bus. */
13267
+ var SMTP_INBOUND_TEXT_MAX_CHARS = 4096;
13268
+ var PortSchema = number().int().min(1).max(65535);
13269
+ /** A recipient local-part: what stands before the `@`. */
13270
+ var SmtpRecipientSchema = string().min(1).max(64).regex(/^[A-Za-z0-9._+-]+$/);
13271
+ object({
13272
+ port: PortSchema.default(SMTP_INBOUND_DEFAULT_PORT),
13273
+ bindHost: string().min(1).default("0.0.0.0"),
13274
+ domain: string().min(1).default(SMTP_INBOUND_DEFAULT_DOMAIN),
13275
+ requireAuth: boolean().default(true),
13276
+ username: string().default(""),
13277
+ password: string().default("").meta({ secret: true }),
13278
+ starttls: boolean().default(false),
13279
+ maxMessageBytes: number().int().positive().default(SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES)
13280
+ });
13281
+ object({
13282
+ host: string().min(1).nullable(),
13283
+ hostReason: string().nullable(),
13284
+ port: PortSchema,
13285
+ domain: string().min(1),
13286
+ requireAuth: boolean(),
13287
+ username: string(),
13288
+ password: string(),
13289
+ starttls: boolean()
13290
+ });
13291
+ object({
13292
+ recipients: array(SmtpRecipientSchema).min(1),
13293
+ /**
13294
+ * Who is subscribing. A second `subscribe` with the same id REPLACES that subscriber's
13295
+ * recipients (the way a consumer that restarted, or lost a device, declares its set again);
13296
+ * a recipient held by another subscriber is refused with `smtp-inbound/recipient-claimed`.
13297
+ * Absent, the subscriber is anonymous and unique.
13298
+ */
13299
+ subscriberId: string().min(1).max(64).optional()
13300
+ });
13301
+ var SmtpInboundAttachmentSchema = object({
13302
+ filename: string(),
13303
+ contentType: string(),
13304
+ bytes: number().int().nonnegative()
13305
+ });
13306
+ /** The payload of one `broker.message` (the key is the recipient local-part). */
13307
+ var SmtpInboundMessageSchema = object({
13308
+ /** Monotonic per mailbox; a gap tells a consumer it missed an event. */
13309
+ seq: number().int().positive(),
13310
+ messageId: string(),
13311
+ receivedAt: number().int().nonnegative(),
13312
+ from: string(),
13313
+ to: string(),
13314
+ subject: string(),
13315
+ text: string().max(SMTP_INBOUND_TEXT_MAX_CHARS),
13316
+ attachments: array(SmtpInboundAttachmentSchema)
13317
+ });
13318
+ object({
13319
+ /** The newest seq issued so far (0 before any mail). */
13320
+ lastSeq: number().int().nonnegative(),
13321
+ /** The oldest seq still retained; messages below it are gone. */
13322
+ oldestSeq: number().int().nonnegative(),
13323
+ messages: array(object({
13324
+ key: string(),
13325
+ message: SmtpInboundMessageSchema
13326
+ }))
13327
+ });
13134
13328
  new Set([
13135
13329
  "track",
13136
13330
  "face",
@@ -14295,6 +14489,16 @@ var MigrationPlanSchema = object({ edits: array(discriminatedUnion("op", [
14295
14489
  precondition: PreconditionSchema
14296
14490
  })
14297
14491
  ])) });
14492
+ /** `JSON.stringify` with object keys sorted, so equal values spell the same. */
14493
+ function canonicalJson(value) {
14494
+ if (Array.isArray(value)) return `[${value.map((item) => canonicalJson(item)).join(",")}]`;
14495
+ 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(",")}}`;
14496
+ return JSON.stringify(value) ?? "null";
14497
+ }
14498
+ /** The precondition string for a value a plan read (`null` when it read nothing). */
14499
+ function preconditionOf(value) {
14500
+ return canonicalJson(value ?? null);
14501
+ }
14298
14502
  /**
14299
14503
  * What a `procedure` body reports. `already-done` means the rerun observed the
14300
14504
  * work finished (a crash between the work and the ledger row, or a manual fix)
@@ -16309,8 +16513,18 @@ var LogChannelDescriptorSchema = object({
16309
16513
  * the operator narrows to one camera, sees nothing, and concludes the code
16310
16514
  * path was never taken.
16311
16515
  */
16312
- perDevice: boolean()
16313
- });
16516
+ perDevice: boolean(),
16517
+ /**
16518
+ * What the channel is FOR, so the UI can list the channels an addon offers.
16519
+ *
16520
+ * - `diagnostic` (the default): a per-component diagnostic armed from the
16521
+ * Levels page, emitted at its declared level.
16522
+ * - `debug`: a `debug.<channel>` dump watched live for a short window
16523
+ * (`ctx.debug`). Always per-device, and its lines are denied by the log
16524
+ * ring unless somebody is watching that device.
16525
+ */
16526
+ kind: _enum(["diagnostic", "debug"]).default("diagnostic")
16527
+ }).refine((d) => d.kind !== "debug" || d.name.startsWith("debug.") && d.perDevice, { message: "a debug channel is named debug.<channel> and is per-device" });
16314
16528
  /**
16315
16529
  * An armed window over one channel, as the document hands it to a mirror.
16316
16530
  *
@@ -19617,24 +19831,52 @@ var APPLIANCE_CAP_VOCABULARY = {
19617
19831
  args: { on: false }
19618
19832
  },
19619
19833
  {
19620
- id: "petFountain.intervalOn",
19621
- method: "setPumpInterval",
19834
+ id: "petFountain.resetDailyConsumption",
19835
+ method: "resetDailyConsumption",
19836
+ label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
19837
+ phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
19838
+ icon: "rotate-ccw"
19839
+ }
19840
+ ],
19841
+ state: [{
19842
+ kind: "boolean",
19843
+ field: "empty",
19844
+ label: t("Tank empty", "Serbatoio vuoto"),
19845
+ whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
19846
+ whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
19847
+ icon: "droplet"
19848
+ }, {
19849
+ kind: "numeric",
19850
+ field: "waterLevel",
19851
+ quantity: t("the water level", "il livello dell’acqua"),
19852
+ label: t("Water level", "Livello dell’acqua"),
19853
+ unit: "%",
19854
+ icon: "droplets"
19855
+ }]
19856
+ },
19857
+ "pump-cycle": {
19858
+ scope: "device",
19859
+ noun: t("Pump cycle", "Ciclo della pompa"),
19860
+ actions: [
19861
+ {
19862
+ id: "pumpCycle.on",
19863
+ method: "setEnabled",
19622
19864
  label: t("Pump cycle on", "Ciclo pompa attivo"),
19623
19865
  phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
19624
19866
  icon: "timer",
19625
19867
  args: { on: true }
19626
19868
  },
19627
19869
  {
19628
- id: "petFountain.intervalOff",
19629
- method: "setPumpInterval",
19870
+ id: "pumpCycle.off",
19871
+ method: "setEnabled",
19630
19872
  label: t("Pump cycle off", "Ciclo pompa spento"),
19631
19873
  phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
19632
19874
  icon: "timer-off",
19633
19875
  args: { on: false }
19634
19876
  },
19635
19877
  {
19636
- id: "petFountain.pumpOnMinutes",
19637
- method: "setPumpOnMinutes",
19878
+ id: "pumpCycle.onMinutes",
19879
+ method: "setOnMinutes",
19638
19880
  label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
19639
19881
  phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
19640
19882
  icon: "timer",
@@ -19650,8 +19892,8 @@ var APPLIANCE_CAP_VOCABULARY = {
19650
19892
  }]
19651
19893
  },
19652
19894
  {
19653
- id: "petFountain.pumpOffMinutes",
19654
- method: "setPumpOffMinutes",
19895
+ id: "pumpCycle.offMinutes",
19896
+ method: "setOffMinutes",
19655
19897
  label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
19656
19898
  phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
19657
19899
  icon: "timer-off",
@@ -19665,35 +19907,63 @@ var APPLIANCE_CAP_VOCABULARY = {
19665
19907
  unit: "min"
19666
19908
  }
19667
19909
  }]
19668
- },
19669
- {
19670
- id: "petFountain.resetDailyConsumption",
19671
- method: "resetDailyConsumption",
19672
- label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
19673
- phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
19674
- icon: "rotate-ccw"
19675
19910
  }
19676
19911
  ],
19677
19912
  state: [{
19678
19913
  kind: "boolean",
19679
- field: "empty",
19680
- label: t("Tank empty", "Serbatoio vuoto"),
19681
- whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
19682
- whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
19683
- icon: "droplet"
19684
- }, {
19685
- kind: "numeric",
19686
- field: "waterLevel",
19687
- quantity: t("the water level", "il livello dell’acqua"),
19688
- label: t("Water level", "Livello dell’acqua"),
19689
- unit: "%",
19690
- icon: "droplets"
19914
+ field: "enabled",
19915
+ label: t("Pump cycle", "Ciclo pompa"),
19916
+ whenTrue: t("When {device} starts running its pump on a cycle", "Quando {device} inizia a far lavorare la pompa a ciclo"),
19917
+ whenFalse: t("When {device} runs its pump continuously", "Quando {device} fa lavorare la pompa in continuo"),
19918
+ icon: "timer"
19691
19919
  }]
19692
19920
  },
19693
19921
  "media-player": {
19694
19922
  scope: "device",
19695
19923
  noun: t("Media player", "Lettore multimediale"),
19696
19924
  actions: [
19925
+ {
19926
+ id: "media.turnOn",
19927
+ method: "turnOn",
19928
+ label: t("Turn on", "Accendi"),
19929
+ phrase: t("Turn on {device}", "Accendi {device}"),
19930
+ icon: "power"
19931
+ },
19932
+ {
19933
+ id: "media.turnOff",
19934
+ method: "turnOff",
19935
+ label: t("Turn off", "Spegni"),
19936
+ phrase: t("Turn off {device}", "Spegni {device}"),
19937
+ icon: "power"
19938
+ },
19939
+ {
19940
+ id: "media.volumeUp",
19941
+ method: "volumeUp",
19942
+ label: t("Volume up", "Alza il volume"),
19943
+ phrase: t("Raise the volume of {device}", "Alza il volume di {device}"),
19944
+ icon: "volume-2"
19945
+ },
19946
+ {
19947
+ id: "media.volumeDown",
19948
+ method: "volumeDown",
19949
+ label: t("Volume down", "Abbassa il volume"),
19950
+ phrase: t("Lower the volume of {device}", "Abbassa il volume di {device}"),
19951
+ icon: "volume-2"
19952
+ },
19953
+ {
19954
+ id: "media.channelUp",
19955
+ method: "channelUp",
19956
+ label: t("Channel up", "Canale successivo"),
19957
+ phrase: t("Go to the next channel on {device}", "Passa al canale successivo su {device}"),
19958
+ icon: "skip-forward"
19959
+ },
19960
+ {
19961
+ id: "media.channelDown",
19962
+ method: "channelDown",
19963
+ label: t("Channel down", "Canale precedente"),
19964
+ phrase: t("Go to the previous channel on {device}", "Torna al canale precedente su {device}"),
19965
+ icon: "skip-back"
19966
+ },
19697
19967
  {
19698
19968
  id: "media.play",
19699
19969
  method: "play",
@@ -20373,6 +20643,33 @@ var APPLIANCE_CAP_VOCABULARY = {
20373
20643
  }
20374
20644
  ]
20375
20645
  },
20646
+ "do-not-disturb": {
20647
+ scope: "device",
20648
+ noun: t("Do not disturb", "Non disturbare"),
20649
+ actions: [{
20650
+ id: "dnd.on",
20651
+ method: "setEnabled",
20652
+ label: t("Do not disturb on", "Attiva Non disturbare"),
20653
+ phrase: t("Turn on Do not disturb on {device}", "Attiva Non disturbare su {device}"),
20654
+ icon: "bell-off",
20655
+ args: { enabled: true }
20656
+ }, {
20657
+ id: "dnd.off",
20658
+ method: "setEnabled",
20659
+ label: t("Do not disturb off", "Disattiva Non disturbare"),
20660
+ phrase: t("Turn off Do not disturb on {device}", "Disattiva Non disturbare su {device}"),
20661
+ icon: "bell",
20662
+ args: { enabled: false }
20663
+ }],
20664
+ state: [{
20665
+ kind: "boolean",
20666
+ field: "enabled",
20667
+ label: t("Do not disturb", "Non disturbare"),
20668
+ whenTrue: t("When Do not disturb turns on on {device}", "Quando {device} attiva Non disturbare"),
20669
+ whenFalse: t("When Do not disturb turns off on {device}", "Quando {device} disattiva Non disturbare"),
20670
+ icon: "bell-off"
20671
+ }]
20672
+ },
20376
20673
  update: {
20377
20674
  scope: "device",
20378
20675
  noun: t("Firmware update", "Aggiornamento firmware"),
@@ -21553,6 +21850,7 @@ var SYSTEM_CAP_VOCABULARY = {
21553
21850
  "audio-analyzer": system(PIPELINE),
21554
21851
  "audio-codec": system(INTERNAL),
21555
21852
  "auth-provider": system(IDENTITY),
21853
+ "board-key-source": system(INTERNAL),
21556
21854
  backup: system("system backups — run and restored from the Backups page"),
21557
21855
  broker: system("message-broker connections — configured, not actuated"),
21558
21856
  "calendar-source": system(INTERNAL),
@@ -21587,6 +21885,7 @@ var SYSTEM_CAP_VOCABULARY = {
21587
21885
  "load-contribution": system(INTERNAL),
21588
21886
  "local-network": system(NETWORK),
21589
21887
  "log-channels": system(INTERNAL),
21888
+ "integration-instances": system(INTERNAL),
21590
21889
  "log-destination": system(INTERNAL),
21591
21890
  "login-method": system(IDENTITY),
21592
21891
  "mesh-network": system(NETWORK),
@@ -42429,14 +42728,16 @@ var DeviceIsLeafSchema = object({
42429
42728
  });
42430
42729
  /**
42431
42730
  * True when the camera currently has a PARKED object matching `subjects` in at
42432
- * least one of `zones`. Reads the zone-analytics snapshot through the same
42731
+ * least one of `zones` (`minCount` of them, default one). Reads the zone-analytics snapshot through the same
42433
42732
  * mirror as every other state leaf, so a dropped event never decides it (D49).
42434
42733
  */
42435
42734
  var StationaryPresentLeafSchema = object({
42436
42735
  kind: literal("stationary-present"),
42437
42736
  deviceId: number().int().nonnegative(),
42438
42737
  subjects: array(StationarySubjectSchema).min(1).optional(),
42439
- zones: array(string().min(1)).min(1).optional()
42738
+ zones: array(string().min(1)).min(1).optional(),
42739
+ /** How many matching parked objects must be there; absent means one. */
42740
+ minCount: number().int().positive().optional()
42440
42741
  });
42441
42742
  /**
42442
42743
  * The escape hatch: the bounded expression engine over named device bindings.
@@ -42948,6 +43249,28 @@ function convertLegacyRecipe(legacy) {
42948
43249
  * it. The output type is always the new one.
42949
43250
  */
42950
43251
  var AutomationRecipeSchema = union([CurrentAutomationRecipeSchema, LegacyAutomationRecipeSchema.transform(convertLegacyRecipe)]);
43252
+ var DETECTION_DESCRIPTIONS = {
43253
+ deviceId: "the camera that saw it",
43254
+ className: "what it saw",
43255
+ trackId: "the track",
43256
+ score: "how sure the detector was",
43257
+ label: "the label it matched (a name, a plate), empty when none"
43258
+ };
43259
+ var STATIONARY_DESCRIPTIONS = {
43260
+ deviceId: "the camera that saw it",
43261
+ className: "what it saw",
43262
+ zones: "the zones it is in",
43263
+ phase: "appeared or departed",
43264
+ entryId: "the stopped object"
43265
+ };
43266
+ function describe$1(descriptions) {
43267
+ return Object.entries(descriptions).map(([name, description]) => ({
43268
+ name,
43269
+ description
43270
+ }));
43271
+ }
43272
+ describe$1(DETECTION_DESCRIPTIONS);
43273
+ describe$1(STATIONARY_DESCRIPTIONS);
42951
43274
  new Set(Object.values(COCO_TO_MACRO.mapping));
42952
43275
  /**
42953
43276
  * Schedulers (D983) — an entity that performs actions over the day.
@@ -43709,7 +44032,7 @@ var TargetKindCapsSchema = object({
43709
44032
  * the union is large and not meant for runtime validation here; the exported
43710
44033
  * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
43711
44034
  */
43712
- var ConfigSchemaPassthrough$3 = unknown();
44035
+ var ConfigSchemaPassthrough$4 = unknown();
43713
44036
  var TargetKindSchema = object({
43714
44037
  kind: string(),
43715
44038
  label: string(),
@@ -43746,7 +44069,7 @@ var TargetKindSchema = object({
43746
44069
  * its raster path, which is the safe default for an unknown image.
43747
44070
  */
43748
44071
  iconMediaType: string().optional(),
43749
- configSchema: ConfigSchemaPassthrough$3,
44072
+ configSchema: ConfigSchemaPassthrough$4,
43750
44073
  /**
43751
44074
  * The config keys that decide WHERE this kind's secrets are sent (server,
43752
44075
  * base URL, instance, chat, recipient). A save that changes any of them
@@ -46058,6 +46381,49 @@ object({
46058
46381
  lastChangedAt: number()
46059
46382
  });
46060
46383
  DeviceType.Sensor;
46384
+ /**
46385
+ * Why a board key could not be read. Typed so a caller reports the cause and
46386
+ * never treats "could not read" as "has no key" (D49).
46387
+ */
46388
+ var BoardKeyFailureReasonSchema = _enum([
46389
+ "unknown-source",
46390
+ "not-admin",
46391
+ "no-builder",
46392
+ "no-ingress-url",
46393
+ "unreachable",
46394
+ "unknown-board",
46395
+ "no-encryption-key",
46396
+ "unreadable-config"
46397
+ ]);
46398
+ var BoardKeySourceSchema = object({
46399
+ sourceId: string(),
46400
+ name: string()
46401
+ });
46402
+ var BoardKeyBoardSchema = object({
46403
+ /** The builder's file name, e.g. `kitchen.yaml`: the handle `getBoardKey` takes. */
46404
+ configuration: string(),
46405
+ /** The node name the builder gives the board. */
46406
+ name: string(),
46407
+ /** The address the builder knows the board by, when it has one. */
46408
+ address: string().nullable()
46409
+ });
46410
+ var BoardKeyFailureSchema = object({
46411
+ ok: literal(false),
46412
+ reason: BoardKeyFailureReasonSchema,
46413
+ detail: string().optional()
46414
+ });
46415
+ var ListBoardsResultSchema = discriminatedUnion("ok", [object({
46416
+ ok: literal(true),
46417
+ boards: array(BoardKeyBoardSchema).readonly()
46418
+ }), BoardKeyFailureSchema]);
46419
+ var GetBoardKeyResultSchema = discriminatedUnion("ok", [object({
46420
+ ok: literal(true),
46421
+ key: string()
46422
+ }), BoardKeyFailureSchema]);
46423
+ method(_void(), array(BoardKeySourceSchema).readonly(), { auth: "admin" }), method(object({ sourceId: string().min(1) }), ListBoardsResultSchema, { auth: "admin" }), method(object({
46424
+ sourceId: string().min(1),
46425
+ configuration: string().min(1)
46426
+ }), GetBoardKeyResultSchema, { auth: "admin" });
46061
46427
  object({
46062
46428
  /** Current level as 0..100 inclusive. Firmware-reported. */
46063
46429
  level: number().min(0).max(100).meta(readingMeta("percentage")),
@@ -48151,6 +48517,188 @@ DeviceType.Control, method(object({
48151
48517
  kind: "mutation",
48152
48518
  auth: "protected"
48153
48519
  });
48520
+ /**
48521
+ * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
48522
+ * Apple TV, Spotify, Roku, generic OTT receivers, …) on
48523
+ * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
48524
+ * surface — those use `DeviceType.Camera` + the broker pipeline.
48525
+ *
48526
+ * The cap declares a wide method surface; not every backend supports
48527
+ * every method. Drivers signal sub-capability via the
48528
+ * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
48529
+ * corresponding method) so the UI gates buttons without a slice
48530
+ * fetch — same pattern as `PanTiltZoom` for cameras.
48531
+ */
48532
+ var MediaPlayerStateSchema = _enum([
48533
+ "off",
48534
+ "on",
48535
+ "idle",
48536
+ "playing",
48537
+ "paused",
48538
+ "buffering",
48539
+ "standby"
48540
+ ]);
48541
+ var MediaPlayerRepeatSchema = _enum([
48542
+ "off",
48543
+ "all",
48544
+ "one"
48545
+ ]);
48546
+ var MediaInfoSchema = object({
48547
+ /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
48548
+ * `podcast`, …). */
48549
+ type: string(),
48550
+ /** Human-readable title. */
48551
+ title: string(),
48552
+ /** Optional artist / channel / station label. */
48553
+ artist: string().optional(),
48554
+ /** Optional album / season / show name. */
48555
+ album: string().optional(),
48556
+ /** Optional cover-art / thumbnail URL. */
48557
+ imageUrl: string().optional()
48558
+ });
48559
+ /**
48560
+ * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
48561
+ * the device said so. `assumed`: the driver has no feedback (infrared) and
48562
+ * tracks what it last SENT; it moves only after a send was accepted, and a
48563
+ * human at the real remote makes it wrong. A UI shows an assumed value as a
48564
+ * guess, never as a reading.
48565
+ */
48566
+ var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
48567
+ /** The fields of a media-player status a driver can only guess. */
48568
+ var MediaPlayerAssumedFieldSchema = _enum([
48569
+ "state",
48570
+ "volumeLevel",
48571
+ "isMuted",
48572
+ "source"
48573
+ ]);
48574
+ var MediaPlayerStatusSchema = object({
48575
+ /** Playback lifecycle state. */
48576
+ state: MediaPlayerStateSchema,
48577
+ /**
48578
+ * Whether the state fields are readings or the driver's own bookkeeping.
48579
+ * A slice written before this field existed parses as `reported`.
48580
+ */
48581
+ stateSource: MediaPlayerStateSourceSchema.default("reported"),
48582
+ /**
48583
+ * Which fields are the driver's own guess. `stateSource` is `assumed` when
48584
+ * this is not empty; a field not listed here is a reading even then (power
48585
+ * from a running-state source, mute guessed from the last send).
48586
+ */
48587
+ assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
48588
+ /** Volume as 0..100 inclusive. Null when the device has no volume
48589
+ * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
48590
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
48591
+ /** Mute toggle distinct from volume=0. Null when no mute surface.
48592
+ * Pair with `DeviceFeature.MediaPlayerMute`. */
48593
+ isMuted: boolean().nullable(),
48594
+ /** Active source / input. Empty when no source surface. */
48595
+ source: string(),
48596
+ /** Selectable sources. Empty when no source surface.
48597
+ * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
48598
+ availableSources: array(string()),
48599
+ /** Currently-playing media info. Null when nothing is playing. */
48600
+ currentMedia: MediaInfoSchema.nullable(),
48601
+ /** Current playback position in ms. Null when not seekable or
48602
+ * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
48603
+ position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
48604
+ /** Total duration of the current media in ms. Null when unknown
48605
+ * (live stream) or nothing is playing. */
48606
+ duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
48607
+ /** Shuffle toggle. Null when no shuffle surface.
48608
+ * Pair with `DeviceFeature.MediaPlayerShuffle`. */
48609
+ shuffle: boolean().nullable(),
48610
+ /** Repeat mode. Null when no repeat surface.
48611
+ * Pair with `DeviceFeature.MediaPlayerRepeat`. */
48612
+ repeat: MediaPlayerRepeatSchema.nullable(),
48613
+ /** Ms epoch when the slice was last updated. */
48614
+ lastChangedAt: number()
48615
+ });
48616
+ var stepInput = object({
48617
+ deviceId: number().int().nonnegative(),
48618
+ /** How many presses: the caller's count (Alexa `volumeSteps`, `channelCount`). */
48619
+ steps: number().int().min(1).max(50).default(1)
48620
+ });
48621
+ var deviceOnly = object({ deviceId: number().int().nonnegative() });
48622
+ DeviceType.MediaPlayer, method(deviceOnly, _void(), {
48623
+ kind: "mutation",
48624
+ auth: "protected"
48625
+ }), method(deviceOnly, _void(), {
48626
+ kind: "mutation",
48627
+ auth: "protected"
48628
+ }), method(stepInput, _void(), {
48629
+ kind: "mutation",
48630
+ auth: "protected"
48631
+ }), method(stepInput, _void(), {
48632
+ kind: "mutation",
48633
+ auth: "protected"
48634
+ }), method(stepInput, _void(), {
48635
+ kind: "mutation",
48636
+ auth: "protected"
48637
+ }), method(stepInput, _void(), {
48638
+ kind: "mutation",
48639
+ auth: "protected"
48640
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48641
+ kind: "mutation",
48642
+ auth: "protected"
48643
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48644
+ kind: "mutation",
48645
+ auth: "protected"
48646
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48647
+ kind: "mutation",
48648
+ auth: "protected"
48649
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48650
+ kind: "mutation",
48651
+ auth: "protected"
48652
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48653
+ kind: "mutation",
48654
+ auth: "protected"
48655
+ }), method(object({
48656
+ deviceId: number().int().nonnegative(),
48657
+ position: number().int().nonnegative()
48658
+ }), _void(), {
48659
+ kind: "mutation",
48660
+ auth: "protected"
48661
+ }), method(object({
48662
+ deviceId: number().int().nonnegative(),
48663
+ volumeLevel: number().min(0).max(100)
48664
+ }), _void(), {
48665
+ kind: "mutation",
48666
+ auth: "protected"
48667
+ }), method(object({
48668
+ deviceId: number().int().nonnegative(),
48669
+ muted: boolean()
48670
+ }), _void(), {
48671
+ kind: "mutation",
48672
+ auth: "protected"
48673
+ }), method(object({
48674
+ deviceId: number().int().nonnegative(),
48675
+ shuffle: boolean()
48676
+ }), _void(), {
48677
+ kind: "mutation",
48678
+ auth: "protected"
48679
+ }), method(object({
48680
+ deviceId: number().int().nonnegative(),
48681
+ repeat: MediaPlayerRepeatSchema
48682
+ }), _void(), {
48683
+ kind: "mutation",
48684
+ auth: "protected"
48685
+ }), method(object({
48686
+ deviceId: number().int().nonnegative(),
48687
+ source: string().min(1)
48688
+ }), _void(), {
48689
+ kind: "mutation",
48690
+ auth: "protected"
48691
+ }), method(object({
48692
+ deviceId: number().int().nonnegative(),
48693
+ /** Media identifier / URL. */
48694
+ mediaId: string().min(1),
48695
+ /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
48696
+ * passes it through to the upstream service. */
48697
+ mediaType: string().min(1)
48698
+ }), _void(), {
48699
+ kind: "mutation",
48700
+ auth: "protected"
48701
+ });
48154
48702
  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;
48155
48703
  var NUMBER = {
48156
48704
  kind: "fixed",
@@ -50214,6 +50762,45 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
50214
50762
  auth: "admin"
50215
50763
  });
50216
50764
  /**
50765
+ * What the passive listener of `local-network` saw on the wire, before any
50766
+ * provider classified it. Device-manager turns an observation into the hits
50767
+ * of the providers whose declared discovery modes it matches.
50768
+ */
50769
+ var DiscoveryObservationSchema = discriminatedUnion("kind", [object({
50770
+ kind: literal("mdns"),
50771
+ /** Normalised DNS-SD service type, e.g. `_esphomelib._tcp`. */
50772
+ serviceType: string(),
50773
+ instance: string(),
50774
+ host: string(),
50775
+ /** The A record address when the announcement carried one. */
50776
+ address: string().nullable(),
50777
+ port: number().int(),
50778
+ txt: record(string(), string())
50779
+ }), object({
50780
+ kind: literal("ssdp"),
50781
+ /** Sender address of the datagram. */
50782
+ host: string(),
50783
+ port: number().int(),
50784
+ /** `NT` of a NOTIFY, `ST` of a search response. */
50785
+ target: string(),
50786
+ headers: record(string(), string())
50787
+ })]);
50788
+ object({
50789
+ addonId: string(),
50790
+ candidate: DiscoveryCandidateSchema,
50791
+ firstSeenAt: number(),
50792
+ lastSeenAt: number(),
50793
+ dismissed: boolean()
50794
+ });
50795
+ var DiscoveryProposalSchema = object({
50796
+ id: string(),
50797
+ addonId: string(),
50798
+ candidate: DiscoveryCandidateSchema,
50799
+ firstSeenAt: number(),
50800
+ lastSeenAt: number(),
50801
+ dismissed: boolean()
50802
+ });
50803
+ /**
50217
50804
  * Device Manager capability — hub-side singleton that unifies device persistence,
50218
50805
  * live registry access, and all management operations into a single tRPC surface.
50219
50806
  *
@@ -50942,6 +51529,19 @@ method(object({
50942
51529
  }), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
50943
51530
  kind: "mutation",
50944
51531
  auth: "admin"
51532
+ }), method(object({}), object({ proposals: array(DiscoveryProposalSchema).readonly() }), { auth: "admin" }), method(object({ id: string() }), object({ dismissed: boolean() }), {
51533
+ kind: "mutation",
51534
+ auth: "admin"
51535
+ }), method(object({ observations: array(DiscoveryObservationSchema).max(512) }), object({ proposed: number().int() }), {
51536
+ kind: "mutation",
51537
+ auth: "admin"
51538
+ }), method(object({}), object({
51539
+ providers: number().int(),
51540
+ proposed: number().int()
51541
+ }), {
51542
+ kind: "mutation",
51543
+ auth: "admin",
51544
+ timeoutMs: 12e4
50945
51545
  }), method(object({ addonId: string() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string() }), unknown(), { auth: "admin" }), method(object({
50946
51546
  deviceId: number(),
50947
51547
  key: string(),
@@ -51769,7 +52369,7 @@ object({
51769
52369
  /** Ms epoch of the last value received from the appliance; 0 = never. */
51770
52370
  lastFetchedAt: number()
51771
52371
  });
51772
- var DeviceIdSchema$1 = number().int().nonnegative();
52372
+ var DeviceIdSchema$2 = number().int().nonnegative();
51773
52373
  /** A value a program option or setting can take. */
51774
52374
  var DishwasherValueSchema = union([
51775
52375
  boolean(),
@@ -51833,77 +52433,77 @@ var DishwasherOptionsSchema = object({
51833
52433
  options: array(DishwasherOptionDescriptorSchema)
51834
52434
  });
51835
52435
  DeviceType.Dishwasher, method(object({
51836
- deviceId: DeviceIdSchema$1,
52436
+ deviceId: DeviceIdSchema$2,
51837
52437
  program: string().min(1).optional(),
51838
52438
  options: record(string(), DishwasherValueSchema).optional()
51839
52439
  }), _void(), {
51840
52440
  kind: "mutation",
51841
52441
  auth: "protected"
51842
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52442
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51843
52443
  kind: "mutation",
51844
52444
  auth: "protected"
51845
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52445
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51846
52446
  kind: "mutation",
51847
52447
  auth: "protected"
51848
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52448
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51849
52449
  kind: "mutation",
51850
52450
  auth: "protected"
51851
52451
  }), method(object({
51852
- deviceId: DeviceIdSchema$1,
52452
+ deviceId: DeviceIdSchema$2,
51853
52453
  program: string().min(1)
51854
52454
  }), _void(), {
51855
52455
  kind: "mutation",
51856
52456
  auth: "protected"
51857
52457
  }), method(object({
51858
- deviceId: DeviceIdSchema$1,
52458
+ deviceId: DeviceIdSchema$2,
51859
52459
  on: boolean()
51860
52460
  }), _void(), {
51861
52461
  kind: "mutation",
51862
52462
  auth: "protected"
51863
52463
  }), method(object({
51864
- deviceId: DeviceIdSchema$1,
52464
+ deviceId: DeviceIdSchema$2,
51865
52465
  on: boolean()
51866
52466
  }), _void(), {
51867
52467
  kind: "mutation",
51868
52468
  auth: "protected"
51869
52469
  }), method(object({
51870
- deviceId: DeviceIdSchema$1,
52470
+ deviceId: DeviceIdSchema$2,
51871
52471
  on: boolean()
51872
52472
  }), _void(), {
51873
52473
  kind: "mutation",
51874
52474
  auth: "protected"
51875
52475
  }), method(object({
51876
- deviceId: DeviceIdSchema$1,
52476
+ deviceId: DeviceIdSchema$2,
51877
52477
  on: boolean()
51878
52478
  }), _void(), {
51879
52479
  kind: "mutation",
51880
52480
  auth: "protected"
51881
52481
  }), method(object({
51882
- deviceId: DeviceIdSchema$1,
52482
+ deviceId: DeviceIdSchema$2,
51883
52483
  on: boolean()
51884
52484
  }), _void(), {
51885
52485
  kind: "mutation",
51886
52486
  auth: "protected"
51887
52487
  }), method(object({
51888
- deviceId: DeviceIdSchema$1,
52488
+ deviceId: DeviceIdSchema$2,
51889
52489
  on: boolean()
51890
52490
  }), _void(), {
51891
52491
  kind: "mutation",
51892
52492
  auth: "protected"
51893
52493
  }), method(object({
51894
- deviceId: DeviceIdSchema$1,
52494
+ deviceId: DeviceIdSchema$2,
51895
52495
  on: boolean()
51896
52496
  }), _void(), {
51897
52497
  kind: "mutation",
51898
52498
  auth: "protected"
51899
52499
  }), method(object({
51900
- deviceId: DeviceIdSchema$1,
52500
+ deviceId: DeviceIdSchema$2,
51901
52501
  key: string().min(1),
51902
52502
  value: DishwasherValueSchema
51903
52503
  }), _void(), {
51904
52504
  kind: "mutation",
51905
52505
  auth: "protected"
51906
- }), method(object({ deviceId: DeviceIdSchema$1 }), DishwasherOptionsSchema, { auth: "protected" });
52506
+ }), method(object({ deviceId: DeviceIdSchema$2 }), DishwasherOptionsSchema, { auth: "protected" });
51907
52507
  /**
51908
52508
  * Palette entry ids (D939). Audio is the one gradient; `audio-*` leaves are
51909
52509
  * not entries. `heatmapScrub` is a mark, not an event kind.
@@ -52307,6 +52907,19 @@ method(_void(), paletteResultSchema, {
52307
52907
  kind: "mutation",
52308
52908
  auth: "admin"
52309
52909
  });
52910
+ object({
52911
+ /** True while Do Not Disturb is on; null when unknown. */
52912
+ enabled: boolean().nullable().meta({ label: "Do not disturb" }),
52913
+ /** Ms epoch of the last read or write that set `enabled`. */
52914
+ lastChangedAt: number()
52915
+ });
52916
+ DeviceType.MediaPlayer, method(object({
52917
+ deviceId: number().int(),
52918
+ enabled: boolean()
52919
+ }), _void(), {
52920
+ kind: "mutation",
52921
+ auth: "protected"
52922
+ });
52310
52923
  DeviceType.Camera;
52311
52924
  object({
52312
52925
  /** Ms epoch of the last press. null = never observed since this provider started. */
@@ -53605,6 +54218,89 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
53605
54218
  auth: "admin"
53606
54219
  });
53607
54220
  /**
54221
+ * `integration-instances` - the connection of an addon that holds ONE or SEVERAL
54222
+ * (an account, a relay, a destination) as typed records (D985, D986). The addon's
54223
+ * own function page reads and writes them (Logging for Loki); the Integrations
54224
+ * page lists only the integrations that bring devices (D996).
54225
+ *
54226
+ * A collection of providers: each addon that holds connections registers one and a
54227
+ * caller reaches a provider with the pinned `addonId`.
54228
+ *
54229
+ * Identity: the instance id is immutable and opaque to the caller. A record the
54230
+ * Loki migration made keeps the `integrations` registry id it was created under
54231
+ * (`int_NNNN`); a single instance made by its function page takes the addon id.
54232
+ * `name` is the editable label.
54233
+ *
54234
+ * Secrets: every field the instance kind marks `.meta({ secret: true })` reaches
54235
+ * the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
54236
+ * or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
54237
+ * clears it.
54238
+ */
54239
+ var ConfigSchemaPassthrough$3 = custom();
54240
+ var IntegrationInstanceIdSchema = string().min(1);
54241
+ var IntegrationInstanceDescriptionSchema = object({
54242
+ /** `single`: at most one instance can exist (Loki). `multiple`: an account each. */
54243
+ instanceMode: _enum(["single", "multiple"]),
54244
+ /** What the instance is, for the UI (`destination`, `relay`, `account`). */
54245
+ kind: string(),
54246
+ /** True when `testInstance` really probes the remote. */
54247
+ canTest: boolean()
54248
+ });
54249
+ var IntegrationInstanceStatusSchema = object({
54250
+ state: _enum([
54251
+ "ok",
54252
+ "off",
54253
+ "error",
54254
+ "unknown"
54255
+ ]),
54256
+ detail: string().optional()
54257
+ });
54258
+ var IntegrationInstanceSchema = object({
54259
+ id: IntegrationInstanceIdSchema,
54260
+ name: string(),
54261
+ /** The addon's own rule (an URL is present, a client id is present...). */
54262
+ configured: boolean(),
54263
+ /**
54264
+ * The instance's own on/off switch (D996): always present, derived from the record body
54265
+ * (`enabled !== false`, so a row written before the field existed is on).
54266
+ */
54267
+ enabled: boolean(),
54268
+ /** Values for the instance form; a secret is a `SecretFieldView`, never text. */
54269
+ formValues: record(string(), unknown()),
54270
+ status: IntegrationInstanceStatusSchema.optional()
54271
+ });
54272
+ var IntegrationInstancePatchSchema = object({
54273
+ id: IntegrationInstanceIdSchema,
54274
+ name: string().min(1).optional(),
54275
+ /** Omitted / '' / redaction token keeps a secret; `{ $secretClear: true }` clears it. */
54276
+ values: record(string(), unknown())
54277
+ });
54278
+ 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({
54279
+ id: IntegrationInstanceIdSchema,
54280
+ name: string().min(1)
54281
+ }), object({ id: string() }), {
54282
+ kind: "mutation",
54283
+ auth: "admin"
54284
+ }), method(IntegrationInstancePatchSchema, object({ ok: literal(true) }), {
54285
+ kind: "mutation",
54286
+ auth: "admin"
54287
+ }), method(object({
54288
+ id: IntegrationInstanceIdSchema,
54289
+ enabled: boolean()
54290
+ }), object({ ok: literal(true) }), {
54291
+ kind: "mutation",
54292
+ auth: "admin"
54293
+ }), method(object({ id: IntegrationInstanceIdSchema }), object({ ok: literal(true) }), {
54294
+ kind: "mutation",
54295
+ auth: "admin"
54296
+ }), optionalMethod(object({
54297
+ id: IntegrationInstanceIdSchema.nullable(),
54298
+ values: record(string(), unknown())
54299
+ }), TestConnectionResultSchema$1, {
54300
+ kind: "mutation",
54301
+ auth: "admin"
54302
+ });
54303
+ /**
53608
54304
  * Two-way audio / talk-back cap. Clients open a WebRTC audio-only
53609
54305
  * session (server-initiated offer pattern, identical to the main
53610
54306
  * video WebRTC flow) and the browser captures the mic; the server
@@ -54193,6 +54889,14 @@ var LlmGenerateBaseInputSchema = object({
54193
54889
  topP: number().min(0).max(1).optional(),
54194
54890
  /** Per-call override of the profile default (top-k sampling). */
54195
54891
  topK: number().int().positive().optional(),
54892
+ /** Per-call override of `profile.reasoningEffort`. Sent only to a kind whose
54893
+ * descriptor offers the field; a kind that does not never sends it. */
54894
+ reasoningEffort: _enum([
54895
+ "off",
54896
+ "low",
54897
+ "medium",
54898
+ "high"
54899
+ ]).optional(),
54196
54900
  /** Per-call override of `profile.timeoutMs` — the total generation bound. */
54197
54901
  timeoutMs: number().int().positive().optional(),
54198
54902
  /** Per-call override; beats both the consumer table and the profile. */
@@ -54484,7 +55188,10 @@ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind i
54484
55188
  var LlmModelFeaturesSchema = object({
54485
55189
  vision: boolean(),
54486
55190
  tools: boolean(),
54487
- streaming: boolean()
55191
+ streaming: boolean(),
55192
+ /** Whether the model thinks before it answers. `null` = the endpoint does not
55193
+ * say; an editor then still offers the switch (unknown is not "no"). */
55194
+ reasoning: boolean().nullable().optional()
54488
55195
  });
54489
55196
  /** One model a provider offers. `features` overrides the kind's defaults, per field. */
54490
55197
  var LlmModelInfoSchema = object({
@@ -55575,164 +56282,6 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
55575
56282
  ]);
55576
56283
  method(_void(), array(LoginMethodContributionSchema).readonly());
55577
56284
  /**
55578
- * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
55579
- * Apple TV, Spotify, Roku, generic OTT receivers, …) on
55580
- * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
55581
- * surface — those use `DeviceType.Camera` + the broker pipeline.
55582
- *
55583
- * The cap declares a wide method surface; not every backend supports
55584
- * every method. Drivers signal sub-capability via the
55585
- * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
55586
- * corresponding method) so the UI gates buttons without a slice
55587
- * fetch — same pattern as `PanTiltZoom` for cameras.
55588
- */
55589
- var MediaPlayerStateSchema = _enum([
55590
- "off",
55591
- "on",
55592
- "idle",
55593
- "playing",
55594
- "paused",
55595
- "buffering",
55596
- "standby"
55597
- ]);
55598
- var MediaPlayerRepeatSchema = _enum([
55599
- "off",
55600
- "all",
55601
- "one"
55602
- ]);
55603
- var MediaInfoSchema = object({
55604
- /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
55605
- * `podcast`, …). */
55606
- type: string(),
55607
- /** Human-readable title. */
55608
- title: string(),
55609
- /** Optional artist / channel / station label. */
55610
- artist: string().optional(),
55611
- /** Optional album / season / show name. */
55612
- album: string().optional(),
55613
- /** Optional cover-art / thumbnail URL. */
55614
- imageUrl: string().optional()
55615
- });
55616
- /**
55617
- * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
55618
- * the device said so. `assumed`: the driver has no feedback (infrared) and
55619
- * tracks what it last SENT; it moves only after a send was accepted, and a
55620
- * human at the real remote makes it wrong. A UI shows an assumed value as a
55621
- * guess, never as a reading.
55622
- */
55623
- var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
55624
- /** The fields of a media-player status a driver can only guess. */
55625
- var MediaPlayerAssumedFieldSchema = _enum([
55626
- "state",
55627
- "volumeLevel",
55628
- "isMuted",
55629
- "source"
55630
- ]);
55631
- object({
55632
- /** Playback lifecycle state. */
55633
- state: MediaPlayerStateSchema,
55634
- /**
55635
- * Whether the state fields are readings or the driver's own bookkeeping.
55636
- * A slice written before this field existed parses as `reported`.
55637
- */
55638
- stateSource: MediaPlayerStateSourceSchema.default("reported"),
55639
- /**
55640
- * Which fields are the driver's own guess. `stateSource` is `assumed` when
55641
- * this is not empty; a field not listed here is a reading even then (power
55642
- * from a running-state source, mute guessed from the last send).
55643
- */
55644
- assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
55645
- /** Volume as 0..100 inclusive. Null when the device has no volume
55646
- * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
55647
- volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
55648
- /** Mute toggle distinct from volume=0. Null when no mute surface.
55649
- * Pair with `DeviceFeature.MediaPlayerMute`. */
55650
- isMuted: boolean().nullable(),
55651
- /** Active source / input. Empty when no source surface. */
55652
- source: string(),
55653
- /** Selectable sources. Empty when no source surface.
55654
- * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
55655
- availableSources: array(string()),
55656
- /** Currently-playing media info. Null when nothing is playing. */
55657
- currentMedia: MediaInfoSchema.nullable(),
55658
- /** Current playback position in ms. Null when not seekable or
55659
- * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
55660
- position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
55661
- /** Total duration of the current media in ms. Null when unknown
55662
- * (live stream) or nothing is playing. */
55663
- duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
55664
- /** Shuffle toggle. Null when no shuffle surface.
55665
- * Pair with `DeviceFeature.MediaPlayerShuffle`. */
55666
- shuffle: boolean().nullable(),
55667
- /** Repeat mode. Null when no repeat surface.
55668
- * Pair with `DeviceFeature.MediaPlayerRepeat`. */
55669
- repeat: MediaPlayerRepeatSchema.nullable(),
55670
- /** Ms epoch when the slice was last updated. */
55671
- lastChangedAt: number()
55672
- });
55673
- DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }), _void(), {
55674
- kind: "mutation",
55675
- auth: "protected"
55676
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55677
- kind: "mutation",
55678
- auth: "protected"
55679
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55680
- kind: "mutation",
55681
- auth: "protected"
55682
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55683
- kind: "mutation",
55684
- auth: "protected"
55685
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55686
- kind: "mutation",
55687
- auth: "protected"
55688
- }), method(object({
55689
- deviceId: number().int().nonnegative(),
55690
- position: number().int().nonnegative()
55691
- }), _void(), {
55692
- kind: "mutation",
55693
- auth: "protected"
55694
- }), method(object({
55695
- deviceId: number().int().nonnegative(),
55696
- volumeLevel: number().min(0).max(100)
55697
- }), _void(), {
55698
- kind: "mutation",
55699
- auth: "protected"
55700
- }), method(object({
55701
- deviceId: number().int().nonnegative(),
55702
- muted: boolean()
55703
- }), _void(), {
55704
- kind: "mutation",
55705
- auth: "protected"
55706
- }), method(object({
55707
- deviceId: number().int().nonnegative(),
55708
- shuffle: boolean()
55709
- }), _void(), {
55710
- kind: "mutation",
55711
- auth: "protected"
55712
- }), method(object({
55713
- deviceId: number().int().nonnegative(),
55714
- repeat: MediaPlayerRepeatSchema
55715
- }), _void(), {
55716
- kind: "mutation",
55717
- auth: "protected"
55718
- }), method(object({
55719
- deviceId: number().int().nonnegative(),
55720
- source: string().min(1)
55721
- }), _void(), {
55722
- kind: "mutation",
55723
- auth: "protected"
55724
- }), method(object({
55725
- deviceId: number().int().nonnegative(),
55726
- /** Media identifier / URL. */
55727
- mediaId: string().min(1),
55728
- /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
55729
- * passes it through to the upstream service. */
55730
- mediaType: string().min(1)
55731
- }), _void(), {
55732
- kind: "mutation",
55733
- auth: "protected"
55734
- });
55735
- /**
55736
56285
  * mesh-network — collection cap for mesh-VPN providers.
55737
56286
  *
55738
56287
  * Different shape from `network-access` (public tunnels):
@@ -63626,7 +64175,14 @@ var NcMediaPolicySchema = object({
63626
64175
  */
63627
64176
  profile: CamProfileSchema.optional(),
63628
64177
  /** See {@link NcLinkedCameraModeSchema}. */
63629
- linkedCameras: NcLinkedCameraModeSchema.optional()
64178
+ linkedCameras: NcLinkedCameraModeSchema.optional(),
64179
+ /**
64180
+ * Sensor rules only: may this rule wake a SLEEPING battery camera to take
64181
+ * the linked still it attaches (D998)? Absent means yes, an explicit `false`
64182
+ * opts out. Deliberately not a Zod default: a rule that never chose keeps
64183
+ * following the hub's. One bounded wake per event; nothing is attached later.
64184
+ */
64185
+ wakeSleepingCamera: boolean().optional()
63630
64186
  });
63631
64187
  /**
63632
64188
  * Cooldown GRANULARITY over the subject's class — how much a fired
@@ -64018,6 +64574,21 @@ var NcTemplateVarKindSchema = _enum([
64018
64574
  "sound",
64019
64575
  "system"
64020
64576
  ]);
64577
+ /**
64578
+ * The default title/body a rule of one SITUATION is delivered with when the
64579
+ * operator wrote no template — served so an editor can pre-fill it (and the
64580
+ * operator can rebuild it from placeholders) instead of starting from a blank
64581
+ * box that, once saved, silently replaces it. `id` names the situation inside
64582
+ * a rule `kind`: `appliance-cycle` is a `sensor` rule whose device is an
64583
+ * appliance finishing a cycle. Texts are raw templates (`{{var}}` intact), in
64584
+ * the hub's current language and with its overrides applied.
64585
+ */
64586
+ var NcTemplateDefaultSchema = object({
64587
+ id: _enum(["appliance-cycle"]),
64588
+ kind: NcRuleKindSchema,
64589
+ title: string(),
64590
+ body: string()
64591
+ });
64021
64592
  /** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
64022
64593
  var NcTemplateFamilySchema = _enum([
64023
64594
  "rule",
@@ -64873,7 +65444,11 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
64873
65444
  }), method(object({}), object({
64874
65445
  catalog: array(NcConditionDescriptorSchema),
64875
65446
  taxonomy: NcTaxonomySchema.optional()
64876
- })), method(object({}), object({ vars: array(NcTemplateVarDescriptorSchema) })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
65447
+ })), method(object({}), object({
65448
+ vars: array(NcTemplateVarDescriptorSchema),
65449
+ /** Per-situation default texts; absent on a hub that predates them. */
65450
+ defaults: array(NcTemplateDefaultSchema)
65451
+ })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
64877
65452
  kind: "mutation",
64878
65453
  access: "view"
64879
65454
  }), 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 }), {
@@ -65621,52 +66196,27 @@ object({
65621
66196
  empty: boolean().nullable(),
65622
66197
  /** True while the pump is running. Null while unknown. */
65623
66198
  pumpRunning: boolean().nullable(),
65624
- /** True when the pump works on an on/off duty cycle rather than continuously. */
65625
- pumpIntervalEnabled: boolean().nullable(),
65626
- /** How long the pump runs per cycle, in seconds. */
65627
- pumpOnTime: number().min(0).nullable().meta(readingMeta("duration")),
65628
- /** How long the pump rests per cycle, in seconds. */
65629
- pumpOffTime: number().min(0).nullable().meta(readingMeta("duration")),
65630
66199
  /** Water drunk in the last drink, in litres. */
65631
66200
  lastDrink: number().min(0).nullable().meta(readingMeta("volume")),
65632
66201
  /** Water drunk in the current hour, in litres. */
65633
66202
  currentHourDrink: number().min(0).nullable().meta(readingMeta("volume")),
65634
66203
  /** Water drunk over the last 24 hours (rolling), in litres. */
65635
66204
  last24hDrink: number().min(0).nullable().meta(readingMeta("volume")),
65636
- /** Water drunk since local midnight, in litres. */
66205
+ /** Water drunk since local midnight, in litres. Null when the fountain has no such sensor. */
65637
66206
  todayDrink: number().min(0).nullable().meta(readingMeta("volume")),
65638
66207
  /** Decoded fault message. Null means healthy; a non-null string is an active fault. */
65639
66208
  error: string().nullable(),
65640
66209
  /** Ms epoch when the slice was last refreshed. */
65641
66210
  lastFetchedAt: number()
65642
66211
  });
65643
- var DeviceIdSchema = number().int().nonnegative();
65644
- var MinutesSchema = number().int().min(0);
66212
+ var DeviceIdSchema$1 = number().int().nonnegative();
65645
66213
  DeviceType.PetFountain, method(object({
65646
- deviceId: DeviceIdSchema,
65647
- on: boolean()
65648
- }), _void(), {
65649
- kind: "mutation",
65650
- auth: "protected"
65651
- }), method(object({
65652
- deviceId: DeviceIdSchema,
66214
+ deviceId: DeviceIdSchema$1,
65653
66215
  on: boolean()
65654
66216
  }), _void(), {
65655
66217
  kind: "mutation",
65656
66218
  auth: "protected"
65657
- }), method(object({
65658
- deviceId: DeviceIdSchema,
65659
- minutes: MinutesSchema
65660
- }), _void(), {
65661
- kind: "mutation",
65662
- auth: "protected"
65663
- }), method(object({
65664
- deviceId: DeviceIdSchema,
65665
- minutes: MinutesSchema
65666
- }), _void(), {
65667
- kind: "mutation",
65668
- auth: "protected"
65669
- }), method(object({ deviceId: DeviceIdSchema }), _void(), {
66219
+ }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
65670
66220
  kind: "mutation",
65671
66221
  auth: "protected"
65672
66222
  });
@@ -67626,6 +68176,37 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
67626
68176
  deviceId: number(),
67627
68177
  status: PtzAutotrackStatusSchema
67628
68178
  });
68179
+ object({
68180
+ /** True when the pump works on the on/off cycle, false when it runs continuously. Null while unknown. */
68181
+ enabled: boolean().nullable(),
68182
+ /** How long the pump runs per cycle, in seconds. Null while unknown. */
68183
+ onTime: number().min(0).nullable().meta(readingMeta("duration")),
68184
+ /** How long the pump rests per cycle, in seconds. Null while unknown. */
68185
+ offTime: number().min(0).nullable().meta(readingMeta("duration")),
68186
+ /** Ms epoch when the slice was last refreshed. */
68187
+ lastFetchedAt: number()
68188
+ });
68189
+ var DeviceIdSchema = number().int().nonnegative();
68190
+ var MinutesSchema = number().int().min(0);
68191
+ DeviceType.PetFountain, method(object({
68192
+ deviceId: DeviceIdSchema,
68193
+ on: boolean()
68194
+ }), _void(), {
68195
+ kind: "mutation",
68196
+ auth: "protected"
68197
+ }), method(object({
68198
+ deviceId: DeviceIdSchema,
68199
+ minutes: MinutesSchema
68200
+ }), _void(), {
68201
+ kind: "mutation",
68202
+ auth: "protected"
68203
+ }), method(object({
68204
+ deviceId: DeviceIdSchema,
68205
+ minutes: MinutesSchema
68206
+ }), _void(), {
68207
+ kind: "mutation",
68208
+ auth: "protected"
68209
+ });
67629
68210
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, DeviceType.Gateway, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
67630
68211
  kind: "mutation",
67631
68212
  auth: "admin"
@@ -70532,7 +71113,13 @@ var RemoteMediaCommandSchema = _enum([
70532
71113
  "next",
70533
71114
  "previous",
70534
71115
  "setMute",
70535
- "selectSource"
71116
+ "selectSource",
71117
+ "turnOn",
71118
+ "turnOff",
71119
+ "volumeUp",
71120
+ "volumeDown",
71121
+ "channelUp",
71122
+ "channelDown"
70536
71123
  ]);
70537
71124
  /** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
70538
71125
  var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
@@ -70553,7 +71140,7 @@ method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.e
70553
71140
  }), RemoteSendResultSchema, {
70554
71141
  kind: "mutation",
70555
71142
  auth: "protected"
70556
- }), method(deviceInput.extend({
71143
+ }), method(deviceInput, MediaPlayerStatusSchema.nullable(), { auth: "protected" }), method(deviceInput.extend({
70557
71144
  command: RemoteMediaCommandSchema,
70558
71145
  muted: boolean().optional(),
70559
71146
  source: string().optional(),
@@ -71425,9 +72012,17 @@ var ServerUpdateActionResultSchema = object({
71425
72012
  */
71426
72013
  requiredAddonUpdates: array(RequiredAddonUpdateSchema).optional()
71427
72014
  });
71428
- var LaunchOverridesSchema = object({
71429
- /** The persisted heap ceiling in MB, or `null` when none is set. */
71430
- heapMb: number().int().nullable() });
72015
+ var LaunchOverridesSchema = object({
72016
+ /** The persisted heap ceiling in MB, or `null` when none is set. */
72017
+ heapMb: number().int().nullable(),
72018
+ /** The persisted hub-main RSS budget in MB, or `null` when none is set. */
72019
+ rssBudgetMb: number().int().nullable()
72020
+ });
72021
+ var SetLaunchOverridesInputSchema = object({
72022
+ heapMb: number().int().min(512).max(65536).nullable(),
72023
+ /** Omitted keeps the stored budget; `null` clears it. */
72024
+ rssBudgetMb: number().int().min(512).max(65536).nullable().optional()
72025
+ });
71431
72026
  var SetLaunchOverridesResultSchema = LaunchOverridesSchema.extend({
71432
72027
  /** Always true: the override is read at launch, not by the running process. */
71433
72028
  restartRequired: boolean() });
@@ -71456,7 +72051,7 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
71456
72051
  }), method(_void(), ServerUpdateActionResultSchema, {
71457
72052
  kind: "mutation",
71458
72053
  auth: "admin"
71459
- }), method(_void(), LaunchOverridesSchema, { auth: "admin" }), method(object({ heapMb: number().int().min(512).max(65536).nullable() }), SetLaunchOverridesResultSchema, {
72054
+ }), method(_void(), LaunchOverridesSchema, { auth: "admin" }), method(SetLaunchOverridesInputSchema, SetLaunchOverridesResultSchema, {
71460
72055
  kind: "mutation",
71461
72056
  auth: "admin"
71462
72057
  });
@@ -71488,7 +72083,16 @@ DeviceType.Sensor;
71488
72083
  * future fields without breaking the existing call sites.
71489
72084
  */
71490
72085
  var EmailAddressSchema = email();
72086
+ /**
72087
+ * Which relay of a multi-relay provider answers (D996). Absent = the provider's first / default
72088
+ * relay, so a caller written before relays existed keeps working unchanged. A provider with one
72089
+ * fixed relay ignores it. This is the integration instance id (`int_NNNN`), NOT the addon id: the
72090
+ * collection pin `addonId` still picks the provider, `instanceId` picks the relay inside it.
72091
+ */
72092
+ var InstanceIdSchema = string().min(1).optional();
72093
+ var RelayPinSchema = object({ instanceId: InstanceIdSchema });
71491
72094
  var SendEmailInputSchema = object({
72095
+ instanceId: InstanceIdSchema,
71492
72096
  to: union([EmailAddressSchema, array(EmailAddressSchema).min(1)]),
71493
72097
  cc: array(EmailAddressSchema).optional(),
71494
72098
  bcc: array(EmailAddressSchema).optional(),
@@ -71524,11 +72128,11 @@ method(SendEmailInputSchema, SendEmailResultSchema, {
71524
72128
  kind: "mutation",
71525
72129
  auth: "admin",
71526
72130
  access: "create"
71527
- }), method(_void(), SmtpStatusSchema, {
72131
+ }), method(RelayPinSchema, SmtpStatusSchema, {
71528
72132
  kind: "mutation",
71529
72133
  auth: "admin",
71530
72134
  access: "view"
71531
- }), method(_void(), SmtpStatusSchema, { auth: "admin" });
72135
+ }), method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" });
71532
72136
  /**
71533
72137
  * A single device snapshot returned as base64 JPEG/PNG.
71534
72138
  *
@@ -71560,10 +72164,12 @@ DeviceType.Camera, method(object({
71560
72164
  * even when the cache is well within the device's
71561
72165
  * `snapshotMaxAgeS` window.
71562
72166
  *
71563
- * **`force` is an OPERATOR signal, not a freshness preference.** On a
72167
+ * **`force` is a demand with a named principal, not a freshness
72168
+ * preference** — an operator button, the scheduled refresh (D847), or a
72169
+ * notification rule that left the camera's wake allowed (D998). On a
71564
72170
  * battery camera it is the one thing that walks past the wrapper's
71565
- * sleep gate and wakes the camera, so a background caller — a poller,
71566
- * an event handler, a thumbnail — must NEVER set it. Every such caller
72171
+ * sleep gate and wakes the camera, so a poller, a thumbnail or a
72172
+ * prestream must NEVER set it. Every such caller
71567
72173
  * gets the cached frame, which on a sleeping battery camera is the
71568
72174
  * correct answer: stale but honest beats woken.
71569
72175
  */
@@ -72371,7 +72977,11 @@ object({
72371
72977
  });
72372
72978
  Object.values(DeviceType), method(_void(), array(StreamSignalSchema).readonly());
72373
72979
  object({
72374
- on: boolean().meta({ label: "On" }),
72980
+ /**
72981
+ * `null` = the device has never reported its state (a measurement that
72982
+ * has not happened is unknown, never `false`).
72983
+ */
72984
+ on: boolean().nullable().meta({ label: "On" }),
72375
72985
  /** Ms epoch of the last state change. Useful for UI "X minutes ago". */
72376
72986
  lastChangedAt: number()
72377
72987
  });
@@ -72383,7 +72993,7 @@ DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceTyp
72383
72993
  auth: "protected"
72384
72994
  }), object({
72385
72995
  deviceId: number(),
72386
- on: boolean(),
72996
+ on: boolean().nullable(),
72387
72997
  lastChangedAt: number()
72388
72998
  });
72389
72999
  /** C0 controls, DEL and the C1 range: none of them belongs in a name. */
@@ -72914,6 +73524,40 @@ var LoggingSettingsStateSchema = object({
72914
73524
  opsLogRetentionDays: number().int().min(0),
72915
73525
  persisted: boolean()
72916
73526
  });
73527
+ /**
73528
+ * Debug WATCH — a short, per-device window over `debug.<channel>` lines.
73529
+ *
73530
+ * `start` opens (or re-arms) a 10 minute window; `rearm` extends a LIVE one
73531
+ * and never revives a lapsed one; `stop` closes it; `list` only reads. No
73532
+ * chain of re-arms outlives 60 minutes from the first start. The hub holds the
73533
+ * watches in memory and pushes the interest to every node, so a watch lapses
73534
+ * by itself and survives nothing — a restart is a stop.
73535
+ */
73536
+ var DebugWatchInputSchema = object({
73537
+ action: _enum([
73538
+ "list",
73539
+ "start",
73540
+ "rearm",
73541
+ "stop"
73542
+ ]),
73543
+ /** Full channel names, `debug.<channel>`, each declared with `kind: 'debug'`. */
73544
+ channels: array(string().min(1)).readonly().default([]),
73545
+ /** Numeric device ids. Required (non-empty) for `start`. */
73546
+ deviceIds: array(number().int()).readonly().default([])
73547
+ });
73548
+ var DebugWatchStateSchema = object({
73549
+ channel: string(),
73550
+ deviceIds: array(number().int()).readonly(),
73551
+ startedAtMs: number(),
73552
+ untilMs: number(),
73553
+ capAtMs: number()
73554
+ });
73555
+ var DebugWatchResultSchema = object({
73556
+ nowMs: number(),
73557
+ watches: array(DebugWatchStateSchema).readonly(),
73558
+ /** Channels a `rearm` found already lapsed: nothing was revived. */
73559
+ lapsed: array(string()).readonly()
73560
+ });
72917
73561
  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(), {
72918
73562
  kind: "mutation",
72919
73563
  auth: "admin"
@@ -72929,6 +73573,9 @@ method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_
72929
73573
  }), 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, {
72930
73574
  kind: "mutation",
72931
73575
  auth: "admin"
73576
+ }), method(DebugWatchInputSchema, DebugWatchResultSchema, {
73577
+ kind: "mutation",
73578
+ auth: "admin"
72932
73579
  });
72933
73580
  object({
72934
73581
  /** True when the device's tamper switch / case-open contact is
@@ -75370,6 +76017,7 @@ function buildDescriptor(capName, kind) {
75370
76017
  * contributes one entry per bound cap present in this map.
75371
76018
  */
75372
76019
  var EVENT_KIND_BY_CAP = Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
76020
+ DeviceFeature.MediaPlayerPower, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious;
75373
76021
  var btn = (idSuffix, row, col, init) => ({
75374
76022
  idSuffix,
75375
76023
  row,
@@ -75496,7 +76144,7 @@ discriminatedUnion("kind", [object({
75496
76144
  kind: literal("pronto"),
75497
76145
  code: string()
75498
76146
  })]);
75499
- DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
76147
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverStoppable, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
75500
76148
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
75501
76149
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
75502
76150
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
@@ -76477,6 +77125,27 @@ Object.freeze({
76477
77125
  access: "view",
76478
77126
  role: "viewer"
76479
77127
  },
77128
+ "boardKeySource.getBoardKey": {
77129
+ capName: "board-key-source",
77130
+ capScope: "system",
77131
+ addonId: null,
77132
+ access: "view",
77133
+ role: "admin"
77134
+ },
77135
+ "boardKeySource.listBoards": {
77136
+ capName: "board-key-source",
77137
+ capScope: "system",
77138
+ addonId: null,
77139
+ access: "view",
77140
+ role: "admin"
77141
+ },
77142
+ "boardKeySource.listSources": {
77143
+ capName: "board-key-source",
77144
+ capScope: "system",
77145
+ addonId: null,
77146
+ access: "view",
77147
+ role: "admin"
77148
+ },
76480
77149
  "brightness.getStatus": {
76481
77150
  capName: "brightness",
76482
77151
  capScope: "device",
@@ -77814,6 +78483,13 @@ Object.freeze({
77814
78483
  access: "view",
77815
78484
  role: "admin"
77816
78485
  },
78486
+ "deviceManager.dismissDiscoveryProposal": {
78487
+ capName: "device-manager",
78488
+ capScope: "system",
78489
+ addonId: null,
78490
+ access: "create",
78491
+ role: "admin"
78492
+ },
77817
78493
  "deviceManager.enable": {
77818
78494
  capName: "device-manager",
77819
78495
  capScope: "system",
@@ -77996,6 +78672,13 @@ Object.freeze({
77996
78672
  access: "view",
77997
78673
  role: "viewer"
77998
78674
  },
78675
+ "deviceManager.listDiscoveryProposals": {
78676
+ capName: "device-manager",
78677
+ capScope: "system",
78678
+ addonId: null,
78679
+ access: "view",
78680
+ role: "admin"
78681
+ },
77999
78682
  "deviceManager.listLocationDescriptions": {
78000
78683
  capName: "device-manager",
78001
78684
  capScope: "system",
@@ -78150,6 +78833,13 @@ Object.freeze({
78150
78833
  access: "create",
78151
78834
  role: "admin"
78152
78835
  },
78836
+ "deviceManager.reportDiscoveryObservations": {
78837
+ capName: "device-manager",
78838
+ capScope: "system",
78839
+ addonId: null,
78840
+ access: "create",
78841
+ role: "admin"
78842
+ },
78153
78843
  "deviceManager.runDeviceAction": {
78154
78844
  capName: "device-manager",
78155
78845
  capScope: "system",
@@ -78157,6 +78847,13 @@ Object.freeze({
78157
78847
  access: "create",
78158
78848
  role: "admin"
78159
78849
  },
78850
+ "deviceManager.runDiscoverySweep": {
78851
+ capName: "device-manager",
78852
+ capScope: "system",
78853
+ addonId: null,
78854
+ access: "create",
78855
+ role: "admin"
78856
+ },
78160
78857
  "deviceManager.setChildLayout": {
78161
78858
  capName: "device-manager",
78162
78859
  capScope: "system",
@@ -78710,6 +79407,20 @@ Object.freeze({
78710
79407
  access: "create",
78711
79408
  role: "admin"
78712
79409
  },
79410
+ "doNotDisturb.getStatus": {
79411
+ capName: "do-not-disturb",
79412
+ capScope: "device",
79413
+ addonId: null,
79414
+ access: "view",
79415
+ role: "viewer"
79416
+ },
79417
+ "doNotDisturb.setEnabled": {
79418
+ capName: "do-not-disturb",
79419
+ capScope: "device",
79420
+ addonId: null,
79421
+ access: "create",
79422
+ role: "viewer"
79423
+ },
78713
79424
  "doorbell.getStatus": {
78714
79425
  capName: "doorbell",
78715
79426
  capScope: "device",
@@ -79074,6 +79785,69 @@ Object.freeze({
79074
79785
  access: "create",
79075
79786
  role: "admin"
79076
79787
  },
79788
+ "integrationInstances.createInstance": {
79789
+ capName: "integration-instances",
79790
+ capScope: "system",
79791
+ addonId: null,
79792
+ access: "create",
79793
+ role: "admin"
79794
+ },
79795
+ "integrationInstances.deleteInstance": {
79796
+ capName: "integration-instances",
79797
+ capScope: "system",
79798
+ addonId: null,
79799
+ access: "delete",
79800
+ role: "admin"
79801
+ },
79802
+ "integrationInstances.describe": {
79803
+ capName: "integration-instances",
79804
+ capScope: "system",
79805
+ addonId: null,
79806
+ access: "view",
79807
+ role: "admin"
79808
+ },
79809
+ "integrationInstances.getInstance": {
79810
+ capName: "integration-instances",
79811
+ capScope: "system",
79812
+ addonId: null,
79813
+ access: "view",
79814
+ role: "admin"
79815
+ },
79816
+ "integrationInstances.instanceFormSchema": {
79817
+ capName: "integration-instances",
79818
+ capScope: "system",
79819
+ addonId: null,
79820
+ access: "view",
79821
+ role: "admin"
79822
+ },
79823
+ "integrationInstances.listInstances": {
79824
+ capName: "integration-instances",
79825
+ capScope: "system",
79826
+ addonId: null,
79827
+ access: "view",
79828
+ role: "admin"
79829
+ },
79830
+ "integrationInstances.setInstanceEnabled": {
79831
+ capName: "integration-instances",
79832
+ capScope: "system",
79833
+ addonId: null,
79834
+ access: "create",
79835
+ role: "admin"
79836
+ },
79837
+ "integrationInstances.testInstance": {
79838
+ capName: "integration-instances",
79839
+ capScope: "system",
79840
+ addonId: null,
79841
+ access: "create",
79842
+ role: "admin"
79843
+ },
79844
+ "integrationInstances.updateInstance": {
79845
+ capName: "integration-instances",
79846
+ capScope: "system",
79847
+ addonId: null,
79848
+ access: "create",
79849
+ role: "admin"
79850
+ },
79077
79851
  "integrations.create": {
79078
79852
  capName: "integrations",
79079
79853
  capScope: "system",
@@ -79858,6 +80632,20 @@ Object.freeze({
79858
80632
  access: "view",
79859
80633
  role: "admin"
79860
80634
  },
80635
+ "mediaPlayer.channelDown": {
80636
+ capName: "media-player",
80637
+ capScope: "device",
80638
+ addonId: null,
80639
+ access: "create",
80640
+ role: "viewer"
80641
+ },
80642
+ "mediaPlayer.channelUp": {
80643
+ capName: "media-player",
80644
+ capScope: "device",
80645
+ addonId: null,
80646
+ access: "create",
80647
+ role: "viewer"
80648
+ },
79861
80649
  "mediaPlayer.getStatus": {
79862
80650
  capName: "media-player",
79863
80651
  capScope: "device",
@@ -79949,6 +80737,34 @@ Object.freeze({
79949
80737
  access: "create",
79950
80738
  role: "viewer"
79951
80739
  },
80740
+ "mediaPlayer.turnOff": {
80741
+ capName: "media-player",
80742
+ capScope: "device",
80743
+ addonId: null,
80744
+ access: "create",
80745
+ role: "viewer"
80746
+ },
80747
+ "mediaPlayer.turnOn": {
80748
+ capName: "media-player",
80749
+ capScope: "device",
80750
+ addonId: null,
80751
+ access: "create",
80752
+ role: "viewer"
80753
+ },
80754
+ "mediaPlayer.volumeDown": {
80755
+ capName: "media-player",
80756
+ capScope: "device",
80757
+ addonId: null,
80758
+ access: "create",
80759
+ role: "viewer"
80760
+ },
80761
+ "mediaPlayer.volumeUp": {
80762
+ capName: "media-player",
80763
+ capScope: "device",
80764
+ addonId: null,
80765
+ access: "create",
80766
+ role: "viewer"
80767
+ },
79952
80768
  "meshNetwork.getStatus": {
79953
80769
  capName: "mesh-network",
79954
80770
  capScope: "system",
@@ -81195,27 +82011,6 @@ Object.freeze({
81195
82011
  access: "create",
81196
82012
  role: "viewer"
81197
82013
  },
81198
- "petFountain.setPumpInterval": {
81199
- capName: "pet-fountain",
81200
- capScope: "device",
81201
- addonId: null,
81202
- access: "create",
81203
- role: "viewer"
81204
- },
81205
- "petFountain.setPumpOffMinutes": {
81206
- capName: "pet-fountain",
81207
- capScope: "device",
81208
- addonId: null,
81209
- access: "create",
81210
- role: "viewer"
81211
- },
81212
- "petFountain.setPumpOnMinutes": {
81213
- capName: "pet-fountain",
81214
- capScope: "device",
81215
- addonId: null,
81216
- access: "create",
81217
- role: "viewer"
81218
- },
81219
82014
  "pipelineAnalytics.addRetrainFrameFromRecording": {
81220
82015
  capName: "pipeline-analytics",
81221
82016
  capScope: "device",
@@ -82994,6 +83789,34 @@ Object.freeze({
82994
83789
  access: "create",
82995
83790
  role: "admin"
82996
83791
  },
83792
+ "pumpCycle.getStatus": {
83793
+ capName: "pump-cycle",
83794
+ capScope: "device",
83795
+ addonId: null,
83796
+ access: "view",
83797
+ role: "viewer"
83798
+ },
83799
+ "pumpCycle.setEnabled": {
83800
+ capName: "pump-cycle",
83801
+ capScope: "device",
83802
+ addonId: null,
83803
+ access: "create",
83804
+ role: "viewer"
83805
+ },
83806
+ "pumpCycle.setOffMinutes": {
83807
+ capName: "pump-cycle",
83808
+ capScope: "device",
83809
+ addonId: null,
83810
+ access: "create",
83811
+ role: "viewer"
83812
+ },
83813
+ "pumpCycle.setOnMinutes": {
83814
+ capName: "pump-cycle",
83815
+ capScope: "device",
83816
+ addonId: null,
83817
+ access: "create",
83818
+ role: "viewer"
83819
+ },
82997
83820
  "reboot.reboot": {
82998
83821
  capName: "reboot",
82999
83822
  capScope: "device",
@@ -83498,6 +84321,13 @@ Object.freeze({
83498
84321
  access: "create",
83499
84322
  role: "admin"
83500
84323
  },
84324
+ "remote.getAssumedStatus": {
84325
+ capName: "remote",
84326
+ capScope: "system",
84327
+ addonId: null,
84328
+ access: "view",
84329
+ role: "admin"
84330
+ },
83501
84331
  "remote.getConfig": {
83502
84332
  capName: "remote",
83503
84333
  capScope: "system",
@@ -84730,6 +85560,13 @@ Object.freeze({
84730
85560
  access: "create",
84731
85561
  role: "viewer"
84732
85562
  },
85563
+ "system.debugWatch": {
85564
+ capName: "system",
85565
+ capScope: "system",
85566
+ addonId: null,
85567
+ access: "create",
85568
+ role: "admin"
85569
+ },
84733
85570
  "system.detectSiteLocation": {
84734
85571
  capName: "system",
84735
85572
  capScope: "system",
@@ -86923,6 +87760,16 @@ Object.freeze({
86923
87760
  form: "single",
86924
87761
  optional: false
86925
87762
  }],
87763
+ "doNotDisturb.getStatus": [{
87764
+ name: "deviceId",
87765
+ form: "single",
87766
+ optional: false
87767
+ }],
87768
+ "doNotDisturb.setEnabled": [{
87769
+ name: "deviceId",
87770
+ form: "single",
87771
+ optional: false
87772
+ }],
86926
87773
  "doorbell.getStatus": [{
86927
87774
  name: "deviceId",
86928
87775
  form: "single",
@@ -87172,6 +88019,16 @@ Object.freeze({
87172
88019
  form: "single",
87173
88020
  optional: true
87174
88021
  }],
88022
+ "mediaPlayer.channelDown": [{
88023
+ name: "deviceId",
88024
+ form: "single",
88025
+ optional: false
88026
+ }],
88027
+ "mediaPlayer.channelUp": [{
88028
+ name: "deviceId",
88029
+ form: "single",
88030
+ optional: false
88031
+ }],
87175
88032
  "mediaPlayer.getStatus": [{
87176
88033
  name: "deviceId",
87177
88034
  form: "single",
@@ -87237,6 +88094,26 @@ Object.freeze({
87237
88094
  form: "single",
87238
88095
  optional: false
87239
88096
  }],
88097
+ "mediaPlayer.turnOff": [{
88098
+ name: "deviceId",
88099
+ form: "single",
88100
+ optional: false
88101
+ }],
88102
+ "mediaPlayer.turnOn": [{
88103
+ name: "deviceId",
88104
+ form: "single",
88105
+ optional: false
88106
+ }],
88107
+ "mediaPlayer.volumeDown": [{
88108
+ name: "deviceId",
88109
+ form: "single",
88110
+ optional: false
88111
+ }],
88112
+ "mediaPlayer.volumeUp": [{
88113
+ name: "deviceId",
88114
+ form: "single",
88115
+ optional: false
88116
+ }],
87240
88117
  "meter.getStatus": [{
87241
88118
  name: "deviceId",
87242
88119
  form: "single",
@@ -87546,21 +88423,6 @@ Object.freeze({
87546
88423
  form: "single",
87547
88424
  optional: false
87548
88425
  }],
87549
- "petFountain.setPumpInterval": [{
87550
- name: "deviceId",
87551
- form: "single",
87552
- optional: false
87553
- }],
87554
- "petFountain.setPumpOffMinutes": [{
87555
- name: "deviceId",
87556
- form: "single",
87557
- optional: false
87558
- }],
87559
- "petFountain.setPumpOnMinutes": [{
87560
- name: "deviceId",
87561
- form: "single",
87562
- optional: false
87563
- }],
87564
88426
  "pipelineAnalytics.addRetrainFrameFromRecording": [{
87565
88427
  name: "deviceId",
87566
88428
  form: "single",
@@ -88196,6 +89058,26 @@ Object.freeze({
88196
89058
  form: "single",
88197
89059
  optional: false
88198
89060
  }],
89061
+ "pumpCycle.getStatus": [{
89062
+ name: "deviceId",
89063
+ form: "single",
89064
+ optional: false
89065
+ }],
89066
+ "pumpCycle.setEnabled": [{
89067
+ name: "deviceId",
89068
+ form: "single",
89069
+ optional: false
89070
+ }],
89071
+ "pumpCycle.setOffMinutes": [{
89072
+ name: "deviceId",
89073
+ form: "single",
89074
+ optional: false
89075
+ }],
89076
+ "pumpCycle.setOnMinutes": [{
89077
+ name: "deviceId",
89078
+ form: "single",
89079
+ optional: false
89080
+ }],
88199
89081
  "reboot.reboot": [{
88200
89082
  name: "deviceId",
88201
89083
  form: "single",
@@ -88397,6 +89279,11 @@ Object.freeze({
88397
89279
  form: "single",
88398
89280
  optional: true
88399
89281
  }],
89282
+ "remote.getAssumedStatus": [{
89283
+ name: "deviceId",
89284
+ form: "single",
89285
+ optional: false
89286
+ }],
88400
89287
  "remote.getConfig": [{
88401
89288
  name: "deviceId",
88402
89289
  form: "single",
@@ -88663,6 +89550,11 @@ Object.freeze({
88663
89550
  form: "single",
88664
89551
  optional: false
88665
89552
  }],
89553
+ "system.debugWatch": [{
89554
+ name: "deviceIds",
89555
+ form: "array",
89556
+ optional: true
89557
+ }],
88666
89558
  "tamper.getStatus": [{
88667
89559
  name: "deviceId",
88668
89560
  form: "single",
@@ -89647,6 +90539,7 @@ var STATE_SUMMARY_VARS = [
89647
90539
  [...RULE_TEXT],
89648
90540
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
89649
90541
  ([...RULE_TEXT], [...COMBINED_ALARM]),
90542
+ ([...RULE_TEXT], [...COMBINED_ALARM]),
89650
90543
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
89651
90544
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
89652
90545
  ([...RULE_TEXT], [...CONSUMABLE]),
@@ -137585,6 +138478,111 @@ function carryForward(base, existing, keys) {
137585
138478
  return out;
137586
138479
  }
137587
138480
  //#endregion
138481
+ //#region src/migrations/hub-node-fields.ts
138482
+ /**
138483
+ * Fields stored once for the cluster that are facts of ONE node become node settings (D986): a
138484
+ * node's row is `<addonId>.<key>@<nodeId>` carrying `nodeId`, and a node never falls back to a
138485
+ * bare row. This owner is placed `hub-only`, so the one node that ever held a value is the hub:
138486
+ * each bare row is COPIED to `<key>@hub`. The bare row stays for a release (a copy, not a move),
138487
+ * and a value already on the node row is never overwritten (a seed never overwrites).
138488
+ *
138489
+ * A keychain marker is copied verbatim: it names the owner and the secret, not the row that
138490
+ * points at it. Idempotent: with every bare row copied the plan is empty.
138491
+ */
138492
+ /** The canonical settings table: one row per key, id `<addonId>.<key>`. */
138493
+ var ADDON_SETTINGS_TABLE = "addon-settings";
138494
+ var nodeKeyOf = (key) => `${key}@hub`;
138495
+ async function planHubNodeFields(addonId, keys, ports) {
138496
+ const stored = await ports.readStored([...keys, ...keys.map(nodeKeyOf)]);
138497
+ const pending = keys.filter((key) => key in stored && !(nodeKeyOf(key) in stored));
138498
+ if (pending.length === 0) return { edits: [] };
138499
+ const rowId = (key) => `${addonId}.${nodeKeyOf(key)}`;
138500
+ return { edits: [{
138501
+ op: "setKeys",
138502
+ scope: ADDON_SETTINGS_TABLE,
138503
+ values: Object.fromEntries(pending.map((key) => [rowId(key), {
138504
+ addonId,
138505
+ key: nodeKeyOf(key),
138506
+ value: stored[key],
138507
+ nodeId: "hub"
138508
+ }])),
138509
+ precondition: preconditionOf(Object.fromEntries(pending.map((key) => [rowId(key), null])))
138510
+ }] };
138511
+ }
138512
+ /**
138513
+ * The port's read over an addon's three-way key read: each of `keys` that has a row, raw. A key
138514
+ * the store could not answer for throws, so the migration fails instead of treating a failed read
138515
+ * as "nothing to copy".
138516
+ */
138517
+ async function readRawKeys(read, addonId, keys) {
138518
+ const found = {};
138519
+ for (const key of keys) {
138520
+ const answer = await read(key);
138521
+ if (answer.kind === "unreadable") throw new Error(`${addonId}: the setting ${key} cannot be read (${answer.reason})`);
138522
+ if (answer.kind === "present") found[key] = answer.value;
138523
+ }
138524
+ return found;
138525
+ }
138526
+ //#endregion
138527
+ //#region src/migrations/fixed-pin-to-keychain.ts
138528
+ /**
138529
+ * The fixed HomeKit setup code pairs a controller with the bridge: a credential. It was a plain
138530
+ * text setting, stored inline in the settings row; it is a `password` field now (D783), and a
138531
+ * password lives in the keychain with a marker in the row. This procedure moves a stored inline
138532
+ * code there, through the operator write path (the one that stores an inline value of a
138533
+ * pre-keychain addon as a keychain secret).
138534
+ *
138535
+ * Idempotent: an absent, empty or already marker-backed code is `already-done`, so a crash
138536
+ * between the keychain write and the ledger row costs nothing on the rerun.
138537
+ */
138538
+ async function moveFixedPinToKeychain(ports) {
138539
+ const stored = (await ports.readStored(["fixedPin"]))["fixedPin"];
138540
+ if (typeof stored !== "string" || stored === "" || isSecretMarker(stored)) return {
138541
+ outcome: "already-done",
138542
+ summary: { moved: false }
138543
+ };
138544
+ await ports.storeFixedPin(stored);
138545
+ return {
138546
+ outcome: "done",
138547
+ summary: { moved: true }
138548
+ };
138549
+ }
138550
+ //#endregion
138551
+ //#region src/migrations/index.ts
138552
+ var EXPORT_HAP_ID = "export-hap";
138553
+ /** The `export-hap` catalogue (D987): offered to the engine when the addon initialises. */
138554
+ var ADDON_MIGRATIONS = [{
138555
+ meta: {
138556
+ id: "export-hap/2026-11-03-interface-name-per-node",
138557
+ owner: EXPORT_HAP_ID,
138558
+ level: "addon-state",
138559
+ seq: 1,
138560
+ dependsOn: [],
138561
+ store: "settings",
138562
+ scope: "per-node",
138563
+ onFailure: "tolerate",
138564
+ bodyKind: "plan",
138565
+ description: "Copy the bare network interface setting to its hub node row; the bare row stays for a release",
138566
+ fixtureMark: "the bridge name the migration does not know"
138567
+ },
138568
+ plan: (ports) => planHubNodeFields(EXPORT_HAP_ID, ["interfaceName"], ports)
138569
+ }, {
138570
+ meta: {
138571
+ id: "export-hap/2026-11-03-fixed-pin-to-keychain",
138572
+ owner: EXPORT_HAP_ID,
138573
+ level: "addon-state",
138574
+ seq: 2,
138575
+ dependsOn: [],
138576
+ store: "settings",
138577
+ scope: "cluster",
138578
+ onFailure: "tolerate",
138579
+ bodyKind: "procedure",
138580
+ description: "Move the fixed setup code from an inline setting into the keychain, where a password field keeps it",
138581
+ fixtureMark: "the bridge name the migration does not know"
138582
+ },
138583
+ procedure: moveFixedPinToKeychain
138584
+ }];
138585
+ //#endregion
137588
138586
  //#region src/hap-setup-uri.ts
137589
138587
  function errMsg$15(e) {
137590
138588
  return e instanceof Error ? e.message : String(e);
@@ -157032,6 +158030,7 @@ var ExportHapAddon = class extends BaseAddon {
157032
158030
  super({ ...DEFAULT_CONFIG });
157033
158031
  }
157034
158032
  async onInitialize() {
158033
+ await this.migrateSettings();
157035
158034
  const identity = await this.ensureIdentity();
157036
158035
  this.pincode = identity.pincode;
157037
158036
  this.bind = this.config.interfaceName || void 0;
@@ -157640,6 +158639,37 @@ var ExportHapAddon = class extends BaseAddon {
157640
158639
  return null;
157641
158640
  }
157642
158641
  }
158642
+ /** The one declaration of the bind-interface field, shared by the node form and the global form. */
158643
+ interfaceNameField() {
158644
+ return this.field({
158645
+ type: "text",
158646
+ key: "interfaceName",
158647
+ perNode: true,
158648
+ label: "Network interface",
158649
+ description: "Optional. Restrict mDNS advertisement and HAP bind to this node's interface (e.g. \"en0\"). Leave blank to advertise on all interfaces.",
158650
+ default: DEFAULT_CONFIG.interfaceName,
158651
+ requiresRestart: true,
158652
+ placement: { tab: "advanced" }
158653
+ });
158654
+ }
158655
+ async nodeSettingsSchema(cap) {
158656
+ return cap === "device-export" ? this.schema({ sections: [{
158657
+ id: "export-hap-node",
158658
+ title: "HomeKit Export",
158659
+ fields: [this.interfaceNameField()]
158660
+ }] }) : null;
158661
+ }
158662
+ /**
158663
+ * Copy the bare `interfaceName` to its hub node row and move an inline `fixedPin` into the
158664
+ * keychain (D986, D987). Re-resolves the config when either landed, so this boot binds the
158665
+ * value the migration wrote.
158666
+ */
158667
+ async migrateSettings() {
158668
+ if ((await this.runMigrations(defineAddonMigrations(ADDON_MIGRATIONS, {
158669
+ readStored: (keys) => readRawKeys((key) => this.readStoredGlobalKey(key), "export-hap", keys),
158670
+ storeFixedPin: (pin) => this.updateGlobalSettingsAsOperator({ fixedPin: pin })
158671
+ }))).applied.length > 0) await this.resolveConfig();
158672
+ }
157643
158673
  globalSettingsSchema() {
157644
158674
  return this.schema({ sections: [{
157645
158675
  id: "export-hap",
@@ -157657,24 +158687,15 @@ var ExportHapAddon = class extends BaseAddon {
157657
158687
  placement: { tab: "advanced" }
157658
158688
  }),
157659
158689
  this.field({
157660
- type: "text",
158690
+ type: "password",
157661
158691
  key: "fixedPin",
157662
- secret: true,
157663
158692
  label: "Fixed setup code (XXX-XX-XXX)",
157664
158693
  description: "Optional. Leave blank to use the auto-generated code persisted on first boot. Useful for CI replay.",
157665
158694
  default: DEFAULT_CONFIG.fixedPin,
157666
158695
  requiresRestart: true,
157667
158696
  placement: { tab: "advanced" }
157668
158697
  }),
157669
- this.field({
157670
- type: "text",
157671
- key: "interfaceName",
157672
- label: "Network interface",
157673
- description: "Optional. Restrict mDNS advertisement and HAP bind to a specific interface (e.g. \"en0\"). Leave blank to advertise on all interfaces.",
157674
- default: DEFAULT_CONFIG.interfaceName,
157675
- requiresRestart: true,
157676
- placement: { tab: "advanced" }
157677
- }),
158698
+ this.interfaceNameField(),
157678
158699
  this.field({
157679
158700
  type: "number",
157680
158701
  key: "clipRetentionDays",