@camstack/addon-export-google 0.1.122 → 0.1.124

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.
@@ -863,7 +863,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
863
863
  return EventCategory;
864
864
  }({});
865
865
  //#endregion
866
- //#region ../types/dist/device-type-BOWLtoOt.mjs
866
+ //#region ../types/dist/device-type-D1fH5kaC.mjs
867
867
  /**
868
868
  import { errMsg } from '@camstack/types'
869
869
  * Extract a human-readable message from an unknown error value.
@@ -1052,6 +1052,9 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1052
1052
  DeviceFeature["CoverPositionable"] = "cover-positionable";
1053
1053
  /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
1054
1054
  DeviceFeature["CoverTilt"] = "cover-tilt";
1055
+ /** Cover has a real stop: `stop` halts the travel in place. Gates the stop
1056
+ * control in exporters; a provider whose `stop` is a no-op never declares it. */
1057
+ DeviceFeature["CoverStoppable"] = "cover-stoppable";
1055
1058
  /** Valve exposes intermediate position control (0..100). Gates the
1056
1059
  * position slider / drag surface UI. */
1057
1060
  DeviceFeature["ValvePositionable"] = "valve-positionable";
@@ -1091,6 +1094,12 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1091
1094
  DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
1092
1095
  /** Media player exposes stop distinct from pause. */
1093
1096
  DeviceFeature["MediaPlayerStop"] = "media-player-stop";
1097
+ /** Media player exposes volume up / down in steps (an infrared TV has no level). */
1098
+ DeviceFeature["MediaPlayerVolumeStep"] = "media-player-volume-step";
1099
+ /** Media player exposes channel up / down in steps. */
1100
+ DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
1101
+ /** Media player exposes power on / off. */
1102
+ DeviceFeature["MediaPlayerPower"] = "media-player-power";
1094
1103
  /** Alarm panel requires a PIN code on arm/disarm. */
1095
1104
  DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
1096
1105
  /** Presence device carries GPS coordinates (lat/lng/accuracy) in
@@ -5917,7 +5926,7 @@ var ZodIssueCode = {
5917
5926
  var ZodFirstPartyTypeKind;
5918
5927
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5919
5928
  //#endregion
5920
- //#region ../types/dist/sleep-Bei295Bz.mjs
5929
+ //#region ../types/dist/sleep-BkzQdpzF.mjs
5921
5930
  /**
5922
5931
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5923
5932
  * window to float samples (D455).
@@ -5996,6 +6005,22 @@ function buildAlawTable() {
5996
6005
  }
5997
6006
  buildUlawTable();
5998
6007
  buildAlawTable();
6008
+ /**
6009
+ * An addon whose own migrations did not apply refuses to initialise (D987). The error is typed
6010
+ * so a runner hosting several addons can tell "this addon is blocked" from a crash and keep its
6011
+ * co-located siblings running. Recognised by NAME and shape, never `instanceof`: a forked addon
6012
+ * bundles its own copy of this module, so the class the runner sees is not the one that threw.
6013
+ */
6014
+ var MIGRATIONS_BLOCKED_ERROR_NAME = "AddonMigrationsBlockedError";
6015
+ var AddonMigrationsBlockedError = class extends Error {
6016
+ /** The ledger ids that did not apply and block the owner. */
6017
+ migrationIds;
6018
+ constructor(migrationIds) {
6019
+ super(`migration(s) ${migrationIds.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
6020
+ this.name = MIGRATIONS_BLOCKED_ERROR_NAME;
6021
+ this.migrationIds = migrationIds;
6022
+ }
6023
+ };
5999
6024
  /** Is this field's stored value a credential? */
6000
6025
  function isSecretConfigField(field) {
6001
6026
  if (field.type === "password") return true;
@@ -6034,7 +6059,7 @@ function isKeychainStoredField(field) {
6034
6059
  var SECRET_CLEAR = { $secretClear: true };
6035
6060
  /** The `'***'` token D634 redaction writes for non-admins. */
6036
6061
  var LEGACY_DEVICE_REDACTION = "***";
6037
- function isRecord$6(value) {
6062
+ function isRecord$7(value) {
6038
6063
  return typeof value === "object" && value !== null && !Array.isArray(value);
6039
6064
  }
6040
6065
  function makeSecretMarker(ref) {
@@ -6045,12 +6070,12 @@ function makeSecretMarker(ref) {
6045
6070
  }
6046
6071
  /** A stored marker: an object whose `$secret` is a non-empty string. */
6047
6072
  function isSecretMarker(value) {
6048
- if (!isRecord$6(value)) return false;
6073
+ if (!isRecord$7(value)) return false;
6049
6074
  const ref = value["$secret"];
6050
6075
  return typeof ref === "string" && ref.length > 0;
6051
6076
  }
6052
6077
  function isSecretClear(value) {
6053
- return isRecord$6(value) && value["$secretClear"] === true;
6078
+ return isRecord$7(value) && value["$secretClear"] === true;
6054
6079
  }
6055
6080
  /**
6056
6081
  * The UI view of a stored secret field value: a marker becomes "set", inline
@@ -6803,7 +6828,7 @@ var KeychainWriteRefusedError = class extends Error {
6803
6828
  }
6804
6829
  };
6805
6830
  var KEEP = { kind: "keep" };
6806
- function isRecord$5(value) {
6831
+ function isRecord$6(value) {
6807
6832
  return typeof value === "object" && value !== null && !Array.isArray(value);
6808
6833
  }
6809
6834
  function defaultMintId() {
@@ -6816,7 +6841,7 @@ function collectSecretMarkerRefs(value, out = []) {
6816
6841
  return out;
6817
6842
  }
6818
6843
  if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
6819
- else if (isRecord$5(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6844
+ else if (isRecord$6(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
6820
6845
  return out;
6821
6846
  }
6822
6847
  async function storedValueEquals(secrets, marker, candidate) {
@@ -6871,7 +6896,7 @@ function rowId(row, idKey) {
6871
6896
  return null;
6872
6897
  }
6873
6898
  async function writeArray(ctx, node, incoming, stored, fieldPath) {
6874
- const storedRows = Array.isArray(stored) ? stored.filter(isRecord$5) : [];
6899
+ const storedRows = Array.isArray(stored) ? stored.filter(isRecord$6) : [];
6875
6900
  if (!Array.isArray(incoming)) {
6876
6901
  ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
6877
6902
  return {
@@ -6887,7 +6912,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
6887
6912
  const kept = /* @__PURE__ */ new Set();
6888
6913
  const rows = [];
6889
6914
  for (const row of incoming) {
6890
- if (!isRecord$5(row)) {
6915
+ if (!isRecord$6(row)) {
6891
6916
  rows.push(row);
6892
6917
  continue;
6893
6918
  }
@@ -6912,7 +6937,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6912
6937
  case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
6913
6938
  case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
6914
6939
  case "object": {
6915
- if (!isRecord$5(incoming)) {
6940
+ if (!isRecord$6(incoming)) {
6916
6941
  if (incoming === void 0) return KEEP;
6917
6942
  ctx.deletes.push(...collectSecretMarkerRefs(stored));
6918
6943
  return {
@@ -6920,7 +6945,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
6920
6945
  value: incoming
6921
6946
  };
6922
6947
  }
6923
- const storedObj = isRecord$5(stored) ? stored : {};
6948
+ const storedObj = isRecord$6(stored) ? stored : {};
6924
6949
  return {
6925
6950
  kind: "value",
6926
6951
  value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
@@ -7043,7 +7068,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
7043
7068
  value: items
7044
7069
  };
7045
7070
  }
7046
- if (isRecord$5(v)) {
7071
+ if (isRecord$6(v)) {
7047
7072
  const out = {};
7048
7073
  for (const [k, child] of Object.entries(v)) {
7049
7074
  const s = substitute(child);
@@ -7075,7 +7100,7 @@ var SecretOverwriteRefusedError = class extends Error {
7075
7100
  this.name = "SecretOverwriteRefusedError";
7076
7101
  }
7077
7102
  };
7078
- function isRecord$4(value) {
7103
+ function isRecord$5(value) {
7079
7104
  return typeof value === "object" && value !== null && !Array.isArray(value);
7080
7105
  }
7081
7106
  function resolvedValue(pass, marker) {
@@ -7104,7 +7129,7 @@ function inArray(pass, incoming, stored) {
7104
7129
  return incoming.map((item, index) => {
7105
7130
  const twin = stored[index];
7106
7131
  if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
7107
- if (isRecord$4(item) && isRecord$4(twin)) return inArrayRow(pass, item, twin);
7132
+ if (isRecord$5(item) && isRecord$5(twin)) return inArrayRow(pass, item, twin);
7108
7133
  if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
7109
7134
  return item;
7110
7135
  });
@@ -7115,7 +7140,7 @@ function inArrayRow(pass, incoming, stored) {
7115
7140
  const twin = stored[key];
7116
7141
  if (isSecretMarker(twin)) {
7117
7142
  if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
7118
- } else if (isRecord$4(value) && isRecord$4(twin)) out[key] = inArrayRow(pass, value, twin);
7143
+ } else if (isRecord$5(value) && isRecord$5(twin)) out[key] = inArrayRow(pass, value, twin);
7119
7144
  else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
7120
7145
  }
7121
7146
  return out;
@@ -7123,7 +7148,7 @@ function inArrayRow(pass, incoming, stored) {
7123
7148
  async function walk(pass, incoming, stored) {
7124
7149
  if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
7125
7150
  if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
7126
- if (!isRecord$4(incoming) || !isRecord$4(stored)) return incoming;
7151
+ if (!isRecord$5(incoming) || !isRecord$5(stored)) return incoming;
7127
7152
  const out = { ...incoming };
7128
7153
  for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
7129
7154
  return out;
@@ -7154,7 +7179,7 @@ async function restoreUnchangedSecrets(input) {
7154
7179
  function isJsonEqual(a, b) {
7155
7180
  if (Object.is(a, b)) return true;
7156
7181
  if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
7157
- if (isRecord$4(a) && isRecord$4(b)) {
7182
+ if (isRecord$5(a) && isRecord$5(b)) {
7158
7183
  const keys = Object.keys(a);
7159
7184
  if (keys.length !== Object.keys(b).length) return false;
7160
7185
  return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
@@ -7178,7 +7203,7 @@ function markerKeysOf(blob, owner) {
7178
7203
  }
7179
7204
  function nodeFromStored(value, owner) {
7180
7205
  if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
7181
- if (!isRecord$4(value)) return null;
7206
+ if (!isRecord$5(value)) return null;
7182
7207
  const children = /* @__PURE__ */ new Map();
7183
7208
  for (const [key, child] of Object.entries(value)) {
7184
7209
  const node = nodeFromStored(child, owner);
@@ -7649,7 +7674,7 @@ var BaseAddon = class {
7649
7674
  startMigration: (input) => api.startMigration.mutate(input),
7650
7675
  finishMigration: (input) => api.finishMigration.mutate(input)
7651
7676
  }, migrations, this.ctx.logger);
7652
- 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`);
7677
+ if (report.blockOwner.length > 0) throw new AddonMigrationsBlockedError(report.blockOwner);
7653
7678
  return report;
7654
7679
  }
7655
7680
  /**
@@ -7797,6 +7822,44 @@ var BaseAddon = class {
7797
7822
  return null;
7798
7823
  }
7799
7824
  /**
7825
+ * D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
7826
+ * provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
7827
+ * declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
7828
+ * {@link nodeSettingsSchema} and of {@link deviceDefaultsSchema} are disjoint, and a key never
7829
+ * contains `@` (guard `check-scoped-settings-declared`). SHAPE only: values are read by scope.
7830
+ */
7831
+ async clusterSettingsSchema(_cap) {
7832
+ return null;
7833
+ }
7834
+ /**
7835
+ * D986: the form shape of the settings one capability owns PER NODE, or `null`. Stored as
7836
+ * `addon-settings` rows `<addonId>.<field>@<nodeId>` carrying `nodeId` in the row data, so a
7837
+ * forgotten node's rows go in one central delete.
7838
+ */
7839
+ async nodeSettingsSchema(_cap) {
7840
+ return null;
7841
+ }
7842
+ /**
7843
+ * D986: the form shape of the FLEET DEFAULTS of the per-device settings one capability owns,
7844
+ * or `null`. Stored as `addon-settings` rows `<addonId>.<field>`; a device resolves its value
7845
+ * as device row, then this default, then the schema default (`resolveDeviceSettings`).
7846
+ */
7847
+ async deviceDefaultsSchema(_cap) {
7848
+ return null;
7849
+ }
7850
+ /**
7851
+ * The host's read of the scoped declarations: the schema one capability declares for `scope`,
7852
+ * or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
7853
+ * host asks this method.
7854
+ */
7855
+ async getScopedSettingsSchema(scope, cap) {
7856
+ switch (scope) {
7857
+ case "cluster": return this.clusterSettingsSchema(cap);
7858
+ case "node": return this.nodeSettingsSchema(cap);
7859
+ case "device-defaults": return this.deviceDefaultsSchema(cap);
7860
+ }
7861
+ }
7862
+ /**
7800
7863
  * What the create wizard and the integration edit page render for one instance: the addon's
7801
7864
  * per-instance schema when it declares one, else its global schema (what they always showed).
7802
7865
  */
@@ -7951,6 +8014,10 @@ var BaseAddon = class {
7951
8014
  const stored = keychain ? await this.readAddonStoreWithRetry() : {};
7952
8015
  const patch = {};
7953
8016
  for (const key of keys) {
8017
+ if (tree.get(key)?.kind === "array") {
8018
+ patch[key] = [];
8019
+ continue;
8020
+ }
7954
8021
  const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
7955
8022
  patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
7956
8023
  }
@@ -8590,6 +8657,21 @@ function normalizeAddonInitResult(result) {
8590
8657
  if (Array.isArray(result)) return { providers: result };
8591
8658
  return result;
8592
8659
  }
8660
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8661
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
8662
+ var RECORD_DATABASES = ["settings", "events"];
8663
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8664
+ var RECORD_CLASSES = [
8665
+ "config",
8666
+ "ledger",
8667
+ "audit",
8668
+ "mirror",
8669
+ "ephemeral"
8670
+ ];
8671
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8672
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8673
+ var RECORD_BATCH_MAX = 1e3;
8674
+ var RECORD_QUERY_MAX = 1e3;
8593
8675
  /**
8594
8676
  * The share-view scope kinds a share-link token can carry. The hub mints
8595
8677
  * and validates them (`ShareViewGrantSchema` builds its
@@ -8614,21 +8696,6 @@ var PeerBytesTicketSchema = object({
8614
8696
  */
8615
8697
  declaredBytes: number().int().nonnegative().nullable()
8616
8698
  });
