@camstack/addon-export-hap 1.2.189 → 1.2.191

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -825,7 +825,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
825
825
  return EventCategory;
826
826
  }({});
827
827
  //#endregion
828
- //#region ../types/dist/device-type-BOWLtoOt.mjs
828
+ //#region ../types/dist/device-type-D1fH5kaC.mjs
829
829
  /**
830
830
  import { errMsg } from '@camstack/types'
831
831
  * Extract a human-readable message from an unknown error value.
@@ -1014,6 +1014,9 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1014
1014
  DeviceFeature["CoverPositionable"] = "cover-positionable";
1015
1015
  /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
1016
1016
  DeviceFeature["CoverTilt"] = "cover-tilt";
1017
+ /** Cover has a real stop: `stop` halts the travel in place. Gates the stop
1018
+ * control in exporters; a provider whose `stop` is a no-op never declares it. */
1019
+ DeviceFeature["CoverStoppable"] = "cover-stoppable";
1017
1020
  /** Valve exposes intermediate position control (0..100). Gates the
1018
1021
  * position slider / drag surface UI. */
1019
1022
  DeviceFeature["ValvePositionable"] = "valve-positionable";
@@ -1053,6 +1056,12 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1053
1056
  DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
1054
1057
  /** Media player exposes stop distinct from pause. */
1055
1058
  DeviceFeature["MediaPlayerStop"] = "media-player-stop";
1059
+ /** Media player exposes volume up / down in steps (an infrared TV has no level). */
1060
+ DeviceFeature["MediaPlayerVolumeStep"] = "media-player-volume-step";
1061
+ /** Media player exposes channel up / down in steps. */
1062
+ DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
1063
+ /** Media player exposes power on / off. */
1064
+ DeviceFeature["MediaPlayerPower"] = "media-player-power";
1056
1065
  /** Alarm panel requires a PIN code on arm/disarm. */
1057
1066
  DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
1058
1067
  /** Presence device carries GPS coordinates (lat/lng/accuracy) in
@@ -5879,7 +5888,7 @@ var ZodIssueCode = {
5879
5888
  var ZodFirstPartyTypeKind;
5880
5889
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5881
5890
  //#endregion
5882
- //#region ../types/dist/sleep-_4vKNWxb.mjs
5891
+ //#region ../types/dist/sleep-BkzQdpzF.mjs
5883
5892
  /**
5884
5893
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5885
5894
  * window to float samples (D455).
@@ -5958,6 +5967,22 @@ function buildAlawTable() {
5958
5967
  }
5959
5968
  buildUlawTable();
5960
5969
  buildAlawTable();
5970
+ /**
5971
+ * An addon whose own migrations did not apply refuses to initialise (D987). The error is typed
5972
+ * so a runner hosting several addons can tell "this addon is blocked" from a crash and keep its
5973
+ * co-located siblings running. Recognised by NAME and shape, never `instanceof`: a forked addon
5974
+ * bundles its own copy of this module, so the class the runner sees is not the one that threw.
5975
+ */
5976
+ var MIGRATIONS_BLOCKED_ERROR_NAME = "AddonMigrationsBlockedError";
5977
+ var AddonMigrationsBlockedError = class extends Error {
5978
+ /** The ledger ids that did not apply and block the owner. */
5979
+ migrationIds;
5980
+ constructor(migrationIds) {
5981
+ super(`migration(s) ${migrationIds.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
5982
+ this.name = MIGRATIONS_BLOCKED_ERROR_NAME;
5983
+ this.migrationIds = migrationIds;
5984
+ }
5985
+ };
5961
5986
  /** Is this field's stored value a credential? */
5962
5987
  function isSecretConfigField(field) {
5963
5988
  if (field.type === "password") return true;
@@ -5996,7 +6021,7 @@ function isKeychainStoredField(field) {
5996
6021
  var SECRET_CLEAR = { $secretClear: true };
5997
6022
  /** The `'***'` token D634 redaction writes for non-admins. */
5998
6023
  var LEGACY_DEVICE_REDACTION = "***";
5999
- function isRecord$6(value) {
6024
+ function isRecord$7(value) {
6000
6025
  return typeof value === "object" && value !== null && !Array.isArray(value);
6001
6026
  }
6002
6027
  function makeSecretMarker(ref) {
@@ -6007,12 +6032,12 @@ function makeSecretMarker(ref) {
6007
6032
  }
6008
6033
  /** A stored marker: an object whose `$secret` is a non-empty string. */
6009
6034
  function isSecretMarker(value) {
6010
- if (!isRecord$6(value)) return false;
6035
+ if (!isRecord$7(value)) return false;
6011
6036
  const ref = value["$secret"];
6012
6037
  return typeof ref === "string" && ref.length > 0;
6013
6038
  }
6014
6039
  function isSecretClear(value) {
6015
- return isRecord$6(value) && value["$secretClear"] === true;
6040
+ return isRecord$7(value) && value["$secretClear"] === true;
6016
6041
  }
6017
6042
  /**
6018
6043
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6395,6 +6420,53 @@ function emitReadiness(bus, params) {
6395
6420
  ts
6396
6421
  }));
6397
6422
  }
6423
+ /** Why a catalogue entry is not a runnable body of its declared kind. */
6424
+ var AddonMigrationDefinitionError = class extends Error {
6425
+ id;
6426
+ constructor(id, message) {
6427
+ super(`${id}: ${message}`);
6428
+ this.id = id;
6429
+ this.name = "AddonMigrationDefinitionError";
6430
+ }
6431
+ };
6432
+ /**
6433
+ * Bind a catalogue to the addon's ports. Throws {@link AddonMigrationDefinitionError} when
6434
+ * an entry's `bodyKind` does not match the body it carries, or is `sql` (a hub-only
6435
+ * body). A throwing body never escapes `execute`: it is reported as a failed result.
6436
+ */
6437
+ function defineAddonMigrations(catalogue, ports) {
6438
+ return catalogue.map((entry) => {
6439
+ const { meta } = entry;
6440
+ if ("plan" in entry) {
6441
+ if (meta.bodyKind !== "plan") throw new AddonMigrationDefinitionError(meta.id, `carries a plan body but declares "${meta.bodyKind}"`);
6442
+ return {
6443
+ meta,
6444
+ execute: () => guarded(async () => ({
6445
+ kind: "plan",
6446
+ plan: await entry.plan(ports)
6447
+ }))
6448
+ };
6449
+ }
6450
+ if (meta.bodyKind !== "procedure") throw new AddonMigrationDefinitionError(meta.id, `carries a procedure body but declares "${meta.bodyKind}"`);
6451
+ return {
6452
+ meta,
6453
+ execute: () => guarded(async () => ({
6454
+ kind: "procedure",
6455
+ result: await entry.procedure(ports)
6456
+ }))
6457
+ };
6458
+ });
6459
+ }
6460
+ async function guarded(work) {
6461
+ try {
6462
+ return await work();
6463
+ } catch (err) {
6464
+ return {
6465
+ kind: "failed",
6466
+ error: errMsg$17(err)
6467
+ };
6468
+ }
6469
+ }
6398
6470
  var NOT_RUN = {
6399
6471
  declared: false,
6400
6472
  snapshot: null,
@@ -6718,7 +6790,7 @@ var KeychainWriteRefusedError = class extends Error {
6718
6790
  }
6719
6791
  };
6720
6792
  var KEEP = { kind: "keep" };
6721
- function isRecord$5(value) {
6793
+ function isRecord$6(value) {
6722
6794
  return typeof value === "object" && value !== null && !Array.isArray(value);
6723
6795
  }
6724
6796
  function defaultMintId() {
@@ -6731,7 +6803,7 @@ function collectSecretMarkerRefs(value, out = []) {
6731
6803
  return out;
6732
6804
  }
6733
6805
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6734
- else if (isRecord$5(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6806
+ else if (isRecord$6(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6735
6807
  return out;
6736
6808
  }
6737
6809
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6786,7 +6858,7 @@ function rowId(row, idKey) {
6786
6858
  return null;
6787
6859
  }
6788
6860
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6789
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$5) : [];
6861
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$6) : [];
6790
6862
  if (!Array.isArray(incoming)) {
6791
6863
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6792
6864
  return {
@@ -6802,7 +6874,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6802
6874
  const kept = /* @__PURE__ */ new Set();
6803
6875
  const rows = [];
6804
6876
  for (const row of incoming) {
6805
- if (!isRecord$5(row)) {
6877
+ if (!isRecord$6(row)) {
6806
6878
  rows.push(row);
6807
6879
  continue;
6808
6880
  }
@@ -6827,7 +6899,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6827
6899
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6828
6900
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6829
6901
  case "object": {
6830
- if (!isRecord$5(incoming)) {
6902
+ if (!isRecord$6(incoming)) {
6831
6903
  if (incoming === void 0) return KEEP;
6832
6904
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6833
6905
  return {
@@ -6835,7 +6907,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6835
6907
  value: incoming
6836
6908
  };
6837
6909
  }
6838
- const storedObj = isRecord$5(stored) ? stored : {};
6910
+ const storedObj = isRecord$6(stored) ? stored : {};
6839
6911
  return {
6840
6912
  kind: "value",
6841
6913
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6958,7 +7030,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6958
7030
  value: items
6959
7031
  };
6960
7032
  }
6961
- if (isRecord$5(v)) {
7033
+ if (isRecord$6(v)) {
6962
7034
  const out = {};
6963
7035
  for (const [k, child] of Object.entries(v)) {
6964
7036
  const s = substitute(child);
@@ -6990,7 +7062,7 @@ var SecretOverwriteRefusedError = class extends Error {
6990
7062
  this.name = "SecretOverwriteRefusedError";
6991
7063
  }
6992
7064
  };
6993
- function isRecord$4(value) {
7065
+ function isRecord$5(value) {
6994
7066
  return typeof value === "object" && value !== null && !Array.isArray(value);
6995
7067
  }
6996
7068
  function resolvedValue(pass, marker) {
@@ -7019,7 +7091,7 @@ function inArray(pass, incoming, stored) {
7019
7091
  return incoming.map((item, index) => {
7020
7092
  const twin = stored[index];
7021
7093
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
7022
- if (isRecord$4(item) && isRecord$4(twin)) return inArrayRow(pass, item, twin);
7094
+ if (isRecord$5(item) && isRecord$5(twin)) return inArrayRow(pass, item, twin);
7023
7095
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
7024
7096
  return item;
7025
7097
  });
@@ -7030,7 +7102,7 @@ function inArrayRow(pass, incoming, stored) {
7030
7102
  const twin = stored[key];
7031
7103
  if (isSecretMarker(twin)) {
7032
7104
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
7033
- } else if (isRecord$4(value) && isRecord$4(twin)) out[key] = inArrayRow(pass, value, twin);
7105
+ } else if (isRecord$5(value) && isRecord$5(twin)) out[key] = inArrayRow(pass, value, twin);
7034
7106
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
7035
7107
  }
7036
7108
  return out;
@@ -7038,7 +7110,7 @@ function inArrayRow(pass, incoming, stored) {
7038
7110
  async function walk(pass, incoming, stored) {
7039
7111
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
7040
7112
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
7041
- if (!isRecord$4(incoming) || !isRecord$4(stored)) return incoming;
7113
+ if (!isRecord$5(incoming) || !isRecord$5(stored)) return incoming;
7042
7114
  const out = { ...incoming };
7043
7115
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
7044
7116
  return out;
@@ -7069,7 +7141,7 @@ async function restoreUnchangedSecrets(input) {
7069
7141
  function isJsonEqual(a, b) {
7070
7142
  if (Object.is(a, b)) return true;
7071
7143
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
7072
- if (isRecord$4(a) && isRecord$4(b)) {
7144
+ if (isRecord$5(a) && isRecord$5(b)) {
7073
7145
  const keys = Object.keys(a);
7074
7146
  if (keys.length !== Object.keys(b).length) return false;
7075
7147
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -7093,7 +7165,7 @@ function markerKeysOf(blob, owner) {
7093
7165
  }
7094
7166
  function nodeFromStored(value, owner) {
7095
7167
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
7096
- if (!isRecord$4(value)) return null;
7168
+ if (!isRecord$5(value)) return null;
7097
7169
  const children = /* @__PURE__ */ new Map();
7098
7170
  for (const [key, child] of Object.entries(value)) {
7099
7171
  const node = nodeFromStored(child, owner);
@@ -7564,7 +7636,7 @@ var BaseAddon = class {
7564
7636
  startMigration: (input) => api.startMigration.mutate(input),
7565
7637
  finishMigration: (input) => api.finishMigration.mutate(input)
7566
7638
  }, migrations, this.ctx.logger);
7567
- if (report.blockOwner.length > 0) throw new Error(`migration(s) ${report.blockOwner.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
7639
+ if (report.blockOwner.length > 0) throw new AddonMigrationsBlockedError(report.blockOwner);
7568
7640
  return report;
7569
7641
  }
7570
7642
  /**
@@ -7712,6 +7784,44 @@ var BaseAddon = class {
7712
7784
  return null;
7713
7785
  }
7714
7786
  /**
7787
+ * D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
7788
+ * provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
7789
+ * declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
7790
+ * {@link nodeSettingsSchema} and of {@link deviceDefaultsSchema} are disjoint, and a key never
7791
+ * contains `@` (guard `check-scoped-settings-declared`). SHAPE only: values are read by scope.
7792
+ */
7793
+ async clusterSettingsSchema(_cap) {
7794
+ return null;
7795
+ }
7796
+ /**
7797
+ * D986: the form shape of the settings one capability owns PER NODE, or `null`. Stored as
7798
+ * `addon-settings` rows `<addonId>.<field>@<nodeId>` carrying `nodeId` in the row data, so a
7799
+ * forgotten node's rows go in one central delete.
7800
+ */
7801
+ async nodeSettingsSchema(_cap) {
7802
+ return null;
7803
+ }
7804
+ /**
7805
+ * D986: the form shape of the FLEET DEFAULTS of the per-device settings one capability owns,
7806
+ * or `null`. Stored as `addon-settings` rows `<addonId>.<field>`; a device resolves its value
7807
+ * as device row, then this default, then the schema default (`resolveDeviceSettings`).
7808
+ */
7809
+ async deviceDefaultsSchema(_cap) {
7810
+ return null;
7811
+ }
7812
+ /**
7813
+ * The host's read of the scoped declarations: the schema one capability declares for `scope`,
7814
+ * or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
7815
+ * host asks this method.
7816
+ */
7817
+ async getScopedSettingsSchema(scope, cap) {
7818
+ switch (scope) {
7819
+ case "cluster": return this.clusterSettingsSchema(cap);
7820
+ case "node": return this.nodeSettingsSchema(cap);
7821
+ case "device-defaults": return this.deviceDefaultsSchema(cap);
7822
+ }
7823
+ }
7824
+ /**
7715
7825
  * What the create wizard and the integration edit page render for one instance: the addon's
7716
7826
  * per-instance schema when it declares one, else its global schema (what they always showed).
7717
7827
  */
@@ -7866,6 +7976,10 @@ var BaseAddon = class {
7866
7976
  const stored = keychain ? await this.readAddonStoreWithRetry() : {};
7867
7977
  const patch = {};
7868
7978
  for (const key of keys) {
7979
+ if (tree.get(key)?.kind === "array") {
7980
+ patch[key] = [];
7981
+ continue;
7982
+ }
7869
7983
  const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
7870
7984
  patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
7871
7985
  }
@@ -8505,6 +8619,21 @@ function normalizeAddonInitResult(result) {
8505
8619
  if (Array.isArray(result)) return { providers: result };
8506
8620
  return result;
8507
8621
  }
8622
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8623
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
8624
+ var RECORD_DATABASES = ["settings", "events"];
8625
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8626
+ var RECORD_CLASSES = [
8627
+ "config",
8628
+ "ledger",
8629
+ "audit",
8630
+ "mirror",
8631
+ "ephemeral"
8632
+ ];
8633
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8634
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8635
+ var RECORD_BATCH_MAX = 1e3;
8636
+ var RECORD_QUERY_MAX = 1e3;
8508
8637
  /**
8509
8638
  * The share-view scope kinds a share-link token can carry. The hub mints
8510
8639
  * and validates them (`ShareViewGrantSchema` builds its
@@ -8529,21 +8658,6 @@ var PeerBytesTicketSchema = object({
8529
8658
  */
8530
8659
  declaredBytes: number().int().nonnegative().nullable()
8531
8660
  });
8532
- /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8533
- /** The files a kind may live in. `history` is device-history's (D850), never records. */
8534
- var RECORD_DATABASES = ["settings", "events"];
8535
- /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8536
- var RECORD_CLASSES = [
8537
- "config",
8538
- "ledger",
8539
- "audit",
8540
- "mirror",
8541
- "ephemeral"
8542
- ];
8543
- var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8544
- var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8545
- var RECORD_BATCH_MAX = 1e3;
8546
- var RECORD_QUERY_MAX = 1e3;
8547
8661
  /**
8548
8662
  * Record kinds (D881): the declaration an addon makes of one kind of fact, the
8549
8663
  * Zod row schema that describes it, and the helper that turns the two into the
@@ -9321,6 +9435,7 @@ var CAP_NAMES = Object.freeze([
9321
9435
  "backup",
9322
9436
  "battery",
9323
9437
  "binary",
9438
+ "board-key-source",
9324
9439
  "brightness",
9325
9440
  "broker",
9326
9441
  "button",
@@ -9363,6 +9478,7 @@ var CAP_NAMES = Object.freeze([
9363
9478
  "device-status",
9364
9479
  "dishwasher",
9365
9480
  "display-palette",
9481
+ "do-not-disturb",
9366
9482
  "doorbell",
9367
9483
  "embedding-encoder",
9368
9484
  "enum-sensor",
@@ -9383,6 +9499,7 @@ var CAP_NAMES = Object.freeze([
9383
9499
  "humidity-sensor",
9384
9500
  "image",
9385
9501
  "image-settings",
9502
+ "integration-instances",
9386
9503
  "integrations",
9387
9504
  "intercom",
9388
9505
  "ir-transmitter",
@@ -9440,6 +9557,7 @@ var CAP_NAMES = Object.freeze([
9440
9557
  "privacy-mask",
9441
9558
  "ptz",
9442
9559
  "ptz-autotrack",
9560
+ "pump-cycle",
9443
9561
  "reboot",
9444
9562
  "record-entries",
9445
9563
  "recording",
@@ -10122,6 +10240,10 @@ Object.freeze({
10122
10240
  "valueType": "string"
10123
10241
  }
10124
10242
  ],
10243
+ "do-not-disturb": [{
10244
+ "path": "enabled",
10245
+ "valueType": "boolean"
10246
+ }],
10125
10247
  "doorbell": [{
10126
10248
  "path": "lastPressedAt",
10127
10249
  "valueType": "number"
@@ -10728,18 +10850,6 @@ Object.freeze({
10728
10850
  "path": "pumpRunning",
10729
10851
  "valueType": "boolean"
10730
10852
  },
10731
- {
10732
- "path": "pumpIntervalEnabled",
10733
- "valueType": "boolean"
10734
- },
10735
- {
10736
- "path": "pumpOnTime",
10737
- "valueType": "number"
10738
- },
10739
- {
10740
- "path": "pumpOffTime",
10741
- "valueType": "number"
10742
- },
10743
10853
  {
10744
10854
  "path": "lastDrink",
10745
10855
  "valueType": "number"
@@ -10863,6 +10973,20 @@ Object.freeze({
10863
10973
  "valueType": "number"
10864
10974
  }
10865
10975
  ],
10976
+ "pump-cycle": [
10977
+ {
10978
+ "path": "enabled",
10979
+ "valueType": "boolean"
10980
+ },
10981
+ {
10982
+ "path": "onTime",
10983
+ "valueType": "number"
10984
+ },
10985
+ {
10986
+ "path": "offTime",
10987
+ "valueType": "number"
10988
+ }
10989
+ ],
10866
10990
  "recording-archive": [
10867
10991
  {
10868
10992
  "path": "deviceId",
@@ -11312,7 +11436,7 @@ object({
11312
11436
  params: record(string(), union([string(), number()])).optional()
11313
11437
  });
11314
11438
  //#endregion
11315
- //#region ../types/dist/composition-kKKOdFIG.mjs
11439
+ //#region ../types/dist/composition-CRNwcFYY.mjs
11316
11440
  var AUDIO_ENCODER_BY_CODEC = {
11317
11441
  opus: "libopus",
11318
11442
  aac: "aac",
@@ -11489,6 +11613,7 @@ function buildVideoArgs(video, outputArgs, filterGraph, hwEncode) {
11489
11613
  if (video.level !== void 0) args.push("-level", video.level);
11490
11614
  if (video.pixelFormat !== void 0) args.push("-pix_fmt", video.pixelFormat);
11491
11615
  if (video.fps !== void 0) args.push("-r", String(video.fps));
11616
+ if (video.fpsMode !== void 0) args.push("-fps_mode", video.fpsMode);
11492
11617
  if (video.gopFrames !== void 0) args.push("-g", String(video.gopFrames));
11493
11618
  if (video.forceKeyFramesSeconds !== void 0) args.push("-force_key_frames", `expr:gte(t,n_forced*${video.forceKeyFramesSeconds})`);
11494
11619
  if (video.bf !== void 0) args.push("-bf", String(video.bf));
@@ -12670,38 +12795,6 @@ function validateExpressionSource(src) {
12670
12795
  return null;
12671
12796
  }
12672
12797
  /**
12673
- * One power reading becomes a washer, dryer or dishwasher (D944 helper).
12674
- *
12675
- * Standby of the control board is under 5 W; a motor or a heater is far
12676
- * above that, so 5 W is the line. A door lock or a short pump spike is not
12677
- * a cycle, so running starts only after 30 s above the line.
12678
- *
12679
- * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
12680
- * bursts) lasts several minutes. Ending the cycle on the first dip would
12681
- * report "finished" in the middle of the program, so the stop dwell is
12682
- * 10 minutes on every type. The number is stored per type so one machine
12683
- * can move later without moving the others.
12684
- */
12685
- var APPLIANCE_TEMPLATE_ID = "appliance";
12686
- var APPLIANCE_KINDS = [
12687
- "washer",
12688
- "dryer",
12689
- "dishwasher"
12690
- ];
12691
- DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
12692
- /**
12693
- * A dumb plug-in stove or heater, built from a smart plug (a `Heater`).
12694
- *
12695
- * The plug is the actuator: `switch.setState` is a FORWARD to the plug's own
12696
- * (D967), so the heater switches exactly as the plug does. Running is the
12697
- * plug being on; when a power reading is also named, running is the draw
12698
- * staying above the line instead (a plug left on with the stove's own
12699
- * thermostat open is not heating). 50 W is far above any standby and below
12700
- * the smallest radiator.
12701
- */
12702
- var HEATER_TEMPLATE_ID = "heater";
12703
- DeviceType.Heater;
12704
- /**
12705
12798
  * Statistics and integrals over a history read (D944).
12706
12799
  *
12707
12800
  * Pure: the same points always give the same answer, so a restart recomputes
@@ -12845,34 +12938,6 @@ var HelperSpecSchema = discriminatedUnion("kind", [
12845
12938
  /** Actuator groups only. Readings leave this unset. */
12846
12939
  active: ActiveCriterionSchema.optional()
12847
12940
  }),
