@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.
@@ -835,7 +835,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
835
835
  return EventCategory;
836
836
  }({});
837
837
  //#endregion
838
- //#region ../types/dist/device-type-BOWLtoOt.mjs
838
+ //#region ../types/dist/device-type-D1fH5kaC.mjs
839
839
  /**
840
840
  import { errMsg } from '@camstack/types'
841
841
  * Extract a human-readable message from an unknown error value.
@@ -1024,6 +1024,9 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1024
1024
  DeviceFeature["CoverPositionable"] = "cover-positionable";
1025
1025
  /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
1026
1026
  DeviceFeature["CoverTilt"] = "cover-tilt";
1027
+ /** Cover has a real stop: `stop` halts the travel in place. Gates the stop
1028
+ * control in exporters; a provider whose `stop` is a no-op never declares it. */
1029
+ DeviceFeature["CoverStoppable"] = "cover-stoppable";
1027
1030
  /** Valve exposes intermediate position control (0..100). Gates the
1028
1031
  * position slider / drag surface UI. */
1029
1032
  DeviceFeature["ValvePositionable"] = "valve-positionable";
@@ -1063,6 +1066,12 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1063
1066
  DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
1064
1067
  /** Media player exposes stop distinct from pause. */
1065
1068
  DeviceFeature["MediaPlayerStop"] = "media-player-stop";
1069
+ /** Media player exposes volume up / down in steps (an infrared TV has no level). */
1070
+ DeviceFeature["MediaPlayerVolumeStep"] = "media-player-volume-step";
1071
+ /** Media player exposes channel up / down in steps. */
1072
+ DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
1073
+ /** Media player exposes power on / off. */
1074
+ DeviceFeature["MediaPlayerPower"] = "media-player-power";
1066
1075
  /** Alarm panel requires a PIN code on arm/disarm. */
1067
1076
  DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
1068
1077
  /** Presence device carries GPS coordinates (lat/lng/accuracy) in
@@ -5889,7 +5898,7 @@ var ZodIssueCode = {
5889
5898
  var ZodFirstPartyTypeKind;
5890
5899
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5891
5900
  //#endregion
5892
- //#region ../types/dist/sleep-_4vKNWxb.mjs
5901
+ //#region ../types/dist/sleep-BkzQdpzF.mjs
5893
5902
  /**
5894
5903
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5895
5904
  * window to float samples (D455).
@@ -5968,6 +5977,22 @@ function buildAlawTable() {
5968
5977
  }
5969
5978
  buildUlawTable();
5970
5979
  buildAlawTable();
5980
+ /**
5981
+ * An addon whose own migrations did not apply refuses to initialise (D987). The error is typed
5982
+ * so a runner hosting several addons can tell "this addon is blocked" from a crash and keep its
5983
+ * co-located siblings running. Recognised by NAME and shape, never `instanceof`: a forked addon
5984
+ * bundles its own copy of this module, so the class the runner sees is not the one that threw.
5985
+ */
5986
+ var MIGRATIONS_BLOCKED_ERROR_NAME = "AddonMigrationsBlockedError";
5987
+ var AddonMigrationsBlockedError = class extends Error {
5988
+ /** The ledger ids that did not apply and block the owner. */
5989
+ migrationIds;
5990
+ constructor(migrationIds) {
5991
+ super(`migration(s) ${migrationIds.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
5992
+ this.name = MIGRATIONS_BLOCKED_ERROR_NAME;
5993
+ this.migrationIds = migrationIds;
5994
+ }
5995
+ };
5971
5996
  /** Is this field's stored value a credential? */
5972
5997
  function isSecretConfigField(field) {
5973
5998
  if (field.type === "password") return true;
@@ -6006,7 +6031,7 @@ function isKeychainStoredField(field) {
6006
6031
  var SECRET_CLEAR = { $secretClear: true };
6007
6032
  /** The `'***'` token D634 redaction writes for non-admins. */
6008
6033
  var LEGACY_DEVICE_REDACTION = "***";
6009
- function isRecord$6(value) {
6034
+ function isRecord$7(value) {
6010
6035
  return typeof value === "object" && value !== null && !Array.isArray(value);
6011
6036
  }
6012
6037
  function makeSecretMarker(ref) {
@@ -6017,12 +6042,12 @@ function makeSecretMarker(ref) {
6017
6042
  }
6018
6043
  /** A stored marker: an object whose `$secret` is a non-empty string. */
6019
6044
  function isSecretMarker(value) {
6020
- if (!isRecord$6(value)) return false;
6045
+ if (!isRecord$7(value)) return false;
6021
6046
  const ref = value["$secret"];
6022
6047
  return typeof ref === "string" && ref.length > 0;
6023
6048
  }
6024
6049
  function isSecretClear(value) {
6025
- return isRecord$6(value) && value["$secretClear"] === true;
6050
+ return isRecord$7(value) && value["$secretClear"] === true;
6026
6051
  }
6027
6052
  /**
6028
6053
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6405,6 +6430,53 @@ function emitReadiness(bus, params) {
6405
6430
  ts
6406
6431
  }));
6407
6432
  }
6433
+ /** Why a catalogue entry is not a runnable body of its declared kind. */
6434
+ var AddonMigrationDefinitionError = class extends Error {
6435
+ id;
6436
+ constructor(id, message) {
6437
+ super(`${id}: ${message}`);
6438
+ this.id = id;
6439
+ this.name = "AddonMigrationDefinitionError";
6440
+ }
6441
+ };
6442
+ /**
6443
+ * Bind a catalogue to the addon's ports. Throws {@link AddonMigrationDefinitionError} when
6444
+ * an entry's `bodyKind` does not match the body it carries, or is `sql` (a hub-only
6445
+ * body). A throwing body never escapes `execute`: it is reported as a failed result.
6446
+ */
6447
+ function defineAddonMigrations(catalogue, ports) {
6448
+ return catalogue.map((entry) => {
6449
+ const { meta } = entry;
6450
+ if ("plan" in entry) {
6451
+ if (meta.bodyKind !== "plan") throw new AddonMigrationDefinitionError(meta.id, `carries a plan body but declares "${meta.bodyKind}"`);
6452
+ return {
6453
+ meta,
6454
+ execute: () => guarded(async () => ({
6455
+ kind: "plan",
6456
+ plan: await entry.plan(ports)
6457
+ }))
6458
+ };
6459
+ }
6460
+ if (meta.bodyKind !== "procedure") throw new AddonMigrationDefinitionError(meta.id, `carries a procedure body but declares "${meta.bodyKind}"`);
6461
+ return {
6462
+ meta,
6463
+ execute: () => guarded(async () => ({
6464
+ kind: "procedure",
6465
+ result: await entry.procedure(ports)
6466
+ }))
6467
+ };
6468
+ });
6469
+ }
6470
+ async function guarded(work) {
6471
+ try {
6472
+ return await work();
6473
+ } catch (err) {
6474
+ return {
6475
+ kind: "failed",
6476
+ error: errMsg$17(err)
6477
+ };
6478
+ }
6479
+ }
6408
6480
  var NOT_RUN = {
6409
6481
  declared: false,
6410
6482
  snapshot: null,
@@ -6728,7 +6800,7 @@ var KeychainWriteRefusedError = class extends Error {
6728
6800
  }
6729
6801
  };
6730
6802
  var KEEP = { kind: "keep" };
6731
- function isRecord$5(value) {
6803
+ function isRecord$6(value) {
6732
6804
  return typeof value === "object" && value !== null && !Array.isArray(value);
6733
6805
  }
6734
6806
  function defaultMintId() {
@@ -6741,7 +6813,7 @@ function collectSecretMarkerRefs(value, out = []) {
6741
6813
  return out;
6742
6814
  }
6743
6815
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6744
- else if (isRecord$5(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6816
+ else if (isRecord$6(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6745
6817
  return out;
6746
6818
  }
6747
6819
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6796,7 +6868,7 @@ function rowId(row, idKey) {
6796
6868
  return null;
6797
6869
  }
6798
6870
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6799
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$5) : [];
6871
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$6) : [];
6800
6872
  if (!Array.isArray(incoming)) {
6801
6873
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6802
6874
  return {
@@ -6812,7 +6884,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6812
6884
  const kept = /* @__PURE__ */ new Set();
6813
6885
  const rows = [];
6814
6886
  for (const row of incoming) {
6815
- if (!isRecord$5(row)) {
6887
+ if (!isRecord$6(row)) {
6816
6888
  rows.push(row);
6817
6889
  continue;
6818
6890
  }
@@ -6837,7 +6909,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6837
6909
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6838
6910
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6839
6911
  case "object": {
6840
- if (!isRecord$5(incoming)) {
6912
+ if (!isRecord$6(incoming)) {
6841
6913
  if (incoming === void 0) return KEEP;
6842
6914
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6843
6915
  return {
@@ -6845,7 +6917,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6845
6917
  value: incoming
6846
6918
  };
6847
6919
  }
6848
- const storedObj = isRecord$5(stored) ? stored : {};
6920
+ const storedObj = isRecord$6(stored) ? stored : {};
6849
6921
  return {
6850
6922
  kind: "value",
6851
6923
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -6968,7 +7040,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
6968
7040
  value: items
6969
7041
  };
6970
7042
  }
6971
- if (isRecord$5(v)) {
7043
+ if (isRecord$6(v)) {
6972
7044
  const out = {};
6973
7045
  for (const [k, child] of Object.entries(v)) {
6974
7046
  const s = substitute(child);
@@ -7000,7 +7072,7 @@ var SecretOverwriteRefusedError = class extends Error {
7000
7072
  this.name = "SecretOverwriteRefusedError";
7001
7073
  }
7002
7074
  };
7003
- function isRecord$4(value) {
7075
+ function isRecord$5(value) {
7004
7076
  return typeof value === "object" && value !== null && !Array.isArray(value);
7005
7077
  }
7006
7078
  function resolvedValue(pass, marker) {
@@ -7029,7 +7101,7 @@ function inArray(pass, incoming, stored) {
7029
7101
  return incoming.map((item, index) => {
7030
7102
  const twin = stored[index];
7031
7103
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
7032
- if (isRecord$4(item) && isRecord$4(twin)) return inArrayRow(pass, item, twin);
7104
+ if (isRecord$5(item) && isRecord$5(twin)) return inArrayRow(pass, item, twin);
7033
7105
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
7034
7106
  return item;
7035
7107
  });
@@ -7040,7 +7112,7 @@ function inArrayRow(pass, incoming, stored) {
7040
7112
  const twin = stored[key];
7041
7113
  if (isSecretMarker(twin)) {
7042
7114
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
7043
- } else if (isRecord$4(value) && isRecord$4(twin)) out[key] = inArrayRow(pass, value, twin);
7115
+ } else if (isRecord$5(value) && isRecord$5(twin)) out[key] = inArrayRow(pass, value, twin);
7044
7116
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
7045
7117
  }
7046
7118
  return out;
@@ -7048,7 +7120,7 @@ function inArrayRow(pass, incoming, stored) {
7048
7120
  async function walk(pass, incoming, stored) {
7049
7121
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
7050
7122
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
7051
- if (!isRecord$4(incoming) || !isRecord$4(stored)) return incoming;
7123
+ if (!isRecord$5(incoming) || !isRecord$5(stored)) return incoming;
7052
7124
  const out = { ...incoming };
7053
7125
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
7054
7126
  return out;
@@ -7079,7 +7151,7 @@ async function restoreUnchangedSecrets(input) {
7079
7151
  function isJsonEqual(a, b) {
7080
7152
  if (Object.is(a, b)) return true;
7081
7153
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
7082
- if (isRecord$4(a) && isRecord$4(b)) {
7154
+ if (isRecord$5(a) && isRecord$5(b)) {
7083
7155
  const keys = Object.keys(a);
7084
7156
  if (keys.length !== Object.keys(b).length) return false;
7085
7157
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -7103,7 +7175,7 @@ function markerKeysOf(blob, owner) {
7103
7175
  }
7104
7176
  function nodeFromStored(value, owner) {
7105
7177
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
7106
- if (!isRecord$4(value)) return null;
7178
+ if (!isRecord$5(value)) return null;
7107
7179
  const children = /* @__PURE__ */ new Map();
7108
7180
  for (const [key, child] of Object.entries(value)) {
7109
7181
  const node = nodeFromStored(child, owner);
@@ -7574,7 +7646,7 @@ var BaseAddon = class {
7574
7646
  startMigration: (input) => api.startMigration.mutate(input),
7575
7647
  finishMigration: (input) => api.finishMigration.mutate(input)
7576
7648
  }, migrations, this.ctx.logger);
7577
- if (report.blockOwner.length > 0) throw new Error(`migration(s) ${report.blockOwner.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
7649
+ if (report.blockOwner.length > 0) throw new AddonMigrationsBlockedError(report.blockOwner);
7578
7650
  return report;
7579
7651
  }
7580
7652
  /**
@@ -7722,6 +7794,44 @@ var BaseAddon = class {
7722
7794
  return null;
7723
7795
  }
7724
7796
  /**
7797
+ * D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
7798
+ * provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
7799
+ * declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
7800
+ * {@link nodeSettingsSchema} and of {@link deviceDefaultsSchema} are disjoint, and a key never
7801
+ * contains `@` (guard `check-scoped-settings-declared`). SHAPE only: values are read by scope.
7802
+ */
7803
+ async clusterSettingsSchema(_cap) {
7804
+ return null;
7805
+ }
7806
+ /**
7807
+ * D986: the form shape of the settings one capability owns PER NODE, or `null`. Stored as
7808
+ * `addon-settings` rows `<addonId>.<field>@<nodeId>` carrying `nodeId` in the row data, so a
7809
+ * forgotten node's rows go in one central delete.
7810
+ */
7811
+ async nodeSettingsSchema(_cap) {
7812
+ return null;
7813
+ }
7814
+ /**
7815
+ * D986: the form shape of the FLEET DEFAULTS of the per-device settings one capability owns,
7816
+ * or `null`. Stored as `addon-settings` rows `<addonId>.<field>`; a device resolves its value
7817
+ * as device row, then this default, then the schema default (`resolveDeviceSettings`).
7818
+ */
7819
+ async deviceDefaultsSchema(_cap) {
7820
+ return null;
7821
+ }
7822
+ /**
7823
+ * The host's read of the scoped declarations: the schema one capability declares for `scope`,
7824
+ * or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
7825
+ * host asks this method.
7826
+ */
7827
+ async getScopedSettingsSchema(scope, cap) {
7828
+ switch (scope) {
7829
+ case "cluster": return this.clusterSettingsSchema(cap);
7830
+ case "node": return this.nodeSettingsSchema(cap);
7831
+ case "device-defaults": return this.deviceDefaultsSchema(cap);
7832
+ }
7833
+ }
7834
+ /**
7725
7835
  * What the create wizard and the integration edit page render for one instance: the addon's
7726
7836
  * per-instance schema when it declares one, else its global schema (what they always showed).
7727
7837
  */
@@ -7876,6 +7986,10 @@ var BaseAddon = class {
7876
7986
  const stored = keychain ? await this.readAddonStoreWithRetry() : {};
7877
7987
  const patch = {};
7878
7988
  for (const key of keys) {
7989
+ if (tree.get(key)?.kind === "array") {
7990
+ patch[key] = [];
7991
+ continue;
7992
+ }
7879
7993
  const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
7880
7994
  patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
7881
7995
  }
@@ -8515,6 +8629,21 @@ function normalizeAddonInitResult(result) {
8515
8629
  if (Array.isArray(result)) return { providers: result };
8516
8630
  return result;
8517
8631
  }
8632
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8633
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
8634
+ var RECORD_DATABASES = ["settings", "events"];
8635
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8636
+ var RECORD_CLASSES = [
8637
+ "config",
8638
+ "ledger",
8639
+ "audit",
8640
+ "mirror",
8641
+ "ephemeral"
8642
+ ];
8643
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8644
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8645
+ var RECORD_BATCH_MAX = 1e3;
8646
+ var RECORD_QUERY_MAX = 1e3;
8518
8647
  /**
8519
8648
  * The share-view scope kinds a share-link token can carry. The hub mints
8520
8649
  * and validates them (`ShareViewGrantSchema` builds its
@@ -8539,21 +8668,6 @@ var PeerBytesTicketSchema = object({
8539
8668
  */
8540
8669
  declaredBytes: number().int().nonnegative().nullable()
8541
8670
  });
8542
- /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8543
- /** The files a kind may live in. `history` is device-history's (D850), never records. */
8544
- var RECORD_DATABASES = ["settings", "events"];
8545
- /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8546
- var RECORD_CLASSES = [
8547
- "config",
8548
- "ledger",
8549
- "audit",
8550
- "mirror",
8551
- "ephemeral"
8552
- ];
8553
- var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8554
- var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8555
- var RECORD_BATCH_MAX = 1e3;
8556
- var RECORD_QUERY_MAX = 1e3;
8557
8671
  /**
8558
8672
  * Record kinds (D881): the declaration an addon makes of one kind of fact, the
8559
8673
  * Zod row schema that describes it, and the helper that turns the two into the
@@ -9331,6 +9445,7 @@ var CAP_NAMES = Object.freeze([
9331
9445
  "backup",
9332
9446
  "battery",
9333
9447
  "binary",
9448
+ "board-key-source",
9334
9449
  "brightness",
9335
9450
  "broker",
9336
9451
  "button",
@@ -9373,6 +9488,7 @@ var CAP_NAMES = Object.freeze([
9373
9488
  "device-status",
9374
9489
  "dishwasher",
9375
9490
  "display-palette",
9491
+ "do-not-disturb",
9376
9492
  "doorbell",
9377
9493
  "embedding-encoder",
9378
9494
  "enum-sensor",
@@ -9393,6 +9509,7 @@ var CAP_NAMES = Object.freeze([
9393
9509
  "humidity-sensor",
9394
9510
  "image",
9395
9511
  "image-settings",
9512
+ "integration-instances",
9396
9513
  "integrations",
9397
9514
  "intercom",
9398
9515
  "ir-transmitter",
@@ -9450,6 +9567,7 @@ var CAP_NAMES = Object.freeze([
9450
9567
  "privacy-mask",
9451
9568
  "ptz",
9452
9569
  "ptz-autotrack",
9570
+ "pump-cycle",
9453
9571
  "reboot",
9454
9572
  "record-entries",
9455
9573
  "recording",
@@ -10132,6 +10250,10 @@ Object.freeze({
10132
10250
  "valueType": "string"
10133
10251
  }
10134
10252
  ],
10253
+ "do-not-disturb": [{
10254
+ "path": "enabled",
10255
+ "valueType": "boolean"
10256
+ }],
10135
10257
  "doorbell": [{
10136
10258
  "path": "lastPressedAt",
10137
10259
  "valueType": "number"
@@ -10738,18 +10860,6 @@ Object.freeze({
10738
10860
  "path": "pumpRunning",
10739
10861
  "valueType": "boolean"
10740
10862
  },
10741
- {
10742
- "path": "pumpIntervalEnabled",
10743
- "valueType": "boolean"
10744
- },
10745
- {
10746
- "path": "pumpOnTime",
10747
- "valueType": "number"
10748
- },
10749
- {
10750
- "path": "pumpOffTime",
10751
- "valueType": "number"
10752
- },
10753
10863
  {
10754
10864
  "path": "lastDrink",
10755
10865
  "valueType": "number"
@@ -10873,6 +10983,20 @@ Object.freeze({
10873
10983
  "valueType": "number"
10874
10984
  }
10875
10985
  ],
10986
+ "pump-cycle": [
10987
+ {
10988
+ "path": "enabled",
10989
+ "valueType": "boolean"
10990
+ },
10991
+ {
10992
+ "path": "onTime",
10993
+ "valueType": "number"
10994
+ },
10995
+ {
10996
+ "path": "offTime",
10997
+ "valueType": "number"
10998
+ }
10999
+ ],
10876
11000
  "recording-archive": [
10877
11001
  {
10878
11002
  "path": "deviceId",
@@ -11322,7 +11446,7 @@ object({
11322
11446
  params: record(string(), union([string(), number()])).optional()
11323
11447
  });
11324
11448
  //#endregion
11325
- //#region ../types/dist/composition-kKKOdFIG.mjs
11449
+ //#region ../types/dist/composition-CRNwcFYY.mjs
11326
11450
  var AUDIO_ENCODER_BY_CODEC = {
11327
11451
  opus: "libopus",
11328
11452
  aac: "aac",
@@ -11499,6 +11623,7 @@ function buildVideoArgs(video, outputArgs, filterGraph, hwEncode) {
11499
11623
  if (video.level !== void 0) args.push("-level", video.level);
11500
11624
  if (video.pixelFormat !== void 0) args.push("-pix_fmt", video.pixelFormat);
11501
11625
  if (video.fps !== void 0) args.push("-r", String(video.fps));
11626
+ if (video.fpsMode !== void 0) args.push("-fps_mode", video.fpsMode);
11502
11627
  if (video.gopFrames !== void 0) args.push("-g", String(video.gopFrames));
11503
11628
  if (video.forceKeyFramesSeconds !== void 0) args.push("-force_key_frames", `expr:gte(t,n_forced*${video.forceKeyFramesSeconds})`);
11504
11629
  if (video.bf !== void 0) args.push("-bf", String(video.bf));
@@ -12680,38 +12805,6 @@ function validateExpressionSource(src) {
12680
12805
  return null;
12681
12806
  }
12682
12807
  /**
12683
- * One power reading becomes a washer, dryer or dishwasher (D944 helper).
12684
- *
12685
- * Standby of the control board is under 5 W; a motor or a heater is far
12686
- * above that, so 5 W is the line. A door lock or a short pump spike is not
12687
- * a cycle, so running starts only after 30 s above the line.
12688
- *
12689
- * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
12690
- * bursts) lasts several minutes. Ending the cycle on the first dip would
12691
- * report "finished" in the middle of the program, so the stop dwell is
12692
- * 10 minutes on every type. The number is stored per type so one machine
12693
- * can move later without moving the others.
12694
- */
12695
- var APPLIANCE_TEMPLATE_ID = "appliance";
12696
- var APPLIANCE_KINDS = [
12697
- "washer",
12698
- "dryer",
12699
- "dishwasher"
12700
- ];
12701
- DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
12702
- /**
12703
- * A dumb plug-in stove or heater, built from a smart plug (a `Heater`).
12704
- *
12705
- * The plug is the actuator: `switch.setState` is a FORWARD to the plug's own
12706
- * (D967), so the heater switches exactly as the plug does. Running is the
12707
- * plug being on; when a power reading is also named, running is the draw
12708
- * staying above the line instead (a plug left on with the stove's own
12709
- * thermostat open is not heating). 50 W is far above any standby and below
12710
- * the smallest radiator.
12711
- */
12712
- var HEATER_TEMPLATE_ID = "heater";
12713
- DeviceType.Heater;
12714
- /**
12715
12808
  * Statistics and integrals over a history read (D944).
12716
12809
  *
12717
12810
  * Pure: the same points always give the same answer, so a restart recomputes
@@ -12855,34 +12948,6 @@ var HelperSpecSchema = discriminatedUnion("kind", [
12855
12948
  /** Actuator groups only. Readings leave this unset. */
12856
12949
  active: ActiveCriterionSchema.optional()
12857
12950
  }),