8617
- /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
8618
- /** The files a kind may live in. `history` is device-history's (D850), never records. */
8619
- var RECORD_DATABASES = ["settings", "events"];
8620
- /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
8621
- var RECORD_CLASSES = [
8622
- "config",
8623
- "ledger",
8624
- "audit",
8625
- "mirror",
8626
- "ephemeral"
8627
- ];
8628
- var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
8629
- var RECORD_MAX_DATA_BYTES = 1024 * 1024;
8630
- var RECORD_BATCH_MAX = 1e3;
8631
- var RECORD_QUERY_MAX = 1e3;
8632
8699
  /**
8633
8700
  * Record kinds (D881): the declaration an addon makes of one kind of fact, the
8634
8701
  * Zod row schema that describes it, and the helper that turns the two into the
@@ -9347,6 +9414,7 @@ var CAP_NAMES = Object.freeze([
9347
9414
  "backup",
9348
9415
  "battery",
9349
9416
  "binary",
9417
+ "board-key-source",
9350
9418
  "brightness",
9351
9419
  "broker",
9352
9420
  "button",
@@ -9410,6 +9478,7 @@ var CAP_NAMES = Object.freeze([
9410
9478
  "humidity-sensor",
9411
9479
  "image",
9412
9480
  "image-settings",
9481
+ "integration-instances",
9413
9482
  "integrations",
9414
9483
  "intercom",
9415
9484
  "ir-transmitter",
@@ -9467,6 +9536,7 @@ var CAP_NAMES = Object.freeze([
9467
9536
  "privacy-mask",
9468
9537
  "ptz",
9469
9538
  "ptz-autotrack",
9539
+ "pump-cycle",
9470
9540
  "reboot",
9471
9541
  "record-entries",
9472
9542
  "recording",
@@ -10759,18 +10829,6 @@ Object.freeze({
10759
10829
  "path": "pumpRunning",
10760
10830
  "valueType": "boolean"
10761
10831
  },
10762
- {
10763
- "path": "pumpIntervalEnabled",
10764
- "valueType": "boolean"
10765
- },
10766
- {
10767
- "path": "pumpOnTime",
10768
- "valueType": "number"
10769
- },
10770
- {
10771
- "path": "pumpOffTime",
10772
- "valueType": "number"
10773
- },
10774
10832
  {
10775
10833
  "path": "lastDrink",
10776
10834
  "valueType": "number"
@@ -10894,6 +10952,20 @@ Object.freeze({
10894
10952
  "valueType": "number"
10895
10953
  }
10896
10954
  ],
10955
+ "pump-cycle": [
10956
+ {
10957
+ "path": "enabled",
10958
+ "valueType": "boolean"
10959
+ },
10960
+ {
10961
+ "path": "onTime",
10962
+ "valueType": "number"
10963
+ },
10964
+ {
10965
+ "path": "offTime",
10966
+ "valueType": "number"
10967
+ }
10968
+ ],
10897
10969
  "recording-archive": [
10898
10970
  {
10899
10971
  "path": "deviceId",
@@ -11343,7 +11415,7 @@ object({
11343
11415
  params: record(string(), union([string(), number()])).optional()
11344
11416
  });
11345
11417
  //#endregion
11346
- //#region ../types/dist/composition-kKKOdFIG.mjs
11418
+ //#region ../types/dist/composition-CRNwcFYY.mjs
11347
11419
  /**
11348
11420
  * The ffmpeg build every CamStack node downloads, per platform and arch.
11349
11421
  *
@@ -12106,38 +12178,6 @@ function validateExpressionSource(src) {
12106
12178
  return null;
12107
12179
  }
12108
12180
  /**
12109
- * One power reading becomes a washer, dryer or dishwasher (D944 helper).
12110
- *
12111
- * Standby of the control board is under 5 W; a motor or a heater is far
12112
- * above that, so 5 W is the line. A door lock or a short pump spike is not
12113
- * a cycle, so running starts only after 30 s above the line.
12114
- *
12115
- * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
12116
- * bursts) lasts several minutes. Ending the cycle on the first dip would
12117
- * report "finished" in the middle of the program, so the stop dwell is
12118
- * 10 minutes on every type. The number is stored per type so one machine
12119
- * can move later without moving the others.
12120
- */
12121
- var APPLIANCE_TEMPLATE_ID = "appliance";
12122
- var APPLIANCE_KINDS = [
12123
- "washer",
12124
- "dryer",
12125
- "dishwasher"
12126
- ];
12127
- DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
12128
- /**
12129
- * A dumb plug-in stove or heater, built from a smart plug (a `Heater`).
12130
- *
12131
- * The plug is the actuator: `switch.setState` is a FORWARD to the plug's own
12132
- * (D967), so the heater switches exactly as the plug does. Running is the
12133
- * plug being on; when a power reading is also named, running is the draw
12134
- * staying above the line instead (a plug left on with the stove's own
12135
- * thermostat open is not heating). 50 W is far above any standby and below
12136
- * the smallest radiator.
12137
- */
12138
- var HEATER_TEMPLATE_ID = "heater";
12139
- DeviceType.Heater;
12140
- /**
12141
12181
  * Statistics and integrals over a history read (D944).
12142
12182
  *
12143
12183
  * Pure: the same points always give the same answer, so a restart recomputes
@@ -12281,34 +12321,6 @@ var HelperSpecSchema = discriminatedUnion("kind", [
12281
12321
  /** Actuator groups only. Readings leave this unset. */
12282
12322
  active: ActiveCriterionSchema.optional()
12283
12323
  }),
12284
- object({
12285
- kind: literal("appliance"),
12286
- templateId: literal(APPLIANCE_TEMPLATE_ID),
12287
- appliance: _enum(APPLIANCE_KINDS),
12288
- thresholdWatts: number().positive(),
12289
- startDwellMs: number().int().nonnegative(),
12290
- stopDwellMs: number().int().nonnegative(),
12291
- member: HelperMemberSchema,
12292
- /**
12293
- * The plug that powers the appliance (`switch.on`). Optional: when set, the
12294
- * composition carries a `power-source` feature, so the hub can cut and restore
12295
- * that plug (power-source link of a NEW-target composition).
12296
- */
12297
- powerSwitch: HelperMemberSchema.optional(),
12298
- /** How long a forced restart keeps the plug off; the cap's default when unset. */
12299
- offSeconds: number().optional()
12300
- }),
12301
- object({
12302
- kind: literal("heater"),
12303
- templateId: literal(HEATER_TEMPLATE_ID),
12304
- /** The plug, read and commanded at `switch.on`. */
12305
- plug: HelperMemberSchema,
12306
- /** The plug's power reading, when it has one: running is then the draw, not the switch. */
12307
- meter: HelperMemberSchema.optional(),
12308
- thresholdWatts: number().positive(),
12309
- startDwellMs: number().int().nonnegative(),
12310
- stopDwellMs: number().int().nonnegative()
12311
- }),
12312
12324
  object({
12313
12325
  kind: literal("statistic"),
12314
12326
  stat: _enum(STATISTIC_STATS),
@@ -12480,7 +12492,14 @@ var CompositionForwardCommandSchema = object({
12480
12492
  method: string().min(1),
12481
12493
  args: record(string().min(1), CompositionForwardArgSchema).optional()
12482
12494
  });
12483
- var CompositionCommandTargetSchema = discriminatedUnion("kind", [CompositionForwardCommandSchema, CompositionCodeSourceSchema]);
12495
+ var CompositionCommandTargetSchema = discriminatedUnion("kind", [
12496
+ CompositionForwardCommandSchema,
12497
+ CompositionCodeSourceSchema,
12498
+ object({
12499
+ kind: literal("extension"),
12500
+ target: literal("remote")
12501
+ })
12502
+ ]);
12484
12503
  /** An item key inside an item-array cap (`consumables.items[<key>]`). */
12485
12504
  var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
12486
12505
  /**
@@ -12525,7 +12544,7 @@ var CompositionSchema = object({
12525
12544
  kind: literal("existing"),
12526
12545
  device: CompositionSourceRefSchema
12527
12546
  })]),
12528
- features: array(CompositionFeatureSchema).min(1).max(16),
12547
+ features: array(CompositionFeatureSchema).min(0).max(16),
12529
12548
  /**
12530
12549
  * Present when the block is a helper template. Absent on a free
12531
12550
  * composition (the room example, device 4603). The editor reads this,
@@ -12557,6 +12576,73 @@ var NodeColorIdSchema = _enum([
12557
12576
  "node-g",
12558
12577
  "node-h"
12559
12578
  ]);
12579
+ //#endregion
12580
+ //#region ../types/dist/index.mjs
12581
+ var SMTP_INBOUND_DEFAULT_PORT = 2525;
12582
+ var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
12583
+ var SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
12584
+ /** The text excerpt a message carries on the bus. */
12585
+ var SMTP_INBOUND_TEXT_MAX_CHARS = 4096;
12586
+ var PortSchema = number().int().min(1).max(65535);
12587
+ /** A recipient local-part: what stands before the `@`. */
12588
+ var SmtpRecipientSchema = string().min(1).max(64).regex(/^[A-Za-z0-9._+-]+$/);
12589
+ object({
12590
+ port: PortSchema.default(SMTP_INBOUND_DEFAULT_PORT),
12591
+ bindHost: string().min(1).default("0.0.0.0"),
12592
+ domain: string().min(1).default(SMTP_INBOUND_DEFAULT_DOMAIN),
12593
+ requireAuth: boolean().default(true),
12594
+ username: string().default(""),
12595
+ password: string().default("").meta({ secret: true }),
12596
+ starttls: boolean().default(false),
12597
+ maxMessageBytes: number().int().positive().default(SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES)
12598
+ });
12599
+ object({
12600
+ host: string().min(1).nullable(),
12601
+ hostReason: string().nullable(),
12602
+ port: PortSchema,
12603
+ domain: string().min(1),
12604
+ requireAuth: boolean(),
12605
+ username: string(),
12606
+ password: string(),
12607
+ starttls: boolean()
12608
+ });
12609
+ object({
12610
+ recipients: array(SmtpRecipientSchema).min(1),
12611
+ /**
12612
+ * Who is subscribing. A second `subscribe` with the same id REPLACES that subscriber's
12613
+ * recipients (the way a consumer that restarted, or lost a device, declares its set again);
12614
+ * a recipient held by another subscriber is refused with `smtp-inbound/recipient-claimed`.
12615
+ * Absent, the subscriber is anonymous and unique.
12616
+ */
12617
+ subscriberId: string().min(1).max(64).optional()
12618
+ });
12619
+ var SmtpInboundAttachmentSchema = object({
12620
+ filename: string(),
12621
+ contentType: string(),
12622
+ bytes: number().int().nonnegative()
12623
+ });
12624
+ /** The payload of one `broker.message` (the key is the recipient local-part). */
12625
+ var SmtpInboundMessageSchema = object({
12626
+ /** Monotonic per mailbox; a gap tells a consumer it missed an event. */
12627
+ seq: number().int().positive(),
12628
+ messageId: string(),
12629
+ receivedAt: number().int().nonnegative(),
12630
+ from: string(),
12631
+ to: string(),
12632
+ subject: string(),
12633
+ text: string().max(SMTP_INBOUND_TEXT_MAX_CHARS),
12634
+ attachments: array(SmtpInboundAttachmentSchema)
12635
+ });
12636
+ object({
12637
+ /** The newest seq issued so far (0 before any mail). */
12638
+ lastSeq: number().int().nonnegative(),
12639
+ /** The oldest seq still retained; messages below it are gone. */
12640
+ oldestSeq: number().int().nonnegative(),
12641
+ messages: array(object({
12642
+ key: string(),
12643
+ message: SmtpInboundMessageSchema
12644
+ }))
12645
+ });
12560
12646
  new Set([
12561
12647
  "track",
12562
12648
  "face",
@@ -18963,24 +19049,52 @@ var APPLIANCE_CAP_VOCABULARY = {
18963
19049
  args: { on: false }
18964
19050
  },
18965
19051
  {
18966
- id: "petFountain.intervalOn",
18967
- method: "setPumpInterval",
19052
+ id: "petFountain.resetDailyConsumption",
19053
+ method: "resetDailyConsumption",
19054
+ label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
19055
+ phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
19056
+ icon: "rotate-ccw"
19057
+ }
19058
+ ],
19059
+ state: [{
19060
+ kind: "boolean",
19061
+ field: "empty",
19062
+ label: t("Tank empty", "Serbatoio vuoto"),
19063
+ whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
19064
+ whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
19065
+ icon: "droplet"
19066
+ }, {
19067
+ kind: "numeric",
19068
+ field: "waterLevel",
19069
+ quantity: t("the water level", "il livello dell’acqua"),
19070
+ label: t("Water level", "Livello dell’acqua"),
19071
+ unit: "%",
19072
+ icon: "droplets"
19073
+ }]
19074
+ },
19075
+ "pump-cycle": {
19076
+ scope: "device",
19077
+ noun: t("Pump cycle", "Ciclo della pompa"),
19078
+ actions: [
19079
+ {
19080
+ id: "pumpCycle.on",
19081
+ method: "setEnabled",
18968
19082
  label: t("Pump cycle on", "Ciclo pompa attivo"),
18969
19083
  phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
18970
19084
  icon: "timer",
18971
19085
  args: { on: true }
18972
19086
  },
18973
19087
  {
18974
- id: "petFountain.intervalOff",
18975
- method: "setPumpInterval",
19088
+ id: "pumpCycle.off",
19089
+ method: "setEnabled",
18976
19090
  label: t("Pump cycle off", "Ciclo pompa spento"),
18977
19091
  phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
18978
19092
  icon: "timer-off",
18979
19093
  args: { on: false }
18980
19094
  },
18981
19095
  {
18982
- id: "petFountain.pumpOnMinutes",
18983
- method: "setPumpOnMinutes",
19096
+ id: "pumpCycle.onMinutes",
19097
+ method: "setOnMinutes",
18984
19098
  label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
18985
19099
  phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
18986
19100
  icon: "timer",
@@ -18996,8 +19110,8 @@ var APPLIANCE_CAP_VOCABULARY = {
18996
19110
  }]
18997
19111
  },
18998
19112
  {
18999
- id: "petFountain.pumpOffMinutes",
19000
- method: "setPumpOffMinutes",
19113
+ id: "pumpCycle.offMinutes",
19114
+ method: "setOffMinutes",
19001
19115
  label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
19002
19116
  phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
19003
19117
  icon: "timer-off",
@@ -19011,35 +19125,63 @@ var APPLIANCE_CAP_VOCABULARY = {
19011
19125
  unit: "min"
19012
19126
  }
19013
19127
  }]
19014
- },
19015
- {
19016
- id: "petFountain.resetDailyConsumption",
19017
- method: "resetDailyConsumption",
19018
- label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
19019
- phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
19020
- icon: "rotate-ccw"
19021
19128
  }
19022
19129
  ],
19023
19130
  state: [{
19024
19131
  kind: "boolean",
19025
- field: "empty",
19026
- label: t("Tank empty", "Serbatoio vuoto"),
19027
- whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
19028
- whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
19029
- icon: "droplet"
19030
- }, {
19031
- kind: "numeric",
19032
- field: "waterLevel",
19033
- quantity: t("the water level", "il livello dell’acqua"),
19034
- label: t("Water level", "Livello dell’acqua"),
19035
- unit: "%",
19036
- icon: "droplets"
19132
+ field: "enabled",
19133
+ label: t("Pump cycle", "Ciclo pompa"),
19134
+ whenTrue: t("When {device} starts running its pump on a cycle", "Quando {device} inizia a far lavorare la pompa a ciclo"),
19135
+ whenFalse: t("When {device} runs its pump continuously", "Quando {device} fa lavorare la pompa in continuo"),
19136
+ icon: "timer"
19037
19137
  }]