12848
- object({
12849
- kind: literal("appliance"),
12850
- templateId: literal(APPLIANCE_TEMPLATE_ID),
12851
- appliance: _enum(APPLIANCE_KINDS),
12852
- thresholdWatts: number().positive(),
12853
- startDwellMs: number().int().nonnegative(),
12854
- stopDwellMs: number().int().nonnegative(),
12855
- member: HelperMemberSchema,
12856
- /**
12857
- * The plug that powers the appliance (`switch.on`). Optional: when set, the
12858
- * composition carries a `power-source` feature, so the hub can cut and restore
12859
- * that plug (power-source link of a NEW-target composition).
12860
- */
12861
- powerSwitch: HelperMemberSchema.optional(),
12862
- /** How long a forced restart keeps the plug off; the cap's default when unset. */
12863
- offSeconds: number().optional()
12864
- }),
12865
- object({
12866
- kind: literal("heater"),
12867
- templateId: literal(HEATER_TEMPLATE_ID),
12868
- /** The plug, read and commanded at `switch.on`. */
12869
- plug: HelperMemberSchema,
12870
- /** The plug's power reading, when it has one: running is then the draw, not the switch. */
12871
- meter: HelperMemberSchema.optional(),
12872
- thresholdWatts: number().positive(),
12873
- startDwellMs: number().int().nonnegative(),
12874
- stopDwellMs: number().int().nonnegative()
12875
- }),
12876
12941
  object({
12877
12942
  kind: literal("statistic"),
12878
12943
  stat: _enum(STATISTIC_STATS),
@@ -13044,7 +13109,14 @@ var CompositionForwardCommandSchema = object({
13044
13109
  method: string().min(1),
13045
13110
  args: record(string().min(1), CompositionForwardArgSchema).optional()
13046
13111
  });
13047
- var CompositionCommandTargetSchema = discriminatedUnion("kind", [CompositionForwardCommandSchema, CompositionCodeSourceSchema]);
13112
+ var CompositionCommandTargetSchema = discriminatedUnion("kind", [
13113
+ CompositionForwardCommandSchema,
13114
+ CompositionCodeSourceSchema,
13115
+ object({
13116
+ kind: literal("extension"),
13117
+ target: literal("remote")
13118
+ })
13119
+ ]);
13048
13120
  /** An item key inside an item-array cap (`consumables.items[<key>]`). */
13049
13121
  var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
13050
13122
  /**
@@ -13089,7 +13161,7 @@ var CompositionSchema = object({
13089
13161
  kind: literal("existing"),
13090
13162
  device: CompositionSourceRefSchema
13091
13163
  })]),
13092
- features: array(CompositionFeatureSchema).min(1).max(16),
13164
+ features: array(CompositionFeatureSchema).min(0).max(16),
13093
13165
  /**
13094
13166
  * Present when the block is a helper template. Absent on a free
13095
13167
  * composition (the room example, device 4603). The editor reads this,
@@ -13121,6 +13193,73 @@ var NodeColorIdSchema = _enum([
13121
13193
  "node-g",
13122
13194
  "node-h"
13123
13195
  ]);
13196
+ //#endregion
13197
+ //#region ../types/dist/index.mjs
13198
+ var SMTP_INBOUND_DEFAULT_PORT = 2525;
13199
+ var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
13200
+ var SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
13201
+ /** The text excerpt a message carries on the bus. */
13202
+ var SMTP_INBOUND_TEXT_MAX_CHARS = 4096;
13203
+ var PortSchema = number().int().min(1).max(65535);
13204
+ /** A recipient local-part: what stands before the `@`. */
13205
+ var SmtpRecipientSchema = string().min(1).max(64).regex(/^[A-Za-z0-9._+-]+$/);
13206
+ object({
13207
+ port: PortSchema.default(SMTP_INBOUND_DEFAULT_PORT),
13208
+ bindHost: string().min(1).default("0.0.0.0"),
13209
+ domain: string().min(1).default(SMTP_INBOUND_DEFAULT_DOMAIN),
13210
+ requireAuth: boolean().default(true),
13211
+ username: string().default(""),
13212
+ password: string().default("").meta({ secret: true }),
13213
+ starttls: boolean().default(false),
13214
+ maxMessageBytes: number().int().positive().default(SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES)
13215
+ });
13216
+ object({
13217
+ host: string().min(1).nullable(),
13218
+ hostReason: string().nullable(),
13219
+ port: PortSchema,
13220
+ domain: string().min(1),
13221
+ requireAuth: boolean(),
13222
+ username: string(),
13223
+ password: string(),
13224
+ starttls: boolean()
13225
+ });
13226
+ object({
13227
+ recipients: array(SmtpRecipientSchema).min(1),
13228
+ /**
13229
+ * Who is subscribing. A second `subscribe` with the same id REPLACES that subscriber's
13230
+ * recipients (the way a consumer that restarted, or lost a device, declares its set again);
13231
+ * a recipient held by another subscriber is refused with `smtp-inbound/recipient-claimed`.
13232
+ * Absent, the subscriber is anonymous and unique.
13233
+ */
13234
+ subscriberId: string().min(1).max(64).optional()
13235
+ });
13236
+ var SmtpInboundAttachmentSchema = object({
13237
+ filename: string(),
13238
+ contentType: string(),
13239
+ bytes: number().int().nonnegative()
13240
+ });
13241
+ /** The payload of one `broker.message` (the key is the recipient local-part). */
13242
+ var SmtpInboundMessageSchema = object({
13243
+ /** Monotonic per mailbox; a gap tells a consumer it missed an event. */
13244
+ seq: number().int().positive(),
13245
+ messageId: string(),
13246
+ receivedAt: number().int().nonnegative(),
13247
+ from: string(),
13248
+ to: string(),
13249
+ subject: string(),
13250
+ text: string().max(SMTP_INBOUND_TEXT_MAX_CHARS),
13251
+ attachments: array(SmtpInboundAttachmentSchema)
13252
+ });
13253
+ object({
13254
+ /** The newest seq issued so far (0 before any mail). */
13255
+ lastSeq: number().int().nonnegative(),
13256
+ /** The oldest seq still retained; messages below it are gone. */
13257
+ oldestSeq: number().int().nonnegative(),
13258
+ messages: array(object({
13259
+ key: string(),
13260
+ message: SmtpInboundMessageSchema
13261
+ }))
13262
+ });
13124
13263
  new Set([
13125
13264
  "track",
13126
13265
  "face",
@@ -14285,6 +14424,16 @@ var MigrationPlanSchema = object({ edits: array(discriminatedUnion("op", [
14285
14424
  precondition: PreconditionSchema
14286
14425
  })
14287
14426
  ])) });
14427
+ /** `JSON.stringify` with object keys sorted, so equal values spell the same. */
14428
+ function canonicalJson(value) {
14429
+ if (Array.isArray(value)) return `[${value.map((item) => canonicalJson(item)).join(",")}]`;
14430
+ 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(",")}}`;
14431
+ return JSON.stringify(value) ?? "null";
14432
+ }
14433
+ /** The precondition string for a value a plan read (`null` when it read nothing). */
14434
+ function preconditionOf(value) {
14435
+ return canonicalJson(value ?? null);
14436
+ }
14288
14437
  /**
14289
14438
  * What a `procedure` body reports. `already-done` means the rerun observed the
14290
14439
  * work finished (a crash between the work and the ledger row, or a manual fix)
@@ -16299,8 +16448,18 @@ var LogChannelDescriptorSchema = object({
16299
16448
  * the operator narrows to one camera, sees nothing, and concludes the code
16300
16449
  * path was never taken.
16301
16450
  */
16302
- perDevice: boolean()
16303
- });
16451
+ perDevice: boolean(),
16452
+ /**
16453
+ * What the channel is FOR, so the UI can list the channels an addon offers.
16454
+ *
16455
+ * - `diagnostic` (the default): a per-component diagnostic armed from the
16456
+ * Levels page, emitted at its declared level.
16457
+ * - `debug`: a `debug.<channel>` dump watched live for a short window
16458
+ * (`ctx.debug`). Always per-device, and its lines are denied by the log
16459
+ * ring unless somebody is watching that device.
16460
+ */
16461
+ kind: _enum(["diagnostic", "debug"]).default("diagnostic")
16462
+ }).refine((d) => d.kind !== "debug" || d.name.startsWith("debug.") && d.perDevice, { message: "a debug channel is named debug.<channel> and is per-device" });
16304
16463
  /**
16305
16464
  * An armed window over one channel, as the document hands it to a mirror.
16306
16465
  *
@@ -19607,24 +19766,52 @@ var APPLIANCE_CAP_VOCABULARY = {
19607
19766
  args: { on: false }
19608
19767
  },
19609
19768
  {
19610
- id: "petFountain.intervalOn",
19611
- method: "setPumpInterval",
19769
+ id: "petFountain.resetDailyConsumption",
19770
+ method: "resetDailyConsumption",
19771
+ label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
19772
+ phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
19773
+ icon: "rotate-ccw"
19774
+ }
19775
+ ],
19776
+ state: [{
19777
+ kind: "boolean",
19778
+ field: "empty",
19779
+ label: t("Tank empty", "Serbatoio vuoto"),
19780
+ whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
19781
+ whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
19782
+ icon: "droplet"
19783
+ }, {
19784
+ kind: "numeric",
19785
+ field: "waterLevel",
19786
+ quantity: t("the water level", "il livello dell’acqua"),
19787
+ label: t("Water level", "Livello dell’acqua"),
19788
+ unit: "%",
19789
+ icon: "droplets"
19790
+ }]
19791
+ },
19792
+ "pump-cycle": {
19793
+ scope: "device",
19794
+ noun: t("Pump cycle", "Ciclo della pompa"),
19795
+ actions: [
19796
+ {
19797
+ id: "pumpCycle.on",
19798
+ method: "setEnabled",
19612
19799
  label: t("Pump cycle on", "Ciclo pompa attivo"),
19613
19800
  phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
19614
19801
  icon: "timer",
19615
19802
  args: { on: true }
19616
19803
  },
19617
19804
  {
19618
- id: "petFountain.intervalOff",
19619
- method: "setPumpInterval",
19805
+ id: "pumpCycle.off",
19806
+ method: "setEnabled",
19620
19807
  label: t("Pump cycle off", "Ciclo pompa spento"),
19621
19808
  phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
19622
19809
  icon: "timer-off",
19623
19810
  args: { on: false }
19624
19811
  },
19625
19812
  {
19626
- id: "petFountain.pumpOnMinutes",
19627
- method: "setPumpOnMinutes",
19813
+ id: "pumpCycle.onMinutes",
19814
+ method: "setOnMinutes",
19628
19815
  label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
19629
19816
  phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
19630
19817
  icon: "timer",
@@ -19640,8 +19827,8 @@ var APPLIANCE_CAP_VOCABULARY = {
19640
19827
  }]
19641
19828
  },
19642
19829
  {
19643
- id: "petFountain.pumpOffMinutes",
19644
- method: "setPumpOffMinutes",
19830
+ id: "pumpCycle.offMinutes",
19831
+ method: "setOffMinutes",
19645
19832
  label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
19646
19833
  phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
19647
19834
  icon: "timer-off",
@@ -19655,35 +19842,63 @@ var APPLIANCE_CAP_VOCABULARY = {
19655
19842
  unit: "min"
19656
19843
  }
19657
19844
  }]
19658
- },
19659
- {
19660
- id: "petFountain.resetDailyConsumption",
19661
- method: "resetDailyConsumption",
19662
- label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
19663
- phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
19664
- icon: "rotate-ccw"
19665
19845
  }
19666
19846
  ],
19667
19847
  state: [{
19668
19848
  kind: "boolean",
19669
- field: "empty",
19670
- label: t("Tank empty", "Serbatoio vuoto"),
19671
- whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
19672
- whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
19673
- icon: "droplet"
19674
- }, {
19675
- kind: "numeric",
19676
- field: "waterLevel",
19677
- quantity: t("the water level", "il livello dell’acqua"),
19678
- label: t("Water level", "Livello dell’acqua"),
19679
- unit: "%",
19680
- icon: "droplets"
19849
+ field: "enabled",
19850
+ label: t("Pump cycle", "Ciclo pompa"),
19851
+ whenTrue: t("When {device} starts running its pump on a cycle", "Quando {device} inizia a far lavorare la pompa a ciclo"),
19852
+ whenFalse: t("When {device} runs its pump continuously", "Quando {device} fa lavorare la pompa in continuo"),
19853
+ icon: "timer"
19681
19854
  }]
19682
19855
  },
19683
19856
  "media-player": {
19684
19857
  scope: "device",
19685
19858
  noun: t("Media player", "Lettore multimediale"),
19686
19859
  actions: [
19860
+ {
19861
+ id: "media.turnOn",
19862
+ method: "turnOn",
19863
+ label: t("Turn on", "Accendi"),
19864
+ phrase: t("Turn on {device}", "Accendi {device}"),
19865
+ icon: "power"
19866
+ },
19867
+ {
19868
+ id: "media.turnOff",
19869
+ method: "turnOff",
19870
+ label: t("Turn off", "Spegni"),
19871
+ phrase: t("Turn off {device}", "Spegni {device}"),
19872
+ icon: "power"
19873
+ },
19874
+ {
19875
+ id: "media.volumeUp",
19876
+ method: "volumeUp",
19877
+ label: t("Volume up", "Alza il volume"),
19878
+ phrase: t("Raise the volume of {device}", "Alza il volume di {device}"),
19879
+ icon: "volume-2"
19880
+ },
19881
+ {
19882
+ id: "media.volumeDown",
19883
+ method: "volumeDown",
19884
+ label: t("Volume down", "Abbassa il volume"),
19885
+ phrase: t("Lower the volume of {device}", "Abbassa il volume di {device}"),
19886
+ icon: "volume-2"
19887
+ },
19888
+ {
19889
+ id: "media.channelUp",
19890
+ method: "channelUp",
19891
+ label: t("Channel up", "Canale successivo"),
19892
+ phrase: t("Go to the next channel on {device}", "Passa al canale successivo su {device}"),
19893
+ icon: "skip-forward"
19894
+ },
19895
+ {
19896
+ id: "media.channelDown",
19897
+ method: "channelDown",
19898
+ label: t("Channel down", "Canale precedente"),
19899
+ phrase: t("Go to the previous channel on {device}", "Torna al canale precedente su {device}"),
19900
+ icon: "skip-back"
19901
+ },
19687
19902
  {
19688
19903
  id: "media.play",
19689
19904
  method: "play",
@@ -20363,6 +20578,33 @@ var APPLIANCE_CAP_VOCABULARY = {
20363
20578
  }
20364
20579
  ]
20365
20580
  },
20581
+ "do-not-disturb": {
20582
+ scope: "device",
20583
+ noun: t("Do not disturb", "Non disturbare"),
20584
+ actions: [{
20585
+ id: "dnd.on",
20586
+ method: "setEnabled",
20587
+ label: t("Do not disturb on", "Attiva Non disturbare"),
20588
+ phrase: t("Turn on Do not disturb on {device}", "Attiva Non disturbare su {device}"),
20589
+ icon: "bell-off",
20590
+ args: { enabled: true }
20591
+ }, {
20592
+ id: "dnd.off",
20593
+ method: "setEnabled",
20594
+ label: t("Do not disturb off", "Disattiva Non disturbare"),
20595
+ phrase: t("Turn off Do not disturb on {device}", "Disattiva Non disturbare su {device}"),
20596
+ icon: "bell",
20597
+ args: { enabled: false }
20598
+ }],
20599
+ state: [{
20600
+ kind: "boolean",
20601
+ field: "enabled",
20602
+ label: t("Do not disturb", "Non disturbare"),
20603
+ whenTrue: t("When Do not disturb turns on on {device}", "Quando {device} attiva Non disturbare"),
20604
+ whenFalse: t("When Do not disturb turns off on {device}", "Quando {device} disattiva Non disturbare"),
20605
+ icon: "bell-off"
20606
+ }]
20607
+ },
20366
20608
  update: {
20367
20609
  scope: "device",
20368
20610
  noun: t("Firmware update", "Aggiornamento firmware"),
@@ -21543,6 +21785,7 @@ var SYSTEM_CAP_VOCABULARY = {
21543
21785
  "audio-analyzer": system(PIPELINE),
21544
21786
  "audio-codec": system(INTERNAL),
21545
21787
  "auth-provider": system(IDENTITY),
21788
+ "board-key-source": system(INTERNAL),
21546
21789
  backup: system("system backups — run and restored from the Backups page"),
21547
21790
  broker: system("message-broker connections — configured, not actuated"),
21548
21791
  "calendar-source": system(INTERNAL),
@@ -21577,6 +21820,7 @@ var SYSTEM_CAP_VOCABULARY = {
21577
21820
  "load-contribution": system(INTERNAL),
21578
21821
  "local-network": system(NETWORK),
21579
21822
  "log-channels": system(INTERNAL),
21823
+ "integration-instances": system(INTERNAL),
21580
21824
  "log-destination": system(INTERNAL),
21581
21825
  "login-method": system(IDENTITY),
21582
21826
  "mesh-network": system(NETWORK),
@@ -42419,14 +42663,16 @@ var DeviceIsLeafSchema = object({
42419
42663
  });
42420
42664
  /**
42421
42665
  * True when the camera currently has a PARKED object matching `subjects` in at
42422
- * least one of `zones`. Reads the zone-analytics snapshot through the same
42666
+ * least one of `zones` (`minCount` of them, default one). Reads the zone-analytics snapshot through the same
42423
42667
  * mirror as every other state leaf, so a dropped event never decides it (D49).
42424
42668
  */
42425
42669
  var StationaryPresentLeafSchema = object({
42426
42670
  kind: literal("stationary-present"),
42427
42671
  deviceId: number().int().nonnegative(),
42428
42672
  subjects: array(StationarySubjectSchema).min(1).optional(),
42429
- zones: array(string().min(1)).min(1).optional()
42673
+ zones: array(string().min(1)).min(1).optional(),
42674
+ /** How many matching parked objects must be there; absent means one. */
42675
+ minCount: number().int().positive().optional()
42430
42676
  });
42431
42677
  /**
42432
42678
  * The escape hatch: the bounded expression engine over named device bindings.
@@ -42938,6 +43184,28 @@ function convertLegacyRecipe(legacy) {
42938
43184
  * it. The output type is always the new one.
42939
43185
  */
42940
43186
  var AutomationRecipeSchema = union([CurrentAutomationRecipeSchema, LegacyAutomationRecipeSchema.transform(convertLegacyRecipe)]);
43187
+ var DETECTION_DESCRIPTIONS = {
43188
+ deviceId: "the camera that saw it",
43189
+ className: "what it saw",
43190
+ trackId: "the track",
43191
+ score: "how sure the detector was",
43192
+ label: "the label it matched (a name, a plate), empty when none"
43193
+ };
43194
+ var STATIONARY_DESCRIPTIONS = {
43195
+ deviceId: "the camera that saw it",
43196
+ className: "what it saw",
43197
+ zones: "the zones it is in",
43198
+ phase: "appeared or departed",
43199
+ entryId: "the stopped object"
43200
+ };
43201
+ function describe$1(descriptions) {
43202
+ return Object.entries(descriptions).map(([name, description]) => ({
43203
+ name,
43204
+ description
43205
+ }));
43206
+ }
43207
+ describe$1(DETECTION_DESCRIPTIONS);
43208
+ describe$1(STATIONARY_DESCRIPTIONS);
42941
43209
  new Set(Object.values(COCO_TO_MACRO.mapping));
42942
43210
  /**
42943
43211
  * Schedulers (D983) — an entity that performs actions over the day.
@@ -43699,7 +43967,7 @@ var TargetKindCapsSchema = object({
43699
43967
  * the union is large and not meant for runtime validation here; the exported
43700
43968
  * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
43701
43969
  */
43702
- var ConfigSchemaPassthrough$3 = unknown();
43970
+ var ConfigSchemaPassthrough$4 = unknown();
43703
43971
  var TargetKindSchema = object({
43704
43972
  kind: string(),
43705
43973
  label: string(),
@@ -43736,7 +44004,7 @@ var TargetKindSchema = object({
43736
44004
  * its raster path, which is the safe default for an unknown image.
43737
44005
  */
43738
44006
  iconMediaType: string().optional(),
43739
- configSchema: ConfigSchemaPassthrough$3,
44007
+ configSchema: ConfigSchemaPassthrough$4,
43740
44008
  /**
43741
44009
  * The config keys that decide WHERE this kind's secrets are sent (server,
43742
44010
  * base URL, instance, chat, recipient). A save that changes any of them
@@ -46048,6 +46316,49 @@ object({
46048
46316
  lastChangedAt: number()
46049
46317
  });
46050
46318
  DeviceType.Sensor;
46319
+ /**
46320
+ * Why a board key could not be read. Typed so a caller reports the cause and
46321
+ * never treats "could not read" as "has no key" (D49).
46322
+ */
46323
+ var BoardKeyFailureReasonSchema = _enum([
46324
+ "unknown-source",
46325
+ "not-admin",
46326
+ "no-builder",
46327
+ "no-ingress-url",
46328
+ "unreachable",
46329
+ "unknown-board",
46330
+ "no-encryption-key",
46331
+ "unreadable-config"
46332
+ ]);
46333
+ var BoardKeySourceSchema = object({
46334
+ sourceId: string(),
46335
+ name: string()
46336
+ });
46337
+ var BoardKeyBoardSchema = object({
46338
+ /** The builder's file name, e.g. `kitchen.yaml`: the handle `getBoardKey` takes. */
46339
+ configuration: string(),
46340
+ /** The node name the builder gives the board. */
46341
+ name: string(),
46342
+ /** The address the builder knows the board by, when it has one. */
46343
+ address: string().nullable()
46344
+ });
46345
+ var BoardKeyFailureSchema = object({
46346
+ ok: literal(false),
46347
+ reason: BoardKeyFailureReasonSchema,
46348
+ detail: string().optional()
46349
+ });
46350
+ var ListBoardsResultSchema = discriminatedUnion("ok", [object({
46351
+ ok: literal(true),
46352
+ boards: array(BoardKeyBoardSchema).readonly()
46353
+ }), BoardKeyFailureSchema]);
46354
+ var GetBoardKeyResultSchema = discriminatedUnion("ok", [object({
46355
+ ok: literal(true),
46356
+ key: string()
46357
+ }), BoardKeyFailureSchema]);
46358
+ method(_void(), array(BoardKeySourceSchema).readonly(), { auth: "admin" }), method(object({ sourceId: string().min(1) }), ListBoardsResultSchema, { auth: "admin" }), method(object({
46359
+ sourceId: string().min(1),
46360
+ configuration: string().min(1)
46361
+ }), GetBoardKeyResultSchema, { auth: "admin" });
46051
46362
  object({
46052
46363
  /** Current level as 0..100 inclusive. Firmware-reported. */
46053
46364
  level: number().min(0).max(100).meta(readingMeta("percentage")),
@@ -48141,6 +48452,188 @@ DeviceType.Control, method(object({
48141
48452
  kind: "mutation",
48142
48453
  auth: "protected"
48143
48454
  });
48455
+ /**
48456
+ * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
48457
+ * Apple TV, Spotify, Roku, generic OTT receivers, …) on
48458
+ * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
48459
+ * surface — those use `DeviceType.Camera` + the broker pipeline.
48460
+ *
48461
+ * The cap declares a wide method surface; not every backend supports
48462
+ * every method. Drivers signal sub-capability via the
48463
+ * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
48464
+ * corresponding method) so the UI gates buttons without a slice
48465
+ * fetch — same pattern as `PanTiltZoom` for cameras.
48466
+ */
48467
+ var MediaPlayerStateSchema = _enum([
48468
+ "off",
48469
+ "on",
48470
+ "idle",
48471
+ "playing",
48472
+ "paused",
48473
+ "buffering",
48474
+ "standby"
48475
+ ]);
48476
+ var MediaPlayerRepeatSchema = _enum([
48477
+ "off",
48478
+ "all",
48479
+ "one"
48480
+ ]);
48481
+ var MediaInfoSchema = object({
48482
+ /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
48483
+ * `podcast`, …). */
48484
+ type: string(),
48485
+ /** Human-readable title. */
48486
+ title: string(),
48487
+ /** Optional artist / channel / station label. */
48488
+ artist: string().optional(),
48489
+ /** Optional album / season / show name. */
48490
+ album: string().optional(),
48491
+ /** Optional cover-art / thumbnail URL. */
48492
+ imageUrl: string().optional()
48493
+ });
48494
+ /**
48495
+ * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
48496
+ * the device said so. `assumed`: the driver has no feedback (infrared) and
48497
+ * tracks what it last SENT; it moves only after a send was accepted, and a
48498
+ * human at the real remote makes it wrong. A UI shows an assumed value as a
48499
+ * guess, never as a reading.
48500
+ */
48501
+ var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
48502
+ /** The fields of a media-player status a driver can only guess. */
48503
+ var MediaPlayerAssumedFieldSchema = _enum([
48504
+ "state",
48505
+ "volumeLevel",
48506
+ "isMuted",
48507
+ "source"
48508
+ ]);
48509
+ var MediaPlayerStatusSchema = object({
48510
+ /** Playback lifecycle state. */
48511
+ state: MediaPlayerStateSchema,
48512
+ /**
48513
+ * Whether the state fields are readings or the driver's own bookkeeping.
48514
+ * A slice written before this field existed parses as `reported`.
48515
+ */
48516
+ stateSource: MediaPlayerStateSourceSchema.default("reported"),
48517
+ /**
48518
+ * Which fields are the driver's own guess. `stateSource` is `assumed` when
48519
+ * this is not empty; a field not listed here is a reading even then (power
48520
+ * from a running-state source, mute guessed from the last send).
48521
+ */
48522
+ assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
48523
+ /** Volume as 0..100 inclusive. Null when the device has no volume
48524
+ * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
48525
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
48526
+ /** Mute toggle distinct from volume=0. Null when no mute surface.
48527
+ * Pair with `DeviceFeature.MediaPlayerMute`. */
48528
+ isMuted: boolean().nullable(),
48529
+ /** Active source / input. Empty when no source surface. */
48530
+ source: string(),
48531
+ /** Selectable sources. Empty when no source surface.
48532
+ * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
48533
+ availableSources: array(string()),
48534
+ /** Currently-playing media info. Null when nothing is playing. */
48535
+ currentMedia: MediaInfoSchema.nullable(),
48536
+ /** Current playback position in ms. Null when not seekable or
48537
+ * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
48538
+ position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
48539
+ /** Total duration of the current media in ms. Null when unknown
48540
+ * (live stream) or nothing is playing. */
48541
+ duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
48542
+ /** Shuffle toggle. Null when no shuffle surface.
48543
+ * Pair with `DeviceFeature.MediaPlayerShuffle`. */
48544
+ shuffle: boolean().nullable(),
48545
+ /** Repeat mode. Null when no repeat surface.
48546
+ * Pair with `DeviceFeature.MediaPlayerRepeat`. */
48547
+ repeat: MediaPlayerRepeatSchema.nullable(),
48548
+ /** Ms epoch when the slice was last updated. */
48549
+ lastChangedAt: number()
48550
+ });
48551
+ var stepInput = object({
48552
+ deviceId: number().int().nonnegative(),
48553
+ /** How many presses: the caller's count (Alexa `volumeSteps`, `channelCount`). */
48554
+ steps: number().int().min(1).max(50).default(1)
48555
+ });
48556
+ var deviceOnly = object({ deviceId: number().int().nonnegative() });
48557
+ DeviceType.MediaPlayer, method(deviceOnly, _void(), {
48558
+ kind: "mutation",
48559
+ auth: "protected"
48560
+ }), method(deviceOnly, _void(), {
48561
+ kind: "mutation",
48562
+ auth: "protected"
48563
+ }), method(stepInput, _void(), {
48564
+ kind: "mutation",
48565
+ auth: "protected"
48566
+ }), method(stepInput, _void(), {
48567
+ kind: "mutation",
48568
+ auth: "protected"
48569
+ }), method(stepInput, _void(), {
48570
+ kind: "mutation",
48571
+ auth: "protected"
48572
+ }), method(stepInput, _void(), {
48573
+ kind: "mutation",
48574
+ auth: "protected"
48575
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48576
+ kind: "mutation",
48577
+ auth: "protected"
48578
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48579
+ kind: "mutation",
48580
+ auth: "protected"
48581
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48582
+ kind: "mutation",
48583
+ auth: "protected"
48584
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48585
+ kind: "mutation",
48586
+ auth: "protected"
48587
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48588
+ kind: "mutation",
48589
+ auth: "protected"
48590
+ }), method(object({
48591
+ deviceId: number().int().nonnegative(),
48592
+ position: number().int().nonnegative()
48593
+ }), _void(), {
48594
+ kind: "mutation",
48595
+ auth: "protected"
48596
+ }), method(object({
48597
+ deviceId: number().int().nonnegative(),
48598
+ volumeLevel: number().min(0).max(100)
48599
+ }), _void(), {
48600
+ kind: "mutation",
48601
+ auth: "protected"
48602
+ }), method(object({
48603
+ deviceId: number().int().nonnegative(),
48604
+ muted: boolean()
48605
+ }), _void(), {
48606
+ kind: "mutation",
48607
+ auth: "protected"
48608
+ }), method(object({
48609
+ deviceId: number().int().nonnegative(),
48610
+ shuffle: boolean()
48611
+ }), _void(), {
48612
+ kind: "mutation",
48613
+ auth: "protected"
48614
+ }), method(object({
48615
+ deviceId: number().int().nonnegative(),
48616
+ repeat: MediaPlayerRepeatSchema
48617
+ }), _void(), {
48618
+ kind: "mutation",
48619
+ auth: "protected"
48620
+ }), method(object({
48621
+ deviceId: number().int().nonnegative(),
48622
+ source: string().min(1)
48623
+ }), _void(), {
48624
+ kind: "mutation",
48625
+ auth: "protected"
48626
+ }), method(object({
48627
+ deviceId: number().int().nonnegative(),
48628
+ /** Media identifier / URL. */
48629
+ mediaId: string().min(1),
48630
+ /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
48631
+ * passes it through to the upstream service. */
48632
+ mediaType: string().min(1)
48633
+ }), _void(), {
48634
+ kind: "mutation",
48635
+ auth: "protected"
48636
+ });
48144
48637
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater;
48145
48638
  var NUMBER = {
48146
48639
  kind: "fixed",
@@ -48588,49 +49081,6 @@ function actuator(input) {
48588
49081
  };
48589
49082
  }
48590
49083
  new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
48591
- var PowerSourceRefusalReasonSchema = _enum([
48592
- "no-power-source",
48593
- "switch-missing",
48594
- "switch-offline",
48595
- "switch-unknown",
48596
- "restart-in-progress",
48597
- "switch-call-failed"
48598
- ]);
48599
- var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
48600
- accepted: literal(false),
48601
- reason: PowerSourceRefusalReasonSchema,
48602
- /** One line for the operator, naming the switch. */
48603
- message: string()
48604
- })]);
48605
- var PowerSourceInfoSchema = object({
48606
- /** False when the device has no power source linked; the rest is then empty. */
48607
- linked: boolean(),
48608
- switchDeviceId: number().nullable(),
48609
- switchName: string().nullable(),
48610
- /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
48611
- switchOn: boolean().nullable(),
48612
- switchOnline: boolean().nullable(),
48613
- restartInProgress: boolean(),
48614
- offSeconds: number().int()
48615
- });
48616
- object({
48617
- /** Null while the switch has not reported: unknown is never `false` (D393). */
48618
- switchOn: boolean().nullable(),
48619
- offSeconds: number().int(),
48620
- lastFetchedAt: number()
48621
- });
48622
- 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;
48623
- var deviceInput$2 = object({ deviceId: number().int().nonnegative() });
48624
- systemMethod(deviceInput$2, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
48625
- kind: "mutation",
48626
- auth: "admin"
48627
- }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
48628
- kind: "mutation",
48629
- auth: "admin"
48630
- }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
48631
- kind: "mutation",
48632
- auth: "admin"
48633
- });
48634
49084
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
48635
49085
  DeviceType.Camera;
48636
49086
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
@@ -48658,6 +49108,165 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
48658
49108
  }).optional()
48659
49109
  })) });
48660
49110
  /**
49111
+ * A saved Customize assignment (D936). The schema is the type: callers use
49112
+ * `z.infer`, they do not restate the shape.
49113
+ */
49114
+ var OverrideSourceSchema = object({
49115
+ addonId: string().min(1),
49116
+ stableId: string().min(1),
49117
+ cap: string().min(1),
49118
+ fieldPath: string().min(1)
49119
+ });
49120
+ var IdentityTransformDraftSchema = object({ kind: literal("identity") });
49121
+ var InvertTransformDraftSchema = object({ kind: literal("invert") });
49122
+ var ThresholdTransformDraftSchema = object({
49123
+ kind: literal("threshold"),
49124
+ comparison: _enum(["gte", "lte"]),
49125
+ threshold: number(),
49126
+ startDwellMs: number().nonnegative(),
49127
+ stopDwellMs: number().nonnegative()
49128
+ });
49129
+ var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
49130
+ IdentityTransformDraftSchema,
49131
+ InvertTransformDraftSchema,
49132
+ ThresholdTransformDraftSchema,
49133
+ object({
49134
+ kind: literal("linear"),
49135
+ scale: number(),
49136
+ offset: number(),
49137
+ clampMin: number().optional(),
49138
+ clampMax: number().optional()
49139
+ }),
49140
+ object({
49141
+ kind: literal("enum-map"),
49142
+ mapping: record(string(), string().nullable())
49143
+ }),
49144
+ object({ kind: literal("number") })
49145
+ ]);
49146
+ var ScalarOverrideDraftSchema = object({
49147
+ kind: literal("scalar"),
49148
+ cap: string().min(1),
49149
+ targetId: string().min(1),
49150
+ source: OverrideSourceSchema,
49151
+ transform: CustomizeTransformDraftSchema
49152
+ });
49153
+ var KeyedArrayOverrideDraftSchema = object({
49154
+ kind: literal("keyedArray"),
49155
+ cap: string().min(1),
49156
+ targetId: string().min(1),
49157
+ key: string().min(1),
49158
+ label: string().min(1),
49159
+ fieldPath: string().min(1),
49160
+ source: OverrideSourceSchema,
49161
+ transform: CustomizeTransformDraftSchema
49162
+ });
49163
+ var PulseOverrideDraftSchema = object({
49164
+ kind: literal("pulse"),
49165
+ cap: string().min(1),
49166
+ targetId: string().min(1),
49167
+ enabled: boolean(),
49168
+ debounceMs: number().nonnegative(),
49169
+ edges: array(_enum([
49170
+ "rising",
49171
+ "button",
49172
+ "native-event"
49173
+ ])).min(1).optional(),
49174
+ sources: array(OverrideSourceSchema).min(1)
49175
+ });
49176
+ var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
49177
+ "in-addition",
49178
+ "confirm",
49179
+ "replace"
49180
+ ]).optional() });
49181
+ discriminatedUnion("kind", [
49182
+ ScalarOverrideDraftSchema,
49183
+ KeyedArrayOverrideDraftSchema,
49184
+ PulseOverrideDraftSchema,
49185
+ object({
49186
+ kind: literal("span"),
49187
+ cap: string().min(1),
49188
+ targetId: string().min(1),
49189
+ timeoutMs: number().nonnegative(),
49190
+ cooldownMs: number().nonnegative().optional(),
49191
+ sources: array(SpanSourceDraftSchema)
49192
+ })
49193
+ ]);
49194
+ object({
49195
+ targetId: string().min(1),
49196
+ configured: boolean(),
49197
+ source: _enum(["native", "assigned"]),
49198
+ state: _enum([
49199
+ "active",
49200
+ "stale",
49201
+ "released",
49202
+ "unavailable"
49203
+ ]),
49204
+ reason: string().nullable()
49205
+ });
49206
+ /**
49207
+ * What a running-threshold proposal says (planning#405). The schema is the
49208
+ * type: the algorithm, the capability method and the UI all read `z.infer`.
49209
+ *
49210
+ * A proposal is read-only advice: it carries the numbers it was derived from
49211
+ * (`evidence`) so the operator can judge it, and an `insufficient` answer names
49212
+ * WHY with a typed reason and the catalog defaults, never an invented number.
49213
+ */
49214
+ var RunningProposalTierSchema = _enum(["raw", "5m"]);
49215
+ var RunningProposalConfidenceSchema = _enum([
49216
+ "high",
49217
+ "medium",
49218
+ "low"
49219
+ ]);
49220
+ var RunningProposalInsufficientReasonSchema = _enum([
49221
+ "no-history",
49222
+ "span-too-short",
49223
+ "truncated",
49224
+ "no-idle-floor",
49225
+ "no-runs",
49226
+ "no-separation"
49227
+ ]);
49228
+ var RunningProposalReplaySchema = object({
49229
+ /** Intervals the real dwell expression held true over the window. */
49230
+ intervals: number().int().nonnegative(),
49231
+ /** Intervals outside every run, or a second interval inside one. */
49232
+ extra: number().int().nonnegative(),
49233
+ /** Runs without an interval of their own (none, or merged into a neighbour). */
49234
+ missed: number().int().nonnegative()
49235
+ });
49236
+ var RunningProposalEvidenceSchema = object({
49237
+ tier: RunningProposalTierSchema,
49238
+ spanMs: number().nonnegative(),
49239
+ from: number(),
49240
+ to: number(),
49241
+ points: number().int().nonnegative(),
49242
+ runsFound: number().int().nonnegative(),
49243
+ pausesFound: number().int().nonnegative(),
49244
+ longestPauseMs: number().nonnegative(),
49245
+ idleFloorW: number(),
49246
+ noiseCeilingW: number(),
49247
+ plateauW: number(),
49248
+ replay: RunningProposalReplaySchema
49249
+ });
49250
+ var RunningProposalInsufficientEvidenceSchema = object({
49251
+ spanMs: number().nonnegative(),
49252
+ points: number().int().nonnegative(),
49253
+ runsFound: number().int().nonnegative()
49254
+ });
49255
+ var RunningThresholdProposalSchema = discriminatedUnion("state", [object({
49256
+ state: literal("proposal"),
49257
+ transform: ThresholdTransformDraftSchema,
49258
+ evidence: RunningProposalEvidenceSchema,
49259
+ confidence: RunningProposalConfidenceSchema,
49260
+ /** Why the confidence is not higher; empty when nothing held it back. */
49261
+ notes: array(string())
49262
+ }), object({
49263
+ state: literal("insufficient"),
49264
+ reason: RunningProposalInsufficientReasonSchema,
49265
+ evidence: RunningProposalInsufficientEvidenceSchema,
49266
+ /** The catalog defaults, offered as what stands when nothing better is known. */
49267
+ fallback: ThresholdTransformDraftSchema
49268
+ })]);
49269
+ /**
48661
49270
  * The report of a one-shot "move this owner's plaintext secrets into the
48662
49271
  * keychain" run (D878). COUNTS only - never a value, never a ref.
48663
49272
  *
@@ -48947,6 +49556,14 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
48947
49556
  kind: "mutation",
48948
49557
  auth: "admin",
48949
49558
  access: "view"
49559
+ }), method(object({
49560
+ deviceId: number().int(),
49561
+ cap: string().min(1),
49562
+ fieldPath: string().min(1),
49563
+ deviceType: _enum(DeviceType).optional()
49564
+ }), RunningThresholdProposalSchema, {
49565
+ auth: "admin",
49566
+ access: "view"
48950
49567
  }), method(object({
48951
49568
  blockId: string().min(1),
48952
49569
  trace: AutomationRunTraceSchema.optional(),
@@ -49811,7 +50428,53 @@ method(object({
49811
50428
  * exposes only the COMMON surface: link state, supported device
49812
50429
  * kinds (so the UI can filter the device picker), and per-device
49813
50430
  * expose/unexpose.
50431
+ *
50432
+ * INSTANCES. One export addon can serve several independent targets (a
50433
+ * HomeKit bridge, a Home Assistant broker). `listInstances` names them.
50434
+ * `instanceId` on a READ is optional: absent = the whole addon (linked if any
50435
+ * enabled instance is, `exposedDeviceCount` = distinct devices, `setup` = the
50436
+ * default instance's); present = that instance; an id the provider does not
50437
+ * serve is refused with `ExportInstanceUnknownError` (`export-instance-unknown`),
50438
+ * never answered empty. `instanceId` on a WRITE is REQUIRED: a membership
50439
+ * change always names the target it changes. A single-instance provider
50440
+ * accepts an absent id on a read or its own id, and refuses any other.
50441
+ */
50442
+ /** Which instance of an export addon a call addresses. Absent on a read = the whole addon. */
50443
+ var InstanceIdSchema$1 = string().min(1);
50444
+ var InstancePinSchema = object({ instanceId: InstanceIdSchema$1.optional() });
50445
+ /** One independent export target of an addon. */
50446
+ var ExportInstanceSchema = object({
50447
+ instanceId: InstanceIdSchema$1,
50448
+ name: string(),
50449
+ enabled: boolean(),
50450
+ kind: string().optional()
50451
+ });
50452
+ var EXPORT_INSTANCE_UNKNOWN = "export-instance-unknown";
50453
+ /** The named failure of an `instanceId` the provider does not serve. The message starts with the code. */
50454
+ var ExportInstanceUnknownError = class extends Error {
50455
+ code = EXPORT_INSTANCE_UNKNOWN;
50456
+ instanceId;
50457
+ constructor(addon, instanceId) {
50458
+ super(`${EXPORT_INSTANCE_UNKNOWN}: ${addon} serves no instance "${instanceId}"`);
50459
+ this.name = "ExportInstanceUnknownError";
50460
+ this.instanceId = instanceId;
50461
+ }
50462
+ };
50463
+ /**
50464
+ * The instance a `getStatus` call names. The cap's `status` block injects a per-device
50465
+ * `getStatus({ deviceId })` beside the method's own `{ instanceId? }`, so the provider sees
50466
+ * both shapes; only the second names an instance (a per-device status read is addon-wide).
50467
+ */
50468
+ function statusInstanceOf(input) {
50469
+ return "instanceId" in input ? input.instanceId : void 0;
50470
+ }
50471
+ /**
50472
+ * A single-instance provider's check: an absent id or its own passes, any other throws
50473
+ * `ExportInstanceUnknownError`.
49814
50474
  */
50475
+ function assertOwnExportInstance(addon, own, instanceId) {
50476
+ if (instanceId !== void 0 && instanceId !== own) throw new ExportInstanceUnknownError(addon, instanceId);
50477
+ }
49815
50478
  var LinkStateSchema = _enum([
49816
50479
  "unlinked",
49817
50480
  "linked",
@@ -49862,10 +50525,14 @@ var ExposedDeviceSchema = object({
49862
50525
  capabilities: array(string()).optional()
49863
50526
  });
49864
50527
  var ExposeInputSchema = object({
50528
+ instanceId: InstanceIdSchema$1,
49865
50529
  deviceId: string(),
49866
50530
  capabilities: array(string()).optional()
49867
50531
  });
49868
- var UnexposeInputSchema = object({ deviceId: string() });
50532
+ var UnexposeInputSchema = object({
50533
+ instanceId: InstanceIdSchema$1,
50534
+ deviceId: string()
50535
+ });
49869
50536
  /**
49870
50537
  * What an exporter may expose besides devices (D968). An action and a
49871
50538
  * notification target are LIST ENTRIES, never devices (D954): they enter an
@@ -49894,8 +50561,14 @@ var ExposedEntitySchema = object({
49894
50561
  entity: ExportEntityRefSchema,
49895
50562
  exposedAs: string().optional()
49896
50563
  });
49897
- var ExposeEntityInputSchema = object({ entity: ExportEntityRefSchema });
49898
- var UnexposeEntityInputSchema = object({ entity: ExportEntityRefSchema });
50564
+ var ExposeEntityInputSchema = object({
50565
+ instanceId: InstanceIdSchema$1,
50566
+ entity: ExportEntityRefSchema
50567
+ });
50568
+ var UnexposeEntityInputSchema = object({
50569
+ instanceId: InstanceIdSchema$1,
50570
+ entity: ExportEntityRefSchema
50571
+ });
49899
50572
  var deviceExportCapability = {
49900
50573
  name: "device-export",
49901
50574
  scope: "system",
@@ -49915,9 +50588,10 @@ var deviceExportCapability = {
49915
50588
  */
49916
50589
  exposesDeviceSettings: true,
49917
50590
  methods: {
49918
- getStatus: method(_void(), DeviceExportStatusSchema),
49919
- listSupportedDeviceKinds: method(_void(), array(DeviceKindSchema)),
49920
- listExposedDevices: method(_void(), array(ExposedDeviceSchema)),
50591
+ getStatus: method(InstancePinSchema, DeviceExportStatusSchema),
50592
+ listInstances: method(_void(), array(ExportInstanceSchema)),
50593
+ listSupportedDeviceKinds: method(InstancePinSchema, array(DeviceKindSchema)),
50594
+ listExposedDevices: method(InstancePinSchema, array(ExposedDeviceSchema)),
49921
50595
  exposeDevice: method(ExposeInputSchema, _void(), {
49922
50596
  kind: "mutation",
49923
50597
  auth: "admin"
@@ -49927,7 +50601,7 @@ var deviceExportCapability = {
49927
50601
  auth: "admin"
49928
50602
  }),
49929
50603
  listSupportedEntityKinds: optionalMethod(_void(), array(ExportEntityKindSchema)),
49930
- listExposedEntities: optionalMethod(_void(), array(ExposedEntitySchema)),
50604
+ listExposedEntities: optionalMethod(InstancePinSchema, array(ExposedEntitySchema)),
49931
50605
  exposeEntity: optionalMethod(ExposeEntityInputSchema, _void(), {
49932
50606
  kind: "mutation",
49933
50607
  auth: "admin"
@@ -50204,6 +50878,45 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
50204
50878
  auth: "admin"
50205
50879
  });
50206
50880
  /**
50881
+ * What the passive listener of `local-network` saw on the wire, before any
50882
+ * provider classified it. Device-manager turns an observation into the hits
50883
+ * of the providers whose declared discovery modes it matches.
50884
+ */
50885
+ var DiscoveryObservationSchema = discriminatedUnion("kind", [object({
50886
+ kind: literal("mdns"),
50887
+ /** Normalised DNS-SD service type, e.g. `_esphomelib._tcp`. */
50888
+ serviceType: string(),
50889
+ instance: string(),
50890
+ host: string(),
50891
+ /** The A record address when the announcement carried one. */
50892
+ address: string().nullable(),
50893
+ port: number().int(),
50894
+ txt: record(string(), string())
50895
+ }), object({
50896
+ kind: literal("ssdp"),
50897
+ /** Sender address of the datagram. */
50898
+ host: string(),
50899
+ port: number().int(),
50900
+ /** `NT` of a NOTIFY, `ST` of a search response. */
50901
+ target: string(),
50902
+ headers: record(string(), string())
50903
+ })]);
50904
+ object({
50905
+ addonId: string(),
50906
+ candidate: DiscoveryCandidateSchema,
50907
+ firstSeenAt: number(),
50908
+ lastSeenAt: number(),
50909
+ dismissed: boolean()
50910
+ });
50911
+ var DiscoveryProposalSchema = object({
50912
+ id: string(),
50913
+ addonId: string(),
50914
+ candidate: DiscoveryCandidateSchema,
50915
+ firstSeenAt: number(),
50916
+ lastSeenAt: number(),
50917
+ dismissed: boolean()
50918
+ });
50919
+ /**
50207
50920
  * Device Manager capability — hub-side singleton that unifies device persistence,
50208
50921
  * live registry access, and all management operations into a single tRPC surface.
50209
50922
  *
@@ -50932,6 +51645,19 @@ method(object({
50932
51645
  }), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
50933
51646
  kind: "mutation",
50934
51647
  auth: "admin"
51648
+ }), method(object({}), object({ proposals: array(DiscoveryProposalSchema).readonly() }), { auth: "admin" }), method(object({ id: string() }), object({ dismissed: boolean() }), {
51649
+ kind: "mutation",
51650
+ auth: "admin"
51651
+ }), method(object({ observations: array(DiscoveryObservationSchema).max(512) }), object({ proposed: number().int() }), {
51652
+ kind: "mutation",
51653
+ auth: "admin"
51654
+ }), method(object({}), object({
51655
+ providers: number().int(),
51656
+ proposed: number().int()
51657
+ }), {
51658
+ kind: "mutation",
51659
+ auth: "admin",
51660
+ timeoutMs: 12e4
50935
51661
  }), method(object({ addonId: string() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string() }), unknown(), { auth: "admin" }), method(object({
50936
51662
  deviceId: number(),
50937
51663
  key: string(),
@@ -51759,7 +52485,7 @@ object({
51759
52485
  /** Ms epoch of the last value received from the appliance; 0 = never. */
51760
52486
  lastFetchedAt: number()
51761
52487
  });
51762
- var DeviceIdSchema$1 = number().int().nonnegative();
52488
+ var DeviceIdSchema$2 = number().int().nonnegative();
51763
52489
  /** A value a program option or setting can take. */
51764
52490
  var DishwasherValueSchema = union([
51765
52491
  boolean(),
@@ -51823,77 +52549,77 @@ var DishwasherOptionsSchema = object({
51823
52549
  options: array(DishwasherOptionDescriptorSchema)
51824
52550
  });
51825
52551
  DeviceType.Dishwasher, method(object({
51826
- deviceId: DeviceIdSchema$1,
52552
+ deviceId: DeviceIdSchema$2,
51827
52553
  program: string().min(1).optional(),
51828
52554
  options: record(string(), DishwasherValueSchema).optional()
51829
52555
  }), _void(), {
51830
52556
  kind: "mutation",
51831
52557
  auth: "protected"
51832
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52558
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51833
52559
  kind: "mutation",
51834
52560
  auth: "protected"
51835
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52561
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51836
52562
  kind: "mutation",
51837
52563
  auth: "protected"
51838
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52564
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51839
52565
  kind: "mutation",
51840
52566
  auth: "protected"
51841
52567
  }), method(object({
51842
- deviceId: DeviceIdSchema$1,
52568
+ deviceId: DeviceIdSchema$2,
51843
52569
  program: string().min(1)
51844
52570
  }), _void(), {
51845
52571
  kind: "mutation",
51846
52572
  auth: "protected"
51847
52573
  }), method(object({
51848
- deviceId: DeviceIdSchema$1,
52574
+ deviceId: DeviceIdSchema$2,
51849
52575
  on: boolean()
51850
52576
  }), _void(), {
51851
52577
  kind: "mutation",
51852
52578
  auth: "protected"
51853
52579
  }), method(object({
51854
- deviceId: DeviceIdSchema$1,
52580
+ deviceId: DeviceIdSchema$2,
51855
52581
  on: boolean()
51856
52582
  }), _void(), {
51857
52583
  kind: "mutation",
51858
52584
  auth: "protected"
51859
52585
  }), method(object({
51860
- deviceId: DeviceIdSchema$1,
52586
+ deviceId: DeviceIdSchema$2,
51861
52587
  on: boolean()
51862
52588
  }), _void(), {
51863
52589
  kind: "mutation",
51864
52590
  auth: "protected"
51865
52591
  }), method(object({
51866
- deviceId: DeviceIdSchema$1,
52592
+ deviceId: DeviceIdSchema$2,
51867
52593
  on: boolean()
51868
52594
  }), _void(), {
51869
52595
  kind: "mutation",
51870
52596
  auth: "protected"
51871
52597
  }), method(object({
51872
- deviceId: DeviceIdSchema$1,
52598
+ deviceId: DeviceIdSchema$2,
51873
52599
  on: boolean()
51874
52600
  }), _void(), {
51875
52601
  kind: "mutation",
51876
52602
  auth: "protected"
51877
52603
  }), method(object({
51878
- deviceId: DeviceIdSchema$1,
52604
+ deviceId: DeviceIdSchema$2,
51879
52605
  on: boolean()
51880
52606
  }), _void(), {
51881
52607
  kind: "mutation",
51882
52608
  auth: "protected"
51883
52609
  }), method(object({
51884
- deviceId: DeviceIdSchema$1,
52610
+ deviceId: DeviceIdSchema$2,
51885
52611
  on: boolean()
51886
52612
  }), _void(), {
51887
52613
  kind: "mutation",
51888
52614
  auth: "protected"
51889
52615
  }), method(object({
51890
- deviceId: DeviceIdSchema$1,
52616
+ deviceId: DeviceIdSchema$2,
51891
52617
  key: string().min(1),
51892
52618
  value: DishwasherValueSchema
51893
52619
  }), _void(), {
51894
52620
  kind: "mutation",
51895
52621
  auth: "protected"
51896
- }), method(object({ deviceId: DeviceIdSchema$1 }), DishwasherOptionsSchema, { auth: "protected" });
52622
+ }), method(object({ deviceId: DeviceIdSchema$2 }), DishwasherOptionsSchema, { auth: "protected" });
51897
52623
  /**
51898
52624
  * Palette entry ids (D939). Audio is the one gradient; `audio-*` leaves are
51899
52625
  * not entries. `heatmapScrub` is a mark, not an event kind.
@@ -52297,6 +53023,19 @@ method(_void(), paletteResultSchema, {
52297
53023
  kind: "mutation",
52298
53024
  auth: "admin"
52299
53025
  });
53026
+ object({
53027
+ /** True while Do Not Disturb is on; null when unknown. */
53028
+ enabled: boolean().nullable().meta({ label: "Do not disturb" }),
53029
+ /** Ms epoch of the last read or write that set `enabled`. */
53030
+ lastChangedAt: number()
53031
+ });
53032
+ DeviceType.MediaPlayer, method(object({
53033
+ deviceId: number().int(),
53034
+ enabled: boolean()
53035
+ }), _void(), {
53036
+ kind: "mutation",
53037
+ auth: "protected"
53038
+ });
52300
53039
  DeviceType.Camera;
52301
53040
  object({
52302
53041
  /** Ms epoch of the last press. null = never observed since this provider started. */
@@ -53067,15 +53806,15 @@ var FanPresetCaptureResultSchema = object({
53067
53806
  items: array(FanCaptureItemSchema),
53068
53807
  omitted: array(FanCaptureOmissionSchema)
53069
53808
  });
53070
- var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
53809
+ var deviceInput$2 = object({ deviceId: number().int().nonnegative() });
53071
53810
  DeviceType.Fan;
53072
- method(deviceInput$1, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$1.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
53811
+ method(deviceInput$2, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$2.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
53073
53812
  kind: "mutation",
53074
53813
  auth: "admin"
53075
- }), method(deviceInput$1.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
53814
+ }), method(deviceInput$2.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
53076
53815
  kind: "mutation",
53077
53816
  auth: "protected"
53078
- }), method(deviceInput$1.extend({
53817
+ }), method(deviceInput$2.extend({
53079
53818
  fields: array(FanCaptureFieldSchema).optional(),
53080
53819
  steps: array(ActionStepSchema).max(20).default([])
53081
53820
  }), FanPresetCaptureResultSchema, { auth: "protected" });
@@ -53595,6 +54334,133 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
53595
54334
  auth: "admin"
53596
54335
  });
53597
54336
  /**
54337
+ * `integration-instances` - the connection of an addon that holds ONE or SEVERAL
54338
+ * (an account, a relay, a destination) as typed records (D985, D986). The addon's
54339
+ * own function page reads and writes them (Logging for Loki); the Integrations
54340
+ * page lists only the integrations that bring devices (D996).
54341
+ *
54342
+ * A collection of providers: each addon that holds connections registers one and a
54343
+ * caller reaches a provider with the pinned `addonId`.
54344
+ *
54345
+ * Identity: the instance id is immutable and opaque to the caller. A record the
54346
+ * Loki migration made keeps the `integrations` registry id it was created under
54347
+ * (`int_NNNN`); a single instance made by its function page takes the addon id.
54348
+ * `name` is the editable label.
54349
+ *
54350
+ * Secrets: every field the instance kind marks `.meta({ secret: true })` reaches
54351
+ * the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
54352
+ * or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
54353
+ * clears it.
54354
+ */
54355
+ var ConfigSchemaPassthrough$3 = custom();
54356
+ var IntegrationInstanceIdSchema = string().min(1);
54357
+ var IntegrationInstanceModeSchema = _enum(["single", "multiple"]);
54358
+ /**
54359
+ * One kind of instance a provider can create (an adapter, an account type). The sign-in and
54360
+ * connect fields follow the `broker` contract (`broker.cap.ts`): `signIn.basePath` is a
54361
+ * hub-relative route set speaking the sign-in contract, `connectPath` / `disconnectPath` open an
54362
+ * interactive account link (popup) and may carry `{{brokerId}}`, which the UI replaces with the
54363
+ * instance id.
54364
+ */
54365
+ var IntegrationInstanceKindSchema = object({
54366
+ /** Stable id of the kind, sent back as `createInstance.kind`. */
54367
+ id: string().min(1),
54368
+ label: string().min(1),
54369
+ /** The kind signs in through a server-held interactive session. */
54370
+ signIn: object({
54371
+ basePath: string().min(1),
54372
+ methods: array(_enum(["device-code", "proxy"])).optional()
54373
+ }).optional(),
54374
+ /** Relative hub path to start an interactive account link of an instance of this kind. */
54375
+ connectPath: string().min(1).optional(),
54376
+ /** Relative hub path to disconnect that account. */
54377
+ disconnectPath: string().min(1).optional()
54378
+ });
54379
+ var IntegrationInstanceDescriptionSchema = object({
54380
+ /** `single`: at most one instance can exist (Loki). `multiple`: an account each. */
54381
+ instanceMode: IntegrationInstanceModeSchema,
54382
+ /** What the instance is, for the UI (`destination`, `relay`, `account`). */
54383
+ kind: string(),
54384
+ /** True when `testInstance` really probes the remote. */
54385
+ canTest: boolean(),
54386
+ /**
54387
+ * The kinds an instance can be of. Absent or one entry: nothing to choose; more than one: the
54388
+ * Add flow asks which first and sends it as `createInstance.kind`.
54389
+ */
54390
+ kinds: array(IntegrationInstanceKindSchema).optional(),
54391
+ /**
54392
+ * The provider accepts `createInstance.id` for an id that once existed (an adopted id, because
54393
+ * devices carry it). The UI then offers "restore under its old id" on Add. Absent means no.
54394
+ */
54395
+ allowRestoreId: boolean().optional(),
54396
+ /**
54397
+ * `createInstance` without an `id` works: the provider mints it. Absent means the caller must
54398
+ * send an id (the UI then mints an opaque one).
54399
+ */
54400
+ mintsId: boolean().optional()
54401
+ });
54402
+ var IntegrationInstanceStatusSchema = object({
54403
+ state: _enum([
54404
+ "ok",
54405
+ "off",
54406
+ "error",
54407
+ "unknown"
54408
+ ]),
54409
+ detail: string().optional(),
54410
+ /** A short human word for the state ("Signed in", "Token expired"); shown instead of `state`. */
54411
+ label: string().optional()
54412
+ });
54413
+ var IntegrationInstanceSchema = object({
54414
+ id: IntegrationInstanceIdSchema,
54415
+ name: string(),
54416
+ /** The addon's own rule (an URL is present, a client id is present...). */
54417
+ configured: boolean(),
54418
+ /**
54419
+ * The instance's own on/off switch (D996): always present, derived from the record body
54420
+ * (`enabled !== false`, so a row written before the field existed is on).
54421
+ */
54422
+ enabled: boolean(),
54423
+ /** The kind of this instance (one of `describe().kinds[].id`), when the provider has kinds. */
54424
+ kind: string().optional(),
54425
+ /** Values for the instance form; a secret is a `SecretFieldView`, never text. */
54426
+ formValues: record(string(), unknown()),
54427
+ status: IntegrationInstanceStatusSchema.optional(),
54428
+ /** Epoch ms of the last probe of the remote that produced `status`; absent when never checked. */
54429
+ lastCheckedAt: number().optional()
54430
+ });
54431
+ var IntegrationInstancePatchSchema = object({
54432
+ id: IntegrationInstanceIdSchema,
54433
+ name: string().min(1).optional(),
54434
+ /** Omitted / '' / redaction token keeps a secret; `{ $secretClear: true }` clears it. */
54435
+ values: record(string(), unknown())
54436
+ });
54437
+ 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({
54438
+ id: IntegrationInstanceIdSchema.optional(),
54439
+ name: string().min(1),
54440
+ kind: string().min(1).optional()
54441
+ }), object({ id: string() }), {
54442
+ kind: "mutation",
54443
+ auth: "admin"
54444
+ }), method(IntegrationInstancePatchSchema, object({ ok: literal(true) }), {
54445
+ kind: "mutation",
54446
+ auth: "admin"
54447
+ }), method(object({
54448
+ id: IntegrationInstanceIdSchema,
54449
+ enabled: boolean()
54450
+ }), object({ ok: literal(true) }), {
54451
+ kind: "mutation",
54452
+ auth: "admin"
54453
+ }), method(object({ id: IntegrationInstanceIdSchema }), object({ ok: literal(true) }), {
54454
+ kind: "mutation",
54455
+ auth: "admin"
54456
+ }), optionalMethod(object({
54457
+ id: IntegrationInstanceIdSchema.nullable(),
54458
+ values: record(string(), unknown())
54459
+ }), TestConnectionResultSchema$1, {
54460
+ kind: "mutation",
54461
+ auth: "admin"
54462
+ });
54463
+ /**
53598
54464
  * Two-way audio / talk-back cap. Clients open a WebRTC audio-only
53599
54465
  * session (server-initiated offer pattern, identical to the main
53600
54466
  * video WebRTC flow) and the browser captures the mic; the server
@@ -54183,6 +55049,14 @@ var LlmGenerateBaseInputSchema = object({
54183
55049
  topP: number().min(0).max(1).optional(),
54184
55050
  /** Per-call override of the profile default (top-k sampling). */
54185
55051
  topK: number().int().positive().optional(),
55052
+ /** Per-call override of `profile.reasoningEffort`. Sent only to a kind whose
55053
+ * descriptor offers the field; a kind that does not never sends it. */
55054
+ reasoningEffort: _enum([
55055
+ "off",
55056
+ "low",
55057
+ "medium",
55058
+ "high"
55059
+ ]).optional(),
54186
55060
  /** Per-call override of `profile.timeoutMs` — the total generation bound. */
54187
55061
  timeoutMs: number().int().positive().optional(),
54188
55062
  /** Per-call override; beats both the consumer table and the profile. */
@@ -54474,7 +55348,10 @@ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind i
54474
55348
  var LlmModelFeaturesSchema = object({
54475
55349
  vision: boolean(),
54476
55350
  tools: boolean(),
54477
- streaming: boolean()
55351
+ streaming: boolean(),
55352
+ /** Whether the model thinks before it answers. `null` = the endpoint does not
55353
+ * say; an editor then still offers the switch (unknown is not "no"). */
55354
+ reasoning: boolean().nullable().optional()
54478
55355
  });
54479
55356
  /** One model a provider offers. `features` overrides the kind's defaults, per field. */
54480
55357
  var LlmModelInfoSchema = object({
@@ -55381,6 +56258,11 @@ var LogEntrySchema = object({
55381
56258
  * flight, and not asking for the next slice ends the scan.
55382
56259
  */
55383
56260
  var LogReadQuerySchema = object({
56261
+ /**
56262
+ * Which destination INSTANCE answers (a destination addon may hold several records). Absent ⇒
56263
+ * the provider's first readable one, so a caller written before instances existed is unchanged.
56264
+ */
56265
+ instanceId: string().min(1).max(200).optional(),
55384
56266
  /** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
55385
56267
  requestId: string().min(1).max(64).optional(),
55386
56268
  /** The device the line is about (`tags.deviceId`, numeric). */
@@ -55443,6 +56325,8 @@ var LogReadResultSchema = object({
55443
56325
  /** True when `cancelRead` ended this slice early. */
55444
56326
  cancelled: boolean().optional()
55445
56327
  });
56328
+ /** Names one destination instance; absent ⇒ the provider's first readable one. */
56329
+ var LogInstanceSelectorSchema = object({ instanceId: string().min(1).max(200).optional() });
55446
56330
  var LogReadCapabilitiesSchema = object({
55447
56331
  /** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
55448
56332
  readable: boolean(),
@@ -55461,7 +56345,7 @@ var LogReadCapabilitiesSchema = object({
55461
56345
  /** How far back the store reaches, when the provider knows (days). */
55462
56346
  retentionDays: number().nullable()
55463
56347
  });
55464
- method(LogEntrySchema, _void(), { kind: "mutation" }), optionalMethod(_void(), LogReadCapabilitiesSchema, { auth: "admin" }), optionalMethod(LogReadQuerySchema, LogReadResultSchema, { auth: "admin" }), optionalMethod(object({ requestId: string().min(1).max(64) }), object({ cancelled: boolean() }), {
56348
+ method(LogEntrySchema, _void(), { kind: "mutation" }), optionalMethod(LogInstanceSelectorSchema, LogReadCapabilitiesSchema, { auth: "admin" }), optionalMethod(LogReadQuerySchema, LogReadResultSchema, { auth: "admin" }), optionalMethod(object({ requestId: string().min(1).max(64) }), object({ cancelled: boolean() }), {
55465
56349
  kind: "mutation",
55466
56350
  auth: "admin"
55467
56351
  });
@@ -55565,164 +56449,6 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
55565
56449
  ]);
55566
56450
  method(_void(), array(LoginMethodContributionSchema).readonly());
55567
56451
  /**
55568
- * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
55569
- * Apple TV, Spotify, Roku, generic OTT receivers, …) on
55570
- * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
55571
- * surface — those use `DeviceType.Camera` + the broker pipeline.
55572
- *
55573
- * The cap declares a wide method surface; not every backend supports
55574
- * every method. Drivers signal sub-capability via the
55575
- * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
55576
- * corresponding method) so the UI gates buttons without a slice
55577
- * fetch — same pattern as `PanTiltZoom` for cameras.
55578
- */
55579
- var MediaPlayerStateSchema = _enum([
55580
- "off",
55581
- "on",
55582
- "idle",
55583
- "playing",
55584
- "paused",
55585
- "buffering",
55586
- "standby"
55587
- ]);
55588
- var MediaPlayerRepeatSchema = _enum([
55589
- "off",
55590
- "all",
55591
- "one"
55592
- ]);
55593
- var MediaInfoSchema = object({
55594
- /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
55595
- * `podcast`, …). */
55596
- type: string(),
55597
- /** Human-readable title. */
55598
- title: string(),
55599
- /** Optional artist / channel / station label. */
55600
- artist: string().optional(),
55601
- /** Optional album / season / show name. */
55602
- album: string().optional(),
55603
- /** Optional cover-art / thumbnail URL. */
55604
- imageUrl: string().optional()
55605
- });
55606
- /**
55607
- * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
55608
- * the device said so. `assumed`: the driver has no feedback (infrared) and
55609
- * tracks what it last SENT; it moves only after a send was accepted, and a
55610
- * human at the real remote makes it wrong. A UI shows an assumed value as a
55611
- * guess, never as a reading.
55612
- */
55613
- var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
55614
- /** The fields of a media-player status a driver can only guess. */
55615
- var MediaPlayerAssumedFieldSchema = _enum([
55616
- "state",
55617
- "volumeLevel",
55618
- "isMuted",
55619
- "source"
55620
- ]);
55621
- object({
55622
- /** Playback lifecycle state. */
55623
- state: MediaPlayerStateSchema,
55624
- /**
55625
- * Whether the state fields are readings or the driver's own bookkeeping.
55626
- * A slice written before this field existed parses as `reported`.
55627
- */
55628
- stateSource: MediaPlayerStateSourceSchema.default("reported"),
55629
- /**
55630
- * Which fields are the driver's own guess. `stateSource` is `assumed` when
55631
- * this is not empty; a field not listed here is a reading even then (power
55632
- * from a running-state source, mute guessed from the last send).
55633
- */
55634
- assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
55635
- /** Volume as 0..100 inclusive. Null when the device has no volume
55636
- * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
55637
- volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
55638
- /** Mute toggle distinct from volume=0. Null when no mute surface.
55639
- * Pair with `DeviceFeature.MediaPlayerMute`. */
55640
- isMuted: boolean().nullable(),
55641
- /** Active source / input. Empty when no source surface. */
55642
- source: string(),
55643
- /** Selectable sources. Empty when no source surface.
55644
- * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
55645
- availableSources: array(string()),
55646
- /** Currently-playing media info. Null when nothing is playing. */
55647
- currentMedia: MediaInfoSchema.nullable(),
55648
- /** Current playback position in ms. Null when not seekable or
55649
- * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
55650
- position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
55651
- /** Total duration of the current media in ms. Null when unknown
55652
- * (live stream) or nothing is playing. */
55653
- duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
55654
- /** Shuffle toggle. Null when no shuffle surface.
55655
- * Pair with `DeviceFeature.MediaPlayerShuffle`. */
55656
- shuffle: boolean().nullable(),
55657
- /** Repeat mode. Null when no repeat surface.
55658
- * Pair with `DeviceFeature.MediaPlayerRepeat`. */
55659
- repeat: MediaPlayerRepeatSchema.nullable(),
55660
- /** Ms epoch when the slice was last updated. */
55661
- lastChangedAt: number()
55662
- });
55663
- DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }), _void(), {
55664
- kind: "mutation",
55665
- auth: "protected"
55666
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55667
- kind: "mutation",
55668
- auth: "protected"
55669
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55670
- kind: "mutation",
55671
- auth: "protected"
55672
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55673
- kind: "mutation",
55674
- auth: "protected"
55675
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55676
- kind: "mutation",
55677
- auth: "protected"
55678
- }), method(object({
55679
- deviceId: number().int().nonnegative(),
55680
- position: number().int().nonnegative()
55681
- }), _void(), {
55682
- kind: "mutation",
55683
- auth: "protected"
55684
- }), method(object({
55685
- deviceId: number().int().nonnegative(),
55686
- volumeLevel: number().min(0).max(100)
55687
- }), _void(), {
55688
- kind: "mutation",
55689
- auth: "protected"
55690
- }), method(object({
55691
- deviceId: number().int().nonnegative(),
55692
- muted: boolean()
55693
- }), _void(), {
55694
- kind: "mutation",
55695
- auth: "protected"
55696
- }), method(object({
55697
- deviceId: number().int().nonnegative(),
55698
- shuffle: boolean()
55699
- }), _void(), {
55700
- kind: "mutation",
55701
- auth: "protected"
55702
- }), method(object({
55703
- deviceId: number().int().nonnegative(),
55704
- repeat: MediaPlayerRepeatSchema
55705
- }), _void(), {
55706
- kind: "mutation",
55707
- auth: "protected"
55708
- }), method(object({
55709
- deviceId: number().int().nonnegative(),
55710
- source: string().min(1)
55711
- }), _void(), {
55712
- kind: "mutation",
55713
- auth: "protected"
55714
- }), method(object({
55715
- deviceId: number().int().nonnegative(),
55716
- /** Media identifier / URL. */
55717
- mediaId: string().min(1),
55718
- /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
55719
- * passes it through to the upstream service. */
55720
- mediaType: string().min(1)
55721
- }), _void(), {
55722
- kind: "mutation",
55723
- auth: "protected"
55724
- });
55725
- /**
55726
56452
  * mesh-network — collection cap for mesh-VPN providers.
55727
56453
  *
55728
56454
  * Different shape from `network-access` (public tunnels):
@@ -63616,7 +64342,14 @@ var NcMediaPolicySchema = object({
63616
64342
  */
63617
64343
  profile: CamProfileSchema.optional(),
63618
64344
  /** See {@link NcLinkedCameraModeSchema}. */
63619
- linkedCameras: NcLinkedCameraModeSchema.optional()
64345
+ linkedCameras: NcLinkedCameraModeSchema.optional(),
64346
+ /**
64347
+ * Sensor rules only: may this rule wake a SLEEPING battery camera to take
64348
+ * the linked still it attaches (D998)? Absent means yes, an explicit `false`
64349
+ * opts out. Deliberately not a Zod default: a rule that never chose keeps
64350
+ * following the hub's. One bounded wake per event; nothing is attached later.
64351
+ */
64352
+ wakeSleepingCamera: boolean().optional()
63620
64353
  });
63621
64354
  /**
63622
64355
  * Cooldown GRANULARITY over the subject's class — how much a fired
@@ -64008,6 +64741,21 @@ var NcTemplateVarKindSchema = _enum([
64008
64741
  "sound",
64009
64742
  "system"
64010
64743
  ]);
64744
+ /**
64745
+ * The default title/body a rule of one SITUATION is delivered with when the
64746
+ * operator wrote no template — served so an editor can pre-fill it (and the
64747
+ * operator can rebuild it from placeholders) instead of starting from a blank
64748
+ * box that, once saved, silently replaces it. `id` names the situation inside
64749
+ * a rule `kind`: `appliance-cycle` is a `sensor` rule whose device is an
64750
+ * appliance finishing a cycle. Texts are raw templates (`{{var}}` intact), in
64751
+ * the hub's current language and with its overrides applied.
64752
+ */
64753
+ var NcTemplateDefaultSchema = object({
64754
+ id: _enum(["appliance-cycle"]),
64755
+ kind: NcRuleKindSchema,
64756
+ title: string(),
64757
+ body: string()
64758
+ });
64011
64759
  /** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
64012
64760
  var NcTemplateFamilySchema = _enum([
64013
64761
  "rule",
@@ -64863,7 +65611,11 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
64863
65611
  }), method(object({}), object({
64864
65612
  catalog: array(NcConditionDescriptorSchema),
64865
65613
  taxonomy: NcTaxonomySchema.optional()
64866
- })), method(object({}), object({ vars: array(NcTemplateVarDescriptorSchema) })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
65614
+ })), method(object({}), object({
65615
+ vars: array(NcTemplateVarDescriptorSchema),
65616
+ /** Per-situation default texts; absent on a hub that predates them. */
65617
+ defaults: array(NcTemplateDefaultSchema)
65618
+ })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
64867
65619
  kind: "mutation",
64868
65620
  access: "view"
64869
65621
  }), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), NcRuleLastRunsSchema, { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
@@ -65611,52 +66363,27 @@ object({
65611
66363
  empty: boolean().nullable(),
65612
66364
  /** True while the pump is running. Null while unknown. */
65613
66365
  pumpRunning: boolean().nullable(),
65614
- /** True when the pump works on an on/off duty cycle rather than continuously. */
65615
- pumpIntervalEnabled: boolean().nullable(),
65616
- /** How long the pump runs per cycle, in seconds. */
65617
- pumpOnTime: number().min(0).nullable().meta(readingMeta("duration")),
65618
- /** How long the pump rests per cycle, in seconds. */
65619
- pumpOffTime: number().min(0).nullable().meta(readingMeta("duration")),
65620
66366
  /** Water drunk in the last drink, in litres. */
65621
66367
  lastDrink: number().min(0).nullable().meta(readingMeta("volume")),
65622
66368
  /** Water drunk in the current hour, in litres. */
65623
66369
  currentHourDrink: number().min(0).nullable().meta(readingMeta("volume")),
65624
66370
  /** Water drunk over the last 24 hours (rolling), in litres. */
65625
66371
  last24hDrink: number().min(0).nullable().meta(readingMeta("volume")),
65626
- /** Water drunk since local midnight, in litres. */
66372
+ /** Water drunk since local midnight, in litres. Null when the fountain has no such sensor. */
65627
66373
  todayDrink: number().min(0).nullable().meta(readingMeta("volume")),
65628
66374
  /** Decoded fault message. Null means healthy; a non-null string is an active fault. */
65629
66375
  error: string().nullable(),
65630
66376
  /** Ms epoch when the slice was last refreshed. */
65631
66377
  lastFetchedAt: number()
65632
66378
  });
65633
- var DeviceIdSchema = number().int().nonnegative();
65634
- var MinutesSchema = number().int().min(0);
66379
+ var DeviceIdSchema$1 = number().int().nonnegative();
65635
66380
  DeviceType.PetFountain, method(object({
65636
- deviceId: DeviceIdSchema,
65637
- on: boolean()
65638
- }), _void(), {
65639
- kind: "mutation",
65640
- auth: "protected"
65641
- }), method(object({
65642
- deviceId: DeviceIdSchema,
66381
+ deviceId: DeviceIdSchema$1,
65643
66382
  on: boolean()
65644
66383
  }), _void(), {
65645
66384
  kind: "mutation",
65646
66385
  auth: "protected"
65647
- }), method(object({
65648
- deviceId: DeviceIdSchema,
65649
- minutes: MinutesSchema
65650
- }), _void(), {
65651
- kind: "mutation",
65652
- auth: "protected"
65653
- }), method(object({
65654
- deviceId: DeviceIdSchema,
65655
- minutes: MinutesSchema
65656
- }), _void(), {
65657
- kind: "mutation",
65658
- auth: "protected"
65659
- }), method(object({ deviceId: DeviceIdSchema }), _void(), {
66386
+ }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
65660
66387
  kind: "mutation",
65661
66388
  auth: "protected"
65662
66389
  });
@@ -67190,6 +67917,49 @@ object({
67190
67917
  DeviceType.PetFeeder,
67191
67918
  DeviceType.Heater
67192
67919
  ].filter((type) => type !== DeviceType.Sensor);
67920
+ var PowerSourceRefusalReasonSchema = _enum([
67921
+ "no-power-source",
67922
+ "switch-missing",
67923
+ "switch-offline",
67924
+ "switch-unknown",
67925
+ "restart-in-progress",
67926
+ "switch-call-failed"
67927
+ ]);
67928
+ var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
67929
+ accepted: literal(false),
67930
+ reason: PowerSourceRefusalReasonSchema,
67931
+ /** One line for the operator, naming the switch. */
67932
+ message: string()
67933
+ })]);
67934
+ var PowerSourceInfoSchema = object({
67935
+ /** False when the device has no power source linked; the rest is then empty. */
67936
+ linked: boolean(),
67937
+ switchDeviceId: number().nullable(),
67938
+ switchName: string().nullable(),
67939
+ /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
67940
+ switchOn: boolean().nullable(),
67941
+ switchOnline: boolean().nullable(),
67942
+ restartInProgress: boolean(),
67943
+ offSeconds: number().int()
67944
+ });
67945
+ object({
67946
+ /** Null while the switch has not reported: unknown is never `false` (D393). */
67947
+ switchOn: boolean().nullable(),
67948
+ offSeconds: number().int(),
67949
+ lastFetchedAt: number()
67950
+ });
67951
+ 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;
67952
+ var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
67953
+ systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
67954
+ kind: "mutation",
67955
+ auth: "admin"
67956
+ }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
67957
+ kind: "mutation",
67958
+ auth: "admin"
67959
+ }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
67960
+ kind: "mutation",
67961
+ auth: "admin"
67962
+ });
67193
67963
  /**
67194
67964
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
67195
67965
  * on `DeviceType.Presence`. Read-only — no setters: presence is
@@ -67616,6 +68386,37 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
67616
68386
  deviceId: number(),
67617
68387
  status: PtzAutotrackStatusSchema
67618
68388
  });
68389
+ object({
68390
+ /** True when the pump works on the on/off cycle, false when it runs continuously. Null while unknown. */
68391
+ enabled: boolean().nullable(),
68392
+ /** How long the pump runs per cycle, in seconds. Null while unknown. */
68393
+ onTime: number().min(0).nullable().meta(readingMeta("duration")),
68394
+ /** How long the pump rests per cycle, in seconds. Null while unknown. */
68395
+ offTime: number().min(0).nullable().meta(readingMeta("duration")),
68396
+ /** Ms epoch when the slice was last refreshed. */
68397
+ lastFetchedAt: number()
68398
+ });
68399
+ var DeviceIdSchema = number().int().nonnegative();
68400
+ var MinutesSchema = number().int().min(0);
68401
+ DeviceType.PetFountain, method(object({
68402
+ deviceId: DeviceIdSchema,
68403
+ on: boolean()
68404
+ }), _void(), {
68405
+ kind: "mutation",
68406
+ auth: "protected"
68407
+ }), method(object({
68408
+ deviceId: DeviceIdSchema,
68409
+ minutes: MinutesSchema
68410
+ }), _void(), {
68411
+ kind: "mutation",
68412
+ auth: "protected"
68413
+ }), method(object({
68414
+ deviceId: DeviceIdSchema,
68415
+ minutes: MinutesSchema
68416
+ }), _void(), {
68417
+ kind: "mutation",
68418
+ auth: "protected"
68419
+ });
67619
68420
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, DeviceType.Gateway, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
67620
68421
  kind: "mutation",
67621
68422
  auth: "admin"
@@ -70522,7 +71323,13 @@ var RemoteMediaCommandSchema = _enum([
70522
71323
  "next",
70523
71324
  "previous",
70524
71325
  "setMute",
70525
- "selectSource"
71326
+ "selectSource",
71327
+ "turnOn",
71328
+ "turnOff",
71329
+ "volumeUp",
71330
+ "volumeDown",
71331
+ "channelUp",
71332
+ "channelDown"
70526
71333
  ]);
70527
71334
  /** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
70528
71335
  var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
@@ -70543,7 +71350,7 @@ method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.e
70543
71350
  }), RemoteSendResultSchema, {
70544
71351
  kind: "mutation",
70545
71352
  auth: "protected"
70546
- }), method(deviceInput.extend({
71353
+ }), method(deviceInput, MediaPlayerStatusSchema.nullable(), { auth: "protected" }), method(deviceInput.extend({
70547
71354
  command: RemoteMediaCommandSchema,
70548
71355
  muted: boolean().optional(),
70549
71356
  source: string().optional(),
@@ -71415,9 +72222,17 @@ var ServerUpdateActionResultSchema = object({
71415
72222
  */
71416
72223
  requiredAddonUpdates: array(RequiredAddonUpdateSchema).optional()
71417
72224
  });
71418
- var LaunchOverridesSchema = object({
71419
- /** The persisted heap ceiling in MB, or `null` when none is set. */
71420
- heapMb: number().int().nullable() });
72225
+ var LaunchOverridesSchema = object({
72226
+ /** The persisted heap ceiling in MB, or `null` when none is set. */
72227
+ heapMb: number().int().nullable(),
72228
+ /** The persisted hub-main RSS budget in MB, or `null` when none is set. */
72229
+ rssBudgetMb: number().int().nullable()
72230
+ });
72231
+ var SetLaunchOverridesInputSchema = object({
72232
+ heapMb: number().int().min(512).max(65536).nullable(),
72233
+ /** Omitted keeps the stored budget; `null` clears it. */
72234
+ rssBudgetMb: number().int().min(512).max(65536).nullable().optional()
72235
+ });
71421
72236
  var SetLaunchOverridesResultSchema = LaunchOverridesSchema.extend({
71422
72237
  /** Always true: the override is read at launch, not by the running process. */
71423
72238
  restartRequired: boolean() });
@@ -71446,7 +72261,7 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
71446
72261
  }), method(_void(), ServerUpdateActionResultSchema, {
71447
72262
  kind: "mutation",
71448
72263
  auth: "admin"
71449
- }), method(_void(), LaunchOverridesSchema, { auth: "admin" }), method(object({ heapMb: number().int().min(512).max(65536).nullable() }), SetLaunchOverridesResultSchema, {
72264
+ }), method(_void(), LaunchOverridesSchema, { auth: "admin" }), method(SetLaunchOverridesInputSchema, SetLaunchOverridesResultSchema, {
71450
72265
  kind: "mutation",
71451
72266
  auth: "admin"
71452
72267
  });
@@ -71478,7 +72293,16 @@ DeviceType.Sensor;
71478
72293
  * future fields without breaking the existing call sites.
71479
72294
  */
71480
72295
  var EmailAddressSchema = email();
72296
+ /**
72297
+ * Which relay of a multi-relay provider answers (D996). Absent = the provider's first / default
72298
+ * relay, so a caller written before relays existed keeps working unchanged. A provider with one
72299
+ * fixed relay ignores it. This is the integration instance id (`int_NNNN`), NOT the addon id: the
72300
+ * collection pin `addonId` still picks the provider, `instanceId` picks the relay inside it.
72301
+ */
72302
+ var InstanceIdSchema = string().min(1).optional();
72303
+ var RelayPinSchema = object({ instanceId: InstanceIdSchema });
71481
72304
  var SendEmailInputSchema = object({
72305
+ instanceId: InstanceIdSchema,
71482
72306
  to: union([EmailAddressSchema, array(EmailAddressSchema).min(1)]),
71483
72307
  cc: array(EmailAddressSchema).optional(),
71484
72308
  bcc: array(EmailAddressSchema).optional(),
@@ -71514,11 +72338,11 @@ method(SendEmailInputSchema, SendEmailResultSchema, {
71514
72338
  kind: "mutation",
71515
72339
  auth: "admin",
71516
72340
  access: "create"
71517
- }), method(_void(), SmtpStatusSchema, {
72341
+ }), method(RelayPinSchema, SmtpStatusSchema, {
71518
72342
  kind: "mutation",
71519
72343
  auth: "admin",
71520
72344
  access: "view"
71521
- }), method(_void(), SmtpStatusSchema, { auth: "admin" });
72345
+ }), method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" });
71522
72346
  /**
71523
72347
  * A single device snapshot returned as base64 JPEG/PNG.
71524
72348
  *
@@ -71550,10 +72374,12 @@ DeviceType.Camera, method(object({
71550
72374
  * even when the cache is well within the device's
71551
72375
  * `snapshotMaxAgeS` window.
71552
72376
  *
71553
- * **`force` is an OPERATOR signal, not a freshness preference.** On a
72377
+ * **`force` is a demand with a named principal, not a freshness
72378
+ * preference** — an operator button, the scheduled refresh (D847), or a
72379
+ * notification rule that left the camera's wake allowed (D998). On a
71554
72380
  * battery camera it is the one thing that walks past the wrapper's
71555
- * sleep gate and wakes the camera, so a background caller — a poller,
71556
- * an event handler, a thumbnail — must NEVER set it. Every such caller
72381
+ * sleep gate and wakes the camera, so a poller, a thumbnail or a
72382
+ * prestream must NEVER set it. Every such caller
71557
72383
  * gets the cached frame, which on a sleeping battery camera is the
71558
72384
  * correct answer: stale but honest beats woken.
71559
72385
  */
@@ -72361,7 +73187,11 @@ object({
72361
73187
  });
72362
73188
  Object.values(DeviceType), method(_void(), array(StreamSignalSchema).readonly());
72363
73189
  object({
72364
- on: boolean().meta({ label: "On" }),
73190
+ /**
73191
+ * `null` = the device has never reported its state (a measurement that
73192
+ * has not happened is unknown, never `false`).
73193
+ */
73194
+ on: boolean().nullable().meta({ label: "On" }),
72365
73195
  /** Ms epoch of the last state change. Useful for UI "X minutes ago". */
72366
73196
  lastChangedAt: number()
72367
73197
  });
@@ -72373,7 +73203,7 @@ DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceTyp
72373
73203
  auth: "protected"
72374
73204
  }), object({
72375
73205
  deviceId: number(),
72376
- on: boolean(),
73206
+ on: boolean().nullable(),
72377
73207
  lastChangedAt: number()
72378
73208
  });
72379
73209
  /** C0 controls, DEL and the C1 range: none of them belongs in a name. */
@@ -72904,6 +73734,40 @@ var LoggingSettingsStateSchema = object({
72904
73734
  opsLogRetentionDays: number().int().min(0),
72905
73735
  persisted: boolean()
72906
73736
  });
73737
+ /**
73738
+ * Debug WATCH — a short, per-device window over `debug.<channel>` lines.
73739
+ *
73740
+ * `start` opens (or re-arms) a 10 minute window; `rearm` extends a LIVE one
73741
+ * and never revives a lapsed one; `stop` closes it; `list` only reads. No
73742
+ * chain of re-arms outlives 60 minutes from the first start. The hub holds the
73743
+ * watches in memory and pushes the interest to every node, so a watch lapses
73744
+ * by itself and survives nothing — a restart is a stop.
73745
+ */
73746
+ var DebugWatchInputSchema = object({
73747
+ action: _enum([
73748
+ "list",
73749
+ "start",
73750
+ "rearm",
73751
+ "stop"
73752
+ ]),
73753
+ /** Full channel names, `debug.<channel>`, each declared with `kind: 'debug'`. */
73754
+ channels: array(string().min(1)).readonly().default([]),
73755
+ /** Numeric device ids. Required (non-empty) for `start`. */
73756
+ deviceIds: array(number().int()).readonly().default([])
73757
+ });
73758
+ var DebugWatchStateSchema = object({
73759
+ channel: string(),
73760
+ deviceIds: array(number().int()).readonly(),
73761
+ startedAtMs: number(),
73762
+ untilMs: number(),
73763
+ capAtMs: number()
73764
+ });
73765
+ var DebugWatchResultSchema = object({
73766
+ nowMs: number(),
73767
+ watches: array(DebugWatchStateSchema).readonly(),
73768
+ /** Channels a `rearm` found already lapsed: nothing was revived. */
73769
+ lapsed: array(string()).readonly()
73770
+ });
72907
73771
  method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
72908
73772
  kind: "mutation",
72909
73773
  auth: "admin"
@@ -72919,6 +73783,9 @@ method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_
72919
73783
  }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(_void(), array(ReportedFailureContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
72920
73784
  kind: "mutation",
72921
73785
  auth: "admin"
73786
+ }), method(DebugWatchInputSchema, DebugWatchResultSchema, {
73787
+ kind: "mutation",
73788
+ auth: "admin"
72922
73789
  });
72923
73790
  object({
72924
73791
  /** True when the device's tamper switch / case-open contact is
@@ -75360,6 +76227,26 @@ function buildDescriptor(capName, kind) {
75360
76227
  * contributes one entry per bound cap present in this map.
75361
76228
  */
75362
76229
  var EVENT_KIND_BY_CAP = Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
76230
+ /**
76231
+ * What a remote key is CALLED and what it LOOKS like, for every role (D963),
76232
+ * shared by the admin UI and the viewer. A role is data on the wire; each
76233
+ * client resolves its name from `label` (English and Italian side by side) and
76234
+ * its glyph from `icon`, a lucide id from the shared icon catalogue — the
76235
+ * server sends an id, a client maps it to its own icon set.
76236
+ *
76237
+ * `legend` is text printed on the key INSTEAD of a glyph (a digit has no
76238
+ * pictogram): a client that can draw text shows it, one that cannot falls back
76239
+ * to `icon`.
76240
+ */
76241
+ function digit(n) {
76242
+ return {
76243
+ label: t(n, n),
76244
+ icon: "hash",
76245
+ legend: n
76246
+ };
76247
+ }
76248
+ digit("0"), digit("1"), digit("2"), digit("3"), digit("4"), digit("5"), digit("6"), digit("7"), digit("8"), digit("9");
76249
+ DeviceFeature.MediaPlayerPower, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious;
75363
76250
  var btn = (idSuffix, row, col, init) => ({
75364
76251
  idSuffix,
75365
76252
  row,
@@ -75486,7 +76373,35 @@ discriminatedUnion("kind", [object({
75486
76373
  kind: literal("pronto"),
75487
76374
  code: string()
75488
76375
  })]);
75489
- DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
76376
+ /**
76377
+ * Propose a running threshold from a device's own power history (planning#405).
76378
+ *
76379
+ * Pure and deterministic: the same series gives the same answer. The series is
76380
+ * a HELD-VALUE step series — a point's value stands until the next point — which
76381
+ * is how device-history stores a gauge, so "time at a level" is exact, not a
76382
+ * count of samples.
76383
+ *
76384
+ * 1. idle floor F = time-weighted median; noise ceiling N = highest value seen
76385
+ * near F. A device that is not near one level most of the time has no floor.
76386
+ * 2. coarse activity = above max(2N, N + 5 W); consecutive stretches are episodes.
76387
+ * 3. gaps between episodes split in two by the largest log-scale jump (>= 3x):
76388
+ * the short ones are pauses INSIDE a run (a soak), the long ones separate runs.
76389
+ * 4. T = geometric mean of N and the plateau's 10th percentile, snapped to a
76390
+ * grid a person would type; stop dwell covers the longest pause; start dwell
76391
+ * covers the longest standby blip above T.
76392
+ * 5. the numbers are proved by REPLAY through the real `dwell` evaluation: each
76393
+ * run must hold exactly one true interval and nothing may flap outside.
76394
+ */
76395
+ var SECOND_MS = 1e3;
76396
+ var MINUTE_MS$1 = 60 * SECOND_MS;
76397
+ 24 * (60 * MINUTE_MS$1);
76398
+ 10 * MINUTE_MS$1;
76399
+ 30 * SECOND_MS;
76400
+ 60 * SECOND_MS;
76401
+ 20 * MINUTE_MS$1;
76402
+ 10 * SECOND_MS;
76403
+ 10 * SECOND_MS;
76404
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverStoppable, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
75490
76405
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
75491
76406
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
75492
76407
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
@@ -76467,6 +77382,27 @@ Object.freeze({
76467
77382
  access: "view",
76468
77383
  role: "viewer"
76469
77384
  },
77385
+ "boardKeySource.getBoardKey": {
77386
+ capName: "board-key-source",
77387
+ capScope: "system",
77388
+ addonId: null,
77389
+ access: "view",
77390
+ role: "admin"
77391
+ },
77392
+ "boardKeySource.listBoards": {
77393
+ capName: "board-key-source",
77394
+ capScope: "system",
77395
+ addonId: null,
77396
+ access: "view",
77397
+ role: "admin"
77398
+ },
77399
+ "boardKeySource.listSources": {
77400
+ capName: "board-key-source",
77401
+ capScope: "system",
77402
+ addonId: null,
77403
+ access: "view",
77404
+ role: "admin"
77405
+ },
76470
77406
  "brightness.getStatus": {
76471
77407
  capName: "brightness",
76472
77408
  capScope: "device",
@@ -77006,6 +77942,13 @@ Object.freeze({
77006
77942
  access: "create",
77007
77943
  role: "admin"
77008
77944
  },
77945
+ "coreBlocks.proposeRunningThreshold": {
77946
+ capName: "core-blocks",
77947
+ capScope: "system",
77948
+ addonId: null,
77949
+ access: "view",
77950
+ role: "admin"
77951
+ },
77009
77952
  "coreBlocks.reportAutomationRun": {
77010
77953
  capName: "core-blocks",
77011
77954
  capScope: "system",
@@ -77517,6 +78460,13 @@ Object.freeze({
77517
78460
  access: "view",
77518
78461
  role: "admin"
77519
78462
  },
78463
+ "deviceExport.listInstances": {
78464
+ capName: "device-export",
78465
+ capScope: "system",
78466
+ addonId: null,
78467
+ access: "view",
78468
+ role: "admin"
78469
+ },
77520
78470
  "deviceExport.listSupportedDeviceKinds": {
77521
78471
  capName: "device-export",
77522
78472
  capScope: "system",
@@ -77804,6 +78754,13 @@ Object.freeze({
77804
78754
  access: "view",
77805
78755
  role: "admin"
77806
78756
  },
78757
+ "deviceManager.dismissDiscoveryProposal": {
78758
+ capName: "device-manager",
78759
+ capScope: "system",
78760
+ addonId: null,
78761
+ access: "create",
78762
+ role: "admin"
78763
+ },
77807
78764
  "deviceManager.enable": {
77808
78765
  capName: "device-manager",
77809
78766
  capScope: "system",
@@ -77986,6 +78943,13 @@ Object.freeze({
77986
78943
  access: "view",
77987
78944
  role: "viewer"
77988
78945
  },
78946
+ "deviceManager.listDiscoveryProposals": {
78947
+ capName: "device-manager",
78948
+ capScope: "system",
78949
+ addonId: null,
78950
+ access: "view",
78951
+ role: "admin"
78952
+ },
77989
78953
  "deviceManager.listLocationDescriptions": {
77990
78954
  capName: "device-manager",
77991
78955
  capScope: "system",
@@ -78140,6 +79104,13 @@ Object.freeze({
78140
79104
  access: "create",
78141
79105
  role: "admin"
78142
79106
  },
79107
+ "deviceManager.reportDiscoveryObservations": {
79108
+ capName: "device-manager",
79109
+ capScope: "system",
79110
+ addonId: null,
79111
+ access: "create",
79112
+ role: "admin"
79113
+ },
78143
79114
  "deviceManager.runDeviceAction": {
78144
79115
  capName: "device-manager",
78145
79116
  capScope: "system",
@@ -78147,6 +79118,13 @@ Object.freeze({
78147
79118
  access: "create",
78148
79119
  role: "admin"
78149
79120
  },
79121
+ "deviceManager.runDiscoverySweep": {
79122
+ capName: "device-manager",
79123
+ capScope: "system",
79124
+ addonId: null,
79125
+ access: "create",
79126
+ role: "admin"
79127
+ },
78150
79128
  "deviceManager.setChildLayout": {
78151
79129
  capName: "device-manager",
78152
79130
  capScope: "system",
@@ -78700,6 +79678,20 @@ Object.freeze({
78700
79678
  access: "create",
78701
79679
  role: "admin"
78702
79680
  },
79681
+ "doNotDisturb.getStatus": {
79682
+ capName: "do-not-disturb",
79683
+ capScope: "device",
79684
+ addonId: null,
79685
+ access: "view",
79686
+ role: "viewer"
79687
+ },
79688
+ "doNotDisturb.setEnabled": {
79689
+ capName: "do-not-disturb",
79690
+ capScope: "device",
79691
+ addonId: null,
79692
+ access: "create",
79693
+ role: "viewer"
79694
+ },
78703
79695
  "doorbell.getStatus": {
78704
79696
  capName: "doorbell",
78705
79697
  capScope: "device",
@@ -79064,6 +80056,69 @@ Object.freeze({
79064
80056
  access: "create",
79065
80057
  role: "admin"
79066
80058
  },
80059
+ "integrationInstances.createInstance": {
80060
+ capName: "integration-instances",
80061
+ capScope: "system",
80062
+ addonId: null,
80063
+ access: "create",
80064
+ role: "admin"
80065
+ },
80066
+ "integrationInstances.deleteInstance": {
80067
+ capName: "integration-instances",
80068
+ capScope: "system",
80069
+ addonId: null,
80070
+ access: "delete",
80071
+ role: "admin"
80072
+ },
80073
+ "integrationInstances.describe": {
80074
+ capName: "integration-instances",
80075
+ capScope: "system",
80076
+ addonId: null,
80077
+ access: "view",
80078
+ role: "admin"
80079
+ },
80080
+ "integrationInstances.getInstance": {
80081
+ capName: "integration-instances",
80082
+ capScope: "system",
80083
+ addonId: null,
80084
+ access: "view",
80085
+ role: "admin"
80086
+ },
80087
+ "integrationInstances.instanceFormSchema": {
80088
+ capName: "integration-instances",
80089
+ capScope: "system",
80090
+ addonId: null,
80091
+ access: "view",
80092
+ role: "admin"
80093
+ },
80094
+ "integrationInstances.listInstances": {
80095
+ capName: "integration-instances",
80096
+ capScope: "system",
80097
+ addonId: null,
80098
+ access: "view",
80099
+ role: "admin"
80100
+ },
80101
+ "integrationInstances.setInstanceEnabled": {
80102
+ capName: "integration-instances",
80103
+ capScope: "system",
80104
+ addonId: null,
80105
+ access: "create",
80106
+ role: "admin"
80107
+ },
80108
+ "integrationInstances.testInstance": {
80109
+ capName: "integration-instances",
80110
+ capScope: "system",
80111
+ addonId: null,
80112
+ access: "create",
80113
+ role: "admin"
80114
+ },
80115
+ "integrationInstances.updateInstance": {
80116
+ capName: "integration-instances",
80117
+ capScope: "system",
80118
+ addonId: null,
80119
+ access: "create",
80120
+ role: "admin"
80121
+ },
79067
80122
  "integrations.create": {
79068
80123
  capName: "integrations",
79069
80124
  capScope: "system",
@@ -79848,6 +80903,20 @@ Object.freeze({
79848
80903
  access: "view",
79849
80904
  role: "admin"
79850
80905
  },
80906
+ "mediaPlayer.channelDown": {
80907
+ capName: "media-player",
80908
+ capScope: "device",
80909
+ addonId: null,
80910
+ access: "create",
80911
+ role: "viewer"
80912
+ },
80913
+ "mediaPlayer.channelUp": {
80914
+ capName: "media-player",
80915
+ capScope: "device",
80916
+ addonId: null,
80917
+ access: "create",
80918
+ role: "viewer"
80919
+ },
79851
80920
  "mediaPlayer.getStatus": {
79852
80921
  capName: "media-player",
79853
80922
  capScope: "device",
@@ -79939,6 +81008,34 @@ Object.freeze({
79939
81008
  access: "create",
79940
81009
  role: "viewer"
79941
81010
  },
81011
+ "mediaPlayer.turnOff": {
81012
+ capName: "media-player",
81013
+ capScope: "device",
81014
+ addonId: null,
81015
+ access: "create",
81016
+ role: "viewer"
81017
+ },
81018
+ "mediaPlayer.turnOn": {
81019
+ capName: "media-player",
81020
+ capScope: "device",
81021
+ addonId: null,
81022
+ access: "create",
81023
+ role: "viewer"
81024
+ },
81025
+ "mediaPlayer.volumeDown": {
81026
+ capName: "media-player",
81027
+ capScope: "device",
81028
+ addonId: null,
81029
+ access: "create",
81030
+ role: "viewer"
81031
+ },
81032
+ "mediaPlayer.volumeUp": {
81033
+ capName: "media-player",
81034
+ capScope: "device",
81035
+ addonId: null,
81036
+ access: "create",
81037
+ role: "viewer"
81038
+ },
79942
81039
  "meshNetwork.getStatus": {
79943
81040
  capName: "mesh-network",
79944
81041
  capScope: "system",
@@ -81185,27 +82282,6 @@ Object.freeze({
81185
82282
  access: "create",
81186
82283
  role: "viewer"
81187
82284
  },
81188
- "petFountain.setPumpInterval": {
81189
- capName: "pet-fountain",
81190
- capScope: "device",
81191
- addonId: null,
81192
- access: "create",
81193
- role: "viewer"
81194
- },
81195
- "petFountain.setPumpOffMinutes": {
81196
- capName: "pet-fountain",
81197
- capScope: "device",
81198
- addonId: null,
81199
- access: "create",
81200
- role: "viewer"
81201
- },
81202
- "petFountain.setPumpOnMinutes": {
81203
- capName: "pet-fountain",
81204
- capScope: "device",
81205
- addonId: null,
81206
- access: "create",
81207
- role: "viewer"
81208
- },
81209
82285
  "pipelineAnalytics.addRetrainFrameFromRecording": {
81210
82286
  capName: "pipeline-analytics",
81211
82287
  capScope: "device",
@@ -82984,6 +84060,34 @@ Object.freeze({
82984
84060
  access: "create",
82985
84061
  role: "admin"
82986
84062
  },
84063
+ "pumpCycle.getStatus": {
84064
+ capName: "pump-cycle",
84065
+ capScope: "device",
84066
+ addonId: null,
84067
+ access: "view",
84068
+ role: "viewer"
84069
+ },
84070
+ "pumpCycle.setEnabled": {
84071
+ capName: "pump-cycle",
84072
+ capScope: "device",
84073
+ addonId: null,
84074
+ access: "create",
84075
+ role: "viewer"
84076
+ },
84077
+ "pumpCycle.setOffMinutes": {
84078
+ capName: "pump-cycle",
84079
+ capScope: "device",
84080
+ addonId: null,
84081
+ access: "create",
84082
+ role: "viewer"
84083
+ },
84084
+ "pumpCycle.setOnMinutes": {
84085
+ capName: "pump-cycle",
84086
+ capScope: "device",
84087
+ addonId: null,
84088
+ access: "create",
84089
+ role: "viewer"
84090
+ },
82987
84091
  "reboot.reboot": {
82988
84092
  capName: "reboot",
82989
84093
  capScope: "device",
@@ -83488,6 +84592,13 @@ Object.freeze({
83488
84592
  access: "create",
83489
84593
  role: "admin"
83490
84594
  },
84595
+ "remote.getAssumedStatus": {
84596
+ capName: "remote",
84597
+ capScope: "system",
84598
+ addonId: null,
84599
+ access: "view",
84600
+ role: "admin"
84601
+ },
83491
84602
  "remote.getConfig": {
83492
84603
  capName: "remote",
83493
84604
  capScope: "system",
@@ -84720,6 +85831,13 @@ Object.freeze({
84720
85831
  access: "create",
84721
85832
  role: "viewer"
84722
85833
  },
85834
+ "system.debugWatch": {
85835
+ capName: "system",
85836
+ capScope: "system",
85837
+ addonId: null,
85838
+ access: "create",
85839
+ role: "admin"
85840
+ },
84723
85841
  "system.detectSiteLocation": {
84724
85842
  capName: "system",
84725
85843
  capScope: "system",
@@ -86321,6 +87439,11 @@ Object.freeze({
86321
87439
  form: "single",
86322
87440
  optional: false
86323
87441
  }],
87442
+ "coreBlocks.proposeRunningThreshold": [{
87443
+ name: "deviceId",
87444
+ form: "single",
87445
+ optional: false
87446
+ }],
86324
87447
  "cover.close": [{
86325
87448
  name: "deviceId",
86326
87449
  form: "single",
@@ -86913,6 +88036,16 @@ Object.freeze({
86913
88036
  form: "single",
86914
88037
  optional: false
86915
88038
  }],
88039
+ "doNotDisturb.getStatus": [{
88040
+ name: "deviceId",
88041
+ form: "single",
88042
+ optional: false
88043
+ }],
88044
+ "doNotDisturb.setEnabled": [{
88045
+ name: "deviceId",
88046
+ form: "single",
88047
+ optional: false
88048
+ }],
86916
88049
  "doorbell.getStatus": [{
86917
88050
  name: "deviceId",
86918
88051
  form: "single",
@@ -87162,6 +88295,16 @@ Object.freeze({
87162
88295
  form: "single",
87163
88296
  optional: true
87164
88297
  }],
88298
+ "mediaPlayer.channelDown": [{
88299
+ name: "deviceId",
88300
+ form: "single",
88301
+ optional: false
88302
+ }],
88303
+ "mediaPlayer.channelUp": [{
88304
+ name: "deviceId",
88305
+ form: "single",
88306
+ optional: false
88307
+ }],
87165
88308
  "mediaPlayer.getStatus": [{
87166
88309
  name: "deviceId",
87167
88310
  form: "single",
@@ -87227,6 +88370,26 @@ Object.freeze({
87227
88370
  form: "single",
87228
88371
  optional: false
87229
88372
  }],
88373
+ "mediaPlayer.turnOff": [{
88374
+ name: "deviceId",
88375
+ form: "single",
88376
+ optional: false
88377
+ }],
88378
+ "mediaPlayer.turnOn": [{
88379
+ name: "deviceId",
88380
+ form: "single",
88381
+ optional: false
88382
+ }],
88383
+ "mediaPlayer.volumeDown": [{
88384
+ name: "deviceId",
88385
+ form: "single",
88386
+ optional: false
88387
+ }],
88388
+ "mediaPlayer.volumeUp": [{
88389
+ name: "deviceId",
88390
+ form: "single",
88391
+ optional: false
88392
+ }],
87230
88393
  "meter.getStatus": [{
87231
88394
  name: "deviceId",
87232
88395
  form: "single",
@@ -87536,21 +88699,6 @@ Object.freeze({
87536
88699
  form: "single",
87537
88700
  optional: false
87538
88701
  }],
87539
- "petFountain.setPumpInterval": [{
87540
- name: "deviceId",
87541
- form: "single",
87542
- optional: false
87543
- }],
87544
- "petFountain.setPumpOffMinutes": [{
87545
- name: "deviceId",
87546
- form: "single",
87547
- optional: false
87548
- }],
87549
- "petFountain.setPumpOnMinutes": [{
87550
- name: "deviceId",
87551
- form: "single",
87552
- optional: false
87553
- }],
87554
88702
  "pipelineAnalytics.addRetrainFrameFromRecording": [{
87555
88703
  name: "deviceId",
87556
88704
  form: "single",
@@ -88186,6 +89334,26 @@ Object.freeze({
88186
89334
  form: "single",
88187
89335
  optional: false
88188
89336
  }],
89337
+ "pumpCycle.getStatus": [{
89338
+ name: "deviceId",
89339
+ form: "single",
89340
+ optional: false
89341
+ }],
89342
+ "pumpCycle.setEnabled": [{
89343
+ name: "deviceId",
89344
+ form: "single",
89345
+ optional: false
89346
+ }],
89347
+ "pumpCycle.setOffMinutes": [{
89348
+ name: "deviceId",
89349
+ form: "single",
89350
+ optional: false
89351
+ }],
89352
+ "pumpCycle.setOnMinutes": [{
89353
+ name: "deviceId",
89354
+ form: "single",
89355
+ optional: false
89356
+ }],
88189
89357
  "reboot.reboot": [{
88190
89358
  name: "deviceId",
88191
89359
  form: "single",
@@ -88387,6 +89555,11 @@ Object.freeze({
88387
89555
  form: "single",
88388
89556
  optional: true
88389
89557
  }],
89558
+ "remote.getAssumedStatus": [{
89559
+ name: "deviceId",
89560
+ form: "single",
89561
+ optional: false
89562
+ }],
88390
89563
  "remote.getConfig": [{
88391
89564
  name: "deviceId",
88392
89565
  form: "single",
@@ -88653,6 +89826,11 @@ Object.freeze({
88653
89826
  form: "single",
88654
89827
  optional: false
88655
89828
  }],
89829
+ "system.debugWatch": [{
89830
+ name: "deviceIds",
89831
+ form: "array",
89832
+ optional: true
89833
+ }],
88656
89834
  "tamper.getStatus": [{
88657
89835
  name: "deviceId",
88658
89836
  form: "single",
@@ -88929,99 +90107,6 @@ Object.freeze({
88929
90107
  "network-access": "ingress",
88930
90108
  "smtp-provider": "email"
88931
90109
  });
88932
- /**
88933
- * A saved Customize assignment (D936). The schema is the type: callers use
88934
- * `z.infer`, they do not restate the shape.
88935
- */
88936
- var OverrideSourceSchema = object({
88937
- addonId: string().min(1),
88938
- stableId: string().min(1),
88939
- cap: string().min(1),
88940
- fieldPath: string().min(1)
88941
- });
88942
- var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
88943
- object({ kind: literal("identity") }),
88944
- object({ kind: literal("invert") }),
88945
- object({
88946
- kind: literal("threshold"),
88947
- comparison: _enum(["gte", "lte"]),
88948
- threshold: number(),
88949
- startDwellMs: number().nonnegative(),
88950
- stopDwellMs: number().nonnegative()
88951
- }),
88952
- object({
88953
- kind: literal("linear"),
88954
- scale: number(),
88955
- offset: number(),
88956
- clampMin: number().optional(),
88957
- clampMax: number().optional()
88958
- }),
88959
- object({
88960
- kind: literal("enum-map"),
88961
- mapping: record(string(), string().nullable())
88962
- }),
88963
- object({ kind: literal("number") })
88964
- ]);
88965
- var ScalarOverrideDraftSchema = object({
88966
- kind: literal("scalar"),
88967
- cap: string().min(1),
88968
- targetId: string().min(1),
88969
- source: OverrideSourceSchema,
88970
- transform: CustomizeTransformDraftSchema
88971
- });
88972
- var KeyedArrayOverrideDraftSchema = object({
88973
- kind: literal("keyedArray"),
88974
- cap: string().min(1),
88975
- targetId: string().min(1),
88976
- key: string().min(1),
88977
- label: string().min(1),
88978
- fieldPath: string().min(1),
88979
- source: OverrideSourceSchema,
88980
- transform: CustomizeTransformDraftSchema
88981
- });
88982
- var PulseOverrideDraftSchema = object({
88983
- kind: literal("pulse"),
88984
- cap: string().min(1),
88985
- targetId: string().min(1),
88986
- enabled: boolean(),
88987
- debounceMs: number().nonnegative(),
88988
- edges: array(_enum([
88989
- "rising",
88990
- "button",
88991
- "native-event"
88992
- ])).min(1).optional(),
88993
- sources: array(OverrideSourceSchema).min(1)
88994
- });
88995
- var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
88996
- "in-addition",
88997
- "confirm",
88998
- "replace"
88999
- ]).optional() });
89000
- discriminatedUnion("kind", [
89001
- ScalarOverrideDraftSchema,
89002
- KeyedArrayOverrideDraftSchema,
89003
- PulseOverrideDraftSchema,
89004
- object({
89005
- kind: literal("span"),
89006
- cap: string().min(1),
89007
- targetId: string().min(1),
89008
- timeoutMs: number().nonnegative(),
89009
- cooldownMs: number().nonnegative().optional(),
89010
- sources: array(SpanSourceDraftSchema)
89011
- })
89012
- ]);
89013
- object({
89014
- targetId: string().min(1),
89015
- configured: boolean(),
89016
- source: _enum(["native", "assigned"]),
89017
- state: _enum([
89018
- "active",
89019
- "stale",
89020
- "released",
89021
- "unavailable"
89022
- ]),
89023
- reason: string().nullable()
89024
- });
89025
90110
  var G711_SCALE_CORRECTION_DB = {
89026
90111
  PCMU: 20 * Math.log10(4),
89027
90112
  PCMA: 20 * Math.log10(8)
@@ -89637,6 +90722,7 @@ var STATE_SUMMARY_VARS = [
89637
90722
  [...RULE_TEXT],
89638
90723
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
89639
90724
  ([...RULE_TEXT], [...COMBINED_ALARM]),
90725
+ ([...RULE_TEXT], [...COMBINED_ALARM]),
89640
90726
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
89641
90727
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
89642
90728
  ([...RULE_TEXT], [...CONSUMABLE]),
@@ -137575,6 +138661,111 @@ function carryForward(base, existing, keys) {
137575
138661
  return out;
137576
138662
  }
137577
138663
  //#endregion
138664
+ //#region src/migrations/hub-node-fields.ts
138665
+ /**
138666
+ * Fields stored once for the cluster that are facts of ONE node become node settings (D986): a
138667
+ * node's row is `<addonId>.<key>@<nodeId>` carrying `nodeId`, and a node never falls back to a
138668
+ * bare row. This owner is placed `hub-only`, so the one node that ever held a value is the hub:
138669
+ * each bare row is COPIED to `<key>@hub`. The bare row stays for a release (a copy, not a move),
138670
+ * and a value already on the node row is never overwritten (a seed never overwrites).
138671
+ *
138672
+ * A keychain marker is copied verbatim: it names the owner and the secret, not the row that
138673
+ * points at it. Idempotent: with every bare row copied the plan is empty.
138674
+ */
138675
+ /** The canonical settings table: one row per key, id `<addonId>.<key>`. */
138676
+ var ADDON_SETTINGS_TABLE = "addon-settings";
138677
+ var nodeKeyOf = (key) => `${key}@hub`;
138678
+ async function planHubNodeFields(addonId, keys, ports) {
138679
+ const stored = await ports.readStored([...keys, ...keys.map(nodeKeyOf)]);
138680
+ const pending = keys.filter((key) => key in stored && !(nodeKeyOf(key) in stored));
138681
+ if (pending.length === 0) return { edits: [] };
138682
+ const rowId = (key) => `${addonId}.${nodeKeyOf(key)}`;
138683
+ return { edits: [{
138684
+ op: "setKeys",
138685
+ scope: ADDON_SETTINGS_TABLE,
138686
+ values: Object.fromEntries(pending.map((key) => [rowId(key), {
138687
+ addonId,
138688
+ key: nodeKeyOf(key),
138689
+ value: stored[key],
138690
+ nodeId: "hub"
138691
+ }])),
138692
+ precondition: preconditionOf(Object.fromEntries(pending.map((key) => [rowId(key), null])))
138693
+ }] };
138694
+ }
138695
+ /**
138696
+ * The port's read over an addon's three-way key read: each of `keys` that has a row, raw. A key
138697
+ * the store could not answer for throws, so the migration fails instead of treating a failed read
138698
+ * as "nothing to copy".
138699
+ */
138700
+ async function readRawKeys(read, addonId, keys) {
138701
+ const found = {};
138702
+ for (const key of keys) {
138703
+ const answer = await read(key);
138704
+ if (answer.kind === "unreadable") throw new Error(`${addonId}: the setting ${key} cannot be read (${answer.reason})`);
138705
+ if (answer.kind === "present") found[key] = answer.value;
138706
+ }
138707
+ return found;
138708
+ }
138709
+ //#endregion
138710
+ //#region src/migrations/fixed-pin-to-keychain.ts
138711
+ /**
138712
+ * The fixed HomeKit setup code pairs a controller with the bridge: a credential. It was a plain
138713
+ * text setting, stored inline in the settings row; it is a `password` field now (D783), and a
138714
+ * password lives in the keychain with a marker in the row. This procedure moves a stored inline
138715
+ * code there, through the operator write path (the one that stores an inline value of a
138716
+ * pre-keychain addon as a keychain secret).
138717
+ *
138718
+ * Idempotent: an absent, empty or already marker-backed code is `already-done`, so a crash
138719
+ * between the keychain write and the ledger row costs nothing on the rerun.
138720
+ */
138721
+ async function moveFixedPinToKeychain(ports) {
138722
+ const stored = (await ports.readStored(["fixedPin"]))["fixedPin"];
138723
+ if (typeof stored !== "string" || stored === "" || isSecretMarker(stored)) return {
138724
+ outcome: "already-done",
138725
+ summary: { moved: false }
138726
+ };
138727
+ await ports.storeFixedPin(stored);
138728
+ return {
138729
+ outcome: "done",
138730
+ summary: { moved: true }
138731
+ };
138732
+ }
138733
+ //#endregion
138734
+ //#region src/migrations/index.ts
138735
+ var EXPORT_HAP_ID = "export-hap";
138736
+ /** The `export-hap` catalogue (D987): offered to the engine when the addon initialises. */
138737
+ var ADDON_MIGRATIONS = [{
138738
+ meta: {
138739
+ id: "export-hap/2026-11-03-interface-name-per-node",
138740
+ owner: EXPORT_HAP_ID,
138741
+ level: "addon-state",
138742
+ seq: 1,
138743
+ dependsOn: [],
138744
+ store: "settings",
138745
+ scope: "per-node",
138746
+ onFailure: "tolerate",
138747
+ bodyKind: "plan",
138748
+ description: "Copy the bare network interface setting to its hub node row; the bare row stays for a release",
138749
+ fixtureMark: "the bridge name the migration does not know"
138750
+ },
138751
+ plan: (ports) => planHubNodeFields(EXPORT_HAP_ID, ["interfaceName"], ports)
138752
+ }, {
138753
+ meta: {
138754
+ id: "export-hap/2026-11-03-fixed-pin-to-keychain",
138755
+ owner: EXPORT_HAP_ID,
138756
+ level: "addon-state",
138757
+ seq: 2,
138758
+ dependsOn: [],
138759
+ store: "settings",
138760
+ scope: "cluster",
138761
+ onFailure: "tolerate",
138762
+ bodyKind: "procedure",
138763
+ description: "Move the fixed setup code from an inline setting into the keychain, where a password field keeps it",
138764
+ fixtureMark: "the bridge name the migration does not know"
138765
+ },
138766
+ procedure: moveFixedPinToKeychain
138767
+ }];
138768
+ //#endregion
137578
138769
  //#region src/hap-setup-uri.ts
137579
138770
  function errMsg$15(e) {
137580
138771
  return e instanceof Error ? e.message : String(e);
@@ -157022,6 +158213,7 @@ var ExportHapAddon = class extends BaseAddon {
157022
158213
  super({ ...DEFAULT_CONFIG });
157023
158214
  }
157024
158215
  async onInitialize() {
158216
+ await this.migrateSettings();
157025
158217
  const identity = await this.ensureIdentity();
157026
158218
  this.pincode = identity.pincode;
157027
158219
  this.bind = this.config.interfaceName || void 0;
@@ -157110,8 +158302,10 @@ var ExportHapAddon = class extends BaseAddon {
157110
158302
  this.subscribeDeviceReadyForReconcile();
157111
158303
  this.subscribeStorageLocationsForClips();
157112
158304
  this.disposeSharedRebuildTimers();
158305
+ const ownInstance = (instanceId) => assertOwnExportInstance("export-hap", EXPORT_HAP_ADDON_ID, instanceId);
157113
158306
  const provider = {
157114
- getStatus: async () => {
158307
+ getStatus: async (input) => {
158308
+ ownInstance(statusInstanceOf(input));
157115
158309
  const anyPaired = Array.from(this.exposed.values()).some((m) => accessoryPaired(m.accessory));
157116
158310
  const linkState = this.lastError ? "error" : anyPaired ? "linked" : "unlinked";
157117
158311
  const setup = this.buildSetupBlock();
@@ -157122,19 +158316,38 @@ var ExportHapAddon = class extends BaseAddon {
157122
158316
  ...setup ? { setup } : {}
157123
158317
  };
157124
158318
  },
157125
- listSupportedDeviceKinds: async () => [...HAP_EXPORTABLE_DEVICE_TYPES],
157126
- listExposedDevices: async () => Array.from(this.exposed.entries()).map(([deviceId, m]) => {
157127
- const entry = this.config.exposed.find((e) => e.deviceId === deviceId);
157128
- return {
157129
- deviceId,
157130
- exposedAs: m.accessory.displayName,
157131
- ...entry?.capabilities ? { capabilities: [...entry.capabilities] } : {}
157132
- };
157133
- }),
157134
- exposeDevice: async ({ deviceId, capabilities }) => this.exposeDevice(deviceId, capabilities),
157135
- unexposeDevice: async ({ deviceId }) => this.unexposeDevice(deviceId),
158319
+ listInstances: async () => [{
158320
+ instanceId: EXPORT_HAP_ADDON_ID,
158321
+ name: "HomeKit",
158322
+ enabled: true,
158323
+ kind: "hap-bridge"
158324
+ }],
158325
+ listSupportedDeviceKinds: async ({ instanceId }) => {
158326
+ ownInstance(instanceId);
158327
+ return [...HAP_EXPORTABLE_DEVICE_TYPES];
158328
+ },
158329
+ listExposedDevices: async ({ instanceId }) => {
158330
+ ownInstance(instanceId);
158331
+ return Array.from(this.exposed.entries()).map(([deviceId, m]) => {
158332
+ const entry = this.config.exposed.find((e) => e.deviceId === deviceId);
158333
+ return {
158334
+ deviceId,
158335
+ exposedAs: m.accessory.displayName,
158336
+ ...entry?.capabilities ? { capabilities: [...entry.capabilities] } : {}
158337
+ };
158338
+ });
158339
+ },
158340
+ exposeDevice: async ({ instanceId, deviceId, capabilities }) => {
158341
+ ownInstance(instanceId);
158342
+ return this.exposeDevice(deviceId, capabilities);
158343
+ },
158344
+ unexposeDevice: async ({ instanceId, deviceId }) => {
158345
+ ownInstance(instanceId);
158346
+ return this.unexposeDevice(deviceId);
158347
+ },
157136
158348
  listSupportedEntityKinds: async () => ["device", "action"],
157137
- listExposedEntities: async () => {
158349
+ listExposedEntities: async ({ instanceId }) => {
158350
+ ownInstance(instanceId);
157138
158351
  await this.actionExports?.reconcile();
157139
158352
  return [...Array.from(this.exposed.entries()).map(([deviceId, m]) => ({
157140
158353
  entity: {
@@ -157144,12 +158357,14 @@ var ExportHapAddon = class extends BaseAddon {
157144
158357
  exposedAs: m.accessory.displayName
157145
158358
  })), ...this.actionExports?.list() ?? []];
157146
158359
  },
157147
- exposeEntity: async ({ entity }) => {
158360
+ exposeEntity: async ({ instanceId, entity }) => {
158361
+ ownInstance(instanceId);
157148
158362
  if (entity.kind === "device") return this.exposeDevice(entity.deviceId);
157149
158363
  if (entity.kind === "action") return this.requireActionExports().expose(entity.actionId);
157150
158364
  throw new Error("export-hap: a notification target cannot be exported to HomeKit");
157151
158365
  },
157152
- unexposeEntity: async ({ entity }) => {
158366
+ unexposeEntity: async ({ instanceId, entity }) => {
158367
+ ownInstance(instanceId);
157153
158368
  if (entity.kind === "device") return this.unexposeDevice(entity.deviceId);
157154
158369
  if (entity.kind === "action") return this.requireActionExports().unexpose(entity.actionId);
157155
158370
  throw new Error("export-hap: a notification target cannot be exported to HomeKit");
@@ -157630,6 +158845,37 @@ var ExportHapAddon = class extends BaseAddon {
157630
158845
  return null;
157631
158846
  }
157632
158847
  }
158848
+ /** The one declaration of the bind-interface field, shared by the node form and the global form. */
158849
+ interfaceNameField() {
158850
+ return this.field({
158851
+ type: "text",
158852
+ key: "interfaceName",
158853
+ perNode: true,
158854
+ label: "Network interface",
158855
+ description: "Optional. Restrict mDNS advertisement and HAP bind to this node's interface (e.g. \"en0\"). Leave blank to advertise on all interfaces.",
158856
+ default: DEFAULT_CONFIG.interfaceName,
158857
+ requiresRestart: true,
158858
+ placement: { tab: "advanced" }
158859
+ });
158860
+ }
158861
+ async nodeSettingsSchema(cap) {
158862
+ return cap === "device-export" ? this.schema({ sections: [{
158863
+ id: "export-hap-node",
158864
+ title: "HomeKit Export",
158865
+ fields: [this.interfaceNameField()]
158866
+ }] }) : null;
158867
+ }
158868
+ /**
158869
+ * Copy the bare `interfaceName` to its hub node row and move an inline `fixedPin` into the
158870
+ * keychain (D986, D987). Re-resolves the config when either landed, so this boot binds the
158871
+ * value the migration wrote.
158872
+ */
158873
+ async migrateSettings() {
158874
+ if ((await this.runMigrations(defineAddonMigrations(ADDON_MIGRATIONS, {
158875
+ readStored: (keys) => readRawKeys((key) => this.readStoredGlobalKey(key), "export-hap", keys),
158876
+ storeFixedPin: (pin) => this.updateGlobalSettingsAsOperator({ fixedPin: pin })
158877
+ }))).applied.length > 0) await this.resolveConfig();
158878
+ }
157633
158879
  globalSettingsSchema() {
157634
158880
  return this.schema({ sections: [{
157635
158881
  id: "export-hap",
@@ -157647,24 +158893,15 @@ var ExportHapAddon = class extends BaseAddon {
157647
158893
  placement: { tab: "advanced" }
157648
158894
  }),
157649
158895
  this.field({
157650
- type: "text",
158896
+ type: "password",
157651
158897
  key: "fixedPin",
157652
- secret: true,
157653
158898
  label: "Fixed setup code (XXX-XX-XXX)",
157654
158899
  description: "Optional. Leave blank to use the auto-generated code persisted on first boot. Useful for CI replay.",
157655
158900
  default: DEFAULT_CONFIG.fixedPin,
157656
158901
  requiresRestart: true,
157657
158902
  placement: { tab: "advanced" }
157658
158903
  }),
157659
- this.field({
157660
- type: "text",
157661
- key: "interfaceName",
157662
- label: "Network interface",
157663
- description: "Optional. Restrict mDNS advertisement and HAP bind to a specific interface (e.g. \"en0\"). Leave blank to advertise on all interfaces.",
157664
- default: DEFAULT_CONFIG.interfaceName,
157665
- requiresRestart: true,
157666
- placement: { tab: "advanced" }
157667
- }),
158904
+ this.interfaceNameField(),
157668
158905
  this.field({
157669
158906
  type: "number",
157670
158907
  key: "clipRetentionDays",