12858
- object({
12859
- kind: literal("appliance"),
12860
- templateId: literal(APPLIANCE_TEMPLATE_ID),
12861
- appliance: _enum(APPLIANCE_KINDS),
12862
- thresholdWatts: number().positive(),
12863
- startDwellMs: number().int().nonnegative(),
12864
- stopDwellMs: number().int().nonnegative(),
12865
- member: HelperMemberSchema,
12866
- /**
12867
- * The plug that powers the appliance (`switch.on`). Optional: when set, the
12868
- * composition carries a `power-source` feature, so the hub can cut and restore
12869
- * that plug (power-source link of a NEW-target composition).
12870
- */
12871
- powerSwitch: HelperMemberSchema.optional(),
12872
- /** How long a forced restart keeps the plug off; the cap's default when unset. */
12873
- offSeconds: number().optional()
12874
- }),
12875
- object({
12876
- kind: literal("heater"),
12877
- templateId: literal(HEATER_TEMPLATE_ID),
12878
- /** The plug, read and commanded at `switch.on`. */
12879
- plug: HelperMemberSchema,
12880
- /** The plug's power reading, when it has one: running is then the draw, not the switch. */
12881
- meter: HelperMemberSchema.optional(),
12882
- thresholdWatts: number().positive(),
12883
- startDwellMs: number().int().nonnegative(),
12884
- stopDwellMs: number().int().nonnegative()
12885
- }),
12886
12951
  object({
12887
12952
  kind: literal("statistic"),
12888
12953
  stat: _enum(STATISTIC_STATS),
@@ -13054,7 +13119,14 @@ var CompositionForwardCommandSchema = object({
13054
13119
  method: string().min(1),
13055
13120
  args: record(string().min(1), CompositionForwardArgSchema).optional()
13056
13121
  });
13057
- var CompositionCommandTargetSchema = discriminatedUnion("kind", [CompositionForwardCommandSchema, CompositionCodeSourceSchema]);
13122
+ var CompositionCommandTargetSchema = discriminatedUnion("kind", [
13123
+ CompositionForwardCommandSchema,
13124
+ CompositionCodeSourceSchema,
13125
+ object({
13126
+ kind: literal("extension"),
13127
+ target: literal("remote")
13128
+ })
13129
+ ]);
13058
13130
  /** An item key inside an item-array cap (`consumables.items[<key>]`). */
13059
13131
  var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
13060
13132
  /**
@@ -13099,7 +13171,7 @@ var CompositionSchema = object({
13099
13171
  kind: literal("existing"),
13100
13172
  device: CompositionSourceRefSchema
13101
13173
  })]),
13102
- features: array(CompositionFeatureSchema).min(1).max(16),
13174
+ features: array(CompositionFeatureSchema).min(0).max(16),
13103
13175
  /**
13104
13176
  * Present when the block is a helper template. Absent on a free
13105
13177
  * composition (the room example, device 4603). The editor reads this,
@@ -13131,6 +13203,73 @@ var NodeColorIdSchema = _enum([
13131
13203
  "node-g",
13132
13204
  "node-h"
13133
13205
  ]);
13206
+ //#endregion
13207
+ //#region ../types/dist/index.mjs
13208
+ var SMTP_INBOUND_DEFAULT_PORT = 2525;
13209
+ var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
13210
+ var SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
13211
+ /** The text excerpt a message carries on the bus. */
13212
+ var SMTP_INBOUND_TEXT_MAX_CHARS = 4096;
13213
+ var PortSchema = number().int().min(1).max(65535);
13214
+ /** A recipient local-part: what stands before the `@`. */
13215
+ var SmtpRecipientSchema = string().min(1).max(64).regex(/^[A-Za-z0-9._+-]+$/);
13216
+ object({
13217
+ port: PortSchema.default(SMTP_INBOUND_DEFAULT_PORT),
13218
+ bindHost: string().min(1).default("0.0.0.0"),
13219
+ domain: string().min(1).default(SMTP_INBOUND_DEFAULT_DOMAIN),
13220
+ requireAuth: boolean().default(true),
13221
+ username: string().default(""),
13222
+ password: string().default("").meta({ secret: true }),
13223
+ starttls: boolean().default(false),
13224
+ maxMessageBytes: number().int().positive().default(SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES)
13225
+ });
13226
+ object({
13227
+ host: string().min(1).nullable(),
13228
+ hostReason: string().nullable(),
13229
+ port: PortSchema,
13230
+ domain: string().min(1),
13231
+ requireAuth: boolean(),
13232
+ username: string(),
13233
+ password: string(),
13234
+ starttls: boolean()
13235
+ });
13236
+ object({
13237
+ recipients: array(SmtpRecipientSchema).min(1),
13238
+ /**
13239
+ * Who is subscribing. A second `subscribe` with the same id REPLACES that subscriber's
13240
+ * recipients (the way a consumer that restarted, or lost a device, declares its set again);
13241
+ * a recipient held by another subscriber is refused with `smtp-inbound/recipient-claimed`.
13242
+ * Absent, the subscriber is anonymous and unique.
13243
+ */
13244
+ subscriberId: string().min(1).max(64).optional()
13245
+ });
13246
+ var SmtpInboundAttachmentSchema = object({
13247
+ filename: string(),
13248
+ contentType: string(),
13249
+ bytes: number().int().nonnegative()
13250
+ });
13251
+ /** The payload of one `broker.message` (the key is the recipient local-part). */
13252
+ var SmtpInboundMessageSchema = object({
13253
+ /** Monotonic per mailbox; a gap tells a consumer it missed an event. */
13254
+ seq: number().int().positive(),
13255
+ messageId: string(),
13256
+ receivedAt: number().int().nonnegative(),
13257
+ from: string(),
13258
+ to: string(),
13259
+ subject: string(),
13260
+ text: string().max(SMTP_INBOUND_TEXT_MAX_CHARS),
13261
+ attachments: array(SmtpInboundAttachmentSchema)
13262
+ });
13263
+ object({
13264
+ /** The newest seq issued so far (0 before any mail). */
13265
+ lastSeq: number().int().nonnegative(),
13266
+ /** The oldest seq still retained; messages below it are gone. */
13267
+ oldestSeq: number().int().nonnegative(),
13268
+ messages: array(object({
13269
+ key: string(),
13270
+ message: SmtpInboundMessageSchema
13271
+ }))
13272
+ });
13134
13273
  new Set([
13135
13274
  "track",
13136
13275
  "face",
@@ -14295,6 +14434,16 @@ var MigrationPlanSchema = object({ edits: array(discriminatedUnion("op", [
14295
14434
  precondition: PreconditionSchema
14296
14435
  })
14297
14436
  ])) });
14437
+ /** `JSON.stringify` with object keys sorted, so equal values spell the same. */
14438
+ function canonicalJson(value) {
14439
+ if (Array.isArray(value)) return `[${value.map((item) => canonicalJson(item)).join(",")}]`;
14440
+ 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(",")}}`;
14441
+ return JSON.stringify(value) ?? "null";
14442
+ }
14443
+ /** The precondition string for a value a plan read (`null` when it read nothing). */
14444
+ function preconditionOf(value) {
14445
+ return canonicalJson(value ?? null);
14446
+ }
14298
14447
  /**
14299
14448
  * What a `procedure` body reports. `already-done` means the rerun observed the
14300
14449
  * work finished (a crash between the work and the ledger row, or a manual fix)
@@ -16309,8 +16458,18 @@ var LogChannelDescriptorSchema = object({
16309
16458
  * the operator narrows to one camera, sees nothing, and concludes the code
16310
16459
  * path was never taken.
16311
16460
  */
16312
- perDevice: boolean()
16313
- });
16461
+ perDevice: boolean(),
16462
+ /**
16463
+ * What the channel is FOR, so the UI can list the channels an addon offers.
16464
+ *
16465
+ * - `diagnostic` (the default): a per-component diagnostic armed from the
16466
+ * Levels page, emitted at its declared level.
16467
+ * - `debug`: a `debug.<channel>` dump watched live for a short window
16468
+ * (`ctx.debug`). Always per-device, and its lines are denied by the log
16469
+ * ring unless somebody is watching that device.
16470
+ */
16471
+ kind: _enum(["diagnostic", "debug"]).default("diagnostic")
16472
+ }).refine((d) => d.kind !== "debug" || d.name.startsWith("debug.") && d.perDevice, { message: "a debug channel is named debug.<channel> and is per-device" });
16314
16473
  /**
16315
16474
  * An armed window over one channel, as the document hands it to a mirror.
16316
16475
  *
@@ -19617,24 +19776,52 @@ var APPLIANCE_CAP_VOCABULARY = {
19617
19776
  args: { on: false }
19618
19777
  },
19619
19778
  {
19620
- id: "petFountain.intervalOn",
19621
- method: "setPumpInterval",
19779
+ id: "petFountain.resetDailyConsumption",
19780
+ method: "resetDailyConsumption",
19781
+ label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
19782
+ phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
19783
+ icon: "rotate-ccw"
19784
+ }
19785
+ ],
19786
+ state: [{
19787
+ kind: "boolean",
19788
+ field: "empty",
19789
+ label: t("Tank empty", "Serbatoio vuoto"),
19790
+ whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
19791
+ whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
19792
+ icon: "droplet"
19793
+ }, {
19794
+ kind: "numeric",
19795
+ field: "waterLevel",
19796
+ quantity: t("the water level", "il livello dell’acqua"),
19797
+ label: t("Water level", "Livello dell’acqua"),
19798
+ unit: "%",
19799
+ icon: "droplets"
19800
+ }]
19801
+ },
19802
+ "pump-cycle": {
19803
+ scope: "device",
19804
+ noun: t("Pump cycle", "Ciclo della pompa"),
19805
+ actions: [
19806
+ {
19807
+ id: "pumpCycle.on",
19808
+ method: "setEnabled",
19622
19809
  label: t("Pump cycle on", "Ciclo pompa attivo"),
19623
19810
  phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
19624
19811
  icon: "timer",
19625
19812
  args: { on: true }
19626
19813
  },
19627
19814
  {
19628
- id: "petFountain.intervalOff",
19629
- method: "setPumpInterval",
19815
+ id: "pumpCycle.off",
19816
+ method: "setEnabled",
19630
19817
  label: t("Pump cycle off", "Ciclo pompa spento"),
19631
19818
  phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
19632
19819
  icon: "timer-off",
19633
19820
  args: { on: false }
19634
19821
  },
19635
19822
  {
19636
- id: "petFountain.pumpOnMinutes",
19637
- method: "setPumpOnMinutes",
19823
+ id: "pumpCycle.onMinutes",
19824
+ method: "setOnMinutes",
19638
19825
  label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
19639
19826
  phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
19640
19827
  icon: "timer",
@@ -19650,8 +19837,8 @@ var APPLIANCE_CAP_VOCABULARY = {
19650
19837
  }]
19651
19838
  },
19652
19839
  {
19653
- id: "petFountain.pumpOffMinutes",
19654
- method: "setPumpOffMinutes",
19840
+ id: "pumpCycle.offMinutes",
19841
+ method: "setOffMinutes",
19655
19842
  label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
19656
19843
  phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
19657
19844
  icon: "timer-off",
@@ -19665,35 +19852,63 @@ var APPLIANCE_CAP_VOCABULARY = {
19665
19852
  unit: "min"
19666
19853
  }
19667
19854
  }]
19668
- },
19669
- {
19670
- id: "petFountain.resetDailyConsumption",
19671
- method: "resetDailyConsumption",
19672
- label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
19673
- phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
19674
- icon: "rotate-ccw"
19675
19855
  }
19676
19856
  ],
19677
19857
  state: [{
19678
19858
  kind: "boolean",
19679
- field: "empty",
19680
- label: t("Tank empty", "Serbatoio vuoto"),
19681
- whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
19682
- whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
19683
- icon: "droplet"
19684
- }, {
19685
- kind: "numeric",
19686
- field: "waterLevel",
19687
- quantity: t("the water level", "il livello dell’acqua"),
19688
- label: t("Water level", "Livello dell’acqua"),
19689
- unit: "%",
19690
- icon: "droplets"
19859
+ field: "enabled",
19860
+ label: t("Pump cycle", "Ciclo pompa"),
19861
+ whenTrue: t("When {device} starts running its pump on a cycle", "Quando {device} inizia a far lavorare la pompa a ciclo"),
19862
+ whenFalse: t("When {device} runs its pump continuously", "Quando {device} fa lavorare la pompa in continuo"),
19863
+ icon: "timer"
19691
19864
  }]
19692
19865
  },
19693
19866
  "media-player": {
19694
19867
  scope: "device",
19695
19868
  noun: t("Media player", "Lettore multimediale"),
19696
19869
  actions: [
19870
+ {
19871
+ id: "media.turnOn",
19872
+ method: "turnOn",
19873
+ label: t("Turn on", "Accendi"),
19874
+ phrase: t("Turn on {device}", "Accendi {device}"),
19875
+ icon: "power"
19876
+ },
19877
+ {
19878
+ id: "media.turnOff",
19879
+ method: "turnOff",
19880
+ label: t("Turn off", "Spegni"),
19881
+ phrase: t("Turn off {device}", "Spegni {device}"),
19882
+ icon: "power"
19883
+ },
19884
+ {
19885
+ id: "media.volumeUp",
19886
+ method: "volumeUp",
19887
+ label: t("Volume up", "Alza il volume"),
19888
+ phrase: t("Raise the volume of {device}", "Alza il volume di {device}"),
19889
+ icon: "volume-2"
19890
+ },
19891
+ {
19892
+ id: "media.volumeDown",
19893
+ method: "volumeDown",
19894
+ label: t("Volume down", "Abbassa il volume"),
19895
+ phrase: t("Lower the volume of {device}", "Abbassa il volume di {device}"),
19896
+ icon: "volume-2"
19897
+ },
19898
+ {
19899
+ id: "media.channelUp",
19900
+ method: "channelUp",
19901
+ label: t("Channel up", "Canale successivo"),
19902
+ phrase: t("Go to the next channel on {device}", "Passa al canale successivo su {device}"),
19903
+ icon: "skip-forward"
19904
+ },
19905
+ {
19906
+ id: "media.channelDown",
19907
+ method: "channelDown",
19908
+ label: t("Channel down", "Canale precedente"),
19909
+ phrase: t("Go to the previous channel on {device}", "Torna al canale precedente su {device}"),
19910
+ icon: "skip-back"
19911
+ },
19697
19912
  {
19698
19913
  id: "media.play",
19699
19914
  method: "play",
@@ -20373,6 +20588,33 @@ var APPLIANCE_CAP_VOCABULARY = {
20373
20588
  }
20374
20589
  ]
20375
20590
  },
20591
+ "do-not-disturb": {
20592
+ scope: "device",
20593
+ noun: t("Do not disturb", "Non disturbare"),
20594
+ actions: [{
20595
+ id: "dnd.on",
20596
+ method: "setEnabled",
20597
+ label: t("Do not disturb on", "Attiva Non disturbare"),
20598
+ phrase: t("Turn on Do not disturb on {device}", "Attiva Non disturbare su {device}"),
20599
+ icon: "bell-off",
20600
+ args: { enabled: true }
20601
+ }, {
20602
+ id: "dnd.off",
20603
+ method: "setEnabled",
20604
+ label: t("Do not disturb off", "Disattiva Non disturbare"),
20605
+ phrase: t("Turn off Do not disturb on {device}", "Disattiva Non disturbare su {device}"),
20606
+ icon: "bell",
20607
+ args: { enabled: false }
20608
+ }],
20609
+ state: [{
20610
+ kind: "boolean",
20611
+ field: "enabled",
20612
+ label: t("Do not disturb", "Non disturbare"),
20613
+ whenTrue: t("When Do not disturb turns on on {device}", "Quando {device} attiva Non disturbare"),
20614
+ whenFalse: t("When Do not disturb turns off on {device}", "Quando {device} disattiva Non disturbare"),
20615
+ icon: "bell-off"
20616
+ }]
20617
+ },
20376
20618
  update: {
20377
20619
  scope: "device",
20378
20620
  noun: t("Firmware update", "Aggiornamento firmware"),
@@ -21553,6 +21795,7 @@ var SYSTEM_CAP_VOCABULARY = {
21553
21795
  "audio-analyzer": system(PIPELINE),
21554
21796
  "audio-codec": system(INTERNAL),
21555
21797
  "auth-provider": system(IDENTITY),
21798
+ "board-key-source": system(INTERNAL),
21556
21799
  backup: system("system backups — run and restored from the Backups page"),
21557
21800
  broker: system("message-broker connections — configured, not actuated"),
21558
21801
  "calendar-source": system(INTERNAL),
@@ -21587,6 +21830,7 @@ var SYSTEM_CAP_VOCABULARY = {
21587
21830
  "load-contribution": system(INTERNAL),
21588
21831
  "local-network": system(NETWORK),
21589
21832
  "log-channels": system(INTERNAL),
21833
+ "integration-instances": system(INTERNAL),
21590
21834
  "log-destination": system(INTERNAL),
21591
21835
  "login-method": system(IDENTITY),
21592
21836
  "mesh-network": system(NETWORK),
@@ -42429,14 +42673,16 @@ var DeviceIsLeafSchema = object({
42429
42673
  });
42430
42674
  /**
42431
42675
  * True when the camera currently has a PARKED object matching `subjects` in at
42432
- * least one of `zones`. Reads the zone-analytics snapshot through the same
42676
+ * least one of `zones` (`minCount` of them, default one). Reads the zone-analytics snapshot through the same
42433
42677
  * mirror as every other state leaf, so a dropped event never decides it (D49).
42434
42678
  */
42435
42679
  var StationaryPresentLeafSchema = object({
42436
42680
  kind: literal("stationary-present"),
42437
42681
  deviceId: number().int().nonnegative(),
42438
42682
  subjects: array(StationarySubjectSchema).min(1).optional(),
42439
- zones: array(string().min(1)).min(1).optional()
42683
+ zones: array(string().min(1)).min(1).optional(),
42684
+ /** How many matching parked objects must be there; absent means one. */
42685
+ minCount: number().int().positive().optional()
42440
42686
  });
42441
42687
  /**
42442
42688
  * The escape hatch: the bounded expression engine over named device bindings.
@@ -42948,6 +43194,28 @@ function convertLegacyRecipe(legacy) {
42948
43194
  * it. The output type is always the new one.
42949
43195
  */
42950
43196
  var AutomationRecipeSchema = union([CurrentAutomationRecipeSchema, LegacyAutomationRecipeSchema.transform(convertLegacyRecipe)]);
43197
+ var DETECTION_DESCRIPTIONS = {
43198
+ deviceId: "the camera that saw it",
43199
+ className: "what it saw",
43200
+ trackId: "the track",
43201
+ score: "how sure the detector was",
43202
+ label: "the label it matched (a name, a plate), empty when none"
43203
+ };
43204
+ var STATIONARY_DESCRIPTIONS = {
43205
+ deviceId: "the camera that saw it",
43206
+ className: "what it saw",
43207
+ zones: "the zones it is in",
43208
+ phase: "appeared or departed",
43209
+ entryId: "the stopped object"
43210
+ };
43211
+ function describe$1(descriptions) {
43212
+ return Object.entries(descriptions).map(([name, description]) => ({
43213
+ name,
43214
+ description
43215
+ }));
43216
+ }
43217
+ describe$1(DETECTION_DESCRIPTIONS);
43218
+ describe$1(STATIONARY_DESCRIPTIONS);
42951
43219
  new Set(Object.values(COCO_TO_MACRO.mapping));
42952
43220
  /**
42953
43221
  * Schedulers (D983) — an entity that performs actions over the day.
@@ -43709,7 +43977,7 @@ var TargetKindCapsSchema = object({
43709
43977
  * the union is large and not meant for runtime validation here; the exported
43710
43978
  * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
43711
43979
  */
43712
- var ConfigSchemaPassthrough$3 = unknown();
43980
+ var ConfigSchemaPassthrough$4 = unknown();
43713
43981
  var TargetKindSchema = object({
43714
43982
  kind: string(),
43715
43983
  label: string(),
@@ -43746,7 +44014,7 @@ var TargetKindSchema = object({
43746
44014
  * its raster path, which is the safe default for an unknown image.
43747
44015
  */
43748
44016
  iconMediaType: string().optional(),
43749
- configSchema: ConfigSchemaPassthrough$3,
44017
+ configSchema: ConfigSchemaPassthrough$4,
43750
44018
  /**
43751
44019
  * The config keys that decide WHERE this kind's secrets are sent (server,
43752
44020
  * base URL, instance, chat, recipient). A save that changes any of them
@@ -46058,6 +46326,49 @@ object({
46058
46326
  lastChangedAt: number()
46059
46327
  });
46060
46328
  DeviceType.Sensor;
46329
+ /**
46330
+ * Why a board key could not be read. Typed so a caller reports the cause and
46331
+ * never treats "could not read" as "has no key" (D49).
46332
+ */
46333
+ var BoardKeyFailureReasonSchema = _enum([
46334
+ "unknown-source",
46335
+ "not-admin",
46336
+ "no-builder",
46337
+ "no-ingress-url",
46338
+ "unreachable",
46339
+ "unknown-board",
46340
+ "no-encryption-key",
46341
+ "unreadable-config"
46342
+ ]);
46343
+ var BoardKeySourceSchema = object({
46344
+ sourceId: string(),
46345
+ name: string()
46346
+ });
46347
+ var BoardKeyBoardSchema = object({
46348
+ /** The builder's file name, e.g. `kitchen.yaml`: the handle `getBoardKey` takes. */
46349
+ configuration: string(),
46350
+ /** The node name the builder gives the board. */
46351
+ name: string(),
46352
+ /** The address the builder knows the board by, when it has one. */
46353
+ address: string().nullable()
46354
+ });
46355
+ var BoardKeyFailureSchema = object({
46356
+ ok: literal(false),
46357
+ reason: BoardKeyFailureReasonSchema,
46358
+ detail: string().optional()
46359
+ });
46360
+ var ListBoardsResultSchema = discriminatedUnion("ok", [object({
46361
+ ok: literal(true),
46362
+ boards: array(BoardKeyBoardSchema).readonly()
46363
+ }), BoardKeyFailureSchema]);
46364
+ var GetBoardKeyResultSchema = discriminatedUnion("ok", [object({
46365
+ ok: literal(true),
46366
+ key: string()
46367
+ }), BoardKeyFailureSchema]);
46368
+ method(_void(), array(BoardKeySourceSchema).readonly(), { auth: "admin" }), method(object({ sourceId: string().min(1) }), ListBoardsResultSchema, { auth: "admin" }), method(object({
46369
+ sourceId: string().min(1),
46370
+ configuration: string().min(1)
46371
+ }), GetBoardKeyResultSchema, { auth: "admin" });
46061
46372
  object({
46062
46373
  /** Current level as 0..100 inclusive. Firmware-reported. */
46063
46374
  level: number().min(0).max(100).meta(readingMeta("percentage")),
@@ -48151,6 +48462,188 @@ DeviceType.Control, method(object({
48151
48462
  kind: "mutation",
48152
48463
  auth: "protected"
48153
48464
  });
48465
+ /**
48466
+ * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
48467
+ * Apple TV, Spotify, Roku, generic OTT receivers, …) on
48468
+ * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
48469
+ * surface — those use `DeviceType.Camera` + the broker pipeline.
48470
+ *
48471
+ * The cap declares a wide method surface; not every backend supports
48472
+ * every method. Drivers signal sub-capability via the
48473
+ * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
48474
+ * corresponding method) so the UI gates buttons without a slice
48475
+ * fetch — same pattern as `PanTiltZoom` for cameras.
48476
+ */
48477
+ var MediaPlayerStateSchema = _enum([
48478
+ "off",
48479
+ "on",
48480
+ "idle",
48481
+ "playing",
48482
+ "paused",
48483
+ "buffering",
48484
+ "standby"
48485
+ ]);
48486
+ var MediaPlayerRepeatSchema = _enum([
48487
+ "off",
48488
+ "all",
48489
+ "one"
48490
+ ]);
48491
+ var MediaInfoSchema = object({
48492
+ /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
48493
+ * `podcast`, …). */
48494
+ type: string(),
48495
+ /** Human-readable title. */
48496
+ title: string(),
48497
+ /** Optional artist / channel / station label. */
48498
+ artist: string().optional(),
48499
+ /** Optional album / season / show name. */
48500
+ album: string().optional(),
48501
+ /** Optional cover-art / thumbnail URL. */
48502
+ imageUrl: string().optional()
48503
+ });
48504
+ /**
48505
+ * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
48506
+ * the device said so. `assumed`: the driver has no feedback (infrared) and
48507
+ * tracks what it last SENT; it moves only after a send was accepted, and a
48508
+ * human at the real remote makes it wrong. A UI shows an assumed value as a
48509
+ * guess, never as a reading.
48510
+ */
48511
+ var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
48512
+ /** The fields of a media-player status a driver can only guess. */
48513
+ var MediaPlayerAssumedFieldSchema = _enum([
48514
+ "state",
48515
+ "volumeLevel",
48516
+ "isMuted",
48517
+ "source"
48518
+ ]);
48519
+ var MediaPlayerStatusSchema = object({
48520
+ /** Playback lifecycle state. */
48521
+ state: MediaPlayerStateSchema,
48522
+ /**
48523
+ * Whether the state fields are readings or the driver's own bookkeeping.
48524
+ * A slice written before this field existed parses as `reported`.
48525
+ */
48526
+ stateSource: MediaPlayerStateSourceSchema.default("reported"),
48527
+ /**
48528
+ * Which fields are the driver's own guess. `stateSource` is `assumed` when
48529
+ * this is not empty; a field not listed here is a reading even then (power
48530
+ * from a running-state source, mute guessed from the last send).
48531
+ */
48532
+ assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
48533
+ /** Volume as 0..100 inclusive. Null when the device has no volume
48534
+ * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
48535
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
48536
+ /** Mute toggle distinct from volume=0. Null when no mute surface.
48537
+ * Pair with `DeviceFeature.MediaPlayerMute`. */
48538
+ isMuted: boolean().nullable(),
48539
+ /** Active source / input. Empty when no source surface. */
48540
+ source: string(),
48541
+ /** Selectable sources. Empty when no source surface.
48542
+ * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
48543
+ availableSources: array(string()),
48544
+ /** Currently-playing media info. Null when nothing is playing. */
48545
+ currentMedia: MediaInfoSchema.nullable(),
48546
+ /** Current playback position in ms. Null when not seekable or
48547
+ * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
48548
+ position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
48549
+ /** Total duration of the current media in ms. Null when unknown
48550
+ * (live stream) or nothing is playing. */
48551
+ duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
48552
+ /** Shuffle toggle. Null when no shuffle surface.
48553
+ * Pair with `DeviceFeature.MediaPlayerShuffle`. */
48554
+ shuffle: boolean().nullable(),
48555
+ /** Repeat mode. Null when no repeat surface.
48556
+ * Pair with `DeviceFeature.MediaPlayerRepeat`. */
48557
+ repeat: MediaPlayerRepeatSchema.nullable(),
48558
+ /** Ms epoch when the slice was last updated. */
48559
+ lastChangedAt: number()
48560
+ });
48561
+ var stepInput = object({
48562
+ deviceId: number().int().nonnegative(),
48563
+ /** How many presses: the caller's count (Alexa `volumeSteps`, `channelCount`). */
48564
+ steps: number().int().min(1).max(50).default(1)
48565
+ });
48566
+ var deviceOnly = object({ deviceId: number().int().nonnegative() });
48567
+ DeviceType.MediaPlayer, method(deviceOnly, _void(), {
48568
+ kind: "mutation",
48569
+ auth: "protected"
48570
+ }), method(deviceOnly, _void(), {
48571
+ kind: "mutation",
48572
+ auth: "protected"
48573
+ }), method(stepInput, _void(), {
48574
+ kind: "mutation",
48575
+ auth: "protected"
48576
+ }), method(stepInput, _void(), {
48577
+ kind: "mutation",
48578
+ auth: "protected"
48579
+ }), method(stepInput, _void(), {
48580
+ kind: "mutation",
48581
+ auth: "protected"
48582
+ }), method(stepInput, _void(), {
48583
+ kind: "mutation",
48584
+ auth: "protected"
48585
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48586
+ kind: "mutation",
48587
+ auth: "protected"
48588
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48589
+ kind: "mutation",
48590
+ auth: "protected"
48591
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48592
+ kind: "mutation",
48593
+ auth: "protected"
48594
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48595
+ kind: "mutation",
48596
+ auth: "protected"
48597
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
48598
+ kind: "mutation",
48599
+ auth: "protected"
48600
+ }), method(object({
48601
+ deviceId: number().int().nonnegative(),
48602
+ position: number().int().nonnegative()
48603
+ }), _void(), {
48604
+ kind: "mutation",
48605
+ auth: "protected"
48606
+ }), method(object({
48607
+ deviceId: number().int().nonnegative(),
48608
+ volumeLevel: number().min(0).max(100)
48609
+ }), _void(), {
48610
+ kind: "mutation",
48611
+ auth: "protected"
48612
+ }), method(object({
48613
+ deviceId: number().int().nonnegative(),
48614
+ muted: boolean()
48615
+ }), _void(), {
48616
+ kind: "mutation",
48617
+ auth: "protected"
48618
+ }), method(object({
48619
+ deviceId: number().int().nonnegative(),
48620
+ shuffle: boolean()
48621
+ }), _void(), {
48622
+ kind: "mutation",
48623
+ auth: "protected"
48624
+ }), method(object({
48625
+ deviceId: number().int().nonnegative(),
48626
+ repeat: MediaPlayerRepeatSchema
48627
+ }), _void(), {
48628
+ kind: "mutation",
48629
+ auth: "protected"
48630
+ }), method(object({
48631
+ deviceId: number().int().nonnegative(),
48632
+ source: string().min(1)
48633
+ }), _void(), {
48634
+ kind: "mutation",
48635
+ auth: "protected"
48636
+ }), method(object({
48637
+ deviceId: number().int().nonnegative(),
48638
+ /** Media identifier / URL. */
48639
+ mediaId: string().min(1),
48640
+ /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
48641
+ * passes it through to the upstream service. */
48642
+ mediaType: string().min(1)
48643
+ }), _void(), {
48644
+ kind: "mutation",
48645
+ auth: "protected"
48646
+ });
48154
48647
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater;
48155
48648
  var NUMBER = {
48156
48649
  kind: "fixed",
@@ -48598,49 +49091,6 @@ function actuator(input) {
48598
49091
  };
48599
49092
  }
48600
49093
  new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
48601
- var PowerSourceRefusalReasonSchema = _enum([
48602
- "no-power-source",
48603
- "switch-missing",
48604
- "switch-offline",
48605
- "switch-unknown",
48606
- "restart-in-progress",
48607
- "switch-call-failed"
48608
- ]);
48609
- var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
48610
- accepted: literal(false),
48611
- reason: PowerSourceRefusalReasonSchema,
48612
- /** One line for the operator, naming the switch. */
48613
- message: string()
48614
- })]);
48615
- var PowerSourceInfoSchema = object({
48616
- /** False when the device has no power source linked; the rest is then empty. */
48617
- linked: boolean(),
48618
- switchDeviceId: number().nullable(),
48619
- switchName: string().nullable(),
48620
- /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
48621
- switchOn: boolean().nullable(),
48622
- switchOnline: boolean().nullable(),
48623
- restartInProgress: boolean(),
48624
- offSeconds: number().int()
48625
- });
48626
- object({
48627
- /** Null while the switch has not reported: unknown is never `false` (D393). */
48628
- switchOn: boolean().nullable(),
48629
- offSeconds: number().int(),
48630
- lastFetchedAt: number()
48631
- });
48632
- 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;
48633
- var deviceInput$2 = object({ deviceId: number().int().nonnegative() });
48634
- systemMethod(deviceInput$2, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
48635
- kind: "mutation",
48636
- auth: "admin"
48637
- }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
48638
- kind: "mutation",
48639
- auth: "admin"
48640
- }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
48641
- kind: "mutation",
48642
- auth: "admin"
48643
- });
48644
49094
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
48645
49095
  DeviceType.Camera;
48646
49096
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
@@ -48668,6 +49118,165 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
48668
49118
  }).optional()
48669
49119
  })) });
48670
49120
  /**
49121
+ * A saved Customize assignment (D936). The schema is the type: callers use
49122
+ * `z.infer`, they do not restate the shape.
49123
+ */
49124
+ var OverrideSourceSchema = object({
49125
+ addonId: string().min(1),
49126
+ stableId: string().min(1),
49127
+ cap: string().min(1),
49128
+ fieldPath: string().min(1)
49129
+ });
49130
+ var IdentityTransformDraftSchema = object({ kind: literal("identity") });
49131
+ var InvertTransformDraftSchema = object({ kind: literal("invert") });
49132
+ var ThresholdTransformDraftSchema = object({
49133
+ kind: literal("threshold"),
49134
+ comparison: _enum(["gte", "lte"]),
49135
+ threshold: number(),
49136
+ startDwellMs: number().nonnegative(),
49137
+ stopDwellMs: number().nonnegative()
49138
+ });
49139
+ var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
49140
+ IdentityTransformDraftSchema,
49141
+ InvertTransformDraftSchema,
49142
+ ThresholdTransformDraftSchema,
49143
+ object({
49144
+ kind: literal("linear"),
49145
+ scale: number(),
49146
+ offset: number(),
49147
+ clampMin: number().optional(),
49148
+ clampMax: number().optional()
49149
+ }),
49150
+ object({
49151
+ kind: literal("enum-map"),
49152
+ mapping: record(string(), string().nullable())
49153
+ }),
49154
+ object({ kind: literal("number") })
49155
+ ]);
49156
+ var ScalarOverrideDraftSchema = object({
49157
+ kind: literal("scalar"),
49158
+ cap: string().min(1),
49159
+ targetId: string().min(1),
49160
+ source: OverrideSourceSchema,
49161
+ transform: CustomizeTransformDraftSchema
49162
+ });
49163
+ var KeyedArrayOverrideDraftSchema = object({
49164
+ kind: literal("keyedArray"),
49165
+ cap: string().min(1),
49166
+ targetId: string().min(1),
49167
+ key: string().min(1),
49168
+ label: string().min(1),
49169
+ fieldPath: string().min(1),
49170
+ source: OverrideSourceSchema,
49171
+ transform: CustomizeTransformDraftSchema
49172
+ });
49173
+ var PulseOverrideDraftSchema = object({
49174
+ kind: literal("pulse"),
49175
+ cap: string().min(1),
49176
+ targetId: string().min(1),
49177
+ enabled: boolean(),
49178
+ debounceMs: number().nonnegative(),
49179
+ edges: array(_enum([
49180
+ "rising",
49181
+ "button",
49182
+ "native-event"
49183
+ ])).min(1).optional(),
49184
+ sources: array(OverrideSourceSchema).min(1)
49185
+ });
49186
+ var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
49187
+ "in-addition",
49188
+ "confirm",
49189
+ "replace"
49190
+ ]).optional() });
49191
+ discriminatedUnion("kind", [
49192
+ ScalarOverrideDraftSchema,
49193
+ KeyedArrayOverrideDraftSchema,
49194
+ PulseOverrideDraftSchema,
49195
+ object({
49196
+ kind: literal("span"),
49197
+ cap: string().min(1),
49198
+ targetId: string().min(1),
49199
+ timeoutMs: number().nonnegative(),
49200
+ cooldownMs: number().nonnegative().optional(),
49201
+ sources: array(SpanSourceDraftSchema)
49202
+ })
49203
+ ]);
49204
+ object({
49205
+ targetId: string().min(1),
49206
+ configured: boolean(),
49207
+ source: _enum(["native", "assigned"]),
49208
+ state: _enum([
49209
+ "active",
49210
+ "stale",
49211
+ "released",
49212
+ "unavailable"
49213
+ ]),
49214
+ reason: string().nullable()
49215
+ });
49216
+ /**
49217
+ * What a running-threshold proposal says (planning#405). The schema is the
49218
+ * type: the algorithm, the capability method and the UI all read `z.infer`.
49219
+ *
49220
+ * A proposal is read-only advice: it carries the numbers it was derived from
49221
+ * (`evidence`) so the operator can judge it, and an `insufficient` answer names
49222
+ * WHY with a typed reason and the catalog defaults, never an invented number.
49223
+ */
49224
+ var RunningProposalTierSchema = _enum(["raw", "5m"]);
49225
+ var RunningProposalConfidenceSchema = _enum([
49226
+ "high",
49227
+ "medium",
49228
+ "low"
49229
+ ]);
49230
+ var RunningProposalInsufficientReasonSchema = _enum([
49231
+ "no-history",
49232
+ "span-too-short",
49233
+ "truncated",
49234
+ "no-idle-floor",
49235
+ "no-runs",
49236
+ "no-separation"
49237
+ ]);
49238
+ var RunningProposalReplaySchema = object({
49239
+ /** Intervals the real dwell expression held true over the window. */
49240
+ intervals: number().int().nonnegative(),
49241
+ /** Intervals outside every run, or a second interval inside one. */
49242
+ extra: number().int().nonnegative(),
49243
+ /** Runs without an interval of their own (none, or merged into a neighbour). */
49244
+ missed: number().int().nonnegative()
49245
+ });
49246
+ var RunningProposalEvidenceSchema = object({
49247
+ tier: RunningProposalTierSchema,
49248
+ spanMs: number().nonnegative(),
49249
+ from: number(),
49250
+ to: number(),
49251
+ points: number().int().nonnegative(),
49252
+ runsFound: number().int().nonnegative(),
49253
+ pausesFound: number().int().nonnegative(),
49254
+ longestPauseMs: number().nonnegative(),
49255
+ idleFloorW: number(),
49256
+ noiseCeilingW: number(),
49257
+ plateauW: number(),
49258
+ replay: RunningProposalReplaySchema
49259
+ });
49260
+ var RunningProposalInsufficientEvidenceSchema = object({
49261
+ spanMs: number().nonnegative(),
49262
+ points: number().int().nonnegative(),
49263
+ runsFound: number().int().nonnegative()
49264
+ });
49265
+ var RunningThresholdProposalSchema = discriminatedUnion("state", [object({
49266
+ state: literal("proposal"),
49267
+ transform: ThresholdTransformDraftSchema,
49268
+ evidence: RunningProposalEvidenceSchema,
49269
+ confidence: RunningProposalConfidenceSchema,
49270
+ /** Why the confidence is not higher; empty when nothing held it back. */
49271
+ notes: array(string())
49272
+ }), object({
49273
+ state: literal("insufficient"),
49274
+ reason: RunningProposalInsufficientReasonSchema,
49275
+ evidence: RunningProposalInsufficientEvidenceSchema,
49276
+ /** The catalog defaults, offered as what stands when nothing better is known. */
49277
+ fallback: ThresholdTransformDraftSchema
49278
+ })]);
49279
+ /**
48671
49280
  * The report of a one-shot "move this owner's plaintext secrets into the
48672
49281
  * keychain" run (D878). COUNTS only - never a value, never a ref.
48673
49282
  *
@@ -48957,6 +49566,14 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
48957
49566
  kind: "mutation",
48958
49567
  auth: "admin",
48959
49568
  access: "view"
49569
+ }), method(object({
49570
+ deviceId: number().int(),
49571
+ cap: string().min(1),
49572
+ fieldPath: string().min(1),
49573
+ deviceType: _enum(DeviceType).optional()
49574
+ }), RunningThresholdProposalSchema, {
49575
+ auth: "admin",
49576
+ access: "view"
48960
49577
  }), method(object({
48961
49578
  blockId: string().min(1),
48962
49579
  trace: AutomationRunTraceSchema.optional(),
@@ -49821,7 +50438,53 @@ method(object({
49821
50438
  * exposes only the COMMON surface: link state, supported device
49822
50439
  * kinds (so the UI can filter the device picker), and per-device
49823
50440
  * expose/unexpose.
50441
+ *
50442
+ * INSTANCES. One export addon can serve several independent targets (a
50443
+ * HomeKit bridge, a Home Assistant broker). `listInstances` names them.
50444
+ * `instanceId` on a READ is optional: absent = the whole addon (linked if any
50445
+ * enabled instance is, `exposedDeviceCount` = distinct devices, `setup` = the
50446
+ * default instance's); present = that instance; an id the provider does not
50447
+ * serve is refused with `ExportInstanceUnknownError` (`export-instance-unknown`),
50448
+ * never answered empty. `instanceId` on a WRITE is REQUIRED: a membership
50449
+ * change always names the target it changes. A single-instance provider
50450
+ * accepts an absent id on a read or its own id, and refuses any other.
50451
+ */
50452
+ /** Which instance of an export addon a call addresses. Absent on a read = the whole addon. */
50453
+ var InstanceIdSchema$1 = string().min(1);
50454
+ var InstancePinSchema = object({ instanceId: InstanceIdSchema$1.optional() });
50455
+ /** One independent export target of an addon. */
50456
+ var ExportInstanceSchema = object({
50457
+ instanceId: InstanceIdSchema$1,
50458
+ name: string(),
50459
+ enabled: boolean(),
50460
+ kind: string().optional()
50461
+ });
50462
+ var EXPORT_INSTANCE_UNKNOWN = "export-instance-unknown";
50463
+ /** The named failure of an `instanceId` the provider does not serve. The message starts with the code. */
50464
+ var ExportInstanceUnknownError = class extends Error {
50465
+ code = EXPORT_INSTANCE_UNKNOWN;
50466
+ instanceId;
50467
+ constructor(addon, instanceId) {
50468
+ super(`${EXPORT_INSTANCE_UNKNOWN}: ${addon} serves no instance "${instanceId}"`);
50469
+ this.name = "ExportInstanceUnknownError";
50470
+ this.instanceId = instanceId;
50471
+ }
50472
+ };
50473
+ /**
50474
+ * The instance a `getStatus` call names. The cap's `status` block injects a per-device
50475
+ * `getStatus({ deviceId })` beside the method's own `{ instanceId? }`, so the provider sees
50476
+ * both shapes; only the second names an instance (a per-device status read is addon-wide).
50477
+ */
50478
+ function statusInstanceOf(input) {
50479
+ return "instanceId" in input ? input.instanceId : void 0;
50480
+ }
50481
+ /**
50482
+ * A single-instance provider's check: an absent id or its own passes, any other throws
50483
+ * `ExportInstanceUnknownError`.
49824
50484
  */
50485
+ function assertOwnExportInstance(addon, own, instanceId) {
50486
+ if (instanceId !== void 0 && instanceId !== own) throw new ExportInstanceUnknownError(addon, instanceId);
50487
+ }
49825
50488
  var LinkStateSchema = _enum([
49826
50489
  "unlinked",
49827
50490
  "linked",
@@ -49872,10 +50535,14 @@ var ExposedDeviceSchema = object({
49872
50535
  capabilities: array(string()).optional()
49873
50536
  });
49874
50537
  var ExposeInputSchema = object({
50538
+ instanceId: InstanceIdSchema$1,
49875
50539
  deviceId: string(),
49876
50540
  capabilities: array(string()).optional()
49877
50541
  });
49878
- var UnexposeInputSchema = object({ deviceId: string() });
50542
+ var UnexposeInputSchema = object({
50543
+ instanceId: InstanceIdSchema$1,
50544
+ deviceId: string()
50545
+ });
49879
50546
  /**
49880
50547
  * What an exporter may expose besides devices (D968). An action and a
49881
50548
  * notification target are LIST ENTRIES, never devices (D954): they enter an
@@ -49904,8 +50571,14 @@ var ExposedEntitySchema = object({
49904
50571
  entity: ExportEntityRefSchema,
49905
50572
  exposedAs: string().optional()
49906
50573
  });
49907
- var ExposeEntityInputSchema = object({ entity: ExportEntityRefSchema });
49908
- var UnexposeEntityInputSchema = object({ entity: ExportEntityRefSchema });
50574
+ var ExposeEntityInputSchema = object({
50575
+ instanceId: InstanceIdSchema$1,
50576
+ entity: ExportEntityRefSchema
50577
+ });
50578
+ var UnexposeEntityInputSchema = object({
50579
+ instanceId: InstanceIdSchema$1,
50580
+ entity: ExportEntityRefSchema
50581
+ });
49909
50582
  var deviceExportCapability = {
49910
50583
  name: "device-export",
49911
50584
  scope: "system",
@@ -49925,9 +50598,10 @@ var deviceExportCapability = {
49925
50598
  */
49926
50599
  exposesDeviceSettings: true,
49927
50600
  methods: {
49928
- getStatus: method(_void(), DeviceExportStatusSchema),
49929
- listSupportedDeviceKinds: method(_void(), array(DeviceKindSchema)),
49930
- listExposedDevices: method(_void(), array(ExposedDeviceSchema)),
50601
+ getStatus: method(InstancePinSchema, DeviceExportStatusSchema),
50602
+ listInstances: method(_void(), array(ExportInstanceSchema)),
50603
+ listSupportedDeviceKinds: method(InstancePinSchema, array(DeviceKindSchema)),
50604
+ listExposedDevices: method(InstancePinSchema, array(ExposedDeviceSchema)),
49931
50605
  exposeDevice: method(ExposeInputSchema, _void(), {
49932
50606
  kind: "mutation",
49933
50607
  auth: "admin"
@@ -49937,7 +50611,7 @@ var deviceExportCapability = {
49937
50611
  auth: "admin"
49938
50612
  }),
49939
50613
  listSupportedEntityKinds: optionalMethod(_void(), array(ExportEntityKindSchema)),
49940
- listExposedEntities: optionalMethod(_void(), array(ExposedEntitySchema)),
50614
+ listExposedEntities: optionalMethod(InstancePinSchema, array(ExposedEntitySchema)),
49941
50615
  exposeEntity: optionalMethod(ExposeEntityInputSchema, _void(), {
49942
50616
  kind: "mutation",
49943
50617
  auth: "admin"
@@ -50214,6 +50888,45 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
50214
50888
  auth: "admin"
50215
50889
  });
50216
50890
  /**
50891
+ * What the passive listener of `local-network` saw on the wire, before any
50892
+ * provider classified it. Device-manager turns an observation into the hits
50893
+ * of the providers whose declared discovery modes it matches.
50894
+ */
50895
+ var DiscoveryObservationSchema = discriminatedUnion("kind", [object({
50896
+ kind: literal("mdns"),
50897
+ /** Normalised DNS-SD service type, e.g. `_esphomelib._tcp`. */
50898
+ serviceType: string(),
50899
+ instance: string(),
50900
+ host: string(),
50901
+ /** The A record address when the announcement carried one. */
50902
+ address: string().nullable(),
50903
+ port: number().int(),
50904
+ txt: record(string(), string())
50905
+ }), object({
50906
+ kind: literal("ssdp"),
50907
+ /** Sender address of the datagram. */
50908
+ host: string(),
50909
+ port: number().int(),
50910
+ /** `NT` of a NOTIFY, `ST` of a search response. */
50911
+ target: string(),
50912
+ headers: record(string(), string())
50913
+ })]);
50914
+ object({
50915
+ addonId: string(),
50916
+ candidate: DiscoveryCandidateSchema,
50917
+ firstSeenAt: number(),
50918
+ lastSeenAt: number(),
50919
+ dismissed: boolean()
50920
+ });
50921
+ var DiscoveryProposalSchema = object({
50922
+ id: string(),
50923
+ addonId: string(),
50924
+ candidate: DiscoveryCandidateSchema,
50925
+ firstSeenAt: number(),
50926
+ lastSeenAt: number(),
50927
+ dismissed: boolean()
50928
+ });
50929
+ /**
50217
50930
  * Device Manager capability — hub-side singleton that unifies device persistence,
50218
50931
  * live registry access, and all management operations into a single tRPC surface.
50219
50932
  *
@@ -50942,6 +51655,19 @@ method(object({
50942
51655
  }), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
50943
51656
  kind: "mutation",
50944
51657
  auth: "admin"
51658
+ }), method(object({}), object({ proposals: array(DiscoveryProposalSchema).readonly() }), { auth: "admin" }), method(object({ id: string() }), object({ dismissed: boolean() }), {
51659
+ kind: "mutation",
51660
+ auth: "admin"
51661
+ }), method(object({ observations: array(DiscoveryObservationSchema).max(512) }), object({ proposed: number().int() }), {
51662
+ kind: "mutation",
51663
+ auth: "admin"
51664
+ }), method(object({}), object({
51665
+ providers: number().int(),
51666
+ proposed: number().int()
51667
+ }), {
51668
+ kind: "mutation",
51669
+ auth: "admin",
51670
+ timeoutMs: 12e4
50945
51671
  }), method(object({ addonId: string() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string() }), unknown(), { auth: "admin" }), method(object({
50946
51672
  deviceId: number(),
50947
51673
  key: string(),
@@ -51769,7 +52495,7 @@ object({
51769
52495
  /** Ms epoch of the last value received from the appliance; 0 = never. */
51770
52496
  lastFetchedAt: number()
51771
52497
  });
51772
- var DeviceIdSchema$1 = number().int().nonnegative();
52498
+ var DeviceIdSchema$2 = number().int().nonnegative();
51773
52499
  /** A value a program option or setting can take. */
51774
52500
  var DishwasherValueSchema = union([
51775
52501
  boolean(),
@@ -51833,77 +52559,77 @@ var DishwasherOptionsSchema = object({
51833
52559
  options: array(DishwasherOptionDescriptorSchema)
51834
52560
  });
51835
52561
  DeviceType.Dishwasher, method(object({
51836
- deviceId: DeviceIdSchema$1,
52562
+ deviceId: DeviceIdSchema$2,
51837
52563
  program: string().min(1).optional(),
51838
52564
  options: record(string(), DishwasherValueSchema).optional()
51839
52565
  }), _void(), {
51840
52566
  kind: "mutation",
51841
52567
  auth: "protected"
51842
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52568
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51843
52569
  kind: "mutation",
51844
52570
  auth: "protected"
51845
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52571
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51846
52572
  kind: "mutation",
51847
52573
  auth: "protected"
51848
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
52574
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51849
52575
  kind: "mutation",
51850
52576
  auth: "protected"
51851
52577
  }), method(object({
51852
- deviceId: DeviceIdSchema$1,
52578
+ deviceId: DeviceIdSchema$2,
51853
52579
  program: string().min(1)
51854
52580
  }), _void(), {
51855
52581
  kind: "mutation",
51856
52582
  auth: "protected"
51857
52583
  }), method(object({
51858
- deviceId: DeviceIdSchema$1,
52584
+ deviceId: DeviceIdSchema$2,
51859
52585
  on: boolean()
51860
52586
  }), _void(), {
51861
52587
  kind: "mutation",
51862
52588
  auth: "protected"
51863
52589
  }), method(object({
51864
- deviceId: DeviceIdSchema$1,
52590
+ deviceId: DeviceIdSchema$2,
51865
52591
  on: boolean()
51866
52592
  }), _void(), {
51867
52593
  kind: "mutation",
51868
52594
  auth: "protected"
51869
52595
  }), method(object({
51870
- deviceId: DeviceIdSchema$1,
52596
+ deviceId: DeviceIdSchema$2,
51871
52597
  on: boolean()
51872
52598
  }), _void(), {
51873
52599
  kind: "mutation",
51874
52600
  auth: "protected"
51875
52601
  }), method(object({
51876
- deviceId: DeviceIdSchema$1,
52602
+ deviceId: DeviceIdSchema$2,
51877
52603
  on: boolean()
51878
52604
  }), _void(), {
51879
52605
  kind: "mutation",
51880
52606
  auth: "protected"
51881
52607
  }), method(object({
51882
- deviceId: DeviceIdSchema$1,
52608
+ deviceId: DeviceIdSchema$2,
51883
52609
  on: boolean()
51884
52610
  }), _void(), {
51885
52611
  kind: "mutation",
51886
52612
  auth: "protected"
51887
52613
  }), method(object({
51888
- deviceId: DeviceIdSchema$1,
52614
+ deviceId: DeviceIdSchema$2,
51889
52615
  on: boolean()
51890
52616
  }), _void(), {
51891
52617
  kind: "mutation",
51892
52618
  auth: "protected"
51893
52619
  }), method(object({
51894
- deviceId: DeviceIdSchema$1,
52620
+ deviceId: DeviceIdSchema$2,
51895
52621
  on: boolean()
51896
52622
  }), _void(), {
51897
52623
  kind: "mutation",
51898
52624
  auth: "protected"
51899
52625
  }), method(object({
51900
- deviceId: DeviceIdSchema$1,
52626
+ deviceId: DeviceIdSchema$2,
51901
52627
  key: string().min(1),
51902
52628
  value: DishwasherValueSchema
51903
52629
  }), _void(), {
51904
52630
  kind: "mutation",
51905
52631
  auth: "protected"
51906
- }), method(object({ deviceId: DeviceIdSchema$1 }), DishwasherOptionsSchema, { auth: "protected" });
52632
+ }), method(object({ deviceId: DeviceIdSchema$2 }), DishwasherOptionsSchema, { auth: "protected" });
51907
52633
  /**
51908
52634
  * Palette entry ids (D939). Audio is the one gradient; `audio-*` leaves are
51909
52635
  * not entries. `heatmapScrub` is a mark, not an event kind.
@@ -52307,6 +53033,19 @@ method(_void(), paletteResultSchema, {
52307
53033
  kind: "mutation",
52308
53034
  auth: "admin"
52309
53035
  });
53036
+ object({
53037
+ /** True while Do Not Disturb is on; null when unknown. */
53038
+ enabled: boolean().nullable().meta({ label: "Do not disturb" }),
53039
+ /** Ms epoch of the last read or write that set `enabled`. */
53040
+ lastChangedAt: number()
53041
+ });
53042
+ DeviceType.MediaPlayer, method(object({
53043
+ deviceId: number().int(),
53044
+ enabled: boolean()
53045
+ }), _void(), {
53046
+ kind: "mutation",
53047
+ auth: "protected"
53048
+ });
52310
53049
  DeviceType.Camera;
52311
53050
  object({
52312
53051
  /** Ms epoch of the last press. null = never observed since this provider started. */
@@ -53077,15 +53816,15 @@ var FanPresetCaptureResultSchema = object({
53077
53816
  items: array(FanCaptureItemSchema),
53078
53817
  omitted: array(FanCaptureOmissionSchema)
53079
53818
  });
53080
- var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
53819
+ var deviceInput$2 = object({ deviceId: number().int().nonnegative() });
53081
53820
  DeviceType.Fan;
53082
- method(deviceInput$1, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$1.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
53821
+ method(deviceInput$2, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$2.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
53083
53822
  kind: "mutation",
53084
53823
  auth: "admin"
53085
- }), method(deviceInput$1.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
53824
+ }), method(deviceInput$2.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
53086
53825
  kind: "mutation",
53087
53826
  auth: "protected"
53088
- }), method(deviceInput$1.extend({
53827
+ }), method(deviceInput$2.extend({
53089
53828
  fields: array(FanCaptureFieldSchema).optional(),
53090
53829
  steps: array(ActionStepSchema).max(20).default([])
53091
53830
  }), FanPresetCaptureResultSchema, { auth: "protected" });
@@ -53605,6 +54344,133 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
53605
54344
  auth: "admin"
53606
54345
  });
53607
54346
  /**
54347
+ * `integration-instances` - the connection of an addon that holds ONE or SEVERAL
54348
+ * (an account, a relay, a destination) as typed records (D985, D986). The addon's
54349
+ * own function page reads and writes them (Logging for Loki); the Integrations
54350
+ * page lists only the integrations that bring devices (D996).
54351
+ *
54352
+ * A collection of providers: each addon that holds connections registers one and a
54353
+ * caller reaches a provider with the pinned `addonId`.
54354
+ *
54355
+ * Identity: the instance id is immutable and opaque to the caller. A record the
54356
+ * Loki migration made keeps the `integrations` registry id it was created under
54357
+ * (`int_NNNN`); a single instance made by its function page takes the addon id.
54358
+ * `name` is the editable label.
54359
+ *
54360
+ * Secrets: every field the instance kind marks `.meta({ secret: true })` reaches
54361
+ * the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
54362
+ * or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
54363
+ * clears it.
54364
+ */
54365
+ var ConfigSchemaPassthrough$3 = custom();
54366
+ var IntegrationInstanceIdSchema = string().min(1);
54367
+ var IntegrationInstanceModeSchema = _enum(["single", "multiple"]);
54368
+ /**
54369
+ * One kind of instance a provider can create (an adapter, an account type). The sign-in and
54370
+ * connect fields follow the `broker` contract (`broker.cap.ts`): `signIn.basePath` is a
54371
+ * hub-relative route set speaking the sign-in contract, `connectPath` / `disconnectPath` open an
54372
+ * interactive account link (popup) and may carry `{{brokerId}}`, which the UI replaces with the
54373
+ * instance id.
54374
+ */
54375
+ var IntegrationInstanceKindSchema = object({
54376
+ /** Stable id of the kind, sent back as `createInstance.kind`. */
54377
+ id: string().min(1),
54378
+ label: string().min(1),
54379
+ /** The kind signs in through a server-held interactive session. */
54380
+ signIn: object({
54381
+ basePath: string().min(1),
54382
+ methods: array(_enum(["device-code", "proxy"])).optional()
54383
+ }).optional(),
54384
+ /** Relative hub path to start an interactive account link of an instance of this kind. */
54385
+ connectPath: string().min(1).optional(),
54386
+ /** Relative hub path to disconnect that account. */
54387
+ disconnectPath: string().min(1).optional()
54388
+ });
54389
+ var IntegrationInstanceDescriptionSchema = object({
54390
+ /** `single`: at most one instance can exist (Loki). `multiple`: an account each. */
54391
+ instanceMode: IntegrationInstanceModeSchema,
54392
+ /** What the instance is, for the UI (`destination`, `relay`, `account`). */
54393
+ kind: string(),
54394
+ /** True when `testInstance` really probes the remote. */
54395
+ canTest: boolean(),
54396
+ /**
54397
+ * The kinds an instance can be of. Absent or one entry: nothing to choose; more than one: the
54398
+ * Add flow asks which first and sends it as `createInstance.kind`.
54399
+ */
54400
+ kinds: array(IntegrationInstanceKindSchema).optional(),
54401
+ /**
54402
+ * The provider accepts `createInstance.id` for an id that once existed (an adopted id, because
54403
+ * devices carry it). The UI then offers "restore under its old id" on Add. Absent means no.
54404
+ */
54405
+ allowRestoreId: boolean().optional(),
54406
+ /**
54407
+ * `createInstance` without an `id` works: the provider mints it. Absent means the caller must
54408
+ * send an id (the UI then mints an opaque one).
54409
+ */
54410
+ mintsId: boolean().optional()
54411
+ });
54412
+ var IntegrationInstanceStatusSchema = object({
54413
+ state: _enum([
54414
+ "ok",
54415
+ "off",
54416
+ "error",
54417
+ "unknown"
54418
+ ]),
54419
+ detail: string().optional(),
54420
+ /** A short human word for the state ("Signed in", "Token expired"); shown instead of `state`. */
54421
+ label: string().optional()
54422
+ });
54423
+ var IntegrationInstanceSchema = object({
54424
+ id: IntegrationInstanceIdSchema,
54425
+ name: string(),
54426
+ /** The addon's own rule (an URL is present, a client id is present...). */
54427
+ configured: boolean(),
54428
+ /**
54429
+ * The instance's own on/off switch (D996): always present, derived from the record body
54430
+ * (`enabled !== false`, so a row written before the field existed is on).
54431
+ */
54432
+ enabled: boolean(),
54433
+ /** The kind of this instance (one of `describe().kinds[].id`), when the provider has kinds. */
54434
+ kind: string().optional(),
54435
+ /** Values for the instance form; a secret is a `SecretFieldView`, never text. */
54436
+ formValues: record(string(), unknown()),
54437
+ status: IntegrationInstanceStatusSchema.optional(),
54438
+ /** Epoch ms of the last probe of the remote that produced `status`; absent when never checked. */
54439
+ lastCheckedAt: number().optional()
54440
+ });
54441
+ var IntegrationInstancePatchSchema = object({
54442
+ id: IntegrationInstanceIdSchema,
54443
+ name: string().min(1).optional(),
54444
+ /** Omitted / '' / redaction token keeps a secret; `{ $secretClear: true }` clears it. */
54445
+ values: record(string(), unknown())
54446
+ });
54447
+ 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({
54448
+ id: IntegrationInstanceIdSchema.optional(),
54449
+ name: string().min(1),
54450
+ kind: string().min(1).optional()
54451
+ }), object({ id: string() }), {
54452
+ kind: "mutation",
54453
+ auth: "admin"
54454
+ }), method(IntegrationInstancePatchSchema, object({ ok: literal(true) }), {
54455
+ kind: "mutation",
54456
+ auth: "admin"
54457
+ }), method(object({
54458
+ id: IntegrationInstanceIdSchema,
54459
+ enabled: boolean()
54460
+ }), object({ ok: literal(true) }), {
54461
+ kind: "mutation",
54462
+ auth: "admin"
54463
+ }), method(object({ id: IntegrationInstanceIdSchema }), object({ ok: literal(true) }), {
54464
+ kind: "mutation",
54465
+ auth: "admin"
54466
+ }), optionalMethod(object({
54467
+ id: IntegrationInstanceIdSchema.nullable(),
54468
+ values: record(string(), unknown())
54469
+ }), TestConnectionResultSchema$1, {
54470
+ kind: "mutation",
54471
+ auth: "admin"
54472
+ });
54473
+ /**
53608
54474
  * Two-way audio / talk-back cap. Clients open a WebRTC audio-only
53609
54475
  * session (server-initiated offer pattern, identical to the main
53610
54476
  * video WebRTC flow) and the browser captures the mic; the server
@@ -54193,6 +55059,14 @@ var LlmGenerateBaseInputSchema = object({
54193
55059
  topP: number().min(0).max(1).optional(),
54194
55060
  /** Per-call override of the profile default (top-k sampling). */
54195
55061
  topK: number().int().positive().optional(),
55062
+ /** Per-call override of `profile.reasoningEffort`. Sent only to a kind whose
55063
+ * descriptor offers the field; a kind that does not never sends it. */
55064
+ reasoningEffort: _enum([
55065
+ "off",
55066
+ "low",
55067
+ "medium",
55068
+ "high"
55069
+ ]).optional(),
54196
55070
  /** Per-call override of `profile.timeoutMs` — the total generation bound. */
54197
55071
  timeoutMs: number().int().positive().optional(),
54198
55072
  /** Per-call override; beats both the consumer table and the profile. */
@@ -54484,7 +55358,10 @@ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind i
54484
55358
  var LlmModelFeaturesSchema = object({
54485
55359
  vision: boolean(),
54486
55360
  tools: boolean(),
54487
- streaming: boolean()
55361
+ streaming: boolean(),
55362
+ /** Whether the model thinks before it answers. `null` = the endpoint does not
55363
+ * say; an editor then still offers the switch (unknown is not "no"). */
55364
+ reasoning: boolean().nullable().optional()
54488
55365
  });
54489
55366
  /** One model a provider offers. `features` overrides the kind's defaults, per field. */
54490
55367
  var LlmModelInfoSchema = object({
@@ -55391,6 +56268,11 @@ var LogEntrySchema = object({
55391
56268
  * flight, and not asking for the next slice ends the scan.
55392
56269
  */
55393
56270
  var LogReadQuerySchema = object({
56271
+ /**
56272
+ * Which destination INSTANCE answers (a destination addon may hold several records). Absent ⇒
56273
+ * the provider's first readable one, so a caller written before instances existed is unchanged.
56274
+ */
56275
+ instanceId: string().min(1).max(200).optional(),
55394
56276
  /** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
55395
56277
  requestId: string().min(1).max(64).optional(),
55396
56278
  /** The device the line is about (`tags.deviceId`, numeric). */
@@ -55453,6 +56335,8 @@ var LogReadResultSchema = object({
55453
56335
  /** True when `cancelRead` ended this slice early. */
55454
56336
  cancelled: boolean().optional()
55455
56337
  });
56338
+ /** Names one destination instance; absent ⇒ the provider's first readable one. */
56339
+ var LogInstanceSelectorSchema = object({ instanceId: string().min(1).max(200).optional() });
55456
56340
  var LogReadCapabilitiesSchema = object({
55457
56341
  /** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
55458
56342
  readable: boolean(),
@@ -55471,7 +56355,7 @@ var LogReadCapabilitiesSchema = object({
55471
56355
  /** How far back the store reaches, when the provider knows (days). */
55472
56356
  retentionDays: number().nullable()
55473
56357
  });
55474
- 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() }), {
56358
+ 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() }), {
55475
56359
  kind: "mutation",
55476
56360
  auth: "admin"
55477
56361
  });
@@ -55575,164 +56459,6 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
55575
56459
  ]);
55576
56460
  method(_void(), array(LoginMethodContributionSchema).readonly());
55577
56461
  /**
55578
- * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
55579
- * Apple TV, Spotify, Roku, generic OTT receivers, …) on
55580
- * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
55581
- * surface — those use `DeviceType.Camera` + the broker pipeline.
55582
- *
55583
- * The cap declares a wide method surface; not every backend supports
55584
- * every method. Drivers signal sub-capability via the
55585
- * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
55586
- * corresponding method) so the UI gates buttons without a slice
55587
- * fetch — same pattern as `PanTiltZoom` for cameras.
55588
- */
55589
- var MediaPlayerStateSchema = _enum([
55590
- "off",
55591
- "on",
55592
- "idle",
55593
- "playing",
55594
- "paused",
55595
- "buffering",
55596
- "standby"
55597
- ]);
55598
- var MediaPlayerRepeatSchema = _enum([
55599
- "off",
55600
- "all",
55601
- "one"
55602
- ]);
55603
- var MediaInfoSchema = object({
55604
- /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
55605
- * `podcast`, …). */
55606
- type: string(),
55607
- /** Human-readable title. */
55608
- title: string(),
55609
- /** Optional artist / channel / station label. */
55610
- artist: string().optional(),
55611
- /** Optional album / season / show name. */
55612
- album: string().optional(),
55613
- /** Optional cover-art / thumbnail URL. */
55614
- imageUrl: string().optional()
55615
- });
55616
- /**
55617
- * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
55618
- * the device said so. `assumed`: the driver has no feedback (infrared) and
55619
- * tracks what it last SENT; it moves only after a send was accepted, and a
55620
- * human at the real remote makes it wrong. A UI shows an assumed value as a
55621
- * guess, never as a reading.
55622
- */
55623
- var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
55624
- /** The fields of a media-player status a driver can only guess. */
55625
- var MediaPlayerAssumedFieldSchema = _enum([
55626
- "state",
55627
- "volumeLevel",
55628
- "isMuted",
55629
- "source"
55630
- ]);
55631
- object({
55632
- /** Playback lifecycle state. */
55633
- state: MediaPlayerStateSchema,
55634
- /**
55635
- * Whether the state fields are readings or the driver's own bookkeeping.
55636
- * A slice written before this field existed parses as `reported`.
55637
- */
55638
- stateSource: MediaPlayerStateSourceSchema.default("reported"),
55639
- /**
55640
- * Which fields are the driver's own guess. `stateSource` is `assumed` when
55641
- * this is not empty; a field not listed here is a reading even then (power
55642
- * from a running-state source, mute guessed from the last send).
55643
- */
55644
- assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
55645
- /** Volume as 0..100 inclusive. Null when the device has no volume
55646
- * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
55647
- volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
55648
- /** Mute toggle distinct from volume=0. Null when no mute surface.
55649
- * Pair with `DeviceFeature.MediaPlayerMute`. */
55650
- isMuted: boolean().nullable(),
55651
- /** Active source / input. Empty when no source surface. */
55652
- source: string(),
55653
- /** Selectable sources. Empty when no source surface.
55654
- * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
55655
- availableSources: array(string()),
55656
- /** Currently-playing media info. Null when nothing is playing. */
55657
- currentMedia: MediaInfoSchema.nullable(),
55658
- /** Current playback position in ms. Null when not seekable or
55659
- * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
55660
- position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
55661
- /** Total duration of the current media in ms. Null when unknown
55662
- * (live stream) or nothing is playing. */
55663
- duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
55664
- /** Shuffle toggle. Null when no shuffle surface.
55665
- * Pair with `DeviceFeature.MediaPlayerShuffle`. */
55666
- shuffle: boolean().nullable(),
55667
- /** Repeat mode. Null when no repeat surface.
55668
- * Pair with `DeviceFeature.MediaPlayerRepeat`. */
55669
- repeat: MediaPlayerRepeatSchema.nullable(),
55670
- /** Ms epoch when the slice was last updated. */
55671
- lastChangedAt: number()
55672
- });
55673
- DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }), _void(), {
55674
- kind: "mutation",
55675
- auth: "protected"
55676
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55677
- kind: "mutation",
55678
- auth: "protected"
55679
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55680
- kind: "mutation",
55681
- auth: "protected"
55682
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55683
- kind: "mutation",
55684
- auth: "protected"
55685
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55686
- kind: "mutation",
55687
- auth: "protected"
55688
- }), method(object({
55689
- deviceId: number().int().nonnegative(),
55690
- position: number().int().nonnegative()
55691
- }), _void(), {
55692
- kind: "mutation",
55693
- auth: "protected"
55694
- }), method(object({
55695
- deviceId: number().int().nonnegative(),
55696
- volumeLevel: number().min(0).max(100)
55697
- }), _void(), {
55698
- kind: "mutation",
55699
- auth: "protected"
55700
- }), method(object({
55701
- deviceId: number().int().nonnegative(),
55702
- muted: boolean()
55703
- }), _void(), {
55704
- kind: "mutation",
55705
- auth: "protected"
55706
- }), method(object({
55707
- deviceId: number().int().nonnegative(),
55708
- shuffle: boolean()
55709
- }), _void(), {
55710
- kind: "mutation",
55711
- auth: "protected"
55712
- }), method(object({
55713
- deviceId: number().int().nonnegative(),
55714
- repeat: MediaPlayerRepeatSchema
55715
- }), _void(), {
55716
- kind: "mutation",
55717
- auth: "protected"
55718
- }), method(object({
55719
- deviceId: number().int().nonnegative(),
55720
- source: string().min(1)
55721
- }), _void(), {
55722
- kind: "mutation",
55723
- auth: "protected"
55724
- }), method(object({
55725
- deviceId: number().int().nonnegative(),
55726
- /** Media identifier / URL. */
55727
- mediaId: string().min(1),
55728
- /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
55729
- * passes it through to the upstream service. */
55730
- mediaType: string().min(1)
55731
- }), _void(), {
55732
- kind: "mutation",
55733
- auth: "protected"
55734
- });
55735
- /**
55736
56462
  * mesh-network — collection cap for mesh-VPN providers.
55737
56463
  *
55738
56464
  * Different shape from `network-access` (public tunnels):
@@ -63626,7 +64352,14 @@ var NcMediaPolicySchema = object({
63626
64352
  */
63627
64353
  profile: CamProfileSchema.optional(),
63628
64354
  /** See {@link NcLinkedCameraModeSchema}. */
63629
- linkedCameras: NcLinkedCameraModeSchema.optional()
64355
+ linkedCameras: NcLinkedCameraModeSchema.optional(),
64356
+ /**
64357
+ * Sensor rules only: may this rule wake a SLEEPING battery camera to take
64358
+ * the linked still it attaches (D998)? Absent means yes, an explicit `false`
64359
+ * opts out. Deliberately not a Zod default: a rule that never chose keeps
64360
+ * following the hub's. One bounded wake per event; nothing is attached later.
64361
+ */
64362
+ wakeSleepingCamera: boolean().optional()
63630
64363
  });
63631
64364
  /**
63632
64365
  * Cooldown GRANULARITY over the subject's class — how much a fired
@@ -64018,6 +64751,21 @@ var NcTemplateVarKindSchema = _enum([
64018
64751
  "sound",
64019
64752
  "system"
64020
64753
  ]);
64754
+ /**
64755
+ * The default title/body a rule of one SITUATION is delivered with when the
64756
+ * operator wrote no template — served so an editor can pre-fill it (and the
64757
+ * operator can rebuild it from placeholders) instead of starting from a blank
64758
+ * box that, once saved, silently replaces it. `id` names the situation inside
64759
+ * a rule `kind`: `appliance-cycle` is a `sensor` rule whose device is an
64760
+ * appliance finishing a cycle. Texts are raw templates (`{{var}}` intact), in
64761
+ * the hub's current language and with its overrides applied.
64762
+ */
64763
+ var NcTemplateDefaultSchema = object({
64764
+ id: _enum(["appliance-cycle"]),
64765
+ kind: NcRuleKindSchema,
64766
+ title: string(),
64767
+ body: string()
64768
+ });
64021
64769
  /** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
64022
64770
  var NcTemplateFamilySchema = _enum([
64023
64771
  "rule",
@@ -64873,7 +65621,11 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
64873
65621
  }), method(object({}), object({
64874
65622
  catalog: array(NcConditionDescriptorSchema),
64875
65623
  taxonomy: NcTaxonomySchema.optional()
64876
- })), method(object({}), object({ vars: array(NcTemplateVarDescriptorSchema) })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
65624
+ })), method(object({}), object({
65625
+ vars: array(NcTemplateVarDescriptorSchema),
65626
+ /** Per-situation default texts; absent on a hub that predates them. */
65627
+ defaults: array(NcTemplateDefaultSchema)
65628
+ })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
64877
65629
  kind: "mutation",
64878
65630
  access: "view"
64879
65631
  }), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), NcRuleLastRunsSchema, { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
@@ -65621,52 +66373,27 @@ object({
65621
66373
  empty: boolean().nullable(),
65622
66374
  /** True while the pump is running. Null while unknown. */
65623
66375
  pumpRunning: boolean().nullable(),
65624
- /** True when the pump works on an on/off duty cycle rather than continuously. */
65625
- pumpIntervalEnabled: boolean().nullable(),
65626
- /** How long the pump runs per cycle, in seconds. */
65627
- pumpOnTime: number().min(0).nullable().meta(readingMeta("duration")),
65628
- /** How long the pump rests per cycle, in seconds. */
65629
- pumpOffTime: number().min(0).nullable().meta(readingMeta("duration")),
65630
66376
  /** Water drunk in the last drink, in litres. */
65631
66377
  lastDrink: number().min(0).nullable().meta(readingMeta("volume")),
65632
66378
  /** Water drunk in the current hour, in litres. */
65633
66379
  currentHourDrink: number().min(0).nullable().meta(readingMeta("volume")),
65634
66380
  /** Water drunk over the last 24 hours (rolling), in litres. */
65635
66381
  last24hDrink: number().min(0).nullable().meta(readingMeta("volume")),
65636
- /** Water drunk since local midnight, in litres. */
66382
+ /** Water drunk since local midnight, in litres. Null when the fountain has no such sensor. */
65637
66383
  todayDrink: number().min(0).nullable().meta(readingMeta("volume")),
65638
66384
  /** Decoded fault message. Null means healthy; a non-null string is an active fault. */
65639
66385
  error: string().nullable(),
65640
66386
  /** Ms epoch when the slice was last refreshed. */
65641
66387
  lastFetchedAt: number()
65642
66388
  });
65643
- var DeviceIdSchema = number().int().nonnegative();
65644
- var MinutesSchema = number().int().min(0);
66389
+ var DeviceIdSchema$1 = number().int().nonnegative();
65645
66390
  DeviceType.PetFountain, method(object({
65646
- deviceId: DeviceIdSchema,
65647
- on: boolean()
65648
- }), _void(), {
65649
- kind: "mutation",
65650
- auth: "protected"
65651
- }), method(object({
65652
- deviceId: DeviceIdSchema,
66391
+ deviceId: DeviceIdSchema$1,
65653
66392
  on: boolean()
65654
66393
  }), _void(), {
65655
66394
  kind: "mutation",
65656
66395
  auth: "protected"
65657
- }), method(object({
65658
- deviceId: DeviceIdSchema,
65659
- minutes: MinutesSchema
65660
- }), _void(), {
65661
- kind: "mutation",
65662
- auth: "protected"
65663
- }), method(object({
65664
- deviceId: DeviceIdSchema,
65665
- minutes: MinutesSchema
65666
- }), _void(), {
65667
- kind: "mutation",
65668
- auth: "protected"
65669
- }), method(object({ deviceId: DeviceIdSchema }), _void(), {
66396
+ }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
65670
66397
  kind: "mutation",
65671
66398
  auth: "protected"
65672
66399
  });
@@ -67200,6 +67927,49 @@ object({
67200
67927
  DeviceType.PetFeeder,
67201
67928
  DeviceType.Heater
67202
67929
  ].filter((type) => type !== DeviceType.Sensor);
67930
+ var PowerSourceRefusalReasonSchema = _enum([
67931
+ "no-power-source",
67932
+ "switch-missing",
67933
+ "switch-offline",
67934
+ "switch-unknown",
67935
+ "restart-in-progress",
67936
+ "switch-call-failed"
67937
+ ]);
67938
+ var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
67939
+ accepted: literal(false),
67940
+ reason: PowerSourceRefusalReasonSchema,
67941
+ /** One line for the operator, naming the switch. */
67942
+ message: string()
67943
+ })]);
67944
+ var PowerSourceInfoSchema = object({
67945
+ /** False when the device has no power source linked; the rest is then empty. */
67946
+ linked: boolean(),
67947
+ switchDeviceId: number().nullable(),
67948
+ switchName: string().nullable(),
67949
+ /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
67950
+ switchOn: boolean().nullable(),
67951
+ switchOnline: boolean().nullable(),
67952
+ restartInProgress: boolean(),
67953
+ offSeconds: number().int()
67954
+ });
67955
+ object({
67956
+ /** Null while the switch has not reported: unknown is never `false` (D393). */
67957
+ switchOn: boolean().nullable(),
67958
+ offSeconds: number().int(),
67959
+ lastFetchedAt: number()
67960
+ });
67961
+ 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;
67962
+ var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
67963
+ systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
67964
+ kind: "mutation",
67965
+ auth: "admin"
67966
+ }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
67967
+ kind: "mutation",
67968
+ auth: "admin"
67969
+ }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
67970
+ kind: "mutation",
67971
+ auth: "admin"
67972
+ });
67203
67973
  /**
67204
67974
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
67205
67975
  * on `DeviceType.Presence`. Read-only — no setters: presence is
@@ -67626,6 +68396,37 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
67626
68396
  deviceId: number(),
67627
68397
  status: PtzAutotrackStatusSchema
67628
68398
  });
68399
+ object({
68400
+ /** True when the pump works on the on/off cycle, false when it runs continuously. Null while unknown. */
68401
+ enabled: boolean().nullable(),
68402
+ /** How long the pump runs per cycle, in seconds. Null while unknown. */
68403
+ onTime: number().min(0).nullable().meta(readingMeta("duration")),
68404
+ /** How long the pump rests per cycle, in seconds. Null while unknown. */
68405
+ offTime: number().min(0).nullable().meta(readingMeta("duration")),
68406
+ /** Ms epoch when the slice was last refreshed. */
68407
+ lastFetchedAt: number()
68408
+ });
68409
+ var DeviceIdSchema = number().int().nonnegative();
68410
+ var MinutesSchema = number().int().min(0);
68411
+ DeviceType.PetFountain, method(object({
68412
+ deviceId: DeviceIdSchema,
68413
+ on: boolean()
68414
+ }), _void(), {
68415
+ kind: "mutation",
68416
+ auth: "protected"
68417
+ }), method(object({
68418
+ deviceId: DeviceIdSchema,
68419
+ minutes: MinutesSchema
68420
+ }), _void(), {
68421
+ kind: "mutation",
68422
+ auth: "protected"
68423
+ }), method(object({
68424
+ deviceId: DeviceIdSchema,
68425
+ minutes: MinutesSchema
68426
+ }), _void(), {
68427
+ kind: "mutation",
68428
+ auth: "protected"
68429
+ });
67629
68430
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, DeviceType.Gateway, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
67630
68431
  kind: "mutation",
67631
68432
  auth: "admin"
@@ -70532,7 +71333,13 @@ var RemoteMediaCommandSchema = _enum([
70532
71333
  "next",
70533
71334
  "previous",
70534
71335
  "setMute",
70535
- "selectSource"
71336
+ "selectSource",
71337
+ "turnOn",
71338
+ "turnOff",
71339
+ "volumeUp",
71340
+ "volumeDown",
71341
+ "channelUp",
71342
+ "channelDown"
70536
71343
  ]);
70537
71344
  /** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
70538
71345
  var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
@@ -70553,7 +71360,7 @@ method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.e
70553
71360
  }), RemoteSendResultSchema, {
70554
71361
  kind: "mutation",
70555
71362
  auth: "protected"
70556
- }), method(deviceInput.extend({
71363
+ }), method(deviceInput, MediaPlayerStatusSchema.nullable(), { auth: "protected" }), method(deviceInput.extend({
70557
71364
  command: RemoteMediaCommandSchema,
70558
71365
  muted: boolean().optional(),
70559
71366
  source: string().optional(),
@@ -71425,9 +72232,17 @@ var ServerUpdateActionResultSchema = object({
71425
72232
  */
71426
72233
  requiredAddonUpdates: array(RequiredAddonUpdateSchema).optional()
71427
72234
  });
71428
- var LaunchOverridesSchema = object({
71429
- /** The persisted heap ceiling in MB, or `null` when none is set. */
71430
- heapMb: number().int().nullable() });
72235
+ var LaunchOverridesSchema = object({
72236
+ /** The persisted heap ceiling in MB, or `null` when none is set. */
72237
+ heapMb: number().int().nullable(),
72238
+ /** The persisted hub-main RSS budget in MB, or `null` when none is set. */
72239
+ rssBudgetMb: number().int().nullable()
72240
+ });
72241
+ var SetLaunchOverridesInputSchema = object({
72242
+ heapMb: number().int().min(512).max(65536).nullable(),
72243
+ /** Omitted keeps the stored budget; `null` clears it. */
72244
+ rssBudgetMb: number().int().min(512).max(65536).nullable().optional()
72245
+ });
71431
72246
  var SetLaunchOverridesResultSchema = LaunchOverridesSchema.extend({
71432
72247
  /** Always true: the override is read at launch, not by the running process. */
71433
72248
  restartRequired: boolean() });
@@ -71456,7 +72271,7 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
71456
72271
  }), method(_void(), ServerUpdateActionResultSchema, {
71457
72272
  kind: "mutation",
71458
72273
  auth: "admin"
71459
- }), method(_void(), LaunchOverridesSchema, { auth: "admin" }), method(object({ heapMb: number().int().min(512).max(65536).nullable() }), SetLaunchOverridesResultSchema, {
72274
+ }), method(_void(), LaunchOverridesSchema, { auth: "admin" }), method(SetLaunchOverridesInputSchema, SetLaunchOverridesResultSchema, {
71460
72275
  kind: "mutation",
71461
72276
  auth: "admin"
71462
72277
  });
@@ -71488,7 +72303,16 @@ DeviceType.Sensor;
71488
72303
  * future fields without breaking the existing call sites.
71489
72304
  */
71490
72305
  var EmailAddressSchema = email();
72306
+ /**
72307
+ * Which relay of a multi-relay provider answers (D996). Absent = the provider's first / default
72308
+ * relay, so a caller written before relays existed keeps working unchanged. A provider with one
72309
+ * fixed relay ignores it. This is the integration instance id (`int_NNNN`), NOT the addon id: the
72310
+ * collection pin `addonId` still picks the provider, `instanceId` picks the relay inside it.
72311
+ */
72312
+ var InstanceIdSchema = string().min(1).optional();
72313
+ var RelayPinSchema = object({ instanceId: InstanceIdSchema });
71491
72314
  var SendEmailInputSchema = object({
72315
+ instanceId: InstanceIdSchema,
71492
72316
  to: union([EmailAddressSchema, array(EmailAddressSchema).min(1)]),
71493
72317
  cc: array(EmailAddressSchema).optional(),
71494
72318
  bcc: array(EmailAddressSchema).optional(),
@@ -71524,11 +72348,11 @@ method(SendEmailInputSchema, SendEmailResultSchema, {
71524
72348
  kind: "mutation",
71525
72349
  auth: "admin",
71526
72350
  access: "create"
71527
- }), method(_void(), SmtpStatusSchema, {
72351
+ }), method(RelayPinSchema, SmtpStatusSchema, {
71528
72352
  kind: "mutation",
71529
72353
  auth: "admin",
71530
72354
  access: "view"
71531
- }), method(_void(), SmtpStatusSchema, { auth: "admin" });
72355
+ }), method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" });
71532
72356
  /**
71533
72357
  * A single device snapshot returned as base64 JPEG/PNG.
71534
72358
  *
@@ -71560,10 +72384,12 @@ DeviceType.Camera, method(object({
71560
72384
  * even when the cache is well within the device's
71561
72385
  * `snapshotMaxAgeS` window.
71562
72386
  *
71563
- * **`force` is an OPERATOR signal, not a freshness preference.** On a
72387
+ * **`force` is a demand with a named principal, not a freshness
72388
+ * preference** — an operator button, the scheduled refresh (D847), or a
72389
+ * notification rule that left the camera's wake allowed (D998). On a
71564
72390
  * battery camera it is the one thing that walks past the wrapper's
71565
- * sleep gate and wakes the camera, so a background caller — a poller,
71566
- * an event handler, a thumbnail — must NEVER set it. Every such caller
72391
+ * sleep gate and wakes the camera, so a poller, a thumbnail or a
72392
+ * prestream must NEVER set it. Every such caller
71567
72393
  * gets the cached frame, which on a sleeping battery camera is the
71568
72394
  * correct answer: stale but honest beats woken.
71569
72395
  */
@@ -72371,7 +73197,11 @@ object({
72371
73197
  });
72372
73198
  Object.values(DeviceType), method(_void(), array(StreamSignalSchema).readonly());
72373
73199
  object({
72374
- on: boolean().meta({ label: "On" }),
73200
+ /**
73201
+ * `null` = the device has never reported its state (a measurement that
73202
+ * has not happened is unknown, never `false`).
73203
+ */
73204
+ on: boolean().nullable().meta({ label: "On" }),
72375
73205
  /** Ms epoch of the last state change. Useful for UI "X minutes ago". */
72376
73206
  lastChangedAt: number()
72377
73207
  });
@@ -72383,7 +73213,7 @@ DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceTyp
72383
73213
  auth: "protected"
72384
73214
  }), object({
72385
73215
  deviceId: number(),
72386
- on: boolean(),
73216
+ on: boolean().nullable(),
72387
73217
  lastChangedAt: number()
72388
73218
  });
72389
73219
  /** C0 controls, DEL and the C1 range: none of them belongs in a name. */
@@ -72914,6 +73744,40 @@ var LoggingSettingsStateSchema = object({
72914
73744
  opsLogRetentionDays: number().int().min(0),
72915
73745
  persisted: boolean()
72916
73746
  });
73747
+ /**
73748
+ * Debug WATCH — a short, per-device window over `debug.<channel>` lines.
73749
+ *
73750
+ * `start` opens (or re-arms) a 10 minute window; `rearm` extends a LIVE one
73751
+ * and never revives a lapsed one; `stop` closes it; `list` only reads. No
73752
+ * chain of re-arms outlives 60 minutes from the first start. The hub holds the
73753
+ * watches in memory and pushes the interest to every node, so a watch lapses
73754
+ * by itself and survives nothing — a restart is a stop.
73755
+ */
73756
+ var DebugWatchInputSchema = object({
73757
+ action: _enum([
73758
+ "list",
73759
+ "start",
73760
+ "rearm",
73761
+ "stop"
73762
+ ]),
73763
+ /** Full channel names, `debug.<channel>`, each declared with `kind: 'debug'`. */
73764
+ channels: array(string().min(1)).readonly().default([]),
73765
+ /** Numeric device ids. Required (non-empty) for `start`. */
73766
+ deviceIds: array(number().int()).readonly().default([])
73767
+ });
73768
+ var DebugWatchStateSchema = object({
73769
+ channel: string(),
73770
+ deviceIds: array(number().int()).readonly(),
73771
+ startedAtMs: number(),
73772
+ untilMs: number(),
73773
+ capAtMs: number()
73774
+ });
73775
+ var DebugWatchResultSchema = object({
73776
+ nowMs: number(),
73777
+ watches: array(DebugWatchStateSchema).readonly(),
73778
+ /** Channels a `rearm` found already lapsed: nothing was revived. */
73779
+ lapsed: array(string()).readonly()
73780
+ });
72917
73781
  method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
72918
73782
  kind: "mutation",
72919
73783
  auth: "admin"
@@ -72929,6 +73793,9 @@ method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_
72929
73793
  }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(_void(), array(ReportedFailureContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
72930
73794
  kind: "mutation",
72931
73795
  auth: "admin"
73796
+ }), method(DebugWatchInputSchema, DebugWatchResultSchema, {
73797
+ kind: "mutation",
73798
+ auth: "admin"
72932
73799
  });
72933
73800
  object({
72934
73801
  /** True when the device's tamper switch / case-open contact is
@@ -75370,6 +76237,26 @@ function buildDescriptor(capName, kind) {
75370
76237
  * contributes one entry per bound cap present in this map.
75371
76238
  */
75372
76239
  var EVENT_KIND_BY_CAP = Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
76240
+ /**
76241
+ * What a remote key is CALLED and what it LOOKS like, for every role (D963),
76242
+ * shared by the admin UI and the viewer. A role is data on the wire; each
76243
+ * client resolves its name from `label` (English and Italian side by side) and
76244
+ * its glyph from `icon`, a lucide id from the shared icon catalogue — the
76245
+ * server sends an id, a client maps it to its own icon set.
76246
+ *
76247
+ * `legend` is text printed on the key INSTEAD of a glyph (a digit has no
76248
+ * pictogram): a client that can draw text shows it, one that cannot falls back
76249
+ * to `icon`.
76250
+ */
76251
+ function digit(n) {
76252
+ return {
76253
+ label: t(n, n),
76254
+ icon: "hash",
76255
+ legend: n
76256
+ };
76257
+ }
76258
+ digit("0"), digit("1"), digit("2"), digit("3"), digit("4"), digit("5"), digit("6"), digit("7"), digit("8"), digit("9");
76259
+ DeviceFeature.MediaPlayerPower, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious;
75373
76260
  var btn = (idSuffix, row, col, init) => ({
75374
76261
  idSuffix,
75375
76262
  row,
@@ -75496,7 +76383,35 @@ discriminatedUnion("kind", [object({
75496
76383
  kind: literal("pronto"),
75497
76384
  code: string()
75498
76385
  })]);
75499
- DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
76386
+ /**
76387
+ * Propose a running threshold from a device's own power history (planning#405).
76388
+ *
76389
+ * Pure and deterministic: the same series gives the same answer. The series is
76390
+ * a HELD-VALUE step series — a point's value stands until the next point — which
76391
+ * is how device-history stores a gauge, so "time at a level" is exact, not a
76392
+ * count of samples.
76393
+ *
76394
+ * 1. idle floor F = time-weighted median; noise ceiling N = highest value seen
76395
+ * near F. A device that is not near one level most of the time has no floor.
76396
+ * 2. coarse activity = above max(2N, N + 5 W); consecutive stretches are episodes.
76397
+ * 3. gaps between episodes split in two by the largest log-scale jump (>= 3x):
76398
+ * the short ones are pauses INSIDE a run (a soak), the long ones separate runs.
76399
+ * 4. T = geometric mean of N and the plateau's 10th percentile, snapped to a
76400
+ * grid a person would type; stop dwell covers the longest pause; start dwell
76401
+ * covers the longest standby blip above T.
76402
+ * 5. the numbers are proved by REPLAY through the real `dwell` evaluation: each
76403
+ * run must hold exactly one true interval and nothing may flap outside.
76404
+ */
76405
+ var SECOND_MS = 1e3;
76406
+ var MINUTE_MS$1 = 60 * SECOND_MS;
76407
+ 24 * (60 * MINUTE_MS$1);
76408
+ 10 * MINUTE_MS$1;
76409
+ 30 * SECOND_MS;
76410
+ 60 * SECOND_MS;
76411
+ 20 * MINUTE_MS$1;
76412
+ 10 * SECOND_MS;
76413
+ 10 * SECOND_MS;
76414
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverStoppable, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
75500
76415
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
75501
76416
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
75502
76417
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
@@ -76477,6 +77392,27 @@ Object.freeze({
76477
77392
  access: "view",
76478
77393
  role: "viewer"
76479
77394
  },
77395
+ "boardKeySource.getBoardKey": {
77396
+ capName: "board-key-source",
77397
+ capScope: "system",
77398
+ addonId: null,
77399
+ access: "view",
77400
+ role: "admin"
77401
+ },
77402
+ "boardKeySource.listBoards": {
77403
+ capName: "board-key-source",
77404
+ capScope: "system",
77405
+ addonId: null,
77406
+ access: "view",
77407
+ role: "admin"
77408
+ },
77409
+ "boardKeySource.listSources": {
77410
+ capName: "board-key-source",
77411
+ capScope: "system",
77412
+ addonId: null,
77413
+ access: "view",
77414
+ role: "admin"
77415
+ },
76480
77416
  "brightness.getStatus": {
76481
77417
  capName: "brightness",
76482
77418
  capScope: "device",
@@ -77016,6 +77952,13 @@ Object.freeze({
77016
77952
  access: "create",
77017
77953
  role: "admin"
77018
77954
  },
77955
+ "coreBlocks.proposeRunningThreshold": {
77956
+ capName: "core-blocks",
77957
+ capScope: "system",
77958
+ addonId: null,
77959
+ access: "view",
77960
+ role: "admin"
77961
+ },
77019
77962
  "coreBlocks.reportAutomationRun": {
77020
77963
  capName: "core-blocks",
77021
77964
  capScope: "system",
@@ -77527,6 +78470,13 @@ Object.freeze({
77527
78470
  access: "view",
77528
78471
  role: "admin"
77529
78472
  },
78473
+ "deviceExport.listInstances": {
78474
+ capName: "device-export",
78475
+ capScope: "system",
78476
+ addonId: null,
78477
+ access: "view",
78478
+ role: "admin"
78479
+ },
77530
78480
  "deviceExport.listSupportedDeviceKinds": {
77531
78481
  capName: "device-export",
77532
78482
  capScope: "system",
@@ -77814,6 +78764,13 @@ Object.freeze({
77814
78764
  access: "view",
77815
78765
  role: "admin"
77816
78766
  },
78767
+ "deviceManager.dismissDiscoveryProposal": {
78768
+ capName: "device-manager",
78769
+ capScope: "system",
78770
+ addonId: null,
78771
+ access: "create",
78772
+ role: "admin"
78773
+ },
77817
78774
  "deviceManager.enable": {
77818
78775
  capName: "device-manager",
77819
78776
  capScope: "system",
@@ -77996,6 +78953,13 @@ Object.freeze({
77996
78953
  access: "view",
77997
78954
  role: "viewer"
77998
78955
  },
78956
+ "deviceManager.listDiscoveryProposals": {
78957
+ capName: "device-manager",
78958
+ capScope: "system",
78959
+ addonId: null,
78960
+ access: "view",
78961
+ role: "admin"
78962
+ },
77999
78963
  "deviceManager.listLocationDescriptions": {
78000
78964
  capName: "device-manager",
78001
78965
  capScope: "system",
@@ -78150,6 +79114,13 @@ Object.freeze({
78150
79114
  access: "create",
78151
79115
  role: "admin"
78152
79116
  },
79117
+ "deviceManager.reportDiscoveryObservations": {
79118
+ capName: "device-manager",
79119
+ capScope: "system",
79120
+ addonId: null,
79121
+ access: "create",
79122
+ role: "admin"
79123
+ },
78153
79124
  "deviceManager.runDeviceAction": {
78154
79125
  capName: "device-manager",
78155
79126
  capScope: "system",
@@ -78157,6 +79128,13 @@ Object.freeze({
78157
79128
  access: "create",
78158
79129
  role: "admin"
78159
79130
  },
79131
+ "deviceManager.runDiscoverySweep": {
79132
+ capName: "device-manager",
79133
+ capScope: "system",
79134
+ addonId: null,
79135
+ access: "create",
79136
+ role: "admin"
79137
+ },
78160
79138
  "deviceManager.setChildLayout": {
78161
79139
  capName: "device-manager",
78162
79140
  capScope: "system",
@@ -78710,6 +79688,20 @@ Object.freeze({
78710
79688
  access: "create",
78711
79689
  role: "admin"
78712
79690
  },
79691
+ "doNotDisturb.getStatus": {
79692
+ capName: "do-not-disturb",
79693
+ capScope: "device",
79694
+ addonId: null,
79695
+ access: "view",
79696
+ role: "viewer"
79697
+ },
79698
+ "doNotDisturb.setEnabled": {
79699
+ capName: "do-not-disturb",
79700
+ capScope: "device",
79701
+ addonId: null,
79702
+ access: "create",
79703
+ role: "viewer"
79704
+ },
78713
79705
  "doorbell.getStatus": {
78714
79706
  capName: "doorbell",
78715
79707
  capScope: "device",
@@ -79074,6 +80066,69 @@ Object.freeze({
79074
80066
  access: "create",
79075
80067
  role: "admin"
79076
80068
  },
80069
+ "integrationInstances.createInstance": {
80070
+ capName: "integration-instances",
80071
+ capScope: "system",
80072
+ addonId: null,
80073
+ access: "create",
80074
+ role: "admin"
80075
+ },
80076
+ "integrationInstances.deleteInstance": {
80077
+ capName: "integration-instances",
80078
+ capScope: "system",
80079
+ addonId: null,
80080
+ access: "delete",
80081
+ role: "admin"
80082
+ },
80083
+ "integrationInstances.describe": {
80084
+ capName: "integration-instances",
80085
+ capScope: "system",
80086
+ addonId: null,
80087
+ access: "view",
80088
+ role: "admin"
80089
+ },
80090
+ "integrationInstances.getInstance": {
80091
+ capName: "integration-instances",
80092
+ capScope: "system",
80093
+ addonId: null,
80094
+ access: "view",
80095
+ role: "admin"
80096
+ },
80097
+ "integrationInstances.instanceFormSchema": {
80098
+ capName: "integration-instances",
80099
+ capScope: "system",
80100
+ addonId: null,
80101
+ access: "view",
80102
+ role: "admin"
80103
+ },
80104
+ "integrationInstances.listInstances": {
80105
+ capName: "integration-instances",
80106
+ capScope: "system",
80107
+ addonId: null,
80108
+ access: "view",
80109
+ role: "admin"
80110
+ },
80111
+ "integrationInstances.setInstanceEnabled": {
80112
+ capName: "integration-instances",
80113
+ capScope: "system",
80114
+ addonId: null,
80115
+ access: "create",
80116
+ role: "admin"
80117
+ },
80118
+ "integrationInstances.testInstance": {
80119
+ capName: "integration-instances",
80120
+ capScope: "system",
80121
+ addonId: null,
80122
+ access: "create",
80123
+ role: "admin"
80124
+ },
80125
+ "integrationInstances.updateInstance": {
80126
+ capName: "integration-instances",
80127
+ capScope: "system",
80128
+ addonId: null,
80129
+ access: "create",
80130
+ role: "admin"
80131
+ },
79077
80132
  "integrations.create": {
79078
80133
  capName: "integrations",
79079
80134
  capScope: "system",
@@ -79858,6 +80913,20 @@ Object.freeze({
79858
80913
  access: "view",
79859
80914
  role: "admin"
79860
80915
  },
80916
+ "mediaPlayer.channelDown": {
80917
+ capName: "media-player",
80918
+ capScope: "device",
80919
+ addonId: null,
80920
+ access: "create",
80921
+ role: "viewer"
80922
+ },
80923
+ "mediaPlayer.channelUp": {
80924
+ capName: "media-player",
80925
+ capScope: "device",
80926
+ addonId: null,
80927
+ access: "create",
80928
+ role: "viewer"
80929
+ },
79861
80930
  "mediaPlayer.getStatus": {
79862
80931
  capName: "media-player",
79863
80932
  capScope: "device",
@@ -79949,6 +81018,34 @@ Object.freeze({
79949
81018
  access: "create",
79950
81019
  role: "viewer"
79951
81020
  },
81021
+ "mediaPlayer.turnOff": {
81022
+ capName: "media-player",
81023
+ capScope: "device",
81024
+ addonId: null,
81025
+ access: "create",
81026
+ role: "viewer"
81027
+ },
81028
+ "mediaPlayer.turnOn": {
81029
+ capName: "media-player",
81030
+ capScope: "device",
81031
+ addonId: null,
81032
+ access: "create",
81033
+ role: "viewer"
81034
+ },
81035
+ "mediaPlayer.volumeDown": {
81036
+ capName: "media-player",
81037
+ capScope: "device",
81038
+ addonId: null,
81039
+ access: "create",
81040
+ role: "viewer"
81041
+ },
81042
+ "mediaPlayer.volumeUp": {
81043
+ capName: "media-player",
81044
+ capScope: "device",
81045
+ addonId: null,
81046
+ access: "create",
81047
+ role: "viewer"
81048
+ },
79952
81049
  "meshNetwork.getStatus": {
79953
81050
  capName: "mesh-network",
79954
81051
  capScope: "system",
@@ -81195,27 +82292,6 @@ Object.freeze({
81195
82292
  access: "create",
81196
82293
  role: "viewer"
81197
82294
  },
81198
- "petFountain.setPumpInterval": {
81199
- capName: "pet-fountain",
81200
- capScope: "device",
81201
- addonId: null,
81202
- access: "create",
81203
- role: "viewer"
81204
- },
81205
- "petFountain.setPumpOffMinutes": {
81206
- capName: "pet-fountain",
81207
- capScope: "device",
81208
- addonId: null,
81209
- access: "create",
81210
- role: "viewer"
81211
- },
81212
- "petFountain.setPumpOnMinutes": {
81213
- capName: "pet-fountain",
81214
- capScope: "device",
81215
- addonId: null,
81216
- access: "create",
81217
- role: "viewer"
81218
- },
81219
82295
  "pipelineAnalytics.addRetrainFrameFromRecording": {
81220
82296
  capName: "pipeline-analytics",
81221
82297
  capScope: "device",
@@ -82994,6 +84070,34 @@ Object.freeze({
82994
84070
  access: "create",
82995
84071
  role: "admin"
82996
84072
  },
84073
+ "pumpCycle.getStatus": {
84074
+ capName: "pump-cycle",
84075
+ capScope: "device",
84076
+ addonId: null,
84077
+ access: "view",
84078
+ role: "viewer"
84079
+ },
84080
+ "pumpCycle.setEnabled": {
84081
+ capName: "pump-cycle",
84082
+ capScope: "device",
84083
+ addonId: null,
84084
+ access: "create",
84085
+ role: "viewer"
84086
+ },
84087
+ "pumpCycle.setOffMinutes": {
84088
+ capName: "pump-cycle",
84089
+ capScope: "device",
84090
+ addonId: null,
84091
+ access: "create",
84092
+ role: "viewer"
84093
+ },
84094
+ "pumpCycle.setOnMinutes": {
84095
+ capName: "pump-cycle",
84096
+ capScope: "device",
84097
+ addonId: null,
84098
+ access: "create",
84099
+ role: "viewer"
84100
+ },
82997
84101
  "reboot.reboot": {
82998
84102
  capName: "reboot",
82999
84103
  capScope: "device",
@@ -83498,6 +84602,13 @@ Object.freeze({
83498
84602
  access: "create",
83499
84603
  role: "admin"
83500
84604
  },
84605
+ "remote.getAssumedStatus": {
84606
+ capName: "remote",
84607
+ capScope: "system",
84608
+ addonId: null,
84609
+ access: "view",
84610
+ role: "admin"
84611
+ },
83501
84612
  "remote.getConfig": {
83502
84613
  capName: "remote",
83503
84614
  capScope: "system",
@@ -84730,6 +85841,13 @@ Object.freeze({
84730
85841
  access: "create",
84731
85842
  role: "viewer"
84732
85843
  },
85844
+ "system.debugWatch": {
85845
+ capName: "system",
85846
+ capScope: "system",
85847
+ addonId: null,
85848
+ access: "create",
85849
+ role: "admin"
85850
+ },
84733
85851
  "system.detectSiteLocation": {
84734
85852
  capName: "system",
84735
85853
  capScope: "system",
@@ -86331,6 +87449,11 @@ Object.freeze({
86331
87449
  form: "single",
86332
87450
  optional: false
86333
87451
  }],
87452
+ "coreBlocks.proposeRunningThreshold": [{
87453
+ name: "deviceId",
87454
+ form: "single",
87455
+ optional: false
87456
+ }],
86334
87457
  "cover.close": [{
86335
87458
  name: "deviceId",
86336
87459
  form: "single",
@@ -86923,6 +88046,16 @@ Object.freeze({
86923
88046
  form: "single",
86924
88047
  optional: false
86925
88048
  }],
88049
+ "doNotDisturb.getStatus": [{
88050
+ name: "deviceId",
88051
+ form: "single",
88052
+ optional: false
88053
+ }],
88054
+ "doNotDisturb.setEnabled": [{
88055
+ name: "deviceId",
88056
+ form: "single",
88057
+ optional: false
88058
+ }],
86926
88059
  "doorbell.getStatus": [{
86927
88060
  name: "deviceId",
86928
88061
  form: "single",
@@ -87172,6 +88305,16 @@ Object.freeze({
87172
88305
  form: "single",
87173
88306
  optional: true
87174
88307
  }],
88308
+ "mediaPlayer.channelDown": [{
88309
+ name: "deviceId",
88310
+ form: "single",
88311
+ optional: false
88312
+ }],
88313
+ "mediaPlayer.channelUp": [{
88314
+ name: "deviceId",
88315
+ form: "single",
88316
+ optional: false
88317
+ }],
87175
88318
  "mediaPlayer.getStatus": [{
87176
88319
  name: "deviceId",
87177
88320
  form: "single",
@@ -87237,6 +88380,26 @@ Object.freeze({
87237
88380
  form: "single",
87238
88381
  optional: false
87239
88382
  }],
88383
+ "mediaPlayer.turnOff": [{
88384
+ name: "deviceId",
88385
+ form: "single",
88386
+ optional: false
88387
+ }],
88388
+ "mediaPlayer.turnOn": [{
88389
+ name: "deviceId",
88390
+ form: "single",
88391
+ optional: false
88392
+ }],
88393
+ "mediaPlayer.volumeDown": [{
88394
+ name: "deviceId",
88395
+ form: "single",
88396
+ optional: false
88397
+ }],
88398
+ "mediaPlayer.volumeUp": [{
88399
+ name: "deviceId",
88400
+ form: "single",
88401
+ optional: false
88402
+ }],
87240
88403
  "meter.getStatus": [{
87241
88404
  name: "deviceId",
87242
88405
  form: "single",
@@ -87546,21 +88709,6 @@ Object.freeze({
87546
88709
  form: "single",
87547
88710
  optional: false
87548
88711
  }],
87549
- "petFountain.setPumpInterval": [{
87550
- name: "deviceId",
87551
- form: "single",
87552
- optional: false
87553
- }],
87554
- "petFountain.setPumpOffMinutes": [{
87555
- name: "deviceId",
87556
- form: "single",
87557
- optional: false
87558
- }],
87559
- "petFountain.setPumpOnMinutes": [{
87560
- name: "deviceId",
87561
- form: "single",
87562
- optional: false
87563
- }],
87564
88712
  "pipelineAnalytics.addRetrainFrameFromRecording": [{
87565
88713
  name: "deviceId",
87566
88714
  form: "single",
@@ -88196,6 +89344,26 @@ Object.freeze({
88196
89344
  form: "single",
88197
89345
  optional: false
88198
89346
  }],
89347
+ "pumpCycle.getStatus": [{
89348
+ name: "deviceId",
89349
+ form: "single",
89350
+ optional: false
89351
+ }],
89352
+ "pumpCycle.setEnabled": [{
89353
+ name: "deviceId",
89354
+ form: "single",
89355
+ optional: false
89356
+ }],
89357
+ "pumpCycle.setOffMinutes": [{
89358
+ name: "deviceId",
89359
+ form: "single",
89360
+ optional: false
89361
+ }],
89362
+ "pumpCycle.setOnMinutes": [{
89363
+ name: "deviceId",
89364
+ form: "single",
89365
+ optional: false
89366
+ }],
88199
89367
  "reboot.reboot": [{
88200
89368
  name: "deviceId",
88201
89369
  form: "single",
@@ -88397,6 +89565,11 @@ Object.freeze({
88397
89565
  form: "single",
88398
89566
  optional: true
88399
89567
  }],
89568
+ "remote.getAssumedStatus": [{
89569
+ name: "deviceId",
89570
+ form: "single",
89571
+ optional: false
89572
+ }],
88400
89573
  "remote.getConfig": [{
88401
89574
  name: "deviceId",
88402
89575
  form: "single",
@@ -88663,6 +89836,11 @@ Object.freeze({
88663
89836
  form: "single",
88664
89837
  optional: false
88665
89838
  }],
89839
+ "system.debugWatch": [{
89840
+ name: "deviceIds",
89841
+ form: "array",
89842
+ optional: true
89843
+ }],
88666
89844
  "tamper.getStatus": [{
88667
89845
  name: "deviceId",
88668
89846
  form: "single",
@@ -88939,99 +90117,6 @@ Object.freeze({
88939
90117
  "network-access": "ingress",
88940
90118
  "smtp-provider": "email"
88941
90119
  });
88942
- /**
88943
- * A saved Customize assignment (D936). The schema is the type: callers use
88944
- * `z.infer`, they do not restate the shape.
88945
- */
88946
- var OverrideSourceSchema = object({
88947
- addonId: string().min(1),
88948
- stableId: string().min(1),
88949
- cap: string().min(1),
88950
- fieldPath: string().min(1)
88951
- });
88952
- var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
88953
- object({ kind: literal("identity") }),
88954
- object({ kind: literal("invert") }),
88955
- object({
88956
- kind: literal("threshold"),
88957
- comparison: _enum(["gte", "lte"]),
88958
- threshold: number(),
88959
- startDwellMs: number().nonnegative(),
88960
- stopDwellMs: number().nonnegative()
88961
- }),
88962
- object({
88963
- kind: literal("linear"),
88964
- scale: number(),
88965
- offset: number(),
88966
- clampMin: number().optional(),
88967
- clampMax: number().optional()
88968
- }),
88969
- object({
88970
- kind: literal("enum-map"),
88971
- mapping: record(string(), string().nullable())
88972
- }),
88973
- object({ kind: literal("number") })
88974
- ]);
88975
- var ScalarOverrideDraftSchema = object({
88976
- kind: literal("scalar"),
88977
- cap: string().min(1),
88978
- targetId: string().min(1),
88979
- source: OverrideSourceSchema,
88980
- transform: CustomizeTransformDraftSchema
88981
- });
88982
- var KeyedArrayOverrideDraftSchema = object({
88983
- kind: literal("keyedArray"),
88984
- cap: string().min(1),
88985
- targetId: string().min(1),
88986
- key: string().min(1),
88987
- label: string().min(1),
88988
- fieldPath: string().min(1),
88989
- source: OverrideSourceSchema,
88990
- transform: CustomizeTransformDraftSchema
88991
- });
88992
- var PulseOverrideDraftSchema = object({
88993
- kind: literal("pulse"),
88994
- cap: string().min(1),
88995
- targetId: string().min(1),
88996
- enabled: boolean(),
88997
- debounceMs: number().nonnegative(),
88998
- edges: array(_enum([
88999
- "rising",
89000
- "button",
89001
- "native-event"
89002
- ])).min(1).optional(),
89003
- sources: array(OverrideSourceSchema).min(1)
89004
- });
89005
- var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
89006
- "in-addition",
89007
- "confirm",
89008
- "replace"
89009
- ]).optional() });
89010
- discriminatedUnion("kind", [
89011
- ScalarOverrideDraftSchema,
89012
- KeyedArrayOverrideDraftSchema,
89013
- PulseOverrideDraftSchema,
89014
- object({
89015
- kind: literal("span"),
89016
- cap: string().min(1),
89017
- targetId: string().min(1),
89018
- timeoutMs: number().nonnegative(),
89019
- cooldownMs: number().nonnegative().optional(),
89020
- sources: array(SpanSourceDraftSchema)
89021
- })
89022
- ]);
89023
- object({
89024
- targetId: string().min(1),
89025
- configured: boolean(),
89026
- source: _enum(["native", "assigned"]),
89027
- state: _enum([
89028
- "active",
89029
- "stale",
89030
- "released",
89031
- "unavailable"
89032
- ]),
89033
- reason: string().nullable()
89034
- });
89035
90120
  var G711_SCALE_CORRECTION_DB = {
89036
90121
  PCMU: 20 * Math.log10(4),
89037
90122
  PCMA: 20 * Math.log10(8)
@@ -89647,6 +90732,7 @@ var STATE_SUMMARY_VARS = [
89647
90732
  [...RULE_TEXT],
89648
90733
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
89649
90734
  ([...RULE_TEXT], [...COMBINED_ALARM]),
90735
+ ([...RULE_TEXT], [...COMBINED_ALARM]),
89650
90736
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
89651
90737
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
89652
90738
  ([...RULE_TEXT], [...CONSUMABLE]),
@@ -137585,6 +138671,111 @@ function carryForward(base, existing, keys) {
137585
138671
  return out;
137586
138672
  }
137587
138673
  //#endregion
138674
+ //#region src/migrations/hub-node-fields.ts
138675
+ /**
138676
+ * Fields stored once for the cluster that are facts of ONE node become node settings (D986): a
138677
+ * node's row is `<addonId>.<key>@<nodeId>` carrying `nodeId`, and a node never falls back to a
138678
+ * bare row. This owner is placed `hub-only`, so the one node that ever held a value is the hub:
138679
+ * each bare row is COPIED to `<key>@hub`. The bare row stays for a release (a copy, not a move),
138680
+ * and a value already on the node row is never overwritten (a seed never overwrites).
138681
+ *
138682
+ * A keychain marker is copied verbatim: it names the owner and the secret, not the row that
138683
+ * points at it. Idempotent: with every bare row copied the plan is empty.
138684
+ */
138685
+ /** The canonical settings table: one row per key, id `<addonId>.<key>`. */
138686
+ var ADDON_SETTINGS_TABLE = "addon-settings";
138687
+ var nodeKeyOf = (key) => `${key}@hub`;
138688
+ async function planHubNodeFields(addonId, keys, ports) {
138689
+ const stored = await ports.readStored([...keys, ...keys.map(nodeKeyOf)]);
138690
+ const pending = keys.filter((key) => key in stored && !(nodeKeyOf(key) in stored));
138691
+ if (pending.length === 0) return { edits: [] };
138692
+ const rowId = (key) => `${addonId}.${nodeKeyOf(key)}`;
138693
+ return { edits: [{
138694
+ op: "setKeys",
138695
+ scope: ADDON_SETTINGS_TABLE,
138696
+ values: Object.fromEntries(pending.map((key) => [rowId(key), {
138697
+ addonId,
138698
+ key: nodeKeyOf(key),
138699
+ value: stored[key],
138700
+ nodeId: "hub"
138701
+ }])),
138702
+ precondition: preconditionOf(Object.fromEntries(pending.map((key) => [rowId(key), null])))
138703
+ }] };
138704
+ }
138705
+ /**
138706
+ * The port's read over an addon's three-way key read: each of `keys` that has a row, raw. A key
138707
+ * the store could not answer for throws, so the migration fails instead of treating a failed read
138708
+ * as "nothing to copy".
138709
+ */
138710
+ async function readRawKeys(read, addonId, keys) {
138711
+ const found = {};
138712
+ for (const key of keys) {
138713
+ const answer = await read(key);
138714
+ if (answer.kind === "unreadable") throw new Error(`${addonId}: the setting ${key} cannot be read (${answer.reason})`);
138715
+ if (answer.kind === "present") found[key] = answer.value;
138716
+ }
138717
+ return found;
138718
+ }
138719
+ //#endregion
138720
+ //#region src/migrations/fixed-pin-to-keychain.ts
138721
+ /**
138722
+ * The fixed HomeKit setup code pairs a controller with the bridge: a credential. It was a plain
138723
+ * text setting, stored inline in the settings row; it is a `password` field now (D783), and a
138724
+ * password lives in the keychain with a marker in the row. This procedure moves a stored inline
138725
+ * code there, through the operator write path (the one that stores an inline value of a
138726
+ * pre-keychain addon as a keychain secret).
138727
+ *
138728
+ * Idempotent: an absent, empty or already marker-backed code is `already-done`, so a crash
138729
+ * between the keychain write and the ledger row costs nothing on the rerun.
138730
+ */
138731
+ async function moveFixedPinToKeychain(ports) {
138732
+ const stored = (await ports.readStored(["fixedPin"]))["fixedPin"];
138733
+ if (typeof stored !== "string" || stored === "" || isSecretMarker(stored)) return {
138734
+ outcome: "already-done",
138735
+ summary: { moved: false }
138736
+ };
138737
+ await ports.storeFixedPin(stored);
138738
+ return {
138739
+ outcome: "done",
138740
+ summary: { moved: true }
138741
+ };
138742
+ }
138743
+ //#endregion
138744
+ //#region src/migrations/index.ts
138745
+ var EXPORT_HAP_ID = "export-hap";
138746
+ /** The `export-hap` catalogue (D987): offered to the engine when the addon initialises. */
138747
+ var ADDON_MIGRATIONS = [{
138748
+ meta: {
138749
+ id: "export-hap/2026-11-03-interface-name-per-node",
138750
+ owner: EXPORT_HAP_ID,
138751
+ level: "addon-state",
138752
+ seq: 1,
138753
+ dependsOn: [],
138754
+ store: "settings",
138755
+ scope: "per-node",
138756
+ onFailure: "tolerate",
138757
+ bodyKind: "plan",
138758
+ description: "Copy the bare network interface setting to its hub node row; the bare row stays for a release",
138759
+ fixtureMark: "the bridge name the migration does not know"
138760
+ },
138761
+ plan: (ports) => planHubNodeFields(EXPORT_HAP_ID, ["interfaceName"], ports)
138762
+ }, {
138763
+ meta: {
138764
+ id: "export-hap/2026-11-03-fixed-pin-to-keychain",
138765
+ owner: EXPORT_HAP_ID,
138766
+ level: "addon-state",
138767
+ seq: 2,
138768
+ dependsOn: [],
138769
+ store: "settings",
138770
+ scope: "cluster",
138771
+ onFailure: "tolerate",
138772
+ bodyKind: "procedure",
138773
+ description: "Move the fixed setup code from an inline setting into the keychain, where a password field keeps it",
138774
+ fixtureMark: "the bridge name the migration does not know"
138775
+ },
138776
+ procedure: moveFixedPinToKeychain
138777
+ }];
138778
+ //#endregion
137588
138779
  //#region src/hap-setup-uri.ts
137589
138780
  function errMsg$15(e) {
137590
138781
  return e instanceof Error ? e.message : String(e);
@@ -157032,6 +158223,7 @@ var ExportHapAddon = class extends BaseAddon {
157032
158223
  super({ ...DEFAULT_CONFIG });
157033
158224
  }
157034
158225
  async onInitialize() {
158226
+ await this.migrateSettings();
157035
158227
  const identity = await this.ensureIdentity();
157036
158228
  this.pincode = identity.pincode;
157037
158229
  this.bind = this.config.interfaceName || void 0;
@@ -157120,8 +158312,10 @@ var ExportHapAddon = class extends BaseAddon {
157120
158312
  this.subscribeDeviceReadyForReconcile();
157121
158313
  this.subscribeStorageLocationsForClips();
157122
158314
  this.disposeSharedRebuildTimers();
158315
+ const ownInstance = (instanceId) => assertOwnExportInstance("export-hap", EXPORT_HAP_ADDON_ID, instanceId);
157123
158316
  const provider = {
157124
- getStatus: async () => {
158317
+ getStatus: async (input) => {
158318
+ ownInstance(statusInstanceOf(input));
157125
158319
  const anyPaired = Array.from(this.exposed.values()).some((m) => accessoryPaired(m.accessory));
157126
158320
  const linkState = this.lastError ? "error" : anyPaired ? "linked" : "unlinked";
157127
158321
  const setup = this.buildSetupBlock();
@@ -157132,19 +158326,38 @@ var ExportHapAddon = class extends BaseAddon {
157132
158326
  ...setup ? { setup } : {}
157133
158327
  };
157134
158328
  },
157135
- listSupportedDeviceKinds: async () => [...HAP_EXPORTABLE_DEVICE_TYPES],
157136
- listExposedDevices: async () => Array.from(this.exposed.entries()).map(([deviceId, m]) => {
157137
- const entry = this.config.exposed.find((e) => e.deviceId === deviceId);
157138
- return {
157139
- deviceId,
157140
- exposedAs: m.accessory.displayName,
157141
- ...entry?.capabilities ? { capabilities: [...entry.capabilities] } : {}
157142
- };
157143
- }),
157144
- exposeDevice: async ({ deviceId, capabilities }) => this.exposeDevice(deviceId, capabilities),
157145
- unexposeDevice: async ({ deviceId }) => this.unexposeDevice(deviceId),
158329
+ listInstances: async () => [{
158330
+ instanceId: EXPORT_HAP_ADDON_ID,
158331
+ name: "HomeKit",
158332
+ enabled: true,
158333
+ kind: "hap-bridge"
158334
+ }],
158335
+ listSupportedDeviceKinds: async ({ instanceId }) => {
158336
+ ownInstance(instanceId);
158337
+ return [...HAP_EXPORTABLE_DEVICE_TYPES];
158338
+ },
158339
+ listExposedDevices: async ({ instanceId }) => {
158340
+ ownInstance(instanceId);
158341
+ return Array.from(this.exposed.entries()).map(([deviceId, m]) => {
158342
+ const entry = this.config.exposed.find((e) => e.deviceId === deviceId);
158343
+ return {
158344
+ deviceId,
158345
+ exposedAs: m.accessory.displayName,
158346
+ ...entry?.capabilities ? { capabilities: [...entry.capabilities] } : {}
158347
+ };
158348
+ });
158349
+ },
158350
+ exposeDevice: async ({ instanceId, deviceId, capabilities }) => {
158351
+ ownInstance(instanceId);
158352
+ return this.exposeDevice(deviceId, capabilities);
158353
+ },
158354
+ unexposeDevice: async ({ instanceId, deviceId }) => {
158355
+ ownInstance(instanceId);
158356
+ return this.unexposeDevice(deviceId);
158357
+ },
157146
158358
  listSupportedEntityKinds: async () => ["device", "action"],
157147
- listExposedEntities: async () => {
158359
+ listExposedEntities: async ({ instanceId }) => {
158360
+ ownInstance(instanceId);
157148
158361
  await this.actionExports?.reconcile();
157149
158362
  return [...Array.from(this.exposed.entries()).map(([deviceId, m]) => ({
157150
158363
  entity: {
@@ -157154,12 +158367,14 @@ var ExportHapAddon = class extends BaseAddon {
157154
158367
  exposedAs: m.accessory.displayName
157155
158368
  })), ...this.actionExports?.list() ?? []];
157156
158369
  },
157157
- exposeEntity: async ({ entity }) => {
158370
+ exposeEntity: async ({ instanceId, entity }) => {
158371
+ ownInstance(instanceId);
157158
158372
  if (entity.kind === "device") return this.exposeDevice(entity.deviceId);
157159
158373
  if (entity.kind === "action") return this.requireActionExports().expose(entity.actionId);
157160
158374
  throw new Error("export-hap: a notification target cannot be exported to HomeKit");
157161
158375
  },
157162
- unexposeEntity: async ({ entity }) => {
158376
+ unexposeEntity: async ({ instanceId, entity }) => {
158377
+ ownInstance(instanceId);
157163
158378
  if (entity.kind === "device") return this.unexposeDevice(entity.deviceId);
157164
158379
  if (entity.kind === "action") return this.requireActionExports().unexpose(entity.actionId);
157165
158380
  throw new Error("export-hap: a notification target cannot be exported to HomeKit");
@@ -157640,6 +158855,37 @@ var ExportHapAddon = class extends BaseAddon {
157640
158855
  return null;
157641
158856
  }
157642
158857
  }
158858
+ /** The one declaration of the bind-interface field, shared by the node form and the global form. */
158859
+ interfaceNameField() {
158860
+ return this.field({
158861
+ type: "text",
158862
+ key: "interfaceName",
158863
+ perNode: true,
158864
+ label: "Network interface",
158865
+ description: "Optional. Restrict mDNS advertisement and HAP bind to this node's interface (e.g. \"en0\"). Leave blank to advertise on all interfaces.",
158866
+ default: DEFAULT_CONFIG.interfaceName,
158867
+ requiresRestart: true,
158868
+ placement: { tab: "advanced" }
158869
+ });
158870
+ }
158871
+ async nodeSettingsSchema(cap) {
158872
+ return cap === "device-export" ? this.schema({ sections: [{
158873
+ id: "export-hap-node",
158874
+ title: "HomeKit Export",
158875
+ fields: [this.interfaceNameField()]
158876
+ }] }) : null;
158877
+ }
158878
+ /**
158879
+ * Copy the bare `interfaceName` to its hub node row and move an inline `fixedPin` into the
158880
+ * keychain (D986, D987). Re-resolves the config when either landed, so this boot binds the
158881
+ * value the migration wrote.
158882
+ */
158883
+ async migrateSettings() {
158884
+ if ((await this.runMigrations(defineAddonMigrations(ADDON_MIGRATIONS, {
158885
+ readStored: (keys) => readRawKeys((key) => this.readStoredGlobalKey(key), "export-hap", keys),
158886
+ storeFixedPin: (pin) => this.updateGlobalSettingsAsOperator({ fixedPin: pin })
158887
+ }))).applied.length > 0) await this.resolveConfig();
158888
+ }
157643
158889
  globalSettingsSchema() {
157644
158890
  return this.schema({ sections: [{
157645
158891
  id: "export-hap",
@@ -157657,24 +158903,15 @@ var ExportHapAddon = class extends BaseAddon {
157657
158903
  placement: { tab: "advanced" }
157658
158904
  }),
157659
158905
  this.field({
157660
- type: "text",
158906
+ type: "password",
157661
158907
  key: "fixedPin",
157662
- secret: true,
157663
158908
  label: "Fixed setup code (XXX-XX-XXX)",
157664
158909
  description: "Optional. Leave blank to use the auto-generated code persisted on first boot. Useful for CI replay.",
157665
158910
  default: DEFAULT_CONFIG.fixedPin,
157666
158911
  requiresRestart: true,
157667
158912
  placement: { tab: "advanced" }
157668
158913
  }),
157669
- this.field({
157670
- type: "text",
157671
- key: "interfaceName",
157672
- label: "Network interface",
157673
- description: "Optional. Restrict mDNS advertisement and HAP bind to a specific interface (e.g. \"en0\"). Leave blank to advertise on all interfaces.",
157674
- default: DEFAULT_CONFIG.interfaceName,
157675
- requiresRestart: true,
157676
- placement: { tab: "advanced" }
157677
- }),
158914
+ this.interfaceNameField(),
157678
158915
  this.field({
157679
158916
  type: "number",
157680
158917
  key: "clipRetentionDays",