19038
19138
  },
19039
19139
  "media-player": {
19040
19140
  scope: "device",
19041
19141
  noun: t("Media player", "Lettore multimediale"),
19042
19142
  actions: [
19143
+ {
19144
+ id: "media.turnOn",
19145
+ method: "turnOn",
19146
+ label: t("Turn on", "Accendi"),
19147
+ phrase: t("Turn on {device}", "Accendi {device}"),
19148
+ icon: "power"
19149
+ },
19150
+ {
19151
+ id: "media.turnOff",
19152
+ method: "turnOff",
19153
+ label: t("Turn off", "Spegni"),
19154
+ phrase: t("Turn off {device}", "Spegni {device}"),
19155
+ icon: "power"
19156
+ },
19157
+ {
19158
+ id: "media.volumeUp",
19159
+ method: "volumeUp",
19160
+ label: t("Volume up", "Alza il volume"),
19161
+ phrase: t("Raise the volume of {device}", "Alza il volume di {device}"),
19162
+ icon: "volume-2"
19163
+ },
19164
+ {
19165
+ id: "media.volumeDown",
19166
+ method: "volumeDown",
19167
+ label: t("Volume down", "Abbassa il volume"),
19168
+ phrase: t("Lower the volume of {device}", "Abbassa il volume di {device}"),
19169
+ icon: "volume-2"
19170
+ },
19171
+ {
19172
+ id: "media.channelUp",
19173
+ method: "channelUp",
19174
+ label: t("Channel up", "Canale successivo"),
19175
+ phrase: t("Go to the next channel on {device}", "Passa al canale successivo su {device}"),
19176
+ icon: "skip-forward"
19177
+ },
19178
+ {
19179
+ id: "media.channelDown",
19180
+ method: "channelDown",
19181
+ label: t("Channel down", "Canale precedente"),
19182
+ phrase: t("Go to the previous channel on {device}", "Torna al canale precedente su {device}"),
19183
+ icon: "skip-back"
19184
+ },
19043
19185
  {
19044
19186
  id: "media.play",
19045
19187
  method: "play",
@@ -20926,6 +21068,7 @@ var SYSTEM_CAP_VOCABULARY = {
20926
21068
  "audio-analyzer": system(PIPELINE),
20927
21069
  "audio-codec": system(INTERNAL),
20928
21070
  "auth-provider": system(IDENTITY),
21071
+ "board-key-source": system(INTERNAL),
20929
21072
  backup: system("system backups — run and restored from the Backups page"),
20930
21073
  broker: system("message-broker connections — configured, not actuated"),
20931
21074
  "calendar-source": system(INTERNAL),
@@ -20960,6 +21103,7 @@ var SYSTEM_CAP_VOCABULARY = {
20960
21103
  "load-contribution": system(INTERNAL),
20961
21104
  "local-network": system(NETWORK),
20962
21105
  "log-channels": system(INTERNAL),
21106
+ "integration-instances": system(INTERNAL),
20963
21107
  "log-destination": system(INTERNAL),
20964
21108
  "login-method": system(IDENTITY),
20965
21109
  "mesh-network": system(NETWORK),
@@ -43106,7 +43250,7 @@ var TargetKindCapsSchema = object({
43106
43250
  * the union is large and not meant for runtime validation here; the exported
43107
43251
  * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
43108
43252
  */
43109
- var ConfigSchemaPassthrough$3 = unknown();
43253
+ var ConfigSchemaPassthrough$4 = unknown();
43110
43254
  var TargetKindSchema = object({
43111
43255
  kind: string(),
43112
43256
  label: string(),
@@ -43143,7 +43287,7 @@ var TargetKindSchema = object({
43143
43287
  * its raster path, which is the safe default for an unknown image.
43144
43288
  */
43145
43289
  iconMediaType: string().optional(),
43146
- configSchema: ConfigSchemaPassthrough$3,
43290
+ configSchema: ConfigSchemaPassthrough$4,
43147
43291
  /**
43148
43292
  * The config keys that decide WHERE this kind's secrets are sent (server,
43149
43293
  * base URL, instance, chat, recipient). A save that changes any of them
@@ -45471,6 +45615,49 @@ object({
45471
45615
  });
45472
45616
  DeviceType.Sensor;
45473
45617
  /**
45618
+ * Why a board key could not be read. Typed so a caller reports the cause and
45619
+ * never treats "could not read" as "has no key" (D49).
45620
+ */
45621
+ var BoardKeyFailureReasonSchema = _enum([
45622
+ "unknown-source",
45623
+ "not-admin",
45624
+ "no-builder",
45625
+ "no-ingress-url",
45626
+ "unreachable",
45627
+ "unknown-board",
45628
+ "no-encryption-key",
45629
+ "unreadable-config"
45630
+ ]);
45631
+ var BoardKeySourceSchema = object({
45632
+ sourceId: string(),
45633
+ name: string()
45634
+ });
45635
+ var BoardKeyBoardSchema = object({
45636
+ /** The builder's file name, e.g. `kitchen.yaml`: the handle `getBoardKey` takes. */
45637
+ configuration: string(),
45638
+ /** The node name the builder gives the board. */
45639
+ name: string(),
45640
+ /** The address the builder knows the board by, when it has one. */
45641
+ address: string().nullable()
45642
+ });
45643
+ var BoardKeyFailureSchema = object({
45644
+ ok: literal(false),
45645
+ reason: BoardKeyFailureReasonSchema,
45646
+ detail: string().optional()
45647
+ });
45648
+ var ListBoardsResultSchema = discriminatedUnion("ok", [object({
45649
+ ok: literal(true),
45650
+ boards: array(BoardKeyBoardSchema).readonly()
45651
+ }), BoardKeyFailureSchema]);
45652
+ var GetBoardKeyResultSchema = discriminatedUnion("ok", [object({
45653
+ ok: literal(true),
45654
+ key: string()
45655
+ }), BoardKeyFailureSchema]);
45656
+ method(_void(), array(BoardKeySourceSchema).readonly(), { auth: "admin" }), method(object({ sourceId: string().min(1) }), ListBoardsResultSchema, { auth: "admin" }), method(object({
45657
+ sourceId: string().min(1),
45658
+ configuration: string().min(1)
45659
+ }), GetBoardKeyResultSchema, { auth: "admin" });
45660
+ /**
45474
45661
  * Dimmable-light brightness control. Co-exists with `switch` on the
45475
45662
  * same device — the switch toggles on/off, this cap sets the level
45476
45663
  * applied when the light is on. Drivers map their per-vendor dim
@@ -47559,6 +47746,188 @@ DeviceType.Control, method(object({
47559
47746
  kind: "mutation",
47560
47747
  auth: "protected"
47561
47748
  });
47749
+ /**
47750
+ * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
47751
+ * Apple TV, Spotify, Roku, generic OTT receivers, …) on
47752
+ * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
47753
+ * surface — those use `DeviceType.Camera` + the broker pipeline.
47754
+ *
47755
+ * The cap declares a wide method surface; not every backend supports
47756
+ * every method. Drivers signal sub-capability via the
47757
+ * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
47758
+ * corresponding method) so the UI gates buttons without a slice
47759
+ * fetch — same pattern as `PanTiltZoom` for cameras.
47760
+ */
47761
+ var MediaPlayerStateSchema = _enum([
47762
+ "off",
47763
+ "on",
47764
+ "idle",
47765
+ "playing",
47766
+ "paused",
47767
+ "buffering",
47768
+ "standby"
47769
+ ]);
47770
+ var MediaPlayerRepeatSchema = _enum([
47771
+ "off",
47772
+ "all",
47773
+ "one"
47774
+ ]);
47775
+ var MediaInfoSchema = object({
47776
+ /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
47777
+ * `podcast`, …). */
47778
+ type: string(),
47779
+ /** Human-readable title. */
47780
+ title: string(),
47781
+ /** Optional artist / channel / station label. */
47782
+ artist: string().optional(),
47783
+ /** Optional album / season / show name. */
47784
+ album: string().optional(),
47785
+ /** Optional cover-art / thumbnail URL. */
47786
+ imageUrl: string().optional()
47787
+ });
47788
+ /**
47789
+ * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
47790
+ * the device said so. `assumed`: the driver has no feedback (infrared) and
47791
+ * tracks what it last SENT; it moves only after a send was accepted, and a
47792
+ * human at the real remote makes it wrong. A UI shows an assumed value as a
47793
+ * guess, never as a reading.
47794
+ */
47795
+ var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
47796
+ /** The fields of a media-player status a driver can only guess. */
47797
+ var MediaPlayerAssumedFieldSchema = _enum([
47798
+ "state",
47799
+ "volumeLevel",
47800
+ "isMuted",
47801
+ "source"
47802
+ ]);
47803
+ var MediaPlayerStatusSchema = object({
47804
+ /** Playback lifecycle state. */
47805
+ state: MediaPlayerStateSchema,
47806
+ /**
47807
+ * Whether the state fields are readings or the driver's own bookkeeping.
47808
+ * A slice written before this field existed parses as `reported`.
47809
+ */
47810
+ stateSource: MediaPlayerStateSourceSchema.default("reported"),
47811
+ /**
47812
+ * Which fields are the driver's own guess. `stateSource` is `assumed` when
47813
+ * this is not empty; a field not listed here is a reading even then (power
47814
+ * from a running-state source, mute guessed from the last send).
47815
+ */
47816
+ assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
47817
+ /** Volume as 0..100 inclusive. Null when the device has no volume
47818
+ * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
47819
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
47820
+ /** Mute toggle distinct from volume=0. Null when no mute surface.
47821
+ * Pair with `DeviceFeature.MediaPlayerMute`. */
47822
+ isMuted: boolean().nullable(),
47823
+ /** Active source / input. Empty when no source surface. */
47824
+ source: string(),
47825
+ /** Selectable sources. Empty when no source surface.
47826
+ * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
47827
+ availableSources: array(string()),
47828
+ /** Currently-playing media info. Null when nothing is playing. */
47829
+ currentMedia: MediaInfoSchema.nullable(),
47830
+ /** Current playback position in ms. Null when not seekable or
47831
+ * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
47832
+ position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
47833
+ /** Total duration of the current media in ms. Null when unknown
47834
+ * (live stream) or nothing is playing. */
47835
+ duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
47836
+ /** Shuffle toggle. Null when no shuffle surface.
47837
+ * Pair with `DeviceFeature.MediaPlayerShuffle`. */
47838
+ shuffle: boolean().nullable(),
47839
+ /** Repeat mode. Null when no repeat surface.
47840
+ * Pair with `DeviceFeature.MediaPlayerRepeat`. */
47841
+ repeat: MediaPlayerRepeatSchema.nullable(),
47842
+ /** Ms epoch when the slice was last updated. */
47843
+ lastChangedAt: number()
47844
+ });
47845
+ var stepInput = object({
47846
+ deviceId: number().int().nonnegative(),
47847
+ /** How many presses: the caller's count (Alexa `volumeSteps`, `channelCount`). */
47848
+ steps: number().int().min(1).max(50).default(1)
47849
+ });
47850
+ var deviceOnly = object({ deviceId: number().int().nonnegative() });
47851
+ DeviceType.MediaPlayer, method(deviceOnly, _void(), {
47852
+ kind: "mutation",
47853
+ auth: "protected"
47854
+ }), method(deviceOnly, _void(), {
47855
+ kind: "mutation",
47856
+ auth: "protected"
47857
+ }), method(stepInput, _void(), {
47858
+ kind: "mutation",
47859
+ auth: "protected"
47860
+ }), method(stepInput, _void(), {
47861
+ kind: "mutation",
47862
+ auth: "protected"
47863
+ }), method(stepInput, _void(), {
47864
+ kind: "mutation",
47865
+ auth: "protected"
47866
+ }), method(stepInput, _void(), {
47867
+ kind: "mutation",
47868
+ auth: "protected"
47869
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
47870
+ kind: "mutation",
47871
+ auth: "protected"
47872
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
47873
+ kind: "mutation",
47874
+ auth: "protected"
47875
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
47876
+ kind: "mutation",
47877
+ auth: "protected"
47878
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
47879
+ kind: "mutation",
47880
+ auth: "protected"
47881
+ }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
47882
+ kind: "mutation",
47883
+ auth: "protected"
47884
+ }), method(object({
47885
+ deviceId: number().int().nonnegative(),
47886
+ position: number().int().nonnegative()
47887
+ }), _void(), {
47888
+ kind: "mutation",
47889
+ auth: "protected"
47890
+ }), method(object({
47891
+ deviceId: number().int().nonnegative(),
47892
+ volumeLevel: number().min(0).max(100)
47893
+ }), _void(), {
47894
+ kind: "mutation",
47895
+ auth: "protected"
47896
+ }), method(object({
47897
+ deviceId: number().int().nonnegative(),
47898
+ muted: boolean()
47899
+ }), _void(), {
47900
+ kind: "mutation",
47901
+ auth: "protected"
47902
+ }), method(object({
47903
+ deviceId: number().int().nonnegative(),
47904
+ shuffle: boolean()
47905
+ }), _void(), {
47906
+ kind: "mutation",
47907
+ auth: "protected"
47908
+ }), method(object({
47909
+ deviceId: number().int().nonnegative(),
47910
+ repeat: MediaPlayerRepeatSchema
47911
+ }), _void(), {
47912
+ kind: "mutation",
47913
+ auth: "protected"
47914
+ }), method(object({
47915
+ deviceId: number().int().nonnegative(),
47916
+ source: string().min(1)
47917
+ }), _void(), {
47918
+ kind: "mutation",
47919
+ auth: "protected"
47920
+ }), method(object({
47921
+ deviceId: number().int().nonnegative(),
47922
+ /** Media identifier / URL. */
47923
+ mediaId: string().min(1),
47924
+ /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
47925
+ * passes it through to the upstream service. */
47926
+ mediaType: string().min(1)
47927
+ }), _void(), {
47928
+ kind: "mutation",
47929
+ auth: "protected"
47930
+ });
47562
47931
  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;
47563
47932
  var NUMBER = {
47564
47933
  kind: "fixed",
@@ -48006,49 +48375,6 @@ function actuator(input) {
48006
48375
  };
48007
48376
  }
48008
48377
  new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
48009
- var PowerSourceRefusalReasonSchema = _enum([
48010
- "no-power-source",
48011
- "switch-missing",
48012
- "switch-offline",
48013
- "switch-unknown",
48014
- "restart-in-progress",
48015
- "switch-call-failed"
48016
- ]);
48017
- var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
48018
- accepted: literal(false),
48019
- reason: PowerSourceRefusalReasonSchema,
48020
- /** One line for the operator, naming the switch. */
48021
- message: string()
48022
- })]);
48023
- var PowerSourceInfoSchema = object({
48024
- /** False when the device has no power source linked; the rest is then empty. */
48025
- linked: boolean(),
48026
- switchDeviceId: number().nullable(),
48027
- switchName: string().nullable(),
48028
- /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
48029
- switchOn: boolean().nullable(),
48030
- switchOnline: boolean().nullable(),
48031
- restartInProgress: boolean(),
48032
- offSeconds: number().int()
48033
- });
48034
- object({
48035
- /** Null while the switch has not reported: unknown is never `false` (D393). */
48036
- switchOn: boolean().nullable(),
48037
- offSeconds: number().int(),
48038
- lastFetchedAt: number()
48039
- });
48040
- 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;
48041
- var deviceInput$2 = object({ deviceId: number().int().nonnegative() });
48042
- systemMethod(deviceInput$2, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
48043
- kind: "mutation",
48044
- auth: "admin"
48045
- }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
48046
- kind: "mutation",
48047
- auth: "admin"
48048
- }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
48049
- kind: "mutation",
48050
- auth: "admin"
48051
- });
48052
48378
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
48053
48379
  DeviceType.Camera;
48054
48380
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
@@ -48076,6 +48402,165 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
48076
48402
  }).optional()
48077
48403
  })) });
48078
48404
  /**
48405
+ * A saved Customize assignment (D936). The schema is the type: callers use
48406
+ * `z.infer`, they do not restate the shape.
48407
+ */
48408
+ var OverrideSourceSchema = object({
48409
+ addonId: string().min(1),
48410
+ stableId: string().min(1),
48411
+ cap: string().min(1),
48412
+ fieldPath: string().min(1)
48413
+ });
48414
+ var IdentityTransformDraftSchema = object({ kind: literal("identity") });
48415
+ var InvertTransformDraftSchema = object({ kind: literal("invert") });
48416
+ var ThresholdTransformDraftSchema = object({
48417
+ kind: literal("threshold"),
48418
+ comparison: _enum(["gte", "lte"]),
48419
+ threshold: number(),
48420
+ startDwellMs: number().nonnegative(),
48421
+ stopDwellMs: number().nonnegative()
48422
+ });
48423
+ var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
48424
+ IdentityTransformDraftSchema,
48425
+ InvertTransformDraftSchema,
48426
+ ThresholdTransformDraftSchema,
48427
+ object({
48428
+ kind: literal("linear"),
48429
+ scale: number(),
48430
+ offset: number(),
48431
+ clampMin: number().optional(),
48432
+ clampMax: number().optional()
48433
+ }),
48434
+ object({
48435
+ kind: literal("enum-map"),
48436
+ mapping: record(string(), string().nullable())
48437
+ }),
48438
+ object({ kind: literal("number") })
48439
+ ]);
48440
+ var ScalarOverrideDraftSchema = object({
48441
+ kind: literal("scalar"),
48442
+ cap: string().min(1),
48443
+ targetId: string().min(1),
48444
+ source: OverrideSourceSchema,
48445
+ transform: CustomizeTransformDraftSchema
48446
+ });
48447
+ var KeyedArrayOverrideDraftSchema = object({
48448
+ kind: literal("keyedArray"),
48449
+ cap: string().min(1),
48450
+ targetId: string().min(1),
48451
+ key: string().min(1),
48452
+ label: string().min(1),
48453
+ fieldPath: string().min(1),
48454
+ source: OverrideSourceSchema,
48455
+ transform: CustomizeTransformDraftSchema
48456
+ });
48457
+ var PulseOverrideDraftSchema = object({
48458
+ kind: literal("pulse"),
48459
+ cap: string().min(1),
48460
+ targetId: string().min(1),
48461
+ enabled: boolean(),
48462
+ debounceMs: number().nonnegative(),
48463
+ edges: array(_enum([
48464
+ "rising",
48465
+ "button",
48466
+ "native-event"
48467
+ ])).min(1).optional(),
48468
+ sources: array(OverrideSourceSchema).min(1)
48469
+ });
48470
+ var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
48471
+ "in-addition",
48472
+ "confirm",
48473
+ "replace"
48474
+ ]).optional() });
48475
+ discriminatedUnion("kind", [
48476
+ ScalarOverrideDraftSchema,
48477
+ KeyedArrayOverrideDraftSchema,
48478
+ PulseOverrideDraftSchema,
48479
+ object({
48480
+ kind: literal("span"),
48481
+ cap: string().min(1),
48482
+ targetId: string().min(1),
48483
+ timeoutMs: number().nonnegative(),
48484
+ cooldownMs: number().nonnegative().optional(),
48485
+ sources: array(SpanSourceDraftSchema)
48486
+ })
48487
+ ]);
48488
+ object({
48489
+ targetId: string().min(1),
48490
+ configured: boolean(),
48491
+ source: _enum(["native", "assigned"]),
48492
+ state: _enum([
48493
+ "active",
48494
+ "stale",
48495
+ "released",
48496
+ "unavailable"
48497
+ ]),
48498
+ reason: string().nullable()
48499
+ });
48500
+ /**
48501
+ * What a running-threshold proposal says (planning#405). The schema is the
48502
+ * type: the algorithm, the capability method and the UI all read `z.infer`.
48503
+ *
48504
+ * A proposal is read-only advice: it carries the numbers it was derived from
48505
+ * (`evidence`) so the operator can judge it, and an `insufficient` answer names
48506
+ * WHY with a typed reason and the catalog defaults, never an invented number.
48507
+ */
48508
+ var RunningProposalTierSchema = _enum(["raw", "5m"]);
48509
+ var RunningProposalConfidenceSchema = _enum([
48510
+ "high",
48511
+ "medium",
48512
+ "low"
48513
+ ]);
48514
+ var RunningProposalInsufficientReasonSchema = _enum([
48515
+ "no-history",
48516
+ "span-too-short",
48517
+ "truncated",
48518
+ "no-idle-floor",
48519
+ "no-runs",
48520
+ "no-separation"
48521
+ ]);
48522
+ var RunningProposalReplaySchema = object({
48523
+ /** Intervals the real dwell expression held true over the window. */
48524
+ intervals: number().int().nonnegative(),
48525
+ /** Intervals outside every run, or a second interval inside one. */
48526
+ extra: number().int().nonnegative(),
48527
+ /** Runs without an interval of their own (none, or merged into a neighbour). */
48528
+ missed: number().int().nonnegative()
48529
+ });
48530
+ var RunningProposalEvidenceSchema = object({
48531
+ tier: RunningProposalTierSchema,
48532
+ spanMs: number().nonnegative(),
48533
+ from: number(),
48534
+ to: number(),
48535
+ points: number().int().nonnegative(),
48536
+ runsFound: number().int().nonnegative(),
48537
+ pausesFound: number().int().nonnegative(),
48538
+ longestPauseMs: number().nonnegative(),
48539
+ idleFloorW: number(),
48540
+ noiseCeilingW: number(),
48541
+ plateauW: number(),
48542
+ replay: RunningProposalReplaySchema
48543
+ });
48544
+ var RunningProposalInsufficientEvidenceSchema = object({
48545
+ spanMs: number().nonnegative(),
48546
+ points: number().int().nonnegative(),
48547
+ runsFound: number().int().nonnegative()
48548
+ });
48549
+ var RunningThresholdProposalSchema = discriminatedUnion("state", [object({
48550
+ state: literal("proposal"),
48551
+ transform: ThresholdTransformDraftSchema,
48552
+ evidence: RunningProposalEvidenceSchema,
48553
+ confidence: RunningProposalConfidenceSchema,
48554
+ /** Why the confidence is not higher; empty when nothing held it back. */
48555
+ notes: array(string())
48556
+ }), object({
48557
+ state: literal("insufficient"),
48558
+ reason: RunningProposalInsufficientReasonSchema,
48559
+ evidence: RunningProposalInsufficientEvidenceSchema,
48560
+ /** The catalog defaults, offered as what stands when nothing better is known. */
48561
+ fallback: ThresholdTransformDraftSchema
48562
+ })]);
48563
+ /**
48079
48564
  * The report of a one-shot "move this owner's plaintext secrets into the
48080
48565
  * keychain" run (D878). COUNTS only - never a value, never a ref.
48081
48566
  *
@@ -48365,6 +48850,14 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
48365
48850
  kind: "mutation",
48366
48851
  auth: "admin",
48367
48852
  access: "view"
48853
+ }), method(object({
48854
+ deviceId: number().int(),
48855
+ cap: string().min(1),
48856
+ fieldPath: string().min(1),
48857
+ deviceType: _enum(DeviceType).optional()
48858
+ }), RunningThresholdProposalSchema, {
48859
+ auth: "admin",
48860
+ access: "view"
48368
48861
  }), method(object({
48369
48862
  blockId: string().min(1),
48370
48863
  trace: AutomationRunTraceSchema.optional(),
@@ -49173,7 +49666,53 @@ method(object({
49173
49666
  * exposes only the COMMON surface: link state, supported device
49174
49667
  * kinds (so the UI can filter the device picker), and per-device
49175
49668
  * expose/unexpose.
49669
+ *
49670
+ * INSTANCES. One export addon can serve several independent targets (a
49671
+ * HomeKit bridge, a Home Assistant broker). `listInstances` names them.
49672
+ * `instanceId` on a READ is optional: absent = the whole addon (linked if any
49673
+ * enabled instance is, `exposedDeviceCount` = distinct devices, `setup` = the
49674
+ * default instance's); present = that instance; an id the provider does not
49675
+ * serve is refused with `ExportInstanceUnknownError` (`export-instance-unknown`),
49676
+ * never answered empty. `instanceId` on a WRITE is REQUIRED: a membership
49677
+ * change always names the target it changes. A single-instance provider
49678
+ * accepts an absent id on a read or its own id, and refuses any other.
49679
+ */
49680
+ /** Which instance of an export addon a call addresses. Absent on a read = the whole addon. */
49681
+ var InstanceIdSchema$1 = string().min(1);
49682
+ var InstancePinSchema = object({ instanceId: InstanceIdSchema$1.optional() });
49683
+ /** One independent export target of an addon. */
49684
+ var ExportInstanceSchema = object({
49685
+ instanceId: InstanceIdSchema$1,
49686
+ name: string(),
49687
+ enabled: boolean(),
49688
+ kind: string().optional()
49689
+ });
49690
+ var EXPORT_INSTANCE_UNKNOWN = "export-instance-unknown";
49691
+ /** The named failure of an `instanceId` the provider does not serve. The message starts with the code. */
49692
+ var ExportInstanceUnknownError = class extends Error {
49693
+ code = EXPORT_INSTANCE_UNKNOWN;
49694
+ instanceId;
49695
+ constructor(addon, instanceId) {
49696
+ super(`${EXPORT_INSTANCE_UNKNOWN}: ${addon} serves no instance "${instanceId}"`);
49697
+ this.name = "ExportInstanceUnknownError";
49698
+ this.instanceId = instanceId;
49699
+ }
49700
+ };
49701
+ /**
49702
+ * The instance a `getStatus` call names. The cap's `status` block injects a per-device
49703
+ * `getStatus({ deviceId })` beside the method's own `{ instanceId? }`, so the provider sees
49704
+ * both shapes; only the second names an instance (a per-device status read is addon-wide).
49176
49705
  */
49706
+ function statusInstanceOf(input) {
49707
+ return "instanceId" in input ? input.instanceId : void 0;
49708
+ }
49709
+ /**
49710
+ * A single-instance provider's check: an absent id or its own passes, any other throws
49711
+ * `ExportInstanceUnknownError`.
49712
+ */
49713
+ function assertOwnExportInstance(addon, own, instanceId) {
49714
+ if (instanceId !== void 0 && instanceId !== own) throw new ExportInstanceUnknownError(addon, instanceId);
49715
+ }
49177
49716
  var LinkStateSchema = _enum([
49178
49717
  "unlinked",
49179
49718
  "linked",
@@ -49224,10 +49763,14 @@ var ExposedDeviceSchema = object({
49224
49763
  capabilities: array(string()).optional()
49225
49764
  });
49226
49765
  var ExposeInputSchema = object({
49766
+ instanceId: InstanceIdSchema$1,
49227
49767
  deviceId: string(),
49228
49768
  capabilities: array(string()).optional()
49229
49769
  });
49230
- var UnexposeInputSchema = object({ deviceId: string() });
49770
+ var UnexposeInputSchema = object({
49771
+ instanceId: InstanceIdSchema$1,
49772
+ deviceId: string()
49773
+ });
49231
49774
  /**
49232
49775
  * What an exporter may expose besides devices (D968). An action and a
49233
49776
  * notification target are LIST ENTRIES, never devices (D954): they enter an
@@ -49256,8 +49799,14 @@ var ExposedEntitySchema = object({
49256
49799
  entity: ExportEntityRefSchema,
49257
49800
  exposedAs: string().optional()
49258
49801
  });
49259
- var ExposeEntityInputSchema = object({ entity: ExportEntityRefSchema });
49260
- var UnexposeEntityInputSchema = object({ entity: ExportEntityRefSchema });
49802
+ var ExposeEntityInputSchema = object({
49803
+ instanceId: InstanceIdSchema$1,
49804
+ entity: ExportEntityRefSchema
49805
+ });
49806
+ var UnexposeEntityInputSchema = object({
49807
+ instanceId: InstanceIdSchema$1,
49808
+ entity: ExportEntityRefSchema
49809
+ });
49261
49810
  var deviceExportCapability = {
49262
49811
  name: "device-export",
49263
49812
  scope: "system",
@@ -49277,9 +49826,10 @@ var deviceExportCapability = {
49277
49826
  */
49278
49827
  exposesDeviceSettings: true,
49279
49828
  methods: {
49280
- getStatus: method(_void(), DeviceExportStatusSchema),
49281
- listSupportedDeviceKinds: method(_void(), array(DeviceKindSchema)),
49282
- listExposedDevices: method(_void(), array(ExposedDeviceSchema)),
49829
+ getStatus: method(InstancePinSchema, DeviceExportStatusSchema),
49830
+ listInstances: method(_void(), array(ExportInstanceSchema)),
49831
+ listSupportedDeviceKinds: method(InstancePinSchema, array(DeviceKindSchema)),
49832
+ listExposedDevices: method(InstancePinSchema, array(ExposedDeviceSchema)),
49283
49833
  exposeDevice: method(ExposeInputSchema, _void(), {
49284
49834
  kind: "mutation",
49285
49835
  auth: "admin"
@@ -49289,7 +49839,7 @@ var deviceExportCapability = {
49289
49839
  auth: "admin"
49290
49840
  }),
49291
49841
  listSupportedEntityKinds: optionalMethod(_void(), array(ExportEntityKindSchema)),
49292
- listExposedEntities: optionalMethod(_void(), array(ExposedEntitySchema)),
49842
+ listExposedEntities: optionalMethod(InstancePinSchema, array(ExposedEntitySchema)),
49293
49843
  exposeEntity: optionalMethod(ExposeEntityInputSchema, _void(), {
49294
49844
  kind: "mutation",
49295
49845
  auth: "admin"
@@ -51173,7 +51723,7 @@ object({
51173
51723
  /** Ms epoch of the last value received from the appliance; 0 = never. */
51174
51724
  lastFetchedAt: number()
51175
51725
  });
51176
- var DeviceIdSchema$1 = number().int().nonnegative();
51726
+ var DeviceIdSchema$2 = number().int().nonnegative();
51177
51727
  /** A value a program option or setting can take. */
51178
51728
  var DishwasherValueSchema = union([
51179
51729
  boolean(),
@@ -51237,77 +51787,77 @@ var DishwasherOptionsSchema = object({
51237
51787
  options: array(DishwasherOptionDescriptorSchema)
51238
51788
  });
51239
51789
  DeviceType.Dishwasher, method(object({
51240
- deviceId: DeviceIdSchema$1,
51790
+ deviceId: DeviceIdSchema$2,
51241
51791
  program: string().min(1).optional(),
51242
51792
  options: record(string(), DishwasherValueSchema).optional()
51243
51793
  }), _void(), {
51244
51794
  kind: "mutation",
51245
51795
  auth: "protected"
51246
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
51796
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51247
51797
  kind: "mutation",
51248
51798
  auth: "protected"
51249
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
51799
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51250
51800
  kind: "mutation",
51251
51801
  auth: "protected"
51252
- }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
51802
+ }), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
51253
51803
  kind: "mutation",
51254
51804
  auth: "protected"
51255
51805
  }), method(object({
51256
- deviceId: DeviceIdSchema$1,
51806
+ deviceId: DeviceIdSchema$2,
51257
51807
  program: string().min(1)
51258
51808
  }), _void(), {
51259
51809
  kind: "mutation",
51260
51810
  auth: "protected"
51261
51811
  }), method(object({
51262
- deviceId: DeviceIdSchema$1,
51812
+ deviceId: DeviceIdSchema$2,
51263
51813
  on: boolean()
51264
51814
  }), _void(), {
51265
51815
  kind: "mutation",
51266
51816
  auth: "protected"
51267
51817
  }), method(object({
51268
- deviceId: DeviceIdSchema$1,
51818
+ deviceId: DeviceIdSchema$2,
51269
51819
  on: boolean()
51270
51820
  }), _void(), {
51271
51821
  kind: "mutation",
51272
51822
  auth: "protected"
51273
51823
  }), method(object({
51274
- deviceId: DeviceIdSchema$1,
51824
+ deviceId: DeviceIdSchema$2,
51275
51825
  on: boolean()
51276
51826
  }), _void(), {
51277
51827
  kind: "mutation",
51278
51828
  auth: "protected"
51279
51829
  }), method(object({
51280
- deviceId: DeviceIdSchema$1,
51830
+ deviceId: DeviceIdSchema$2,
51281
51831
  on: boolean()
51282
51832
  }), _void(), {
51283
51833
  kind: "mutation",
51284
51834
  auth: "protected"
51285
51835
  }), method(object({
51286
- deviceId: DeviceIdSchema$1,
51836
+ deviceId: DeviceIdSchema$2,
51287
51837
  on: boolean()
51288
51838
  }), _void(), {
51289
51839
  kind: "mutation",
51290
51840
  auth: "protected"
51291
51841
  }), method(object({
51292
- deviceId: DeviceIdSchema$1,
51842
+ deviceId: DeviceIdSchema$2,
51293
51843
  on: boolean()
51294
51844
  }), _void(), {
51295
51845
  kind: "mutation",
51296
51846
  auth: "protected"
51297
51847
  }), method(object({
51298
- deviceId: DeviceIdSchema$1,
51848
+ deviceId: DeviceIdSchema$2,
51299
51849
  on: boolean()
51300
51850
  }), _void(), {
51301
51851
  kind: "mutation",
51302
51852
  auth: "protected"
51303
51853
  }), method(object({
51304
- deviceId: DeviceIdSchema$1,
51854
+ deviceId: DeviceIdSchema$2,
51305
51855
  key: string().min(1),
51306
51856
  value: DishwasherValueSchema
51307
51857
  }), _void(), {
51308
51858
  kind: "mutation",
51309
51859
  auth: "protected"
51310
- }), method(object({ deviceId: DeviceIdSchema$1 }), DishwasherOptionsSchema, { auth: "protected" });
51860
+ }), method(object({ deviceId: DeviceIdSchema$2 }), DishwasherOptionsSchema, { auth: "protected" });
51311
51861
  /**
51312
51862
  * Palette entry ids (D939). Audio is the one gradient; `audio-*` leaves are
51313
51863
  * not entries. `heatmapScrub` is a mark, not an event kind.
@@ -52494,15 +53044,15 @@ var FanPresetCaptureResultSchema = object({
52494
53044
  items: array(FanCaptureItemSchema),
52495
53045
  omitted: array(FanCaptureOmissionSchema)
52496
53046
  });
52497
- var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
53047
+ var deviceInput$2 = object({ deviceId: number().int().nonnegative() });
52498
53048
  DeviceType.Fan;
52499
- method(deviceInput$1, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$1.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
53049
+ method(deviceInput$2, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$2.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
52500
53050
  kind: "mutation",
52501
53051
  auth: "admin"
52502
- }), method(deviceInput$1.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
53052
+ }), method(deviceInput$2.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
52503
53053
  kind: "mutation",
52504
53054
  auth: "protected"
52505
- }), method(deviceInput$1.extend({
53055
+ }), method(deviceInput$2.extend({
52506
53056
  fields: array(FanCaptureFieldSchema).optional(),
52507
53057
  steps: array(ActionStepSchema).max(20).default([])
52508
53058
  }), FanPresetCaptureResultSchema, { auth: "protected" });
@@ -53006,6 +53556,133 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
53006
53556
  auth: "admin"
53007
53557
  });
53008
53558
  /**
53559
+ * `integration-instances` - the connection of an addon that holds ONE or SEVERAL
53560
+ * (an account, a relay, a destination) as typed records (D985, D986). The addon's
53561
+ * own function page reads and writes them (Logging for Loki); the Integrations
53562
+ * page lists only the integrations that bring devices (D996).
53563
+ *
53564
+ * A collection of providers: each addon that holds connections registers one and a
53565
+ * caller reaches a provider with the pinned `addonId`.
53566
+ *
53567
+ * Identity: the instance id is immutable and opaque to the caller. A record the
53568
+ * Loki migration made keeps the `integrations` registry id it was created under
53569
+ * (`int_NNNN`); a single instance made by its function page takes the addon id.
53570
+ * `name` is the editable label.
53571
+ *
53572
+ * Secrets: every field the instance kind marks `.meta({ secret: true })` reaches
53573
+ * the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
53574
+ * or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
53575
+ * clears it.
53576
+ */
53577
+ var ConfigSchemaPassthrough$3 = custom();
53578
+ var IntegrationInstanceIdSchema = string().min(1);
53579
+ var IntegrationInstanceModeSchema = _enum(["single", "multiple"]);
53580
+ /**
53581
+ * One kind of instance a provider can create (an adapter, an account type). The sign-in and
53582
+ * connect fields follow the `broker` contract (`broker.cap.ts`): `signIn.basePath` is a
53583
+ * hub-relative route set speaking the sign-in contract, `connectPath` / `disconnectPath` open an
53584
+ * interactive account link (popup) and may carry `{{brokerId}}`, which the UI replaces with the
53585
+ * instance id.
53586
+ */
53587
+ var IntegrationInstanceKindSchema = object({
53588
+ /** Stable id of the kind, sent back as `createInstance.kind`. */
53589
+ id: string().min(1),
53590
+ label: string().min(1),
53591
+ /** The kind signs in through a server-held interactive session. */
53592
+ signIn: object({
53593
+ basePath: string().min(1),
53594
+ methods: array(_enum(["device-code", "proxy"])).optional()
53595
+ }).optional(),
53596
+ /** Relative hub path to start an interactive account link of an instance of this kind. */
53597
+ connectPath: string().min(1).optional(),
53598
+ /** Relative hub path to disconnect that account. */
53599
+ disconnectPath: string().min(1).optional()
53600
+ });
53601
+ var IntegrationInstanceDescriptionSchema = object({
53602
+ /** `single`: at most one instance can exist (Loki). `multiple`: an account each. */
53603
+ instanceMode: IntegrationInstanceModeSchema,
53604
+ /** What the instance is, for the UI (`destination`, `relay`, `account`). */
53605
+ kind: string(),
53606
+ /** True when `testInstance` really probes the remote. */
53607
+ canTest: boolean(),
53608
+ /**
53609
+ * The kinds an instance can be of. Absent or one entry: nothing to choose; more than one: the
53610
+ * Add flow asks which first and sends it as `createInstance.kind`.
53611
+ */
53612
+ kinds: array(IntegrationInstanceKindSchema).optional(),
53613
+ /**
53614
+ * The provider accepts `createInstance.id` for an id that once existed (an adopted id, because
53615
+ * devices carry it). The UI then offers "restore under its old id" on Add. Absent means no.
53616
+ */
53617
+ allowRestoreId: boolean().optional(),
53618
+ /**
53619
+ * `createInstance` without an `id` works: the provider mints it. Absent means the caller must
53620
+ * send an id (the UI then mints an opaque one).
53621
+ */
53622
+ mintsId: boolean().optional()
53623
+ });
53624
+ var IntegrationInstanceStatusSchema = object({
53625
+ state: _enum([
53626
+ "ok",
53627
+ "off",
53628
+ "error",
53629
+ "unknown"
53630
+ ]),
53631
+ detail: string().optional(),
53632
+ /** A short human word for the state ("Signed in", "Token expired"); shown instead of `state`. */
53633
+ label: string().optional()
53634
+ });
53635
+ var IntegrationInstanceSchema = object({
53636
+ id: IntegrationInstanceIdSchema,
53637
+ name: string(),
53638
+ /** The addon's own rule (an URL is present, a client id is present...). */
53639
+ configured: boolean(),
53640
+ /**
53641
+ * The instance's own on/off switch (D996): always present, derived from the record body
53642
+ * (`enabled !== false`, so a row written before the field existed is on).
53643
+ */
53644
+ enabled: boolean(),
53645
+ /** The kind of this instance (one of `describe().kinds[].id`), when the provider has kinds. */
53646
+ kind: string().optional(),
53647
+ /** Values for the instance form; a secret is a `SecretFieldView`, never text. */
53648
+ formValues: record(string(), unknown()),
53649
+ status: IntegrationInstanceStatusSchema.optional(),
53650
+ /** Epoch ms of the last probe of the remote that produced `status`; absent when never checked. */
53651
+ lastCheckedAt: number().optional()
53652
+ });
53653
+ var IntegrationInstancePatchSchema = object({
53654
+ id: IntegrationInstanceIdSchema,
53655
+ name: string().min(1).optional(),
53656
+ /** Omitted / '' / redaction token keeps a secret; `{ $secretClear: true }` clears it. */
53657
+ values: record(string(), unknown())
53658
+ });
53659
+ 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({
53660
+ id: IntegrationInstanceIdSchema.optional(),
53661
+ name: string().min(1),
53662
+ kind: string().min(1).optional()
53663
+ }), object({ id: string() }), {
53664
+ kind: "mutation",
53665
+ auth: "admin"
53666
+ }), method(IntegrationInstancePatchSchema, object({ ok: literal(true) }), {
53667
+ kind: "mutation",
53668
+ auth: "admin"
53669
+ }), method(object({
53670
+ id: IntegrationInstanceIdSchema,
53671
+ enabled: boolean()
53672
+ }), object({ ok: literal(true) }), {
53673
+ kind: "mutation",
53674
+ auth: "admin"
53675
+ }), method(object({ id: IntegrationInstanceIdSchema }), object({ ok: literal(true) }), {
53676
+ kind: "mutation",
53677
+ auth: "admin"
53678
+ }), optionalMethod(object({
53679
+ id: IntegrationInstanceIdSchema.nullable(),
53680
+ values: record(string(), unknown())
53681
+ }), TestConnectionResultSchema$1, {
53682
+ kind: "mutation",
53683
+ auth: "admin"
53684
+ });
53685
+ /**
53009
53686
  * Two-way audio / talk-back cap. Clients open a WebRTC audio-only
53010
53687
  * session (server-initiated offer pattern, identical to the main
53011
53688
  * video WebRTC flow) and the browser captures the mic; the server
@@ -54803,6 +55480,11 @@ var LogEntrySchema = object({
54803
55480
  * flight, and not asking for the next slice ends the scan.
54804
55481
  */
54805
55482
  var LogReadQuerySchema = object({
55483
+ /**
55484
+ * Which destination INSTANCE answers (a destination addon may hold several records). Absent ⇒
55485
+ * the provider's first readable one, so a caller written before instances existed is unchanged.
55486
+ */
55487
+ instanceId: string().min(1).max(200).optional(),
54806
55488
  /** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
54807
55489
  requestId: string().min(1).max(64).optional(),
54808
55490
  /** The device the line is about (`tags.deviceId`, numeric). */
@@ -54865,6 +55547,8 @@ var LogReadResultSchema = object({
54865
55547
  /** True when `cancelRead` ended this slice early. */
54866
55548
  cancelled: boolean().optional()
54867
55549
  });
55550
+ /** Names one destination instance; absent ⇒ the provider's first readable one. */
55551
+ var LogInstanceSelectorSchema = object({ instanceId: string().min(1).max(200).optional() });
54868
55552
  var LogReadCapabilitiesSchema = object({
54869
55553
  /** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
54870
55554
  readable: boolean(),
@@ -54883,7 +55567,7 @@ var LogReadCapabilitiesSchema = object({
54883
55567
  /** How far back the store reaches, when the provider knows (days). */
54884
55568
  retentionDays: number().nullable()
54885
55569
  });
54886
- 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() }), {
55570
+ 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() }), {
54887
55571
  kind: "mutation",
54888
55572
  auth: "admin"
54889
55573
  });
@@ -54987,164 +55671,6 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
54987
55671
  ]);
54988
55672
  method(_void(), array(LoginMethodContributionSchema).readonly());
54989
55673
  /**
54990
- * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
54991
- * Apple TV, Spotify, Roku, generic OTT receivers, …) on
54992
- * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
54993
- * surface — those use `DeviceType.Camera` + the broker pipeline.
54994
- *
54995
- * The cap declares a wide method surface; not every backend supports
54996
- * every method. Drivers signal sub-capability via the
54997
- * `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
54998
- * corresponding method) so the UI gates buttons without a slice
54999
- * fetch — same pattern as `PanTiltZoom` for cameras.
55000
- */
55001
- var MediaPlayerStateSchema = _enum([
55002
- "off",
55003
- "on",
55004
- "idle",
55005
- "playing",
55006
- "paused",
55007
- "buffering",
55008
- "standby"
55009
- ]);
55010
- var MediaPlayerRepeatSchema = _enum([
55011
- "off",
55012
- "all",
55013
- "one"
55014
- ]);
55015
- var MediaInfoSchema = object({
55016
- /** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
55017
- * `podcast`, …). */
55018
- type: string(),
55019
- /** Human-readable title. */
55020
- title: string(),
55021
- /** Optional artist / channel / station label. */
55022
- artist: string().optional(),
55023
- /** Optional album / season / show name. */
55024
- album: string().optional(),
55025
- /** Optional cover-art / thumbnail URL. */
55026
- imageUrl: string().optional()
55027
- });
55028
- /**
55029
- * Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
55030
- * the device said so. `assumed`: the driver has no feedback (infrared) and
55031
- * tracks what it last SENT; it moves only after a send was accepted, and a
55032
- * human at the real remote makes it wrong. A UI shows an assumed value as a
55033
- * guess, never as a reading.
55034
- */
55035
- var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
55036
- /** The fields of a media-player status a driver can only guess. */
55037
- var MediaPlayerAssumedFieldSchema = _enum([
55038
- "state",
55039
- "volumeLevel",
55040
- "isMuted",
55041
- "source"
55042
- ]);
55043
- object({
55044
- /** Playback lifecycle state. */
55045
- state: MediaPlayerStateSchema,
55046
- /**
55047
- * Whether the state fields are readings or the driver's own bookkeeping.
55048
- * A slice written before this field existed parses as `reported`.
55049
- */
55050
- stateSource: MediaPlayerStateSourceSchema.default("reported"),
55051
- /**
55052
- * Which fields are the driver's own guess. `stateSource` is `assumed` when
55053
- * this is not empty; a field not listed here is a reading even then (power
55054
- * from a running-state source, mute guessed from the last send).
55055
- */
55056
- assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
55057
- /** Volume as 0..100 inclusive. Null when the device has no volume
55058
- * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
55059
- volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
55060
- /** Mute toggle distinct from volume=0. Null when no mute surface.
55061
- * Pair with `DeviceFeature.MediaPlayerMute`. */
55062
- isMuted: boolean().nullable(),
55063
- /** Active source / input. Empty when no source surface. */
55064
- source: string(),
55065
- /** Selectable sources. Empty when no source surface.
55066
- * Pair with `DeviceFeature.MediaPlayerSelectSource`. */
55067
- availableSources: array(string()),
55068
- /** Currently-playing media info. Null when nothing is playing. */
55069
- currentMedia: MediaInfoSchema.nullable(),
55070
- /** Current playback position in ms. Null when not seekable or
55071
- * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
55072
- position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
55073
- /** Total duration of the current media in ms. Null when unknown
55074
- * (live stream) or nothing is playing. */
55075
- duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
55076
- /** Shuffle toggle. Null when no shuffle surface.
55077
- * Pair with `DeviceFeature.MediaPlayerShuffle`. */
55078
- shuffle: boolean().nullable(),
55079
- /** Repeat mode. Null when no repeat surface.
55080
- * Pair with `DeviceFeature.MediaPlayerRepeat`. */
55081
- repeat: MediaPlayerRepeatSchema.nullable(),
55082
- /** Ms epoch when the slice was last updated. */
55083
- lastChangedAt: number()
55084
- });
55085
- DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }), _void(), {
55086
- kind: "mutation",
55087
- auth: "protected"
55088
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55089
- kind: "mutation",
55090
- auth: "protected"
55091
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55092
- kind: "mutation",
55093
- auth: "protected"
55094
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55095
- kind: "mutation",
55096
- auth: "protected"
55097
- }), method(object({ deviceId: number().int().nonnegative() }), _void(), {
55098
- kind: "mutation",
55099
- auth: "protected"
55100
- }), method(object({
55101
- deviceId: number().int().nonnegative(),
55102
- position: number().int().nonnegative()
55103
- }), _void(), {
55104
- kind: "mutation",
55105
- auth: "protected"
55106
- }), method(object({
55107
- deviceId: number().int().nonnegative(),
55108
- volumeLevel: number().min(0).max(100)
55109
- }), _void(), {
55110
- kind: "mutation",
55111
- auth: "protected"
55112
- }), method(object({
55113
- deviceId: number().int().nonnegative(),
55114
- muted: boolean()
55115
- }), _void(), {
55116
- kind: "mutation",
55117
- auth: "protected"
55118
- }), method(object({
55119
- deviceId: number().int().nonnegative(),
55120
- shuffle: boolean()
55121
- }), _void(), {
55122
- kind: "mutation",
55123
- auth: "protected"
55124
- }), method(object({
55125
- deviceId: number().int().nonnegative(),
55126
- repeat: MediaPlayerRepeatSchema
55127
- }), _void(), {
55128
- kind: "mutation",
55129
- auth: "protected"
55130
- }), method(object({
55131
- deviceId: number().int().nonnegative(),
55132
- source: string().min(1)
55133
- }), _void(), {
55134
- kind: "mutation",
55135
- auth: "protected"
55136
- }), method(object({
55137
- deviceId: number().int().nonnegative(),
55138
- /** Media identifier / URL. */
55139
- mediaId: string().min(1),
55140
- /** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
55141
- * passes it through to the upstream service. */
55142
- mediaType: string().min(1)
55143
- }), _void(), {
55144
- kind: "mutation",
55145
- auth: "protected"
55146
- });
55147
- /**
55148
55674
  * mesh-network — collection cap for mesh-VPN providers.
55149
55675
  *
55150
55676
  * Different shape from `network-access` (public tunnels):
@@ -63038,7 +63564,14 @@ var NcMediaPolicySchema = object({
63038
63564
  */
63039
63565
  profile: CamProfileSchema.optional(),
63040
63566
  /** See {@link NcLinkedCameraModeSchema}. */
63041
- linkedCameras: NcLinkedCameraModeSchema.optional()
63567
+ linkedCameras: NcLinkedCameraModeSchema.optional(),
63568
+ /**
63569
+ * Sensor rules only: may this rule wake a SLEEPING battery camera to take
63570
+ * the linked still it attaches (D998)? Absent means yes, an explicit `false`
63571
+ * opts out. Deliberately not a Zod default: a rule that never chose keeps
63572
+ * following the hub's. One bounded wake per event; nothing is attached later.
63573
+ */
63574
+ wakeSleepingCamera: boolean().optional()
63042
63575
  });
63043
63576
  /**
63044
63577
  * Cooldown GRANULARITY over the subject's class — how much a fired
@@ -63430,6 +63963,21 @@ var NcTemplateVarKindSchema = _enum([
63430
63963
  "sound",
63431
63964
  "system"
63432
63965
  ]);
63966
+ /**
63967
+ * The default title/body a rule of one SITUATION is delivered with when the
63968
+ * operator wrote no template — served so an editor can pre-fill it (and the
63969
+ * operator can rebuild it from placeholders) instead of starting from a blank
63970
+ * box that, once saved, silently replaces it. `id` names the situation inside
63971
+ * a rule `kind`: `appliance-cycle` is a `sensor` rule whose device is an
63972
+ * appliance finishing a cycle. Texts are raw templates (`{{var}}` intact), in
63973
+ * the hub's current language and with its overrides applied.
63974
+ */
63975
+ var NcTemplateDefaultSchema = object({
63976
+ id: _enum(["appliance-cycle"]),
63977
+ kind: NcRuleKindSchema,
63978
+ title: string(),
63979
+ body: string()
63980
+ });
63433
63981
  /** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
63434
63982
  var NcTemplateFamilySchema = _enum([
63435
63983
  "rule",
@@ -64285,7 +64833,11 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
64285
64833
  }), method(object({}), object({
64286
64834
  catalog: array(NcConditionDescriptorSchema),
64287
64835
  taxonomy: NcTaxonomySchema.optional()
64288
- })), method(object({}), object({ vars: array(NcTemplateVarDescriptorSchema) })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
64836
+ })), method(object({}), object({
64837
+ vars: array(NcTemplateVarDescriptorSchema),
64838
+ /** Per-situation default texts; absent on a hub that predates them. */
64839
+ defaults: array(NcTemplateDefaultSchema)
64840
+ })), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
64289
64841
  kind: "mutation",
64290
64842
  access: "view"
64291
64843
  }), 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 }), {
@@ -65049,52 +65601,27 @@ object({
65049
65601
  empty: boolean().nullable(),
65050
65602
  /** True while the pump is running. Null while unknown. */
65051
65603
  pumpRunning: boolean().nullable(),
65052
- /** True when the pump works on an on/off duty cycle rather than continuously. */
65053
- pumpIntervalEnabled: boolean().nullable(),
65054
- /** How long the pump runs per cycle, in seconds. */
65055
- pumpOnTime: number().min(0).nullable().meta(readingMeta("duration")),
65056
- /** How long the pump rests per cycle, in seconds. */
65057
- pumpOffTime: number().min(0).nullable().meta(readingMeta("duration")),
65058
65604
  /** Water drunk in the last drink, in litres. */
65059
65605
  lastDrink: number().min(0).nullable().meta(readingMeta("volume")),
65060
65606
  /** Water drunk in the current hour, in litres. */
65061
65607
  currentHourDrink: number().min(0).nullable().meta(readingMeta("volume")),
65062
65608
  /** Water drunk over the last 24 hours (rolling), in litres. */
65063
65609
  last24hDrink: number().min(0).nullable().meta(readingMeta("volume")),
65064
- /** Water drunk since local midnight, in litres. */
65610
+ /** Water drunk since local midnight, in litres. Null when the fountain has no such sensor. */
65065
65611
  todayDrink: number().min(0).nullable().meta(readingMeta("volume")),
65066
65612
  /** Decoded fault message. Null means healthy; a non-null string is an active fault. */
65067
65613
  error: string().nullable(),
65068
65614
  /** Ms epoch when the slice was last refreshed. */
65069
65615
  lastFetchedAt: number()
65070
65616
  });
65071
- var DeviceIdSchema = number().int().nonnegative();
65072
- var MinutesSchema = number().int().min(0);
65617
+ var DeviceIdSchema$1 = number().int().nonnegative();
65073
65618
  DeviceType.PetFountain, method(object({
65074
- deviceId: DeviceIdSchema,
65075
- on: boolean()
65076
- }), _void(), {
65077
- kind: "mutation",
65078
- auth: "protected"
65079
- }), method(object({
65080
- deviceId: DeviceIdSchema,
65619
+ deviceId: DeviceIdSchema$1,
65081
65620
  on: boolean()
65082
65621
  }), _void(), {
65083
65622
  kind: "mutation",
65084
65623
  auth: "protected"
65085
- }), method(object({
65086
- deviceId: DeviceIdSchema,
65087
- minutes: MinutesSchema
65088
- }), _void(), {
65089
- kind: "mutation",
65090
- auth: "protected"
65091
- }), method(object({
65092
- deviceId: DeviceIdSchema,
65093
- minutes: MinutesSchema
65094
- }), _void(), {
65095
- kind: "mutation",
65096
- auth: "protected"
65097
- }), method(object({ deviceId: DeviceIdSchema }), _void(), {
65624
+ }), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
65098
65625
  kind: "mutation",
65099
65626
  auth: "protected"
65100
65627
  });
@@ -66628,6 +67155,49 @@ object({
66628
67155
  DeviceType.PetFeeder,
66629
67156
  DeviceType.Heater
66630
67157
  ].filter((type) => type !== DeviceType.Sensor);
67158
+ var PowerSourceRefusalReasonSchema = _enum([
67159
+ "no-power-source",
67160
+ "switch-missing",
67161
+ "switch-offline",
67162
+ "switch-unknown",
67163
+ "restart-in-progress",
67164
+ "switch-call-failed"
67165
+ ]);
67166
+ var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
67167
+ accepted: literal(false),
67168
+ reason: PowerSourceRefusalReasonSchema,
67169
+ /** One line for the operator, naming the switch. */
67170
+ message: string()
67171
+ })]);
67172
+ var PowerSourceInfoSchema = object({
67173
+ /** False when the device has no power source linked; the rest is then empty. */
67174
+ linked: boolean(),
67175
+ switchDeviceId: number().nullable(),
67176
+ switchName: string().nullable(),
67177
+ /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
67178
+ switchOn: boolean().nullable(),
67179
+ switchOnline: boolean().nullable(),
67180
+ restartInProgress: boolean(),
67181
+ offSeconds: number().int()
67182
+ });
67183
+ object({
67184
+ /** Null while the switch has not reported: unknown is never `false` (D393). */
67185
+ switchOn: boolean().nullable(),
67186
+ offSeconds: number().int(),
67187
+ lastFetchedAt: number()
67188
+ });
67189
+ 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;
67190
+ var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
67191
+ systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
67192
+ kind: "mutation",
67193
+ auth: "admin"
67194
+ }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
67195
+ kind: "mutation",
67196
+ auth: "admin"
67197
+ }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
67198
+ kind: "mutation",
67199
+ auth: "admin"
67200
+ });
66631
67201
  /**
66632
67202
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
66633
67203
  * on `DeviceType.Presence`. Read-only — no setters: presence is
@@ -67054,6 +67624,37 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
67054
67624
  deviceId: number(),
67055
67625
  status: PtzAutotrackStatusSchema
67056
67626
  });
67627
+ object({
67628
+ /** True when the pump works on the on/off cycle, false when it runs continuously. Null while unknown. */
67629
+ enabled: boolean().nullable(),
67630
+ /** How long the pump runs per cycle, in seconds. Null while unknown. */
67631
+ onTime: number().min(0).nullable().meta(readingMeta("duration")),
67632
+ /** How long the pump rests per cycle, in seconds. Null while unknown. */
67633
+ offTime: number().min(0).nullable().meta(readingMeta("duration")),
67634
+ /** Ms epoch when the slice was last refreshed. */
67635
+ lastFetchedAt: number()
67636
+ });
67637
+ var DeviceIdSchema = number().int().nonnegative();
67638
+ var MinutesSchema = number().int().min(0);
67639
+ DeviceType.PetFountain, method(object({
67640
+ deviceId: DeviceIdSchema,
67641
+ on: boolean()
67642
+ }), _void(), {
67643
+ kind: "mutation",
67644
+ auth: "protected"
67645
+ }), method(object({
67646
+ deviceId: DeviceIdSchema,
67647
+ minutes: MinutesSchema
67648
+ }), _void(), {
67649
+ kind: "mutation",
67650
+ auth: "protected"
67651
+ }), method(object({
67652
+ deviceId: DeviceIdSchema,
67653
+ minutes: MinutesSchema
67654
+ }), _void(), {
67655
+ kind: "mutation",
67656
+ auth: "protected"
67657
+ });
67057
67658
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, DeviceType.Gateway, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
67058
67659
  kind: "mutation",
67059
67660
  auth: "admin"
@@ -69767,7 +70368,13 @@ var RemoteMediaCommandSchema = _enum([
69767
70368
  "next",
69768
70369
  "previous",
69769
70370
  "setMute",
69770
- "selectSource"
70371
+ "selectSource",
70372
+ "turnOn",
70373
+ "turnOff",
70374
+ "volumeUp",
70375
+ "volumeDown",
70376
+ "channelUp",
70377
+ "channelDown"
69771
70378
  ]);
69772
70379
  /** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
69773
70380
  var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
@@ -69788,7 +70395,7 @@ method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.e
69788
70395
  }), RemoteSendResultSchema, {
69789
70396
  kind: "mutation",
69790
70397
  auth: "protected"
69791
- }), method(deviceInput.extend({
70398
+ }), method(deviceInput, MediaPlayerStatusSchema.nullable(), { auth: "protected" }), method(deviceInput.extend({
69792
70399
  command: RemoteMediaCommandSchema,
69793
70400
  muted: boolean().optional(),
69794
70401
  source: string().optional(),
@@ -70722,7 +71329,16 @@ DeviceType.Sensor;
70722
71329
  * future fields without breaking the existing call sites.
70723
71330
  */
70724
71331
  var EmailAddressSchema = email();
71332
+ /**
71333
+ * Which relay of a multi-relay provider answers (D996). Absent = the provider's first / default
71334
+ * relay, so a caller written before relays existed keeps working unchanged. A provider with one
71335
+ * fixed relay ignores it. This is the integration instance id (`int_NNNN`), NOT the addon id: the
71336
+ * collection pin `addonId` still picks the provider, `instanceId` picks the relay inside it.
71337
+ */
71338
+ var InstanceIdSchema = string().min(1).optional();
71339
+ var RelayPinSchema = object({ instanceId: InstanceIdSchema });
70725
71340
  var SendEmailInputSchema = object({
71341
+ instanceId: InstanceIdSchema,
70726
71342
  to: union([EmailAddressSchema, array(EmailAddressSchema).min(1)]),
70727
71343
  cc: array(EmailAddressSchema).optional(),
70728
71344
  bcc: array(EmailAddressSchema).optional(),
@@ -70758,11 +71374,11 @@ method(SendEmailInputSchema, SendEmailResultSchema, {
70758
71374
  kind: "mutation",
70759
71375
  auth: "admin",
70760
71376
  access: "create"
70761
- }), method(_void(), SmtpStatusSchema, {
71377
+ }), method(RelayPinSchema, SmtpStatusSchema, {
70762
71378
  kind: "mutation",
70763
71379
  auth: "admin",
70764
71380
  access: "view"
70765
- }), method(_void(), SmtpStatusSchema, { auth: "admin" });
71381
+ }), method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" });
70766
71382
  /**
70767
71383
  * A single device snapshot returned as base64 JPEG/PNG.
70768
71384
  *
@@ -70794,10 +71410,12 @@ DeviceType.Camera, method(object({
70794
71410
  * even when the cache is well within the device's
70795
71411
  * `snapshotMaxAgeS` window.
70796
71412
  *
70797
- * **`force` is an OPERATOR signal, not a freshness preference.** On a
71413
+ * **`force` is a demand with a named principal, not a freshness
71414
+ * preference** — an operator button, the scheduled refresh (D847), or a
71415
+ * notification rule that left the camera's wake allowed (D998). On a
70798
71416
  * battery camera it is the one thing that walks past the wrapper's
70799
- * sleep gate and wakes the camera, so a background caller — a poller,
70800
- * an event handler, a thumbnail — must NEVER set it. Every such caller
71417
+ * sleep gate and wakes the camera, so a poller, a thumbnail or a
71418
+ * prestream must NEVER set it. Every such caller
70801
71419
  * gets the cached frame, which on a sleeping battery camera is the
70802
71420
  * correct answer: stale but honest beats woken.
70803
71421
  */
@@ -71612,7 +72230,11 @@ Object.values(DeviceType), method(_void(), array(StreamSignalSchema).readonly())
71612
72230
  * `getSettingsUISchema()` surface.
71613
72231
  */
71614
72232
  var SwitchStatusSchema = object({
71615
- on: boolean().meta({ label: "On" }),
72233
+ /**
72234
+ * `null` = the device has never reported its state (a measurement that
72235
+ * has not happened is unknown, never `false`).
72236
+ */
72237
+ on: boolean().nullable().meta({ label: "On" }),
71616
72238
  /** Ms epoch of the last state change. Useful for UI "X minutes ago". */
71617
72239
  lastChangedAt: number()
71618
72240
  });
@@ -71624,7 +72246,7 @@ DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceTyp
71624
72246
  auth: "protected"
71625
72247
  }), object({
71626
72248
  deviceId: number(),
71627
- on: boolean(),
72249
+ on: boolean().nullable(),
71628
72250
  lastChangedAt: number()
71629
72251
  });
71630
72252
  /** C0 controls, DEL and the C1 range: none of them belongs in a name. */
@@ -74636,6 +75258,26 @@ function buildDescriptor(capName, kind) {
74636
75258
  * contributes one entry per bound cap present in this map.
74637
75259
  */
74638
75260
  var EVENT_KIND_BY_CAP = Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
75261
+ /**
75262
+ * What a remote key is CALLED and what it LOOKS like, for every role (D963),
75263
+ * shared by the admin UI and the viewer. A role is data on the wire; each
75264
+ * client resolves its name from `label` (English and Italian side by side) and
75265
+ * its glyph from `icon`, a lucide id from the shared icon catalogue — the
75266
+ * server sends an id, a client maps it to its own icon set.
75267
+ *
75268
+ * `legend` is text printed on the key INSTEAD of a glyph (a digit has no
75269
+ * pictogram): a client that can draw text shows it, one that cannot falls back
75270
+ * to `icon`.
75271
+ */
75272
+ function digit(n) {
75273
+ return {
75274
+ label: t(n, n),
75275
+ icon: "hash",
75276
+ legend: n
75277
+ };
75278
+ }
75279
+ digit("0"), digit("1"), digit("2"), digit("3"), digit("4"), digit("5"), digit("6"), digit("7"), digit("8"), digit("9");
75280
+ DeviceFeature.MediaPlayerPower, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious;
74639
75281
  var btn = (idSuffix, row, col, init) => ({
74640
75282
  idSuffix,
74641
75283
  row,
@@ -74762,7 +75404,35 @@ discriminatedUnion("kind", [object({
74762
75404
  kind: literal("pronto"),
74763
75405
  code: string()
74764
75406
  })]);
74765
- DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
75407
+ /**
75408
+ * Propose a running threshold from a device's own power history (planning#405).
75409
+ *
75410
+ * Pure and deterministic: the same series gives the same answer. The series is
75411
+ * a HELD-VALUE step series — a point's value stands until the next point — which
75412
+ * is how device-history stores a gauge, so "time at a level" is exact, not a
75413
+ * count of samples.
75414
+ *
75415
+ * 1. idle floor F = time-weighted median; noise ceiling N = highest value seen
75416
+ * near F. A device that is not near one level most of the time has no floor.
75417
+ * 2. coarse activity = above max(2N, N + 5 W); consecutive stretches are episodes.
75418
+ * 3. gaps between episodes split in two by the largest log-scale jump (>= 3x):
75419
+ * the short ones are pauses INSIDE a run (a soak), the long ones separate runs.
75420
+ * 4. T = geometric mean of N and the plateau's 10th percentile, snapped to a
75421
+ * grid a person would type; stop dwell covers the longest pause; start dwell
75422
+ * covers the longest standby blip above T.
75423
+ * 5. the numbers are proved by REPLAY through the real `dwell` evaluation: each
75424
+ * run must hold exactly one true interval and nothing may flap outside.
75425
+ */
75426
+ var SECOND_MS = 1e3;
75427
+ var MINUTE_MS$1 = 60 * SECOND_MS;
75428
+ 24 * (60 * MINUTE_MS$1);
75429
+ 10 * MINUTE_MS$1;
75430
+ 30 * SECOND_MS;
75431
+ 60 * SECOND_MS;
75432
+ 20 * MINUTE_MS$1;
75433
+ 10 * SECOND_MS;
75434
+ 10 * SECOND_MS;
75435
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverStoppable, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
74766
75436
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
74767
75437
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
74768
75438
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
@@ -75743,6 +76413,27 @@ Object.freeze({
75743
76413
  access: "view",
75744
76414
  role: "viewer"
75745
76415
  },
76416
+ "boardKeySource.getBoardKey": {
76417
+ capName: "board-key-source",
76418
+ capScope: "system",
76419
+ addonId: null,
76420
+ access: "view",
76421
+ role: "admin"
76422
+ },
76423
+ "boardKeySource.listBoards": {
76424
+ capName: "board-key-source",
76425
+ capScope: "system",
76426
+ addonId: null,
76427
+ access: "view",
76428
+ role: "admin"
76429
+ },
76430
+ "boardKeySource.listSources": {
76431
+ capName: "board-key-source",
76432
+ capScope: "system",
76433
+ addonId: null,
76434
+ access: "view",
76435
+ role: "admin"
76436
+ },
75746
76437
  "brightness.getStatus": {
75747
76438
  capName: "brightness",
75748
76439
  capScope: "device",
@@ -76282,6 +76973,13 @@ Object.freeze({
76282
76973
  access: "create",
76283
76974
  role: "admin"
76284
76975
  },
76976
+ "coreBlocks.proposeRunningThreshold": {
76977
+ capName: "core-blocks",
76978
+ capScope: "system",
76979
+ addonId: null,
76980
+ access: "view",
76981
+ role: "admin"
76982
+ },
76285
76983
  "coreBlocks.reportAutomationRun": {
76286
76984
  capName: "core-blocks",
76287
76985
  capScope: "system",
@@ -76793,6 +77491,13 @@ Object.freeze({
76793
77491
  access: "view",
76794
77492
  role: "admin"
76795
77493
  },
77494
+ "deviceExport.listInstances": {
77495
+ capName: "device-export",
77496
+ capScope: "system",
77497
+ addonId: null,
77498
+ access: "view",
77499
+ role: "admin"
77500
+ },
76796
77501
  "deviceExport.listSupportedDeviceKinds": {
76797
77502
  capName: "device-export",
76798
77503
  capScope: "system",
@@ -78382,6 +79087,69 @@ Object.freeze({
78382
79087
  access: "create",
78383
79088
  role: "admin"
78384
79089
  },
79090
+ "integrationInstances.createInstance": {
79091
+ capName: "integration-instances",
79092
+ capScope: "system",
79093
+ addonId: null,
79094
+ access: "create",
79095
+ role: "admin"
79096
+ },
79097
+ "integrationInstances.deleteInstance": {
79098
+ capName: "integration-instances",
79099
+ capScope: "system",
79100
+ addonId: null,
79101
+ access: "delete",
79102
+ role: "admin"
79103
+ },
79104
+ "integrationInstances.describe": {
79105
+ capName: "integration-instances",
79106
+ capScope: "system",
79107
+ addonId: null,
79108
+ access: "view",
79109
+ role: "admin"
79110
+ },
79111
+ "integrationInstances.getInstance": {
79112
+ capName: "integration-instances",
79113
+ capScope: "system",
79114
+ addonId: null,
79115
+ access: "view",
79116
+ role: "admin"
79117
+ },
79118
+ "integrationInstances.instanceFormSchema": {
79119
+ capName: "integration-instances",
79120
+ capScope: "system",
79121
+ addonId: null,
79122
+ access: "view",
79123
+ role: "admin"
79124
+ },
79125
+ "integrationInstances.listInstances": {
79126
+ capName: "integration-instances",
79127
+ capScope: "system",
79128
+ addonId: null,
79129
+ access: "view",
79130
+ role: "admin"
79131
+ },
79132
+ "integrationInstances.setInstanceEnabled": {
79133
+ capName: "integration-instances",
79134
+ capScope: "system",
79135
+ addonId: null,
79136
+ access: "create",
79137
+ role: "admin"
79138
+ },
79139
+ "integrationInstances.testInstance": {
79140
+ capName: "integration-instances",
79141
+ capScope: "system",
79142
+ addonId: null,
79143
+ access: "create",
79144
+ role: "admin"
79145
+ },
79146
+ "integrationInstances.updateInstance": {
79147
+ capName: "integration-instances",
79148
+ capScope: "system",
79149
+ addonId: null,
79150
+ access: "create",
79151
+ role: "admin"
79152
+ },
78385
79153
  "integrations.create": {
78386
79154
  capName: "integrations",
78387
79155
  capScope: "system",
@@ -79166,6 +79934,20 @@ Object.freeze({
79166
79934
  access: "view",
79167
79935
  role: "admin"
79168
79936
  },
79937
+ "mediaPlayer.channelDown": {
79938
+ capName: "media-player",
79939
+ capScope: "device",
79940
+ addonId: null,
79941
+ access: "create",
79942
+ role: "viewer"
79943
+ },
79944
+ "mediaPlayer.channelUp": {
79945
+ capName: "media-player",
79946
+ capScope: "device",
79947
+ addonId: null,
79948
+ access: "create",
79949
+ role: "viewer"
79950
+ },
79169
79951
  "mediaPlayer.getStatus": {
79170
79952
  capName: "media-player",
79171
79953
  capScope: "device",
@@ -79257,6 +80039,34 @@ Object.freeze({
79257
80039
  access: "create",
79258
80040
  role: "viewer"
79259
80041
  },
80042
+ "mediaPlayer.turnOff": {
80043
+ capName: "media-player",
80044
+ capScope: "device",
80045
+ addonId: null,
80046
+ access: "create",
80047
+ role: "viewer"
80048
+ },
80049
+ "mediaPlayer.turnOn": {
80050
+ capName: "media-player",
80051
+ capScope: "device",
80052
+ addonId: null,
80053
+ access: "create",
80054
+ role: "viewer"
80055
+ },
80056
+ "mediaPlayer.volumeDown": {
80057
+ capName: "media-player",
80058
+ capScope: "device",
80059
+ addonId: null,
80060
+ access: "create",
80061
+ role: "viewer"
80062
+ },
80063
+ "mediaPlayer.volumeUp": {
80064
+ capName: "media-player",
80065
+ capScope: "device",
80066
+ addonId: null,
80067
+ access: "create",
80068
+ role: "viewer"
80069
+ },
79260
80070
  "meshNetwork.getStatus": {
79261
80071
  capName: "mesh-network",
79262
80072
  capScope: "system",
@@ -80503,27 +81313,6 @@ Object.freeze({
80503
81313
  access: "create",
80504
81314
  role: "viewer"
80505
81315
  },
80506
- "petFountain.setPumpInterval": {
80507
- capName: "pet-fountain",
80508
- capScope: "device",
80509
- addonId: null,
80510
- access: "create",
80511
- role: "viewer"
80512
- },
80513
- "petFountain.setPumpOffMinutes": {
80514
- capName: "pet-fountain",
80515
- capScope: "device",
80516
- addonId: null,
80517
- access: "create",
80518
- role: "viewer"
80519
- },
80520
- "petFountain.setPumpOnMinutes": {
80521
- capName: "pet-fountain",
80522
- capScope: "device",
80523
- addonId: null,
80524
- access: "create",
80525
- role: "viewer"
80526
- },
80527
81316
  "pipelineAnalytics.addRetrainFrameFromRecording": {
80528
81317
  capName: "pipeline-analytics",
80529
81318
  capScope: "device",
@@ -82302,6 +83091,34 @@ Object.freeze({
82302
83091
  access: "create",
82303
83092
  role: "admin"
82304
83093
  },
83094
+ "pumpCycle.getStatus": {
83095
+ capName: "pump-cycle",
83096
+ capScope: "device",
83097
+ addonId: null,
83098
+ access: "view",
83099
+ role: "viewer"
83100
+ },
83101
+ "pumpCycle.setEnabled": {
83102
+ capName: "pump-cycle",
83103
+ capScope: "device",
83104
+ addonId: null,
83105
+ access: "create",
83106
+ role: "viewer"
83107
+ },
83108
+ "pumpCycle.setOffMinutes": {
83109
+ capName: "pump-cycle",
83110
+ capScope: "device",
83111
+ addonId: null,
83112
+ access: "create",
83113
+ role: "viewer"
83114
+ },
83115
+ "pumpCycle.setOnMinutes": {
83116
+ capName: "pump-cycle",
83117
+ capScope: "device",
83118
+ addonId: null,
83119
+ access: "create",
83120
+ role: "viewer"
83121
+ },
82305
83122
  "reboot.reboot": {
82306
83123
  capName: "reboot",
82307
83124
  capScope: "device",
@@ -82806,6 +83623,13 @@ Object.freeze({
82806
83623
  access: "create",
82807
83624
  role: "admin"
82808
83625
  },
83626
+ "remote.getAssumedStatus": {
83627
+ capName: "remote",
83628
+ capScope: "system",
83629
+ addonId: null,
83630
+ access: "view",
83631
+ role: "admin"
83632
+ },
82809
83633
  "remote.getConfig": {
82810
83634
  capName: "remote",
82811
83635
  capScope: "system",
@@ -85646,6 +86470,11 @@ Object.freeze({
85646
86470
  form: "single",
85647
86471
  optional: false
85648
86472
  }],
86473
+ "coreBlocks.proposeRunningThreshold": [{
86474
+ name: "deviceId",
86475
+ form: "single",
86476
+ optional: false
86477
+ }],
85649
86478
  "cover.close": [{
85650
86479
  name: "deviceId",
85651
86480
  form: "single",
@@ -86497,6 +87326,16 @@ Object.freeze({
86497
87326
  form: "single",
86498
87327
  optional: true
86499
87328
  }],
87329
+ "mediaPlayer.channelDown": [{
87330
+ name: "deviceId",
87331
+ form: "single",
87332
+ optional: false
87333
+ }],
87334
+ "mediaPlayer.channelUp": [{
87335
+ name: "deviceId",
87336
+ form: "single",
87337
+ optional: false
87338
+ }],
86500
87339
  "mediaPlayer.getStatus": [{
86501
87340
  name: "deviceId",
86502
87341
  form: "single",
@@ -86562,6 +87401,26 @@ Object.freeze({
86562
87401
  form: "single",
86563
87402
  optional: false
86564
87403
  }],
87404
+ "mediaPlayer.turnOff": [{
87405
+ name: "deviceId",
87406
+ form: "single",
87407
+ optional: false
87408
+ }],
87409
+ "mediaPlayer.turnOn": [{
87410
+ name: "deviceId",
87411
+ form: "single",
87412
+ optional: false
87413
+ }],
87414
+ "mediaPlayer.volumeDown": [{
87415
+ name: "deviceId",
87416
+ form: "single",
87417
+ optional: false
87418
+ }],
87419
+ "mediaPlayer.volumeUp": [{
87420
+ name: "deviceId",
87421
+ form: "single",
87422
+ optional: false
87423
+ }],
86565
87424
  "meter.getStatus": [{
86566
87425
  name: "deviceId",
86567
87426
  form: "single",
@@ -86871,21 +87730,6 @@ Object.freeze({
86871
87730
  form: "single",
86872
87731
  optional: false
86873
87732
  }],
86874
- "petFountain.setPumpInterval": [{
86875
- name: "deviceId",
86876
- form: "single",
86877
- optional: false
86878
- }],
86879
- "petFountain.setPumpOffMinutes": [{
86880
- name: "deviceId",
86881
- form: "single",
86882
- optional: false
86883
- }],
86884
- "petFountain.setPumpOnMinutes": [{
86885
- name: "deviceId",
86886
- form: "single",
86887
- optional: false
86888
- }],
86889
87733
  "pipelineAnalytics.addRetrainFrameFromRecording": [{
86890
87734
  name: "deviceId",
86891
87735
  form: "single",
@@ -87521,6 +88365,26 @@ Object.freeze({
87521
88365
  form: "single",
87522
88366
  optional: false
87523
88367
  }],
88368
+ "pumpCycle.getStatus": [{
88369
+ name: "deviceId",
88370
+ form: "single",
88371
+ optional: false
88372
+ }],
88373
+ "pumpCycle.setEnabled": [{
88374
+ name: "deviceId",
88375
+ form: "single",
88376
+ optional: false
88377
+ }],
88378
+ "pumpCycle.setOffMinutes": [{
88379
+ name: "deviceId",
88380
+ form: "single",
88381
+ optional: false
88382
+ }],
88383
+ "pumpCycle.setOnMinutes": [{
88384
+ name: "deviceId",
88385
+ form: "single",
88386
+ optional: false
88387
+ }],
87524
88388
  "reboot.reboot": [{
87525
88389
  name: "deviceId",
87526
88390
  form: "single",
@@ -87722,6 +88586,11 @@ Object.freeze({
87722
88586
  form: "single",
87723
88587
  optional: true
87724
88588
  }],
88589
+ "remote.getAssumedStatus": [{
88590
+ name: "deviceId",
88591
+ form: "single",
88592
+ optional: false
88593
+ }],
87725
88594
  "remote.getConfig": [{
87726
88595
  name: "deviceId",
87727
88596
  form: "single",
@@ -88269,99 +89138,6 @@ Object.freeze({
88269
89138
  "network-access": "ingress",
88270
89139
  "smtp-provider": "email"
88271
89140
  });
88272
- /**
88273
- * A saved Customize assignment (D936). The schema is the type: callers use
88274
- * `z.infer`, they do not restate the shape.
88275
- */
88276
- var OverrideSourceSchema = object({
88277
- addonId: string().min(1),
88278
- stableId: string().min(1),
88279
- cap: string().min(1),
88280
- fieldPath: string().min(1)
88281
- });
88282
- var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
88283
- object({ kind: literal("identity") }),
88284
- object({ kind: literal("invert") }),
88285
- object({
88286
- kind: literal("threshold"),
88287
- comparison: _enum(["gte", "lte"]),
88288
- threshold: number(),
88289
- startDwellMs: number().nonnegative(),
88290
- stopDwellMs: number().nonnegative()
88291
- }),
88292
- object({
88293
- kind: literal("linear"),
88294
- scale: number(),
88295
- offset: number(),
88296
- clampMin: number().optional(),
88297
- clampMax: number().optional()
88298
- }),
88299
- object({
88300
- kind: literal("enum-map"),
88301
- mapping: record(string(), string().nullable())
88302
- }),
88303
- object({ kind: literal("number") })
88304
- ]);
88305
- var ScalarOverrideDraftSchema = object({
88306
- kind: literal("scalar"),
88307
- cap: string().min(1),
88308
- targetId: string().min(1),
88309
- source: OverrideSourceSchema,
88310
- transform: CustomizeTransformDraftSchema
88311
- });
88312
- var KeyedArrayOverrideDraftSchema = object({
88313
- kind: literal("keyedArray"),
88314
- cap: string().min(1),
88315
- targetId: string().min(1),
88316
- key: string().min(1),
88317
- label: string().min(1),
88318
- fieldPath: string().min(1),
88319
- source: OverrideSourceSchema,
88320
- transform: CustomizeTransformDraftSchema
88321
- });
88322
- var PulseOverrideDraftSchema = object({
88323
- kind: literal("pulse"),
88324
- cap: string().min(1),
88325
- targetId: string().min(1),
88326
- enabled: boolean(),
88327
- debounceMs: number().nonnegative(),
88328
- edges: array(_enum([
88329
- "rising",
88330
- "button",
88331
- "native-event"
88332
- ])).min(1).optional(),
88333
- sources: array(OverrideSourceSchema).min(1)
88334
- });
88335
- var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
88336
- "in-addition",
88337
- "confirm",
88338
- "replace"
88339
- ]).optional() });
88340
- discriminatedUnion("kind", [
88341
- ScalarOverrideDraftSchema,
88342
- KeyedArrayOverrideDraftSchema,
88343
- PulseOverrideDraftSchema,
88344
- object({
88345
- kind: literal("span"),
88346
- cap: string().min(1),
88347
- targetId: string().min(1),
88348
- timeoutMs: number().nonnegative(),
88349
- cooldownMs: number().nonnegative().optional(),
88350
- sources: array(SpanSourceDraftSchema)
88351
- })
88352
- ]);
88353
- object({
88354
- targetId: string().min(1),
88355
- configured: boolean(),
88356
- source: _enum(["native", "assigned"]),
88357
- state: _enum([
88358
- "active",
88359
- "stale",
88360
- "released",
88361
- "unavailable"
88362
- ]),
88363
- reason: string().nullable()
88364
- });
88365
89141
  var G711_SCALE_CORRECTION_DB = {
88366
89142
  PCMU: 20 * Math.log10(4),
88367
89143
  PCMA: 20 * Math.log10(8)
@@ -88977,6 +89753,7 @@ var STATE_SUMMARY_VARS = [
88977
89753
  [...RULE_TEXT],
88978
89754
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
88979
89755
  ([...RULE_TEXT], [...COMBINED_ALARM]),
89756
+ ([...RULE_TEXT], [...COMBINED_ALARM]),
88980
89757
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
88981
89758
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
88982
89759
  ([...RULE_TEXT], [...CONSUMABLE]),
@@ -90689,18 +91466,29 @@ function buildGoogleOauthIntegration() {
90689
91466
  *
90690
91467
  * Idempotent: a store without either key yields an empty plan, which writes nothing.
90691
91468
  */
90692
- /** The settings scope of this addon (`<addonId>:addon-settings`). */
90693
- var GOOGLE_SETTINGS_SCOPE = "export-google:addon-settings";
91469
+ /** The addon id, the prefix of its rows in the canonical settings table. */
91470
+ var GOOGLE_ADDON_ID = "export-google";
91471
+ /**
91472
+ * Where the addon's global settings live: the canonical `addon-settings` table, one row per
91473
+ * key, id `<addonId>.<key>`, data `{ addonId, key, value }` (never a per-addon scoped table,
91474
+ * which exists only when something lazily declared it).
91475
+ */
91476
+ var ADDON_SETTINGS_TABLE = "addon-settings";
90694
91477
  var RETIRED_PUBLIC_URL_KEYS = ["publicHubUrl", "detectedPublicHubUrl"];
90695
91478
  async function planDropPublicHubUrl(ports) {
90696
91479
  const stored = await ports.readStored();
90697
91480
  const present = RETIRED_PUBLIC_URL_KEYS.filter((key) => key in stored);
90698
91481
  if (present.length === 0) return { edits: [] };
91482
+ const rowId = (key) => `${GOOGLE_ADDON_ID}.${key}`;
90699
91483
  return { edits: [{
90700
91484
  op: "deleteKeys",
90701
- scope: GOOGLE_SETTINGS_SCOPE,
90702
- keys: [...present],
90703
- precondition: preconditionOf(Object.fromEntries(present.map((key) => [key, stored[key]])))
91485
+ scope: ADDON_SETTINGS_TABLE,
91486
+ keys: present.map(rowId),
91487
+ precondition: preconditionOf(Object.fromEntries(present.map((key) => [rowId(key), {
91488
+ addonId: GOOGLE_ADDON_ID,
91489
+ key,
91490
+ value: stored[key]
91491
+ }])))
90704
91492
  }] };
90705
91493
  }
90706
91494
  //#endregion
@@ -90858,30 +91646,55 @@ var ExportGoogleAddon = class extends BaseAddon {
90858
91646
  actionScenes.reconcile().catch((err) => {
90859
91647
  this.ctx.logger.warn("export-google: action scene reconcile at boot failed", { meta: { error: errMsg$1(err) } });
90860
91648
  });
91649
+ const ownInstance = (instanceId) => assertOwnExportInstance("export-google", ADDON_ID, instanceId);
90861
91650
  const deviceExportProvider = {
90862
- getStatus: async () => ({
90863
- linkState: this.config.linkedAccounts.length > 0 ? "linked" : "unlinked",
90864
- exposedDeviceCount: this.config.exposed.length,
90865
- setup: await this.buildSetupBlock()
90866
- }),
90867
- listSupportedDeviceKinds: async () => [...SUPPORTED_DEVICE_KINDS],
90868
- listExposedDevices: async () => this.config.exposed.map((entry) => ({ deviceId: String(entry.deviceId) })),
90869
- exposeDevice: async ({ deviceId }) => this.exposeDevice(deviceId),
90870
- unexposeDevice: async ({ deviceId }) => this.unexposeDevice(deviceId),
91651
+ getStatus: async (input) => {
91652
+ ownInstance(statusInstanceOf(input));
91653
+ return {
91654
+ linkState: this.config.linkedAccounts.length > 0 ? "linked" : "unlinked",
91655
+ exposedDeviceCount: this.config.exposed.length,
91656
+ setup: await this.buildSetupBlock()
91657
+ };
91658
+ },
91659
+ listInstances: async () => [{
91660
+ instanceId: ADDON_ID,
91661
+ name: "Google Home",
91662
+ enabled: true,
91663
+ kind: "google-home"
91664
+ }],
91665
+ listSupportedDeviceKinds: async ({ instanceId }) => {
91666
+ ownInstance(instanceId);
91667
+ return [...SUPPORTED_DEVICE_KINDS];
91668
+ },
91669
+ listExposedDevices: async ({ instanceId }) => {
91670
+ ownInstance(instanceId);
91671
+ return this.config.exposed.map((entry) => ({ deviceId: String(entry.deviceId) }));
91672
+ },
91673
+ exposeDevice: async ({ instanceId, deviceId }) => {
91674
+ ownInstance(instanceId);
91675
+ return this.exposeDevice(deviceId);
91676
+ },
91677
+ unexposeDevice: async ({ instanceId, deviceId }) => {
91678
+ ownInstance(instanceId);
91679
+ return this.unexposeDevice(deviceId);
91680
+ },
90871
91681
  listSupportedEntityKinds: async () => ["device", "action"],
90872
- listExposedEntities: async () => {
91682
+ listExposedEntities: async ({ instanceId }) => {
91683
+ ownInstance(instanceId);
90873
91684
  await actionScenes.reconcile();
90874
91685
  return [...this.config.exposed.map((entry) => ({ entity: {
90875
91686
  kind: "device",
90876
91687
  deviceId: String(entry.deviceId)
90877
91688
  } })), ...actionScenes.list()];
90878
91689
  },
90879
- exposeEntity: async ({ entity }) => {
91690
+ exposeEntity: async ({ instanceId, entity }) => {
91691
+ ownInstance(instanceId);
90880
91692
  if (entity.kind === "device") return this.exposeDevice(entity.deviceId);
90881
91693
  if (entity.kind === "action") return actionScenes.expose(entity.actionId);
90882
91694
  throw new Error("export-google: a notification target cannot be exported to Google Home");
90883
91695
  },
90884
- unexposeEntity: async ({ entity }) => {
91696
+ unexposeEntity: async ({ instanceId, entity }) => {
91697
+ ownInstance(instanceId);
90885
91698
  if (entity.kind === "device") return this.unexposeDevice(entity.deviceId);
90886
91699
  if (entity.kind === "action") return actionScenes.unexpose(entity.actionId);
90887
91700
  throw new Error("export-google: a notification target cannot be exported to Google Home");