@camstack/addon-provider-homematic 1.2.204 → 1.2.206

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.
Files changed (18) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/_stub.js +2 -2
  3. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-DjEdBUbH.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-DZpqsn6u.mjs} +5 -5
  4. package/dist/_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CiaZc7Zu.mjs +26 -0
  5. package/dist/addon-provider-homematic.css +1 -1
  6. package/dist/addon.js +2686 -252
  7. package/dist/addon.mjs +2686 -252
  8. package/dist/{hostInit-C5XIF453.mjs → hostInit-DBO78Hu-.mjs} +4 -4
  9. package/dist/remoteEntry.js +1 -1
  10. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-BL0O2-to.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-D1CbMi19.mjs} +1 -1
  11. package/dist/widgets/_stub.js +1 -1
  12. package/dist/widgets/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_widgets-Cq-Hf-_G.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_widgets-Bwve1HPK.mjs} +3 -3
  13. package/dist/widgets/_virtual_mf___mfe_internal__addon_provider_homematic_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DaUa1YeZ.mjs +26 -0
  14. package/dist/widgets/{hostInit-DzuijAl4.mjs → hostInit-DSjxilwJ.mjs} +3 -3
  15. package/dist/widgets/remoteEntry.js +1 -1
  16. package/package.json +3 -3
  17. package/dist/_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-B48ZmMNz.mjs +0 -26
  18. package/dist/widgets/_virtual_mf___mfe_internal__addon_provider_homematic_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Cy-JR-hp.mjs +0 -26
package/dist/addon.js CHANGED
@@ -8,7 +8,7 @@ let crypto$1 = require("crypto");
8
8
  let fs_promises = require("fs/promises");
9
9
  let path = require("path");
10
10
  let node_os = require("node:os");
11
- //#region ../types/dist/event-category-Dhcd0TRH.mjs
11
+ //#region ../types/dist/event-category-CY27-fF0.mjs
12
12
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
13
13
  EventCategory["SystemBoot"] = "system.boot";
14
14
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -508,7 +508,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
508
508
  */
509
509
  EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
510
510
  /**
511
- * Emitted by the battery cap provider WHEN `wakeForStream` enters the
511
+ * Emitted by the battery cap provider WHEN `wakeUp` enters the
512
512
  * "wake in progress" window — between the Baichuan wake-up issue and
513
513
  * the camera's first dialed-back RTP packet. The stream-broker
514
514
  * manager subscribes to flip the per-broker placeholder reason to
@@ -530,6 +530,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
530
530
  EventCategory["RunningStarted"] = "running.started";
531
531
  /** Mirrors `runningStateCapability.events.onFinished`. */
532
532
  EventCategory["RunningFinished"] = "running.finished";
533
+ /** Mirrors `workloadCapability.events.onStarted` — a workload reached running (#585). */
534
+ EventCategory["WorkloadStarted"] = "workload.started";
535
+ /** Mirrors `workloadCapability.events.onStopped` — a running workload stopped cleanly. */
536
+ EventCategory["WorkloadStopped"] = "workload.stopped";
537
+ /** Mirrors `workloadCapability.events.onCrashed` — a workload stopped without a request. */
538
+ EventCategory["WorkloadCrashed"] = "workload.crashed";
539
+ /** Mirrors `workloadCapability.events.onRecovered` — a crashed workload runs again. */
540
+ EventCategory["WorkloadRecovered"] = "workload.recovered";
533
541
  /** Mirrors `deviceRunsCapability.events.onRunOpened` - a durable run record opened. */
534
542
  EventCategory["DeviceRunOpened"] = "device-run.opened";
535
543
  /** Mirrors `deviceRunsCapability.events.onRunClosed` - a durable run record closed. */
@@ -832,7 +840,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
832
840
  return EventCategory;
833
841
  }({});
834
842
  //#endregion
835
- //#region ../types/dist/composed-stable-id-RvQIEpqg.mjs
843
+ //#region ../types/dist/composed-stable-id-BNTaDZEh.mjs
836
844
  /**
837
845
  import { errMsg } from '@camstack/types'
838
846
  * Extract a human-readable message from an unknown error value.
@@ -964,15 +972,26 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
964
972
  * and the storage as branches of one bus. One read-only `energy-system` cap carries
965
973
  * every value; the storage is a field of it, never the `battery` cap (#513, #522). */
966
974
  DeviceType["EnergySystem"] = "energy-system";
975
+ /** Something that RUNS on a machine, or the machine itself (#585): a VM, an app
976
+ * container, an LXC, an app, or a host. The kind is the ROLE (D1033, D1056), never
977
+ * a field; one `workload` cap carries the state, the controls and the resources. */
978
+ DeviceType["Workload"] = "workload";
967
979
  return DeviceType;
968
980
  }({});
969
981
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
982
+ /** The device reports a battery reading (the `battery` cap). Says nothing about sleep. */
970
983
  DeviceFeature["BatteryOperated"] = "battery-operated";
984
+ /**
985
+ * The device goes into low-power sleep and must be WOKEN before it streams
986
+ * (the `low-power-sleep` cap, `wakeUp`). A battery reading alone is
987
+ * not this: a battery sensor reports charge and never sleeps (#459, Q2).
988
+ */
989
+ DeviceFeature["Sleeps"] = "sleeps";
971
990
  DeviceFeature["Rebootable"] = "rebootable";
972
991
  /**
973
992
  * Device supports an on-demand re-sync of its derived spec with its
974
- * upstream source — drives the generic Re-sync button. The owning
975
- * provider implements the action via the `device-adoption.resync` cap.
993
+ * upstream source — drives the generic Re-sync button. Present when the
994
+ * device has the `resync` cap bound (#459, Q6).
976
995
  */
977
996
  DeviceFeature["Resyncable"] = "resyncable";
978
997
  DeviceFeature["NativeSnapshot"] = "native-snapshot";
@@ -1056,9 +1075,6 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1056
1075
  DeviceFeature["FanDirection"] = "fan-direction";
1057
1076
  /** Fan exposes an oscillation toggle. */
1058
1077
  DeviceFeature["FanOscillating"] = "fan-oscillating";
1059
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
1060
- * field on the UI lock-controls panel. */
1061
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
1062
1078
  /** Lock supports a latch-release ("open door") action distinct from
1063
1079
  * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
1064
1080
  * `supported_features`. Gates the Open Door button in the UI. */
@@ -1089,8 +1105,6 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1089
1105
  DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
1090
1106
  /** Media player exposes power on / off. */
1091
1107
  DeviceFeature["MediaPlayerPower"] = "media-player-power";
1092
- /** Alarm panel requires a PIN code on arm/disarm. */
1093
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
1094
1108
  /** Presence device carries GPS coordinates (lat/lng/accuracy) in
1095
1109
  * addition to a textual location. */
1096
1110
  DeviceFeature["PresenceGps"] = "presence-gps";
@@ -1110,15 +1124,9 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1110
1124
  /** Automation `trigger` accepts a skipCondition flag — fires the
1111
1125
  * automation's actions while bypassing its condition block. */
1112
1126
  DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
1113
- /** Robot vacuum exposes a live cleaning map (image child). Gates the
1114
- * map tile in the vacuum UI. */
1115
- DeviceFeature["VacuumHasMap"] = "vacuum-has-map";
1116
1127
  /** Robot vacuum exposes AI obstacle-detection toggles. Gates the AI
1117
1128
  * switches group. */
1118
1129
  DeviceFeature["VacuumHasAi"] = "vacuum-has-ai";
1119
- /** Robot mower exposes a live mowing map (SVG image child). Gates the
1120
- * mower map tile. */
1121
- DeviceFeature["MowerHasMap"] = "mower-has-map";
1122
1130
  /** Robot mower exposes targeted mowing (all-area / zones / edges /
1123
1131
  * spots) — gates the Mow action + map selectors. */
1124
1132
  DeviceFeature["MowerHasTargetedMowing"] = "mower-has-targeted-mowing";
@@ -1184,6 +1192,11 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1184
1192
  * `light` type: the provider owns the type, and a light implies brightness
1185
1193
  * or colour this relay lacks. */
1186
1194
  DeviceRole["SwitchLight"] = "switch-light";
1195
+ /** One port of a network switch that powers the device behind it (PoE): on /
1196
+ * off feeds or cuts that power. Its link is `network-link`, its draw
1197
+ * `power-meter`. Restarting the powered device through the port is that
1198
+ * device's `power-source` cap, never a reboot of the port. */
1199
+ DeviceRole["PoePort"] = "poe-port";
1187
1200
  /** Air conditioner / split unit: cooling, fan speed, louvres. */
1188
1201
  DeviceRole["ClimateAc"] = "climate-ac";
1189
1202
  /** Room thermostat: a setpoint and a room temperature. The default. */
@@ -1264,6 +1277,17 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1264
1277
  /** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
1265
1278
  * cap. A `DeviceType.Generic` device. */
1266
1279
  DeviceRole["IrTransmitter"] = "ir-transmitter";
1280
+ /** A virtual machine on a hypervisor. */
1281
+ DeviceRole["Vm"] = "vm";
1282
+ /** An application container (Docker, Podman). */
1283
+ DeviceRole["AppContainer"] = "app-container";
1284
+ /** A system container (LXC). */
1285
+ DeviceRole["Lxc"] = "lxc";
1286
+ /** An application or service running on a host. */
1287
+ DeviceRole["App"] = "app";
1288
+ /** A machine that runs workloads or is an appliance with its own OS: a
1289
+ * server, a hypervisor, a gateway console, a CCU. */
1290
+ DeviceRole["Host"] = "host";
1267
1291
  return DeviceRole;
1268
1292
  }({});
1269
1293
  /**
@@ -1847,8 +1871,8 @@ var _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
1847
1871
  function emoji() {
1848
1872
  return new RegExp(_emoji$1, "u");
1849
1873
  }
1850
- var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
1851
- var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
1874
+ var ipv4$1 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
1875
+ var ipv6$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
1852
1876
  var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
1853
1877
  var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
1854
1878
  var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
@@ -2522,12 +2546,12 @@ var $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def)
2522
2546
  $ZodStringFormat.init(inst, def);
2523
2547
  });
2524
2548
  var $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
2525
- def.pattern ?? (def.pattern = ipv4);
2549
+ def.pattern ?? (def.pattern = ipv4$1);
2526
2550
  $ZodStringFormat.init(inst, def);
2527
2551
  inst._zod.bag.format = `ipv4`;
2528
2552
  });
2529
2553
  var $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
2530
- def.pattern ?? (def.pattern = ipv6);
2554
+ def.pattern ?? (def.pattern = ipv6$1);
2531
2555
  $ZodStringFormat.init(inst, def);
2532
2556
  inst._zod.bag.format = `ipv6`;
2533
2557
  inst._zod.check = (payload) => {
@@ -5443,10 +5467,16 @@ var ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
5443
5467
  $ZodIPv4.init(inst, def);
5444
5468
  ZodStringFormat.init(inst, def);
5445
5469
  });
5470
+ function ipv4(params) {
5471
+ return /* @__PURE__ */ _ipv4(ZodIPv4, params);
5472
+ }
5446
5473
  var ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
5447
5474
  $ZodIPv6.init(inst, def);
5448
5475
  ZodStringFormat.init(inst, def);
5449
5476
  });
5477
+ function ipv6(params) {
5478
+ return /* @__PURE__ */ _ipv6(ZodIPv6, params);
5479
+ }
5450
5480
  var ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => {
5451
5481
  $ZodCIDRv4.init(inst, def);
5452
5482
  ZodStringFormat.init(inst, def);
@@ -6084,7 +6114,7 @@ var ZodIssueCode = {
6084
6114
  var ZodFirstPartyTypeKind;
6085
6115
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6086
6116
  //#endregion
6087
- //#region ../types/dist/sleep-C9EWTQr9.mjs
6117
+ //#region ../types/dist/sleep-BT1bLgPq.mjs
6088
6118
  /**
6089
6119
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6090
6120
  * window to float samples (D455).
@@ -7376,7 +7406,7 @@ var RecordIntegrationInstances = class {
7376
7406
  kindOfBody(body) {
7377
7407
  if (this.hooks.kindOf !== void 0) {
7378
7408
  const id = this.hooks.kindOf(body);
7379
- if (!this.hooks.description.kinds.some((declared) => declared.id === id)) throw new Error(`record kind '${this.kind.name}': kindOf returned '${id}', which describe().kinds does not declare (D1013)`);
7409
+ if (!this.hooks.description.kinds.some((declared) => declared.id === id)) throw new Error(`record kind '${this.kind.name}': kindOf returned '${id}', which describe().kinds does not declare`);
7380
7410
  return id;
7381
7411
  }
7382
7412
  const only = this.hooks.description.kinds[0];
@@ -7406,8 +7436,15 @@ var RecordIntegrationInstances = class {
7406
7436
  field: link.field,
7407
7437
  to: link.to
7408
7438
  })) };
7439
+ const wired = this.hooks.test !== void 0;
7440
+ const stated = this.hooks.description;
7409
7441
  return {
7410
- ...this.hooks.description,
7442
+ ...stated,
7443
+ ...stated.canTest && !wired ? { canTest: false } : {},
7444
+ ...stated.kinds === void 0 ? {} : { kinds: stated.kinds.map((kind) => kind.canTest === true && !wired ? {
7445
+ ...kind,
7446
+ canTest: false
7447
+ } : kind) },
7411
7448
  ...links,
7412
7449
  ...this.hooks.mintId === void 0 ? {} : { mintsId: true }
7413
7450
  };
@@ -10182,6 +10219,18 @@ var RuleFireOriginSchema = object({
10182
10219
  cameraId: number$1().int()
10183
10220
  })).optional()
10184
10221
  });
10222
+ /** WHO an exporter acts for: the ecosystem and the principal it reported, never invented. */
10223
+ var OnBehalfSchema = object({
10224
+ source: _enum([
10225
+ "homeassistant",
10226
+ "homekit",
10227
+ "alexa",
10228
+ "google",
10229
+ "matter"
10230
+ ]),
10231
+ principalId: string(),
10232
+ principalName: string().optional()
10233
+ });
10185
10234
  discriminatedUnion("kind", [
10186
10235
  object({
10187
10236
  kind: literal("action"),
@@ -10198,7 +10247,8 @@ discriminatedUnion("kind", [
10198
10247
  object({
10199
10248
  kind: literal("rule"),
10200
10249
  fire: RuleFireOriginSchema
10201
- })
10250
+ }),
10251
+ OnBehalfSchema.extend({ kind: literal("on-behalf") })
10202
10252
  ]);
10203
10253
  /**
10204
10254
  * One recorded device transition (D1022): a status field of a device went from
@@ -10234,7 +10284,9 @@ var TransitionActorSchema = discriminatedUnion("kind", [
10234
10284
  object({
10235
10285
  kind: literal("addon"),
10236
10286
  addonId: string(),
10237
- nodeId: string().optional()
10287
+ nodeId: string().optional(),
10288
+ /** The ecosystem principal an exporter relayed, when it reported one. */
10289
+ onBehalf: OnBehalfSchema.optional()
10238
10290
  }),
10239
10291
  object({
10240
10292
  kind: literal("action"),
@@ -10764,6 +10816,10 @@ var CAP_VOCABULARY_BY_NAME = {
10764
10816
  effect: {
10765
10817
  field: "on",
10766
10818
  value: true
10819
+ },
10820
+ offeredWhen: {
10821
+ method: "getOptions",
10822
+ field: "supportsSetState"
10767
10823
  }
10768
10824
  },
10769
10825
  {
@@ -10782,6 +10838,10 @@ var CAP_VOCABULARY_BY_NAME = {
10782
10838
  effect: {
10783
10839
  field: "on",
10784
10840
  value: false
10841
+ },
10842
+ offeredWhen: {
10843
+ method: "getOptions",
10844
+ field: "supportsSetState"
10785
10845
  }
10786
10846
  },
10787
10847
  {
@@ -10795,9 +10855,14 @@ var CAP_VOCABULARY_BY_NAME = {
10795
10855
  en: "Toggle {device}",
10796
10856
  it: "Commuta {device}"
10797
10857
  },
10798
- icon: "toggle-right"
10858
+ icon: "toggle-right",
10859
+ offeredWhen: {
10860
+ method: "getOptions",
10861
+ field: "supportsSetState"
10862
+ }
10799
10863
  }
10800
10864
  ],
10865
+ notOperatorFacing: { powerCycle: "a power cycle is the forced restart of the device the switch powers (power-source), never a step of its own" },
10801
10866
  state: [{
10802
10867
  kind: "boolean",
10803
10868
  field: "on",
@@ -11056,6 +11121,47 @@ var CAP_VOCABULARY_BY_NAME = {
11056
11121
  "switch.off": { icon: "plug" }
11057
11122
  },
11058
11123
  state: { on: { icon: "plug-zap" } }
11124
+ },
11125
+ [DeviceRole.PoePort]: {
11126
+ actions: {
11127
+ "switch.on": {
11128
+ label: {
11129
+ en: "Power on",
11130
+ it: "Alimenta"
11131
+ },
11132
+ phrase: {
11133
+ en: "Power on {device}",
11134
+ it: "Alimenta {device}"
11135
+ },
11136
+ icon: "plug-zap"
11137
+ },
11138
+ "switch.off": {
11139
+ label: {
11140
+ en: "Power off",
11141
+ it: "Togli alimentazione"
11142
+ },
11143
+ phrase: {
11144
+ en: "Power off {device}",
11145
+ it: "Togli alimentazione a {device}"
11146
+ },
11147
+ icon: "unplug"
11148
+ }
11149
+ },
11150
+ state: { on: {
11151
+ label: {
11152
+ en: "Powered",
11153
+ it: "Alimentata"
11154
+ },
11155
+ whenTrue: {
11156
+ en: "When {device} is powered",
11157
+ it: "Quando {device} viene alimentata"
11158
+ },
11159
+ whenFalse: {
11160
+ en: "When {device} loses power",
11161
+ it: "Quando {device} perde l’alimentazione"
11162
+ },
11163
+ icon: "plug-zap"
11164
+ } }
11059
11165
  }
11060
11166
  }
11061
11167
  }
@@ -11775,7 +11881,11 @@ var CAP_VOCABULARY_BY_NAME = {
11775
11881
  en: "Power on {device}",
11776
11882
  it: "Dai corrente a {device}"
11777
11883
  },
11778
- icon: "power"
11884
+ icon: "power",
11885
+ offeredWhen: {
11886
+ method: "getStatus",
11887
+ field: "switchSettable"
11888
+ }
11779
11889
  },
11780
11890
  {
11781
11891
  id: "powerSource.off",
@@ -11788,7 +11898,11 @@ var CAP_VOCABULARY_BY_NAME = {
11788
11898
  en: "Cut the power of {device}",
11789
11899
  it: "Togli la corrente a {device}"
11790
11900
  },
11791
- icon: "power-off"
11901
+ icon: "power-off",
11902
+ offeredWhen: {
11903
+ method: "getStatus",
11904
+ field: "switchSettable"
11905
+ }
11792
11906
  },
11793
11907
  {
11794
11908
  id: "powerSource.forceRestart",
@@ -13552,6 +13666,91 @@ var CAP_VOCABULARY_BY_NAME = {
13552
13666
  }],
13553
13667
  events: { onMotionTriggerChanged: { notOperatorFacing: "the `enabled` state trigger phrases both edges of this change" } }
13554
13668
  },
13669
+ "siren": {
13670
+ scope: "device",
13671
+ noun: {
13672
+ en: "Siren",
13673
+ it: "Sirena"
13674
+ },
13675
+ actions: [
13676
+ {
13677
+ id: "siren.trigger",
13678
+ method: "trigger",
13679
+ label: {
13680
+ en: "Sound the siren",
13681
+ it: "Fai suonare la sirena"
13682
+ },
13683
+ phrase: {
13684
+ en: "Sound {device}",
13685
+ it: "Fai suonare {device}"
13686
+ },
13687
+ icon: "siren",
13688
+ args: {}
13689
+ },
13690
+ {
13691
+ id: "siren.triggerPlays",
13692
+ method: "trigger",
13693
+ label: {
13694
+ en: "Sound the siren N times",
13695
+ it: "Fai suonare la sirena N volte"
13696
+ },
13697
+ phrase: {
13698
+ en: "Sound {device} {plays} times",
13699
+ it: "Fai suonare {device} {plays} volte"
13700
+ },
13701
+ icon: "siren",
13702
+ openArgs: [{
13703
+ key: "plays",
13704
+ label: {
13705
+ en: "Plays",
13706
+ it: "Riproduzioni"
13707
+ },
13708
+ offer: {
13709
+ kind: "dynamic",
13710
+ from: "method",
13711
+ method: "getPlayChoices",
13712
+ valueKind: "number"
13713
+ }
13714
+ }]
13715
+ },
13716
+ {
13717
+ id: "siren.stop",
13718
+ method: "stop",
13719
+ label: {
13720
+ en: "Silence the siren",
13721
+ it: "Zittisci la sirena"
13722
+ },
13723
+ phrase: {
13724
+ en: "Silence {device}",
13725
+ it: "Zittisci {device}"
13726
+ },
13727
+ icon: "siren",
13728
+ args: {},
13729
+ effect: {
13730
+ field: "active",
13731
+ value: false
13732
+ }
13733
+ }
13734
+ ],
13735
+ state: [{
13736
+ kind: "boolean",
13737
+ field: "active",
13738
+ label: {
13739
+ en: "Siren sounding",
13740
+ it: "Sirena in funzione"
13741
+ },
13742
+ whenTrue: {
13743
+ en: "When {device} starts sounding",
13744
+ it: "Quando {device} inizia a suonare"
13745
+ },
13746
+ whenFalse: {
13747
+ en: "When {device} falls silent",
13748
+ it: "Quando {device} smette di suonare"
13749
+ },
13750
+ icon: "siren"
13751
+ }],
13752
+ events: { onSirenChanged: { notOperatorFacing: "the `active` state trigger phrases both edges of this change" } }
13753
+ },
13555
13754
  "vacuum-control": {
13556
13755
  scope: "device",
13557
13756
  noun: {
@@ -16127,6 +16326,374 @@ var CAP_VOCABULARY_BY_NAME = {
16127
16326
  icon: "loader"
16128
16327
  }]
16129
16328
  },
16329
+ "workload": {
16330
+ scope: "device",
16331
+ noun: {
16332
+ en: "Workload",
16333
+ it: "Carico di lavoro"
16334
+ },
16335
+ actions: [
16336
+ {
16337
+ id: "workload.start",
16338
+ method: "start",
16339
+ label: {
16340
+ en: "Start",
16341
+ it: "Avvia"
16342
+ },
16343
+ phrase: {
16344
+ en: "Start {device}",
16345
+ it: "Avvia {device}"
16346
+ },
16347
+ icon: "play",
16348
+ effect: {
16349
+ field: "state",
16350
+ value: "running"
16351
+ }
16352
+ },
16353
+ {
16354
+ id: "workload.stop",
16355
+ method: "stop",
16356
+ label: {
16357
+ en: "Stop",
16358
+ it: "Arresta"
16359
+ },
16360
+ phrase: {
16361
+ en: "Stop {device}",
16362
+ it: "Arresta {device}"
16363
+ },
16364
+ icon: "square",
16365
+ effect: {
16366
+ field: "state",
16367
+ value: "stopped"
16368
+ }
16369
+ },
16370
+ {
16371
+ id: "workload.restart",
16372
+ method: "restart",
16373
+ label: {
16374
+ en: "Restart",
16375
+ it: "Riavvia"
16376
+ },
16377
+ phrase: {
16378
+ en: "Restart {device}",
16379
+ it: "Riavvia {device}"
16380
+ },
16381
+ icon: "rotate-ccw"
16382
+ },
16383
+ {
16384
+ id: "workload.pause",
16385
+ method: "pause",
16386
+ label: {
16387
+ en: "Pause",
16388
+ it: "Metti in pausa"
16389
+ },
16390
+ phrase: {
16391
+ en: "Pause {device}",
16392
+ it: "Metti in pausa {device}"
16393
+ },
16394
+ icon: "pause",
16395
+ effect: {
16396
+ field: "state",
16397
+ value: "paused"
16398
+ }
16399
+ },
16400
+ {
16401
+ id: "workload.resume",
16402
+ method: "resume",
16403
+ label: {
16404
+ en: "Resume",
16405
+ it: "Riprendi"
16406
+ },
16407
+ phrase: {
16408
+ en: "Resume {device}",
16409
+ it: "Riprendi {device}"
16410
+ },
16411
+ icon: "circle-play",
16412
+ effect: {
16413
+ field: "state",
16414
+ value: "running"
16415
+ }
16416
+ },
16417
+ {
16418
+ id: "workload.forceStop",
16419
+ method: "forceStop",
16420
+ label: {
16421
+ en: "Force stop",
16422
+ it: "Arresto forzato"
16423
+ },
16424
+ phrase: {
16425
+ en: "Force {device} to stop",
16426
+ it: "Forza l’arresto di {device}"
16427
+ },
16428
+ icon: "octagon-x",
16429
+ effect: {
16430
+ field: "state",
16431
+ value: "stopped"
16432
+ }
16433
+ }
16434
+ ],
16435
+ state: [
16436
+ {
16437
+ kind: "enum",
16438
+ field: "state",
16439
+ label: {
16440
+ en: "State",
16441
+ it: "Stato"
16442
+ },
16443
+ values: [
16444
+ {
16445
+ value: "running",
16446
+ label: {
16447
+ en: "Running",
16448
+ it: "In esecuzione"
16449
+ },
16450
+ phrase: {
16451
+ en: "When {device} is running",
16452
+ it: "Quando {device} è in esecuzione"
16453
+ }
16454
+ },
16455
+ {
16456
+ value: "paused",
16457
+ label: {
16458
+ en: "Paused",
16459
+ it: "In pausa"
16460
+ }
16461
+ },
16462
+ {
16463
+ value: "stopped",
16464
+ label: {
16465
+ en: "Stopped",
16466
+ it: "Arrestato"
16467
+ },
16468
+ phrase: {
16469
+ en: "When {device} is stopped",
16470
+ it: "Quando {device} è arrestato"
16471
+ }
16472
+ },
16473
+ {
16474
+ value: "starting",
16475
+ label: {
16476
+ en: "Starting",
16477
+ it: "In avvio"
16478
+ }
16479
+ },
16480
+ {
16481
+ value: "stopping",
16482
+ label: {
16483
+ en: "Stopping",
16484
+ it: "In arresto"
16485
+ }
16486
+ },
16487
+ {
16488
+ value: "crashed",
16489
+ label: {
16490
+ en: "Crashed",
16491
+ it: "Arrestato in modo anomalo"
16492
+ },
16493
+ phrase: {
16494
+ en: "When {device} has crashed",
16495
+ it: "Quando {device} è arrestato in modo anomalo"
16496
+ }
16497
+ }
16498
+ ],
16499
+ icon: "activity"
16500
+ },
16501
+ {
16502
+ kind: "numeric",
16503
+ field: "resources.cpuPercent",
16504
+ quantity: {
16505
+ en: "the CPU use",
16506
+ it: "l'uso della CPU"
16507
+ },
16508
+ label: {
16509
+ en: "CPU",
16510
+ it: "CPU"
16511
+ },
16512
+ unit: "%",
16513
+ icon: "cpu"
16514
+ },
16515
+ {
16516
+ kind: "numeric",
16517
+ field: "resources.memoryPercent",
16518
+ quantity: {
16519
+ en: "the memory use",
16520
+ it: "l'uso della memoria"
16521
+ },
16522
+ label: {
16523
+ en: "Memory",
16524
+ it: "Memoria"
16525
+ },
16526
+ unit: "%",
16527
+ icon: "memory-stick"
16528
+ },
16529
+ {
16530
+ kind: "numeric",
16531
+ field: "resources.temperature",
16532
+ quantity: {
16533
+ en: "the temperature",
16534
+ it: "la temperatura"
16535
+ },
16536
+ label: {
16537
+ en: "Temperature",
16538
+ it: "Temperatura"
16539
+ },
16540
+ unit: "°C",
16541
+ icon: "thermometer"
16542
+ }
16543
+ ],
16544
+ events: {
16545
+ onStarted: {
16546
+ category: EventCategory.WorkloadStarted,
16547
+ label: {
16548
+ en: "Started",
16549
+ it: "Avviato"
16550
+ },
16551
+ phrase: {
16552
+ en: "When {device} starts",
16553
+ it: "Quando {device} si avvia"
16554
+ },
16555
+ icon: "play"
16556
+ },
16557
+ onStopped: {
16558
+ category: EventCategory.WorkloadStopped,
16559
+ label: {
16560
+ en: "Stopped",
16561
+ it: "Arrestato"
16562
+ },
16563
+ phrase: {
16564
+ en: "When {device} stops",
16565
+ it: "Quando {device} si arresta"
16566
+ },
16567
+ icon: "square"
16568
+ },
16569
+ onCrashed: {
16570
+ category: EventCategory.WorkloadCrashed,
16571
+ label: {
16572
+ en: "Crashed",
16573
+ it: "Arrestato in modo anomalo"
16574
+ },
16575
+ phrase: {
16576
+ en: "When {device} stops without being asked",
16577
+ it: "Quando {device} si arresta senza che sia stato richiesto"
16578
+ },
16579
+ icon: "triangle-alert"
16580
+ },
16581
+ onRecovered: {
16582
+ category: EventCategory.WorkloadRecovered,
16583
+ label: {
16584
+ en: "Recovered",
16585
+ it: "Ripristinato"
16586
+ },
16587
+ phrase: {
16588
+ en: "When {device} runs again after a crash",
16589
+ it: "Quando {device} riparte dopo un arresto anomalo"
16590
+ },
16591
+ icon: "heart-pulse"
16592
+ }
16593
+ },
16594
+ overrides: { byRole: {
16595
+ [DeviceRole.Vm]: {
16596
+ actions: { "workload.start": { icon: "monitor" } },
16597
+ state: { state: { icon: "monitor" } }
16598
+ },
16599
+ [DeviceRole.AppContainer]: {
16600
+ actions: { "workload.start": { icon: "container" } },
16601
+ state: { state: { icon: "container" } }
16602
+ },
16603
+ [DeviceRole.Lxc]: {
16604
+ actions: { "workload.start": { icon: "box" } },
16605
+ state: { state: { icon: "box" } }
16606
+ },
16607
+ [DeviceRole.App]: {
16608
+ actions: { "workload.start": { icon: "app-window" } },
16609
+ state: { state: { icon: "app-window" } }
16610
+ },
16611
+ [DeviceRole.Host]: {
16612
+ actions: {
16613
+ "workload.start": {
16614
+ label: {
16615
+ en: "Power on",
16616
+ it: "Accendi"
16617
+ },
16618
+ phrase: {
16619
+ en: "Power on {device}",
16620
+ it: "Accendi {device}"
16621
+ },
16622
+ icon: "power"
16623
+ },
16624
+ "workload.stop": {
16625
+ label: {
16626
+ en: "Shut down",
16627
+ it: "Spegni"
16628
+ },
16629
+ phrase: {
16630
+ en: "Shut down {device}",
16631
+ it: "Spegni {device}"
16632
+ },
16633
+ icon: "power-off"
16634
+ },
16635
+ "workload.restart": {
16636
+ label: {
16637
+ en: "Reboot",
16638
+ it: "Riavvia"
16639
+ },
16640
+ phrase: {
16641
+ en: "Reboot {device}",
16642
+ it: "Riavvia {device}"
16643
+ },
16644
+ icon: "refresh-cw"
16645
+ }
16646
+ },
16647
+ state: { state: { icon: "server" } },
16648
+ events: {
16649
+ onStarted: {
16650
+ label: {
16651
+ en: "Came online",
16652
+ it: "Tornato in linea"
16653
+ },
16654
+ phrase: {
16655
+ en: "When {device} comes online",
16656
+ it: "Quando {device} torna in linea"
16657
+ },
16658
+ icon: "server"
16659
+ },
16660
+ onStopped: {
16661
+ label: {
16662
+ en: "Shut down",
16663
+ it: "Spento"
16664
+ },
16665
+ phrase: {
16666
+ en: "When {device} shuts down",
16667
+ it: "Quando {device} si spegne"
16668
+ },
16669
+ icon: "server-off"
16670
+ },
16671
+ onCrashed: {
16672
+ label: {
16673
+ en: "Went down",
16674
+ it: "Caduto"
16675
+ },
16676
+ phrase: {
16677
+ en: "When {device} goes down unexpectedly",
16678
+ it: "Quando {device} cade inaspettatamente"
16679
+ },
16680
+ icon: "server-crash"
16681
+ },
16682
+ onRecovered: {
16683
+ label: {
16684
+ en: "Came online",
16685
+ it: "Tornato in linea"
16686
+ },
16687
+ phrase: {
16688
+ en: "When {device} comes back online after going down",
16689
+ it: "Quando {device} torna in linea dopo essere caduto"
16690
+ },
16691
+ icon: "server"
16692
+ }
16693
+ }
16694
+ }
16695
+ } }
16696
+ },
16130
16697
  "accessories": {
16131
16698
  scope: "device",
16132
16699
  noun: {
@@ -16906,6 +17473,14 @@ var CAP_VOCABULARY_BY_NAME = {
16906
17473
  icon: "refresh-cw"
16907
17474
  }]
16908
17475
  },
17476
+ "resync": {
17477
+ scope: "device",
17478
+ noun: {
17479
+ en: "Re-sync",
17480
+ it: "Risincronizzazione"
17481
+ },
17482
+ notOperatorFacing: { resync: "device adoption — re-aligning a device with its source is an onboarding step, not an automation action" }
17483
+ },
16909
17484
  "recording": {
16910
17485
  scope: "device",
16911
17486
  noun: {
@@ -18917,7 +19492,6 @@ var CAP_VOCABULARY_BY_NAME = {
18917
19492
  en: "Battery",
18918
19493
  it: "Batteria"
18919
19494
  },
18920
- notOperatorFacing: { wakeForStream: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage" },
18921
19495
  state: [
18922
19496
  {
18923
19497
  kind: "numeric",
@@ -19027,6 +19601,14 @@ var CAP_VOCABULARY_BY_NAME = {
19027
19601
  icon: "moon"
19028
19602
  }]
19029
19603
  },
19604
+ "low-power-sleep": {
19605
+ scope: "device",
19606
+ noun: {
19607
+ en: "Low-power sleep",
19608
+ it: "Sospensione a basso consumo"
19609
+ },
19610
+ notOperatorFacing: { wakeUp: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage" }
19611
+ },
19030
19612
  "network-link": {
19031
19613
  scope: "device",
19032
19614
  noun: {
@@ -19793,6 +20375,15 @@ var PipelineStepInputSchema = lazy(() => object({
19793
20375
  }));
19794
20376
  /** Typed bridge to the recursive `FrameResult` graph; validation is structural. */
19795
20377
  var PipelineRunResultBridge = custom();
20378
+ /**
20379
+ * Whether a switch can be set (D1058), schema-free so the addon runner can import it from
20380
+ * `@camstack/types/addon` without loading the capability schema graph (D28).
20381
+ */
20382
+ /** The read that decides whether a switch is offered on/off (`offeredWhen` of its actions). */
20383
+ var SWITCH_SETTABLE_GATE = {
20384
+ method: "getOptions",
20385
+ field: "supportsSetState"
20386
+ };
19796
20387
  var StaticDirOutputSchema = object({ staticDir: string() });
19797
20388
  var VersionOutputSchema = object({ version: string() });
19798
20389
  method(_void(), StaticDirOutputSchema, { auth: "admin" }), method(_void(), VersionOutputSchema, { auth: "admin" }), NOT_A_DEVICE.UI_PLUMBING;
@@ -19929,6 +20520,7 @@ var CAP_NAMES = Object.freeze([
19929
20520
  "log-channels",
19930
20521
  "log-destination",
19931
20522
  "login-method",
20523
+ "low-power-sleep",
19932
20524
  "media-player",
19933
20525
  "mesh-network",
19934
20526
  "meter",
@@ -19982,12 +20574,14 @@ var CAP_NAMES = Object.freeze([
19982
20574
  "records",
19983
20575
  "remote",
19984
20576
  "remote-layout-components",
20577
+ "resync",
19985
20578
  "running-state",
19986
20579
  "scene-monitor",
19987
20580
  "schedulers",
19988
20581
  "script-runner",
19989
20582
  "server-management",
19990
20583
  "settings-store",
20584
+ "siren",
19991
20585
  "smoke",
19992
20586
  "smtp-provider",
19993
20587
  "snapshot",
@@ -20027,6 +20621,7 @@ var CAP_NAMES = Object.freeze([
20027
20621
  "weather",
20028
20622
  "weather-station",
20029
20623
  "webrtc-session",
20624
+ "workload",
20030
20625
  "zone-analytics",
20031
20626
  "zone-rules",
20032
20627
  "zones"
@@ -20083,7 +20678,7 @@ Object.freeze({
20083
20678
  ]
20084
20679
  },
20085
20680
  {
20086
- "path": "requiresCode",
20681
+ "path": "codeRequired",
20087
20682
  "valueType": "boolean"
20088
20683
  }
20089
20684
  ],
@@ -21151,7 +21746,24 @@ Object.freeze({
21151
21746
  "jammed",
21152
21747
  "door-open"
21153
21748
  ]
21749
+ }, {
21750
+ "path": "codeRequired",
21751
+ "valueType": "boolean"
21154
21752
  }],
21753
+ "low-power-sleep": [
21754
+ {
21755
+ "path": "sleeping",
21756
+ "valueType": "boolean"
21757
+ },
21758
+ {
21759
+ "path": "lastContactAt",
21760
+ "valueType": "number"
21761
+ },
21762
+ {
21763
+ "path": "lastUpdated",
21764
+ "valueType": "number"
21765
+ }
21766
+ ],
21155
21767
  "media-player": [
21156
21768
  {
21157
21769
  "path": "state",
@@ -21329,6 +21941,14 @@ Object.freeze({
21329
21941
  "path": "ssid",
21330
21942
  "valueType": "string"
21331
21943
  },
21944
+ {
21945
+ "path": "speedKbps",
21946
+ "valueType": "number"
21947
+ },
21948
+ {
21949
+ "path": "linkUp",
21950
+ "valueType": "boolean"
21951
+ },
21332
21952
  {
21333
21953
  "path": "lastUpdated",
21334
21954
  "valueType": "number"
@@ -21712,6 +22332,32 @@ Object.freeze({
21712
22332
  "valueType": "string"
21713
22333
  }
21714
22334
  ],
22335
+ "siren": [
22336
+ {
22337
+ "path": "active",
22338
+ "valueType": "boolean"
22339
+ },
22340
+ {
22341
+ "path": "activeUntil",
22342
+ "valueType": "number"
22343
+ },
22344
+ {
22345
+ "path": "durationSeconds",
22346
+ "valueType": "number"
22347
+ },
22348
+ {
22349
+ "path": "plays",
22350
+ "valueType": "number"
22351
+ },
22352
+ {
22353
+ "path": "activeUntilEstimated",
22354
+ "valueType": "boolean"
22355
+ },
22356
+ {
22357
+ "path": "lastTriggeredAt",
22358
+ "valueType": "number"
22359
+ }
22360
+ ],
21715
22361
  "smoke": [{
21716
22362
  "path": "detected",
21717
22363
  "valueType": "boolean"
@@ -22109,6 +22755,92 @@ Object.freeze({
22109
22755
  "valueType": "number"
22110
22756
  }
22111
22757
  ],
22758
+ "workload": [
22759
+ {
22760
+ "path": "state",
22761
+ "valueType": "enum",
22762
+ "enumValues": [
22763
+ "running",
22764
+ "paused",
22765
+ "stopped",
22766
+ "starting",
22767
+ "stopping",
22768
+ "crashed"
22769
+ ]
22770
+ },
22771
+ {
22772
+ "path": "since",
22773
+ "valueType": "number"
22774
+ },
22775
+ {
22776
+ "path": "hostDeviceId",
22777
+ "valueType": "number"
22778
+ },
22779
+ {
22780
+ "path": "image",
22781
+ "valueType": "string"
22782
+ },
22783
+ {
22784
+ "path": "os",
22785
+ "valueType": "string"
22786
+ },
22787
+ {
22788
+ "path": "version",
22789
+ "valueType": "string"
22790
+ },
22791
+ {
22792
+ "path": "autostart",
22793
+ "valueType": "boolean"
22794
+ },
22795
+ {
22796
+ "path": "resources.cpuPercent",
22797
+ "valueType": "number"
22798
+ },
22799
+ {
22800
+ "path": "resources.memoryUsedBytes",
22801
+ "valueType": "number"
22802
+ },
22803
+ {
22804
+ "path": "resources.memoryPercent",
22805
+ "valueType": "number"
22806
+ },
22807
+ {
22808
+ "path": "resources.memoryLimitBytes",
22809
+ "valueType": "number"
22810
+ },
22811
+ {
22812
+ "path": "resources.vcpus",
22813
+ "valueType": "number"
22814
+ },
22815
+ {
22816
+ "path": "resources.diskUsedBytes",
22817
+ "valueType": "number"
22818
+ },
22819
+ {
22820
+ "path": "resources.diskTotalBytes",
22821
+ "valueType": "number"
22822
+ },
22823
+ {
22824
+ "path": "resources.netRxKbps",
22825
+ "valueType": "number"
22826
+ },
22827
+ {
22828
+ "path": "resources.netTxKbps",
22829
+ "valueType": "number"
22830
+ },
22831
+ {
22832
+ "path": "resources.load1",
22833
+ "valueType": "number"
22834
+ },
22835
+ {
22836
+ "path": "resources.temperature",
22837
+ "valueType": "number"
22838
+ },
22839
+ {
22840
+ "path": "updateAvailable",
22841
+ "valueType": "boolean"
22842
+ }
22843
+ ],
22112
22844
  "zone-analytics": [
22113
22845
  {
22114
22846
  "path": "ts",
@@ -22201,7 +22933,7 @@ Object.freeze({
22201
22933
  }
22202
22934
  });
22203
22935
  //#endregion
22204
- //#region ../types/dist/implemented-methods-C5FMXLGP.mjs
22936
+ //#region ../types/dist/implemented-methods-k3KProJd.mjs
22205
22937
  /**
22206
22938
  * The ffmpeg build every CamStack node downloads, per platform and arch.
22207
22939
  *
@@ -23122,63 +23854,99 @@ var HelperMemberSchema = object({
23122
23854
  cap: string().min(1),
23123
23855
  fieldPath: string().min(1)
23124
23856
  });
23857
+ /** A group, a statistic, or an integral (D944). The composer runs all three. */
23858
+ var GroupHelperSpecSchema = object({
23859
+ kind: literal("group"),
23860
+ templateId: GroupTemplateIdSchema,
23861
+ aggregate: AggregateReducerSchema,
23862
+ members: array(HelperMemberSchema).min(1).max(64),
23863
+ /** Actuator groups only. Readings leave this unset. */
23864
+ active: ActiveCriterionSchema.optional()
23865
+ });
23866
+ var statisticHelperObject = object({
23867
+ kind: literal("statistic"),
23868
+ stat: _enum(STATISTIC_STATS),
23869
+ window: StatisticWindowSchema,
23870
+ source: HelperMemberSchema
23871
+ });
23872
+ var integralHelperObject = object({
23873
+ kind: literal("integral"),
23874
+ reset: _enum(RESET_PERIODS),
23875
+ output: _enum(["energy", "meter"]),
23876
+ source: HelperMemberSchema
23877
+ });
23878
+ var thresholdHelperObject = object({
23879
+ kind: literal("threshold"),
23880
+ source: HelperMemberSchema,
23881
+ high: number$1(),
23882
+ low: number$1(),
23883
+ onForMs: number$1().int().nonnegative(),
23884
+ offForMs: number$1().int().nonnegative()
23885
+ });
23886
+ var arithmeticHelperObject = object({
23887
+ kind: literal("arithmetic"),
23888
+ op: _enum([
23889
+ "sum",
23890
+ "difference",
23891
+ "ratio"
23892
+ ]),
23893
+ inputs: array(HelperMemberSchema).min(2).max(64)
23894
+ });
23895
+ var expressionHelperObject = object({
23896
+ kind: literal("expression"),
23897
+ expr: string().min(1),
23898
+ inputs: array(object({
23899
+ name: string().min(1),
23900
+ member: HelperMemberSchema
23901
+ })).min(1).max(64),
23902
+ output: _enum(["number", "boolean"])
23903
+ });
23904
+ var derivativeHelperObject = object({
23905
+ kind: literal("derivative"),
23906
+ window: RollingWindowSchema,
23907
+ per: _enum([
23908
+ "second",
23909
+ "minute",
23910
+ "hour"
23911
+ ]),
23912
+ source: HelperMemberSchema
23913
+ });
23914
+ /** The stream profiles a camera grid can publish. */
23915
+ var GRID_PROFILES = [
23916
+ "high",
23917
+ "mid",
23918
+ "low"
23919
+ ];
23920
+ /** A rectangle in normalized [0,1] coordinates of whatever contains it. */
23921
+ var GridRectSchema = object({
23922
+ x: number$1().min(0).max(1),
23923
+ y: number$1().min(0).max(1),
23924
+ width: number$1().gt(0).max(1),
23925
+ height: number$1().gt(0).max(1)
23926
+ });
23927
+ var GridCellSpecSchema = object({
23928
+ source: CompositionSourceRefSchema,
23929
+ region: GridRectSchema,
23930
+ cell: GridRectSchema
23931
+ });
23125
23932
  var HelperSpecSchema = discriminatedUnion("kind", [
23126
23933
  object({
23127
- kind: literal("group"),
23128
- templateId: GroupTemplateIdSchema,
23129
- aggregate: AggregateReducerSchema,
23130
- members: array(HelperMemberSchema).min(1).max(64),
23131
- /** Actuator groups only. Readings leave this unset. */
23132
- active: ActiveCriterionSchema.optional()
23934
+ kind: literal("grid"),
23935
+ fps: number$1().int().min(1).max(60),
23936
+ publishedProfiles: array(_enum(GRID_PROFILES)).max(3),
23937
+ cells: array(GridCellSpecSchema).max(16)
23133
23938
  }),
23134
23939
  object({
23135
- kind: literal("statistic"),
23136
- stat: _enum(STATISTIC_STATS),
23137
- window: StatisticWindowSchema,
23138
- source: HelperMemberSchema
23940
+ kind: literal("terminal"),
23941
+ terminalId: string().uuid()
23139
23942
  }),
23140
- object({
23141
- kind: literal("integral"),
23142
- reset: _enum(RESET_PERIODS),
23143
- output: _enum(["energy", "meter"]),
23144
- source: HelperMemberSchema
23145
- }),
23146
- object({
23147
- kind: literal("threshold"),
23148
- source: HelperMemberSchema,
23149
- high: number$1(),
23150
- low: number$1(),
23151
- onForMs: number$1().int().nonnegative(),
23152
- offForMs: number$1().int().nonnegative()
23153
- }),
23154
- object({
23155
- kind: literal("arithmetic"),
23156
- op: _enum([
23157
- "sum",
23158
- "difference",
23159
- "ratio"
23160
- ]),
23161
- inputs: array(HelperMemberSchema).min(2).max(64)
23162
- }),
23163
- object({
23164
- kind: literal("expression"),
23165
- expr: string().min(1),
23166
- inputs: array(object({
23167
- name: string().min(1),
23168
- member: HelperMemberSchema
23169
- })).min(1).max(64),
23170
- output: _enum(["number", "boolean"])
23171
- }),
23172
- object({
23173
- kind: literal("derivative"),
23174
- window: RollingWindowSchema,
23175
- per: _enum([
23176
- "second",
23177
- "minute",
23178
- "hour"
23179
- ]),
23180
- source: HelperMemberSchema
23181
- })
23943
+ GroupHelperSpecSchema,
23944
+ statisticHelperObject,
23945
+ integralHelperObject,
23946
+ thresholdHelperObject,
23947
+ arithmeticHelperObject,
23948
+ expressionHelperObject,
23949
+ derivativeHelperObject
23182
23950
  ]);
23183
23951
  /** Longest snippet a `code` source may carry (slice 4). */
23184
23952
  var MAX_COMPOSITION_CODE_LENGTH = 2e4;
@@ -48601,6 +49369,67 @@ object({
48601
49369
  /** Namespaces the client listed that no longer exist. */
48602
49370
  deleted: array(PreferenceNamespaceSchema)
48603
49371
  });
49372
+ /**
49373
+ * The wire shapes of `apiCatalog.*` — the API explorer's data (planning#595).
49374
+ *
49375
+ * One entry per tRPC method the hub serves, capability and core routes alike,
49376
+ * read off the live router by the hub (never a hand-written list).
49377
+ */
49378
+ var ApiProcedureKindSchema = _enum([
49379
+ "query",
49380
+ "mutation",
49381
+ "subscription"
49382
+ ]);
49383
+ /** The gate a method runs behind. */
49384
+ var ApiProcedureTierSchema = _enum([
49385
+ "public",
49386
+ "protected",
49387
+ "admin"
49388
+ ]);
49389
+ /** The token scope a capability route is matched against (its `METHOD_ACCESS_MAP` row). */
49390
+ var ApiCatalogScopeSchema = object({
49391
+ capName: string(),
49392
+ capScope: _enum(["device", "system"]),
49393
+ access: _enum([
49394
+ "view",
49395
+ "create",
49396
+ "delete"
49397
+ ]),
49398
+ role: string()
49399
+ });
49400
+ var ApiCatalogEntrySchema = object({
49401
+ /** `<router>.<method>` — the tRPC path. */
49402
+ path: string(),
49403
+ router: string(),
49404
+ method: string(),
49405
+ kind: ApiProcedureKindSchema,
49406
+ tier: ApiProcedureTierSchema,
49407
+ source: _enum(["capability", "core"]),
49408
+ /** `null` on a core route: it needs authentication only (plus admin where its tier says so). */
49409
+ scope: ApiCatalogScopeSchema.nullable(),
49410
+ hasInput: boolean()
49411
+ });
49412
+ /**
49413
+ * May the CALLER call a method. The list has no input, so a method reached
49414
+ * only through a device grant is `per-device`: the real call is allowed or
49415
+ * refused on the device its input names.
49416
+ */
49417
+ var ApiCallableSchema = _enum([
49418
+ "yes",
49419
+ "no",
49420
+ "per-device"
49421
+ ]);
49422
+ object({ methods: array(ApiCatalogEntrySchema.extend({ callable: ApiCallableSchema })) });
49423
+ /** A JSON Schema document, as the explorer receives it. */
49424
+ var JsonSchemaDocumentSchema = record$1(string(), unknown());
49425
+ object({
49426
+ path: string(),
49427
+ hasInput: boolean(),
49428
+ /** The INPUT JSON schema (what the caller sends); `null` without input or when it could not be produced. */
49429
+ schema: JsonSchemaDocumentSchema.nullable(),
49430
+ /** Why no schema could be produced (a non-Zod parser, an unrepresentable type). */
49431
+ error: string().nullable()
49432
+ });
48604
49433
  _enum(["new-session", "step-up"]);
48605
49434
  /** The languages the hub's app landing pages are written in (D858). */
48606
49435
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -52459,9 +53288,8 @@ var airQualitySensorCapability = {
52459
53288
  * Many panels require a PIN code on arm / disarm — the optional
52460
53289
  * `code` field on the methods passes it through to the upstream
52461
53290
  * service; it's NEVER persisted in the runtime slice or any event
52462
- * payload. The presence of a required code is signalled by
52463
- * `DeviceFeature.AlarmPinRequired` so the UI gates a code-entry
52464
- * field without a slice fetch.
53291
+ * payload. Whether a code is required is the slice's `codeRequired`
53292
+ * (#459): `null` when the provider cannot tell (D393).
52465
53293
  *
52466
53294
  * `availableModes` mirrors HA's `supported_features`-derived arm
52467
53295
  * mode list — the UI renders only the buttons the panel accepts.
@@ -52500,9 +53328,13 @@ var AlarmPanelStatusSchema = object({
52500
53328
  /** Subset of arm modes the panel accepts. UI renders one button per
52501
53329
  * mode in this list. */
52502
53330
  availableModes: array(AlarmArmModeSchema),
52503
- /** Whether the panel requires a PIN on arm / disarm. Mirrors
52504
- * `DeviceFeature.AlarmPinRequired` for slice consumers. */
52505
- requiresCode: boolean(),
53331
+ /**
53332
+ * Whether the panel requires a PIN on arm / disarm (#459; the field was
53333
+ * `requiresCode`, and the `alarm-pin-required` device feature is gone).
53334
+ * `null` = the provider cannot tell (D393), never `false`. A slice restored
53335
+ * from before the rename is upgraded at boot by `restoredFieldRenames`.
53336
+ */
53337
+ codeRequired: boolean().nullable(),
52506
53338
  /** Ms epoch when the slice was last updated. */
52507
53339
  lastChangedAt: number$1()
52508
53340
  });
@@ -52559,7 +53391,7 @@ var alarmPanelCapability = {
52559
53391
  arm: method(object({
52560
53392
  deviceId: number$1().int().nonnegative(),
52561
53393
  mode: AlarmArmModeSchema,
52562
- /** Optional PIN code. Required when `requiresCode === true`.
53394
+ /** Optional PIN code. Required when `codeRequired === true`.
52563
53395
  * Passed through to the upstream service; never persisted. */
52564
53396
  code: string().min(1).optional()
52565
53397
  }), _void(), {
@@ -52676,7 +53508,7 @@ var alarmPanelCapability = {
52676
53508
  /**
52677
53509
  * Runtime-state slice — mirrored by the kernel. UI panel reads the
52678
53510
  * full slice; renders an arm button per `availableModes` entry and
52679
- * a PIN field iff `requiresCode === true`.
53511
+ * a PIN field iff `codeRequired === true`.
52680
53512
  */
52681
53513
  runtimeState: AlarmPanelStatusSchema,
52682
53514
  /**
@@ -52687,6 +53519,13 @@ var alarmPanelCapability = {
52687
53519
  */
52688
53520
  durability: "restored",
52689
53521
  /**
53522
+ * A slice persisted before #459 carries `requiresCode`; the boot seed reads it
53523
+ * once into `codeRequired` (`restoredPart`), so no reader meets the old key,
53524
+ * and rewrites the row once without it (`seedMirrorFromRow`) — so this entry
53525
+ * can be dropped after every node has booted once on a release that has it.
53526
+ */
53527
+ restoredFieldRenames: { requiresCode: "codeRequired" },
53528
+ /**
52690
53529
  * History (D850): the panel's lifecycle state as an `enum` series —
52691
53530
  * change-only, no floor, so an `arming -> pending -> triggered` sequence of a
52692
53531
  * few seconds keeps every step. Who armed it stays in the events ledger.
@@ -53884,9 +54723,9 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
53884
54723
  auth: "admin"
53885
54724
  });
53886
54725
  /**
53887
- * Battery status snapshot. Emitted by providers whose device is
53888
- * battery-operated (cameras with `DeviceFeature.BatteryOperated`,
53889
- * future sensor/button accessories). Consumers build their own "low
54726
+ * Battery status snapshot. Emitted by providers whose device reports a
54727
+ * battery (`DeviceFeature.BatteryOperated`): battery cameras, sensors,
54728
+ * buttons. Whether the device SLEEPS is `low-power-sleep`, not this cap. Consumers build their own "low
53890
54729
  * battery" alerting on top — the cap deliberately does NOT enforce a
53891
54730
  * threshold.
53892
54731
  */
@@ -54043,47 +54882,12 @@ var batteryCapability = {
54043
54882
  deviceNative: true,
54044
54883
  mode: "singleton",
54045
54884
  deviceTypes: BATTERY_DEVICE_TYPES,
54046
- methods: {
54047
54885
  /**
54048
- * Explicitly wake the camera from low-power sleep ahead of a
54049
- * streaming session start. Consumers that initiate a stream
54050
- * against a sleeping battery cam (HomeKit Secure Video, Alexa
54051
- * RTCSession, snapshot wrappers) call this with a short timeout
54052
- * before establishing the media pipeline — the broker's own
54053
- * passive wake-on-dial works but adds 5–7 seconds to first-frame,
54054
- * during which the consumer renders a black screen. Pre-waking
54055
- * compresses that gap.
54056
- *
54057
- * Returns `awoke: true` when the firmware acknowledged the wake
54058
- * before `timeoutMs`. Returns `awoke: false` when it timed out OR
54059
- * the cap surface is unavailable (no Baichuan / firmware
54060
- * channel); the caller should still attempt the stream — the
54061
- * passive broker wake remains as fallback.
54062
- */
54063
- wakeForStream: method(object({
54064
- deviceId: number$1(),
54065
- /** Bound on the wait. Sensible range 3000–10000ms. */
54066
- timeoutMs: number$1().int().min(500).max(3e4).default(8e3)
54067
- }), object({
54068
- awoke: boolean(),
54069
- durationMs: number$1()
54070
- }), {
54071
- kind: "mutation",
54072
- notOperatorFacing: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage"
54073
- }) },
54074
- /**
54075
- * A composed provider (battery ADDED to a pet feeder or container that has
54076
- * no wake surface) answers `wakeForStream` with the same "unavailable"
54077
- * result the contract already defines above: "Returns `awoke: false` when
54078
- * … the cap surface is unavailable." (D663).
54886
+ * No methods: waking a sleeping camera is `low-power-sleep.wakeUp`
54887
+ * (#459, Q2). A battery reading says nothing about sleep — a battery sensor
54888
+ * reports charge and never needs waking.
54079
54889
  */
54080
- composedMethods: { wakeForStream: {
54081
- kind: "answer",
54082
- value: {
54083
- awoke: false,
54084
- durationMs: 0
54085
- }
54086
- } },
54890
+ methods: {},
54087
54891
  events: {
54088
54892
  /**
54089
54893
  * Emitted whenever the cached status changes (firmware push OR
@@ -54851,9 +55655,10 @@ var GridProfileOfferSchema = object({
54851
55655
  published: boolean()
54852
55656
  });
54853
55657
  var GridLayoutViewSchema = object({
54854
- /** The persisted grid row this camera was declared from. */
54855
- instanceId: string(),
55658
+ /** The grid block (planning#580) whose camera this is. */
55659
+ blockId: string(),
54856
55660
  deviceId: number$1().int().nonnegative(),
55661
+ /** The device row's name — the only name a grid has; it is renamed on the block or the device. */
54857
55662
  name: string(),
54858
55663
  /**
54859
55664
  * NO canvas size. A grid's resolution is not authored: each profile derives
@@ -54869,7 +55674,6 @@ var GridLayoutViewSchema = object({
54869
55674
  });
54870
55675
  var GridLayoutPatchSchema = object({
54871
55676
  deviceId: number$1().int().nonnegative(),
54872
- name: string().min(1).max(160).optional(),
54873
55677
  fps: number$1().int().min(1).max(60).optional(),
54874
55678
  /** Which profiles to publish. See `GridProfileOffer.published`. */
54875
55679
  publishedProfiles: array(_enum([
@@ -58599,7 +59403,7 @@ var mediaPlayerCapability = {
58599
59403
  ]
58600
59404
  }
58601
59405
  };
58602
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, 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.PetFeeder, DeviceType.MediaPlayer, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation;
59406
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, 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.PetFeeder, DeviceType.MediaPlayer, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation;
58603
59407
  var NUMBER = {
58604
59408
  kind: "fixed",
58605
59409
  result: ["number"]
@@ -59049,7 +59853,7 @@ new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
59049
59853
  DeviceType.Camera;
59050
59854
  /**
59051
59855
  * The series a device card trends, per cap (`history.primary` + `history.priority`):
59052
- * 6 caps. The card shows the primary of the enabled cap with the highest priority.
59856
+ * 7 caps. The card shows the primary of the enabled cap with the highest priority.
59053
59857
  */
59054
59858
  var HISTORY_PRIMARY = {
59055
59859
  "climate-control": {
@@ -59075,6 +59879,10 @@ var HISTORY_PRIMARY = {
59075
59879
  "weather-station": {
59076
59880
  field: "temperature",
59077
59881
  priority: 60
59882
+ },
59883
+ "workload": {
59884
+ field: "resources.cpuPercent",
59885
+ priority: 40
59078
59886
  }
59079
59887
  };
59080
59888
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
@@ -59085,6 +59893,8 @@ var PowerSourceRefusalReasonSchema = _enum([
59085
59893
  "switch-unknown",
59086
59894
  "restart-in-progress",
59087
59895
  "switch-call-failed",
59896
+ "switch-options-unreadable",
59897
+ "not-settable",
59088
59898
  "switch-is-actuator"
59089
59899
  ]);
59090
59900
  var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
@@ -59101,6 +59911,14 @@ var PowerSourceInfoSchema = object({
59101
59911
  /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
59102
59912
  switchOn: boolean().nullable(),
59103
59913
  switchOnline: boolean().nullable(),
59914
+ /**
59915
+ * Whether the linked switch can be set (`switch.getOptions().supportsSetState`; a provider
59916
+ * without the method is a plain switch, `true`). `null` = not known: no link, the switch is
59917
+ * missing, or the read FAILED. Absent = a provider that predates the field. Only `false`
59918
+ * withdraws power on / off (`offeredWhen` of `powerSource.on` / `.off`, the device hero) —
59919
+ * unknown keeps them (D315, D1058).
59920
+ */
59921
+ switchSettable: boolean().nullable().optional(),
59104
59922
  restartInProgress: boolean(),
59105
59923
  offSeconds: number$1().int()
59106
59924
  });
@@ -59158,6 +59976,11 @@ var powerSourceCustomize = {
59158
59976
  }]
59159
59977
  };
59160
59978
  var deviceInput$2 = object({ deviceId: number$1().int().nonnegative() });
59979
+ /** The read that decides whether power on / off are offered (`offeredWhen`, D1058). */
59980
+ var POWER_SOURCE_SETTABLE_GATE = {
59981
+ method: "getStatus",
59982
+ field: "switchSettable"
59983
+ };
59161
59984
  var powerSourceCapability = {
59162
59985
  name: "power-source",
59163
59986
  scope: "device",
@@ -59172,7 +59995,8 @@ var powerSourceCapability = {
59172
59995
  id: "powerSource.on",
59173
59996
  label: t("Power on", "Dai corrente"),
59174
59997
  phrase: t("Power on {device}", "Dai corrente a {device}"),
59175
- icon: "power"
59998
+ icon: "power",
59999
+ offeredWhen: POWER_SOURCE_SETTABLE_GATE
59176
60000
  }]
59177
60001
  }),
59178
60002
  powerOff: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
@@ -59182,7 +60006,8 @@ var powerSourceCapability = {
59182
60006
  id: "powerSource.off",
59183
60007
  label: t("Power off", "Togli corrente"),
59184
60008
  phrase: t("Cut the power of {device}", "Togli la corrente a {device}"),
59185
- icon: "power-off"
60009
+ icon: "power-off",
60010
+ offeredWhen: POWER_SOURCE_SETTABLE_GATE
59186
60011
  }]
59187
60012
  }),
59188
60013
  forceRestart: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
@@ -60895,6 +61720,268 @@ var SiteZoneSchema = object({
60895
61720
  * the ones that most want grouping. */
60896
61721
  locationKeys: array(string())
60897
61722
  });
61723
+ /**
61724
+ * Provider-declared device identifiers (D1059, planning#590).
61725
+ *
61726
+ * What a device IS, as its owning provider read it from the hardware: the keys a
61727
+ * later step matches across integrations to tell that two devices are the same
61728
+ * physical object. Separate from `DeviceMetadata` on purpose — metadata is a
61729
+ * free-form blob the operator can edit, identifiers are typed, normalised and
61730
+ * written ONLY by the provider that owns the device (`device-manager.
61731
+ * setIdentifiers`, owner-checked on the transport's caller stamp).
61732
+ *
61733
+ * | Key | Stored form | Strength |
61734
+ * | -------------- | ----------------------------------- | -------- |
61735
+ * | `mac` | `aa:bb:cc:dd:ee:ff`, several | strong |
61736
+ * | `serial` | `<manufacturer>:<serial>` | strong |
61737
+ * | `machine-uuid` | SMBIOS / VM / container uuid | strong |
61738
+ * | `vendor-uid` | `<vendor>:<id>` | strong |
61739
+ * | `hostname` | lower-case, no domain | weak |
61740
+ * | `ip` | IPv4 / IPv6 | weak |
61741
+ *
61742
+ * Strength is a property of the KEY, derived by {@link identifierStrength} —
61743
+ * never stored, so it cannot drift from the table above. A weak key never links
61744
+ * two devices on its own.
61745
+ *
61746
+ * The schema refuses a value that is not in its stored form, so whatever is
61747
+ * persisted is already normalised. Build a declaration with
61748
+ * {@link normaliseIdentifiers}, which turns the raw values a driver read into
61749
+ * that form and names every value it refused.
61750
+ */
61751
+ var DEVICE_IDENTIFIER_KEYS = [
61752
+ "mac",
61753
+ "serial",
61754
+ "machine-uuid",
61755
+ "vendor-uid",
61756
+ "hostname",
61757
+ "ip"
61758
+ ];
61759
+ var DeviceIdentifierKeySchema = _enum(DEVICE_IDENTIFIER_KEYS);
61760
+ /** `read` — the provider read it from the device; `derived` — computed from something else it read. */
61761
+ var DeviceIdentifierOriginSchema = _enum(["read", "derived"]);
61762
+ var MAC_PATTERN = /^[0-9a-f]{2}(?::[0-9a-f]{2}){5}$/;
61763
+ /** `<prefix>:<value>` — prefix a lower-case slug, value lower-case and non-blank. */
61764
+ var PREFIXED_PATTERN = /^[a-z0-9][a-z0-9._-]*:[^\sA-Z]+$/;
61765
+ var MACHINE_UUID_PATTERN = /^[0-9a-f][0-9a-f-]{7,}$/;
61766
+ var HOSTNAME_PATTERN = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
61767
+ function entrySchema(value) {
61768
+ return object({
61769
+ value,
61770
+ origin: DeviceIdentifierOriginSchema,
61771
+ /** Epoch ms of the FIRST read that produced this value (and origin). A later
61772
+ * read of the same value does not move it — see {@link mergeIdentifiers}. */
61773
+ readAt: number$1().int().nonnegative()
61774
+ }).strict();
61775
+ }
61776
+ var MacEntrySchema = entrySchema(string().regex(MAC_PATTERN));
61777
+ var SerialEntrySchema = entrySchema(string().regex(PREFIXED_PATTERN));
61778
+ var MachineUuidEntrySchema = entrySchema(string().regex(MACHINE_UUID_PATTERN));
61779
+ var VendorUidEntrySchema = entrySchema(string().regex(PREFIXED_PATTERN));
61780
+ var HostnameEntrySchema = entrySchema(string().regex(HOSTNAME_PATTERN));
61781
+ var IpEntrySchema = entrySchema(union([ipv4(), ipv6()]));
61782
+ object({
61783
+ value: string().min(1),
61784
+ origin: DeviceIdentifierOriginSchema,
61785
+ readAt: number$1().int().nonnegative()
61786
+ }).strict();
61787
+ /** The typed declaration. Every key optional; `mac` the only one that holds several. */
61788
+ var DeviceIdentifiersSchema = object({
61789
+ mac: array(MacEntrySchema).min(1).readonly().optional(),
61790
+ serial: SerialEntrySchema.optional(),
61791
+ "machine-uuid": MachineUuidEntrySchema.optional(),
61792
+ "vendor-uid": VendorUidEntrySchema.optional(),
61793
+ hostname: HostnameEntrySchema.optional(),
61794
+ ip: IpEntrySchema.optional()
61795
+ }).strict();
61796
+ /** True when the declaration carries no key at all. */
61797
+ function isEmptyIdentifiers(identifiers) {
61798
+ return DEVICE_IDENTIFIER_KEYS.every((key) => identifiers[key] === void 0);
61799
+ }
61800
+ /** Values devices report when they do not know: never an identity. */
61801
+ var PLACEHOLDER_PATTERN = /^(?:unknown|none|n\/?a|null|undefined|default|0+|-+)$/i;
61802
+ var NULL_MACS = new Set(["00:00:00:00:00:00", "ff:ff:ff:ff:ff:ff"]);
61803
+ function rejected(reason) {
61804
+ return {
61805
+ ok: false,
61806
+ reason
61807
+ };
61808
+ }
61809
+ /** `AA-BB-CC-DD-EE-FF`, `aabb.ccdd.eeff`, `AABBCCDDEEFF` → `aa:bb:cc:dd:ee:ff`. */
61810
+ function normaliseMac(raw) {
61811
+ const hex = raw.trim().toLowerCase().replace(/[\s:.-]/g, "");
61812
+ if (!/^[0-9a-f]{12}$/.test(hex)) return rejected("not a 48-bit MAC");
61813
+ const mac = (hex.match(/../g) ?? []).join(":");
61814
+ if (NULL_MACS.has(mac)) return rejected("placeholder MAC");
61815
+ return {
61816
+ ok: true,
61817
+ value: mac
61818
+ };
61819
+ }
61820
+ function slug$2(raw) {
61821
+ return raw.trim().toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[-._]+|[-._]+$/g, "");
61822
+ }
61823
+ function normalisePrefixed(prefixRaw, valueRaw, what) {
61824
+ const prefix = slug$2(prefixRaw);
61825
+ if (prefix.length === 0) return rejected(`no ${what}`);
61826
+ const value = valueRaw.trim().toLowerCase().replace(/\s+/g, "");
61827
+ if (value.length === 0) return rejected("blank value");
61828
+ if (PLACEHOLDER_PATTERN.test(value)) return rejected("placeholder value");
61829
+ return {
61830
+ ok: true,
61831
+ value: `${prefix}:${value}`
61832
+ };
61833
+ }
61834
+ function normaliseMachineUuid(raw) {
61835
+ const value = raw.trim().toLowerCase().replace(/^\{|\}$/g, "");
61836
+ if (!MACHINE_UUID_PATTERN.test(value)) return rejected("not a uuid");
61837
+ if (/^[0-]+$/.test(value) || /^[f-]+$/.test(value)) return rejected("placeholder uuid");
61838
+ return {
61839
+ ok: true,
61840
+ value
61841
+ };
61842
+ }
61843
+ function isIp(value) {
61844
+ return union([ipv4(), ipv6()]).safeParse(value).success;
61845
+ }
61846
+ function normaliseHostname(raw) {
61847
+ const full = raw.trim().toLowerCase().replace(/\.$/, "");
61848
+ if (full.length === 0) return rejected("blank hostname");
61849
+ if (isIp(full)) return rejected("an address, not a hostname");
61850
+ const label = full.split(".")[0] ?? "";
61851
+ if (!HOSTNAME_PATTERN.test(label)) return rejected("not a hostname");
61852
+ if (label === "localhost") return rejected("placeholder hostname");
61853
+ return {
61854
+ ok: true,
61855
+ value: label
61856
+ };
61857
+ }
61858
+ function normaliseIp(raw) {
61859
+ const value = raw.trim().toLowerCase().replace(/^\[|\]$/g, "");
61860
+ if (!isIp(value)) return rejected("not an IP address");
61861
+ if (value === "0.0.0.0" || value === "::" || value === "::1" || value.startsWith("127.")) return rejected("loopback or unspecified address");
61862
+ return {
61863
+ ok: true,
61864
+ value
61865
+ };
61866
+ }
61867
+ function isBlank(value) {
61868
+ return value === null || value === void 0 || value.trim().length === 0;
61869
+ }
61870
+ /**
61871
+ * Turn what a driver read into a valid {@link DeviceIdentifiers}: MACs lower-case
61872
+ * with colons and de-duplicated, a hostname without its domain, an IP validated,
61873
+ * a serial prefixed by its manufacturer, a vendor uid by its vendor. A value that
61874
+ * cannot be normalised is left out and listed in `rejected` — the caller logs it
61875
+ * (with `tags: { deviceId }`), it is never dropped in silence.
61876
+ */
61877
+ function normaliseIdentifiers(raw, options = {}) {
61878
+ const readAt = options.readAt ?? Date.now();
61879
+ const originOf = (key) => options.originByKey?.[key] ?? options.origin ?? "read";
61880
+ const entry = (key, value) => ({
61881
+ value,
61882
+ origin: originOf(key),
61883
+ readAt
61884
+ });
61885
+ const refused = [];
61886
+ const take = (key, input, result) => {
61887
+ if (result.ok) return entry(key, result.value);
61888
+ refused.push({
61889
+ key,
61890
+ value: input,
61891
+ reason: result.reason
61892
+ });
61893
+ };
61894
+ const macInputs = raw.mac === null || raw.mac === void 0 ? [] : [raw.mac].flat();
61895
+ const macs = [];
61896
+ for (const input of macInputs) {
61897
+ if (isBlank(input)) continue;
61898
+ const taken = take("mac", input, normaliseMac(input));
61899
+ if (taken !== void 0 && !macs.some((m) => m.value === taken.value)) macs.push(taken);
61900
+ }
61901
+ const serial = raw.serial === null || raw.serial === void 0 || isBlank(raw.serial.serial) ? void 0 : take("serial", `${raw.serial.manufacturer}:${raw.serial.serial}`, normalisePrefixed(raw.serial.manufacturer, raw.serial.serial, "manufacturer"));
61902
+ const vendorUid = raw.vendorUid === null || raw.vendorUid === void 0 || isBlank(raw.vendorUid.id) ? void 0 : take("vendor-uid", `${raw.vendorUid.vendor}:${raw.vendorUid.id}`, normalisePrefixed(raw.vendorUid.vendor, raw.vendorUid.id, "vendor"));
61903
+ const machineUuid = isBlank(raw.machineUuid) ? void 0 : take("machine-uuid", raw.machineUuid, normaliseMachineUuid(raw.machineUuid));
61904
+ const host = isBlank(raw.host) ? null : raw.host.trim();
61905
+ const hostIsIp = host !== null && isIp(host.toLowerCase().replace(/^\[|\]$/g, ""));
61906
+ const hostnameInput = isBlank(raw.hostname) ? hostIsIp ? null : host : raw.hostname;
61907
+ const ipInput = isBlank(raw.ip) ? hostIsIp ? host : null : raw.ip;
61908
+ const hostname = hostnameInput === null ? void 0 : take("hostname", hostnameInput, normaliseHostname(hostnameInput));
61909
+ const ip = ipInput === null ? void 0 : take("ip", ipInput, normaliseIp(ipInput));
61910
+ return {
61911
+ identifiers: {
61912
+ ...macs.length > 0 ? { mac: macs } : {},
61913
+ ...serial !== void 0 ? { serial } : {},
61914
+ ...machineUuid !== void 0 ? { "machine-uuid": machineUuid } : {},
61915
+ ...vendorUid !== void 0 ? { "vendor-uid": vendorUid } : {},
61916
+ ...hostname !== void 0 ? { hostname } : {},
61917
+ ...ip !== void 0 ? { ip } : {}
61918
+ },
61919
+ rejected: refused
61920
+ };
61921
+ }
61922
+ /**
61923
+ * Cross-integration identity candidates (planning#593, step 2 of D1059's epic).
61924
+ *
61925
+ * Two devices brought by DIFFERENT integrations that share provider-declared
61926
+ * identifiers ({@link DeviceIdentifiers}) are candidates for being the same
61927
+ * physical object. This module holds the answer's shape; the device-manager
61928
+ * keeps the index that finds the pairs and the ONE rule that grades a match
61929
+ * (`classifyIdentityMatch`, `device-identity-index.ts`).
61930
+ *
61931
+ * The rule (operator, planning#590):
61932
+ *
61933
+ * | Matched keys | Confidence |
61934
+ * | ---------------------------------------------- | ----------- |
61935
+ * | two strong KINDS (e.g. `mac` + `serial`) | `auto` |
61936
+ * | `mac` + `ip` | `auto` |
61937
+ * | exactly one strong kind | `proposal` |
61938
+ * | weak keys only (`hostname`, `ip`) | no candidate|
61939
+ *
61940
+ * Strength counts distinct KINDS, not values: two MACs of one device matching
61941
+ * the other's two MACs are still one kind of evidence, so a proposal. In doubt,
61942
+ * no match.
61943
+ *
61944
+ * Read-only: a candidate is NOT a link. Links are step 3.
61945
+ */
61946
+ var IdentityConfidenceSchema = _enum(["auto", "proposal"]);
61947
+ /** One identifier both devices declared, with the same normalised value. */
61948
+ var IdentityMatchedKeySchema = object({
61949
+ key: DeviceIdentifierKeySchema,
61950
+ value: string()
61951
+ });
61952
+ /** One side of a pair: the device and the integration that brought it. */
61953
+ var IdentityCandidateDeviceSchema = object({
61954
+ deviceId: number$1().int(),
61955
+ addonId: string(),
61956
+ /** The integration instance (`int_NNNN`) that adopted it; `null` when none was stamped. */
61957
+ integrationId: string().nullable()
61958
+ });
61959
+ /** Two devices of different integrations sharing at least one strong identifier. `a.deviceId < b.deviceId`. */
61960
+ var IdentityCandidatePairSchema = object({
61961
+ a: IdentityCandidateDeviceSchema,
61962
+ b: IdentityCandidateDeviceSchema,
61963
+ /** Every identifier the two share, weak ones included, ordered by key then value. */
61964
+ keys: array(IdentityMatchedKeySchema).readonly(),
61965
+ confidence: IdentityConfidenceSchema
61966
+ });
61967
+ /**
61968
+ * The answer of `device-manager.listIdentityCandidates`.
61969
+ *
61970
+ * - `unknown` — the index has not loaded yet: nothing can be said, and it is
61971
+ * NOT an empty list (D315).
61972
+ * - `answered` — `pairs` holds every candidate. `undeclaredDeviceIds` are the
61973
+ * devices with no identifiers on record: whether they match anything is
61974
+ * UNKNOWN, never "no match" (D393). A device absent from both lists declared
61975
+ * identifiers and matched nobody.
61976
+ */
61977
+ var IdentityCandidatesSchema = discriminatedUnion("status", [object({
61978
+ status: literal("unknown"),
61979
+ reason: string()
61980
+ }), object({
61981
+ status: literal("answered"),
61982
+ pairs: array(IdentityCandidatePairSchema).readonly(),
61983
+ undeclaredDeviceIds: array(number$1().int()).readonly()
61984
+ })]);
60898
61985
  var DeviceSearchRequiresSchema = object({
60899
61986
  /** Capability names the field wants a value of. Absent when the field wants actions only. */
60900
61987
  caps: array(string()).readonly().optional(),
@@ -61457,6 +62544,10 @@ var DeviceInfoSchema = object({
61457
62544
  /** Hardware + identity blob (manufacturer / model / firmware / sn /
61458
62545
  * uid / mac / …). Populated by drivers; editable via setMetadata. */
61459
62546
  metadata: record$1(string(), unknown()).nullable().optional(),
62547
+ /** Provider-declared identifiers (D1059): typed, normalised, written only by
62548
+ * the owning provider via `setIdentifiers`; read-only for the operator.
62549
+ * Absent ⇒ the provider declared none. */
62550
+ identifiers: DeviceIdentifiersSchema.optional(),
61460
62551
  /** Optional upstream-system identity + rendering envelope. See
61461
62552
  * `SourceInfo` in `packages/types/src/device/source-info.ts`. */
61462
62553
  sourceInfo: SourceInfoSchema.optional(),
@@ -61608,6 +62699,8 @@ var DeviceMetaSchema = object({
61608
62699
  disabled: boolean(),
61609
62700
  parentDeviceId: number$1().nullable(),
61610
62701
  metadata: record$1(string(), unknown()).nullable().optional(),
62702
+ /** Provider-declared identifiers (D1059). See `DeviceMeta.identifiers`. */
62703
+ identifiers: DeviceIdentifiersSchema.optional(),
61611
62704
  /** Optional upstream-system identity + rendering envelope. See
61612
62705
  * `SourceInfo`. Present when the device has been persisted with a
61613
62706
  * non-synthetic source identifier (HA entities, vendor MAC, …);
@@ -61921,6 +63014,17 @@ method(object({
61921
63014
  }), _void(), {
61922
63015
  kind: "mutation",
61923
63016
  auth: "admin"
63017
+ }), method(object({
63018
+ deviceId: number$1(),
63019
+ identifiers: DeviceIdentifiersSchema.nullable(),
63020
+ /** Kinds the provider tried to read and could not: their stored value is kept. */
63021
+ unread: array(DeviceIdentifierKeySchema).optional()
63022
+ }), _void(), {
63023
+ kind: "mutation",
63024
+ auth: "admin"
63025
+ }), method(object({}), IdentityCandidatesSchema, {
63026
+ kind: "query",
63027
+ auth: "admin"
61924
63028
  }), method(_void(), array(string())), method(object({ name: string() }), _void(), {
61925
63029
  kind: "mutation",
61926
63030
  auth: "admin"
@@ -62523,6 +63627,34 @@ var OrphanListSchema = object({
62523
63627
  /** More orphans exist than {@link DEVICE_HISTORY_ORPHAN_LIST_MAX}. */
62524
63628
  truncated: boolean()
62525
63629
  });
63630
+ var DeviceHistoryRangeDeleteRefusalSchema = _enum([
63631
+ "invalid-range",
63632
+ "range-too-large",
63633
+ "series-not-found",
63634
+ "not-a-point-series"
63635
+ ]);
63636
+ var RollupRowsSchema = object({
63637
+ "5m": number$1().int(),
63638
+ "1h": number$1().int(),
63639
+ "1d": number$1().int()
63640
+ });
63641
+ /**
63642
+ * What a time-range delete did, or WOULD do (`dryRun`). `rows` is what was
63643
+ * removed: raw points inside the range, and the rollup rows covering it (those
63644
+ * are removed and rebuilt from what remains, so a gap leaves no stale value).
63645
+ * `rewritten` is how many rollup rows were rebuilt from the remaining points;
63646
+ * `null` on a dry run, which cannot know before it has deleted.
63647
+ */
63648
+ var RangeDeleteResultSchema = discriminatedUnion("ok", [object({
63649
+ ok: literal(true),
63650
+ dryRun: boolean(),
63651
+ seriesId: number$1().int(),
63652
+ rows: TierRowsSchema,
63653
+ rewritten: RollupRowsSchema.nullable()
63654
+ }), object({
63655
+ ok: literal(false),
63656
+ reason: DeviceHistoryRangeDeleteRefusalSchema
63657
+ })]);
62526
63658
  var DeviceHistoryStatusSchema = object({
62527
63659
  startedAt: number$1(),
62528
63660
  /** The store is declared, series loaded and the first reconcile has answered. */
@@ -62623,6 +63755,16 @@ method(object({ deviceId: number$1().int() }), array(SeriesInfoSchema).readonly(
62623
63755
  }), method(object({}), DeviceHistoryStatusSchema, { auth: "admin" }), method(object({}), OrphanListSchema, { auth: "admin" }), method(object({ seriesIds: array(number$1().int()).min(1).max(50) }), object({ results: array(OrphanDeleteEntrySchema).readonly() }), {
62624
63756
  kind: "mutation",
62625
63757
  auth: "admin"
63758
+ }), method(object({
63759
+ deviceId: number$1().int(),
63760
+ key: string().min(1),
63761
+ scope: string(),
63762
+ fromMs: number$1().int().nonnegative(),
63763
+ toMs: number$1().int().nonnegative(),
63764
+ dryRun: boolean()
63765
+ }), RangeDeleteResultSchema, {
63766
+ kind: "mutation",
63767
+ auth: "admin"
62626
63768
  });
62627
63769
  /**
62628
63770
  * `device-removal-hook` — the reliable way an addon learns a device was DELETED,
@@ -67046,8 +68188,8 @@ var HeroSceneSchema = object({
67046
68188
  /** 0..1: volume, cover position, cycle progress. */
67047
68189
  level: number$1().min(0).max(1).nullable()
67048
68190
  });
67049
- DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
67050
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
68191
+ DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
68192
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
67051
68193
  var HeroRowIdSchema = _enum([
67052
68194
  "progress",
67053
68195
  "run-for",
@@ -67276,8 +68418,12 @@ var HeroPowerSupplySlotSchema = object({
67276
68418
  /** Off asks for a confirmation while the device runs. */
67277
68419
  confirmOffWhileRunning: boolean(),
67278
68420
  running: boolean().nullable(),
67279
- powerOn: HeroActionSchema,
67280
- powerOff: HeroActionSchema,
68421
+ /**
68422
+ * `null` when the linked switch ANSWERED it only reports (a PoE port seen through an
68423
+ * API key): power on / off would always be refused. The restart stays (D1058).
68424
+ */
68425
+ powerOn: HeroActionSchema.nullable(),
68426
+ powerOff: HeroActionSchema.nullable(),
67281
68427
  restart: HeroActionSchema
67282
68428
  });
67283
68429
  var HeroStateBackdropSchema = object({
@@ -67439,6 +68585,12 @@ var HeroRowModelSchema = object({
67439
68585
  /** `null` = the type has no inline control, or the caller may not act on it. */
67440
68586
  primary: HeroControlSchema.nullable(),
67441
68587
  /**
68588
+ * `true` when the primary exists but the model gates it (the caller may not act): the
68589
+ * row is read-only and a client draws no control, not a fallback. `false` = nothing
68590
+ * covers the type yet. Absent = an older server.
68591
+ */
68592
+ primaryGated: boolean().optional(),
68593
+ /**
67442
68594
  * Beside `primary` when the device offers a timed run: Run while idle, Stop
67443
68595
  * while armed. `null` when there is no slot, or the caller may not act.
67444
68596
  */
@@ -70411,6 +71563,13 @@ var LockControlStatusSchema = object({
70411
71563
  "jammed",
70412
71564
  "door-open"
70413
71565
  ]),
71566
+ /**
71567
+ * Whether lock / unlock need a PIN `code` (#459, replaces the
71568
+ * `lock-pin-required` device feature). `null` = the provider cannot tell
71569
+ * (D393) — never `false`. `.optional()` so a restored slice written before
71570
+ * the field still parses; readers treat absent exactly like `null`.
71571
+ */
71572
+ codeRequired: boolean().nullable().optional(),
70414
71573
  /** Ms epoch when the slice was last updated. */
70415
71574
  lastChangedAt: number$1()
70416
71575
  });
@@ -70868,6 +72027,90 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
70868
72027
  ]);
70869
72028
  method(_void(), array(LoginMethodContributionSchema).readonly()), NOT_A_DEVICE.IDENTITY;
70870
72029
  /**
72030
+ * low-power-sleep — a device that goes into low-power sleep and must be WOKEN
72031
+ * before it streams (#459, Q2). A battery camera (Reolink Argus, a robot's
72032
+ * on-board camera) is one; a battery SENSOR is not: it reports charge on the
72033
+ * `battery` cap and never sleeps. The two meanings used to share
72034
+ * `DeviceFeature.BatteryOperated`; this cap is the one that answers "sleeps",
72035
+ * and `DeviceFeature.Sleeps` is derived from it being bound with
72036
+ * `wakeUp` implemented.
72037
+ *
72038
+ * The state is the sleep inputs (`deriveBatteryPresence`): whether the device
72039
+ * is asleep, and the last time it PROVED it was reachable. Read from this slice
72040
+ * by the stream broker (`readBatterySleepFacts`), the recorder
72041
+ * (`recordingWakeDeps`) and the snapshot builtin. The broker's per-device
72042
+ * mirror is still also fed by `BatteryOnStatusChanged` events.
72043
+ */
72044
+ var LowPowerSleepStatusSchema = object({
72045
+ /**
72046
+ * True while the firmware is in low-power mode. A provider MUST avoid polling
72047
+ * during sleep — a read wakes the device and drains charge.
72048
+ */
72049
+ sleeping: boolean().meta({ label: "Sleeping" }),
72050
+ /**
72051
+ * Ms epoch of the last time the device proved it was reachable, from
72052
+ * PASSIVE signals only (a completed round-trip, an observed wake, a push).
72053
+ * Absent = never since this slice was born. The only input that separates
72054
+ * "asleep" from "gone".
72055
+ */
72056
+ lastContactAt: number$1().optional(),
72057
+ /** Ms epoch of the last observation. */
72058
+ lastUpdated: number$1().meta(readingMeta("none"))
72059
+ });
72060
+ var lowPowerSleepCapability = {
72061
+ name: "low-power-sleep",
72062
+ scope: "device",
72063
+ deviceNative: true,
72064
+ mode: "singleton",
72065
+ deviceTypes: [DeviceType.Camera],
72066
+ methods: {
72067
+ /**
72068
+ * Explicitly wake the device from low-power sleep ahead of a streaming
72069
+ * session start. Consumers that initiate a stream against a sleeping
72070
+ * camera (wake-on-play, the recorder, HomeKit, Alexa, snapshot wrappers)
72071
+ * call this with a short timeout before establishing the media pipeline —
72072
+ * the broker's own passive wake-on-dial works but adds 5–7 seconds to
72073
+ * first-frame. Pre-waking compresses that gap.
72074
+ *
72075
+ * Returns `awoke: true` when the firmware acknowledged the wake before
72076
+ * `timeoutMs`, `awoke: false` when it timed out; the caller should still
72077
+ * attempt the stream — the passive broker wake remains as fallback.
72078
+ */
72079
+ wakeUp: method(object({
72080
+ deviceId: number$1(),
72081
+ /** Bound on the wait. Sensible range 3000–10000ms. */
72082
+ timeoutMs: number$1().int().min(500).max(3e4).default(8e3)
72083
+ }), object({
72084
+ awoke: boolean(),
72085
+ durationMs: number$1()
72086
+ }), {
72087
+ kind: "mutation",
72088
+ notOperatorFacing: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage"
72089
+ }) },
72090
+ status: {
72091
+ schema: LowPowerSleepStatusSchema,
72092
+ kind: "push",
72093
+ empty: {
72094
+ sleeping: false,
72095
+ lastUpdated: 0
72096
+ }
72097
+ },
72098
+ runtimeState: LowPowerSleepStatusSchema,
72099
+ /**
72100
+ * Runtime-state durability: **restored** — a sleeping camera may not report
72101
+ * for hours; the restored sleep inputs are the only thing the sleep gate and
72102
+ * the presence derivation have (the same argument as `battery`).
72103
+ */
72104
+ durability: "restored",
72105
+ /** History (D850): none — battery never recorded a sleep series either. */
72106
+ history: "none",
72107
+ volatileStateFields: ["lastUpdated"],
72108
+ vocabulary: {
72109
+ noun: t("Low-power sleep", "Sospensione a basso consumo"),
72110
+ order: 5245
72111
+ }
72112
+ };
72113
+ /**
70871
72114
  * mesh-network — collection cap for mesh-VPN providers.
70872
72115
  *
70873
72116
  * Different shape from `network-access` (public tunnels):
@@ -75299,6 +76542,12 @@ var CameraMetricsSchema = object({
75299
76542
  queueDepth: number$1(),
75300
76543
  avgInferenceTimeMs: number$1(),
75301
76544
  droppedFrames: number$1(),
76545
+ /**
76546
+ * Native crops this runner could not produce for the camera (the caller was
76547
+ * handed nothing), cumulative since attach. Additive: a runner that predates
76548
+ * it omits the field, which a reader treats as unknown, never zero.
76549
+ */
76550
+ nativeCropMisses: number$1().optional(),
75302
76551
  phase: _enum([
75303
76552
  "idle",
75304
76553
  "watching",
@@ -78003,6 +79252,19 @@ var NetworkLinkStatusSchema = object({
78003
79252
  rssi: number$1().optional().meta(readingMeta("signal-level")),
78004
79253
  /** Network name of a wireless link, when the firmware reports it. */
78005
79254
  ssid: string().optional(),
79255
+ /**
79256
+ * Negotiated link speed of a wired port, the `bitrate` quantity in its base
79257
+ * unit, kbit/s (a gigabit port is 1 000 000); the display picks the unit.
79258
+ * `null` = the port is down or the speed is not known; absent = the provider
79259
+ * never reports one.
79260
+ */
79261
+ speedKbps: number$1().nonnegative().nullable().optional().meta(readingMeta("bitrate")),
79262
+ /**
79263
+ * Whether the link is up. `type` names the medium, not its state, so a wired
79264
+ * port that lost its link is `ethernet` + `linkUp: false`. `null` = not known;
79265
+ * absent = the provider never reports it.
79266
+ */
79267
+ linkUp: boolean().nullable().optional(),
78006
79268
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
78007
79269
  lastUpdated: number$1().meta(readingMeta("none"))
78008
79270
  });
@@ -80187,7 +81449,32 @@ var NcRuleInputSchema = object({
80187
81449
  * authored before this field meant. An editor turns it off by writing
80188
81450
  * `false`, so it needs no `clear` key.
80189
81451
  */
80190
- askVerdict: boolean().optional()
81452
+ askVerdict: boolean().optional(),
81453
+ /**
81454
+ * Operator tags (D1054), kept on the rule like a core block's. Absent = no
81455
+ * tags. `.optional()`, never `.default()`: a partial `updateRule` patch that
81456
+ * does not name `tags` keeps the stored ones (the store merges), and an
81457
+ * editor empties them by sending `[]` (the store drops an empty list).
81458
+ * Renamed or removed fleet-wide only through the `tags` cap, which writes
81459
+ * here with `setRuleTags`.
81460
+ */
81461
+ tags: TagsFieldSchema.optional()
81462
+ });
81463
+ /**
81464
+ * The rule kinds that carry tags (D1054) — each one its own store. Every kind
81465
+ * labels its rules the same way; this names which store a tag write goes to.
81466
+ */
81467
+ var NcTaggedRuleKindSchema = _enum([
81468
+ "event",
81469
+ "summary",
81470
+ "timelapse",
81471
+ "calendar-events"
81472
+ ]);
81473
+ /** One rule's tags, as the `tags` cap reads them across every kind. */
81474
+ var NcRuleTagsEntrySchema = object({
81475
+ kind: NcTaggedRuleKindSchema,
81476
+ ruleId: string(),
81477
+ tags: array(string())
80191
81478
  });
80192
81479
  /**
80193
81480
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -81204,6 +82491,16 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
81204
82491
  }), object({ success: literal(true) }), {
81205
82492
  kind: "mutation",
81206
82493
  auth: "admin"
82494
+ }), method(object({}), object({ rules: array(NcRuleTagsEntrySchema) }), {
82495
+ kind: "query",
82496
+ auth: "admin"
82497
+ }), method(object({
82498
+ kind: NcTaggedRuleKindSchema,
82499
+ ruleId: string(),
82500
+ tags: TagsFieldSchema
82501
+ }), object({ success: literal(true) }), {
82502
+ kind: "mutation",
82503
+ auth: "admin"
81207
82504
  }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number$1().int()).readonly() }), { auth: "admin" }), method(object({
81208
82505
  deviceId: number$1().int(),
81209
82506
  muted: boolean()
@@ -82773,6 +84070,94 @@ var EffectiveSharesSchema = object({
82773
84070
  nodeWeights: record$1(string(), number$1()),
82774
84071
  deviceWeights: record$1(string(), record$1(string(), number$1()))
82775
84072
  });
84073
+ var HealthFindingKindSchema = _enum([
84074
+ "motion-without-detections",
84075
+ "detections-under-floor",
84076
+ "inference-too-slow",
84077
+ "frames-shed",
84078
+ "inference-device-unusable"
84079
+ ]);
84080
+ var HealthSeveritySchema = _enum([
84081
+ "info",
84082
+ "warning",
84083
+ "critical"
84084
+ ]);
84085
+ var HealthSubjectSchema = discriminatedUnion("type", [
84086
+ object({
84087
+ type: literal("camera"),
84088
+ deviceId: number$1()
84089
+ }),
84090
+ object({
84091
+ type: literal("node"),
84092
+ nodeId: string()
84093
+ }),
84094
+ object({
84095
+ type: literal("inference-device"),
84096
+ nodeId: string(),
84097
+ deviceKey: string()
84098
+ })
84099
+ ]);
84100
+ var HealthFindingSchema = object({
84101
+ /** Stable across ticks for the same condition on the same subject. */
84102
+ id: string(),
84103
+ kind: HealthFindingKindSchema,
84104
+ severity: HealthSeveritySchema,
84105
+ subject: HealthSubjectSchema,
84106
+ what: string(),
84107
+ /** The numbers behind the sentence; `null` = the value could not be read. */
84108
+ evidence: record$1(string(), number$1().nullable()),
84109
+ action: string()
84110
+ });
84111
+ /** One in-memory source the tick read, and whether it answered. */
84112
+ var HealthSourceStatusSchema = object({
84113
+ source: string(),
84114
+ /** Entries read; `null` = the read failed. */
84115
+ entries: number$1().nullable()
84116
+ });
84117
+ var HealthNodeSummarySchema = object({
84118
+ nodeId: string(),
84119
+ sessionsNow: number$1(),
84120
+ /** `deviceKey` of every inference device the balancer excludes on this node. */
84121
+ unusableDevices: array(string()).readonly(),
84122
+ devices: array(object({
84123
+ deviceKey: string(),
84124
+ sessionsNow: number$1(),
84125
+ usable: boolean()
84126
+ })).readonly()
84127
+ });
84128
+ /**
84129
+ * Per-camera runner-side signals, as per-tick deltas of the runner's cumulative
84130
+ * counters. A camera is listed only when at least one signal is known and
84131
+ * non-zero; `null` = the runner did not report it (unknown, never zero).
84132
+ */
84133
+ var HealthCameraRunnerSignalsSchema = object({
84134
+ deviceId: number$1(),
84135
+ /** Native crops the runner failed to produce since the previous tick. */
84136
+ nativeCropMissesSincePreviousTick: number$1().nullable()
84137
+ });
84138
+ var HealthDigestSchema = object({
84139
+ generatedAt: number$1(),
84140
+ /** Wall time the tick took to build this digest. */
84141
+ tickMs: number$1(),
84142
+ /** Cameras known to the digest; `null` when a camera source failed to read (the union would be incomplete). */
84143
+ camerasSeen: number$1().nullable(),
84144
+ findings: array(HealthFindingSchema).readonly(),
84145
+ /** Runner-side per-camera deltas worth a look; see {@link HealthCameraRunnerSignalsSchema}. */
84146
+ cameraSignals: array(HealthCameraRunnerSignalsSchema).readonly(),
84147
+ nodes: array(HealthNodeSummarySchema).readonly(),
84148
+ sources: array(HealthSourceStatusSchema).readonly(),
84149
+ /** Signals the digest does not cover yet, and why — never computed by scanning. */
84150
+ notCovered: array(string()).readonly()
84151
+ });
84152
+ var HealthDigestInputSchema = object({
84153
+ /** Newest first; 1 = the latest digest. */
84154
+ history: number$1().int().min(1).max(24).default(1) });
84155
+ var HealthDigestAnswerSchema = object({
84156
+ /** Null until the first tick has run. */
84157
+ latest: HealthDigestSchema.nullable(),
84158
+ /** Older digests, newest first, when `history` > 1. */
84159
+ previous: array(HealthDigestSchema).readonly()
84160
+ });
82776
84161
  var CameraPipelineConfigSchema = object({
82777
84162
  engine: PipelineEngineChoiceSchema.optional(),
82778
84163
  steps: array(PipelineStepInputSchema).readonly(),
@@ -83434,7 +84819,7 @@ method(object({
83434
84819
  }), method(LoadBalancingSharesInputSchema, object({ success: literal(true) }), {
83435
84820
  kind: "mutation",
83436
84821
  auth: "admin"
83437
- }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
84822
+ }), method(PlacementStatsInputSchema, PlacementStatsSchema, { auth: "admin" }), method(HealthDigestInputSchema, HealthDigestAnswerSchema, { auth: "admin" }), method(SuggestSharesInputSchema, SuggestSharesResultSchema, { auth: "admin" }), method(_void(), EffectiveSharesSchema, { auth: "admin" }), method(SetShareSourceInputSchema, object({ success: literal(true) }), {
83438
84823
  kind: "mutation",
83439
84824
  auth: "admin"
83440
84825
  }), method(NodeBenchmarkPlanSchema, NodeBenchmarkPreflightSchema, { auth: "admin" }), method(NodeBenchmarkPlanSchema, discriminatedUnion("kind", [object({
@@ -86573,7 +87958,18 @@ DeviceType.Camera, method(object({
86573
87958
  * older than this field keeps working unchanged (D382 — an unstated
86574
87959
  * ask is zero).
86575
87960
  */
86576
- audio: ClipStreamAudioSchema.optional()
87961
+ audio: ClipStreamAudioSchema.optional(),
87962
+ /**
87963
+ * The operator's authorisation to wake a sleeping camera for this
87964
+ * dial — the same {@link ClipWakeSchema} the byte reads carry. Absent
87965
+ * — the default — means a sleeping standalone battery camera is
87966
+ * REFUSED by name before any URL is minted. A caller sets it only
87967
+ * when a viewer itself asked for the clip (the broker's `playClip`);
87968
+ * a prefetch, a reconcile or a retry never does. With it, the
87969
+ * provider wakes the camera and waits under a bound; a camera that
87970
+ * does not come up is refused `wake-timeout`, naming the wait.
87971
+ */
87972
+ wake: ClipWakeSchema.optional()
86577
87973
  }), ClipStreamDialSchema, {
86578
87974
  kind: "query",
86579
87975
  auth: "protected"
@@ -86802,7 +88198,8 @@ _enum([
86802
88198
  "camera-refused",
86803
88199
  "fetch-failed",
86804
88200
  "too-large-to-transfer",
86805
- "wake-expired"
88201
+ "wake-expired",
88202
+ "wake-timeout"
86806
88203
  ]);
86807
88204
  /** Candidate download URLs (LAN first, then operator extra hosts). */
86808
88205
  var ExportDownloadSchema = object({
@@ -87866,6 +89263,42 @@ var RemoteLayoutComponentSchema = object({
87866
89263
  });
87867
89264
  });
87868
89265
  method(object({}), array(RemoteLayoutComponentSchema), { auth: "protected" });
89266
+ /**
89267
+ * resync — a device whose derived spec can be re-aligned on demand with its
89268
+ * upstream source (#459, Q6). Registered by the containers an integration
89269
+ * adopted; `DeviceFeature.Resyncable` (the generic Re-sync button) is derived
89270
+ * from it being bound with `resync` implemented.
89271
+ *
89272
+ * The work itself stays where it is: the owning addon's `device-adoption`
89273
+ * provider, reached through `deviceManager.adoptionResync` (which also owns
89274
+ * the "resync from zero" child purge). A provider answers this method by
89275
+ * asking for exactly that — see `resyncThroughAdoption`.
89276
+ */
89277
+ var ResyncDeviceInputSchema = object({
89278
+ deviceId: number$1().int().nonnegative(),
89279
+ /** "Resync from zero": purge the accessory children before re-deriving. */
89280
+ resetToSource: boolean().optional()
89281
+ });
89282
+ var resyncCapability = {
89283
+ name: "resync",
89284
+ scope: "device",
89285
+ deviceNative: true,
89286
+ mode: "singleton",
89287
+ deviceTypes: [
89288
+ DeviceType.Container,
89289
+ DeviceType.Workload,
89290
+ DeviceType.WeatherStation
89291
+ ],
89292
+ methods: { resync: method(ResyncDeviceInputSchema, ResyncResultSchema, {
89293
+ kind: "mutation",
89294
+ auth: "admin",
89295
+ notOperatorFacing: "device adoption — re-aligning a device with its source is an onboarding step, not an automation action"
89296
+ }) },
89297
+ vocabulary: {
89298
+ noun: t("Re-sync", "Risincronizzazione"),
89299
+ order: 3245
89300
+ }
89301
+ };
87869
89302
  var RUNNING_POWER_START_DELAY_MS = 3e4;
87870
89303
  var RUNNING_POWER_STOP_DELAY_MS = 18e4;
87871
89304
  /**
@@ -89021,6 +90454,201 @@ method(_void(), ServerPackageStatusSchema, { auth: "admin" }), method(_void(), S
89021
90454
  auth: "admin"
89022
90455
  }), NOT_A_DEVICE.CLUSTER;
89023
90456
  /**
90457
+ * Timed siren: trigger the siren for a duration and know until when it sounds.
90458
+ *
90459
+ * The plain on/off `switch` of a siren stays as it is (HomeKit / Alexa see a
90460
+ * switch); this cap adds the part a switch cannot say — HOW LONG, and the
90461
+ * moment the siren is expected to fall silent (`activeUntil`, epoch ms), so a
90462
+ * UI can show the activation with a countdown.
90463
+ *
90464
+ * The allowed durations are never hardcoded: `getOptions` answers what the
90465
+ * CAMERA reports (a discrete list or `{min,max,step}`), the default, and the
90466
+ * unit truth — a camera that counts plays rather than seconds says so, with the
90467
+ * seconds-per-play factor used to convert, and whether that factor was read
90468
+ * from the camera or is an estimate.
90469
+ */
90470
+ /** What the camera counts natively. */
90471
+ var SirenDurationUnit = {
90472
+ Seconds: "seconds",
90473
+ Plays: "plays"
90474
+ };
90475
+ /** Where the numbers of an options answer come from. */
90476
+ var SirenOptionsSource = {
90477
+ /** Read from the camera by this fetch. */
90478
+ Camera: "camera",
90479
+ /** The camera did not answer or does not advertise it; a documented fallback. */
90480
+ Fallback: "fallback"
90481
+ };
90482
+ var SirenDurationRangeSchema = object({
90483
+ min: number$1().positive(),
90484
+ max: number$1().positive(),
90485
+ step: number$1().positive()
90486
+ });
90487
+ var SirenOptionsSchema = object({
90488
+ /** Discrete durations in seconds the operator may pick; `null` when the camera gives a range. */
90489
+ allowedSeconds: array(number$1().positive()).nullable(),
90490
+ /** Continuous range in seconds; `null` when the camera gives a discrete list. */
90491
+ rangeSeconds: SirenDurationRangeSchema.nullable(),
90492
+ /** The camera's default duration, seconds. */
90493
+ defaultSeconds: number$1().positive(),
90494
+ /**
90495
+ * Discrete play counts the operator may pick; `null` when the camera gives a
90496
+ * range or does not count plays. Defaults to `null` so a provider that
90497
+ * predates plays (#589) reads as declaring none.
90498
+ */
90499
+ allowedPlays: array(number$1().int().positive()).nullable().default(null),
90500
+ /** Continuous range of play counts; `null` when listed or not counted. */
90501
+ rangePlays: SirenDurationRangeSchema.nullable().default(null),
90502
+ /** The camera's default play count; `null` when the camera does not count plays. */
90503
+ defaultPlays: number$1().int().positive().nullable().default(null),
90504
+ /** What the camera counts natively. */
90505
+ unit: _enum([SirenDurationUnit.Seconds, SirenDurationUnit.Plays]),
90506
+ /** Seconds one play lasts, when `unit` is `plays`; `null` for a seconds camera. */
90507
+ secondsPerPlay: number$1().positive().nullable(),
90508
+ /** `camera` when the values were read from it, `fallback` when the camera could not say. */
90509
+ source: _enum([SirenOptionsSource.Camera, SirenOptionsSource.Fallback]),
90510
+ /** Ms epoch of the read that produced this answer. */
90511
+ fetchedAt: number$1()
90512
+ });
90513
+ var SirenStatusSchema = object({
90514
+ /** True while the siren is sounding by a timed trigger or switched on. */
90515
+ active: boolean(),
90516
+ /** Ms epoch the siren is expected to fall silent; `null` when not active or open-ended. */
90517
+ activeUntil: number$1().nullable(),
90518
+ /** Duration of the current / last activation, seconds; `null` when none yet. */
90519
+ durationSeconds: number$1().nullable(),
90520
+ /**
90521
+ * The play count of the current / last activation when it was asked in plays;
90522
+ * `null` when it was asked in seconds (or none yet). The unit that was asked.
90523
+ */
90524
+ plays: number$1().int().positive().nullable().default(null),
90525
+ /**
90526
+ * True when `activeUntil` comes from a seconds-per-play factor the camera did
90527
+ * not report — the siren may fall silent somewhat earlier or later.
90528
+ */
90529
+ activeUntilEstimated: boolean().default(false),
90530
+ /** Ms epoch of the last trigger (0 = never). */
90531
+ lastTriggeredAt: number$1()
90532
+ });
90533
+ /** A trigger asks seconds OR plays (#589); neither means the camera default. */
90534
+ var SirenTriggerInputSchema = object({
90535
+ deviceId: number$1().int().nonnegative(),
90536
+ durationSeconds: number$1().positive().optional(),
90537
+ plays: number$1().int().positive().optional()
90538
+ }).refine((input) => input.durationSeconds === void 0 || input.plays === void 0, {
90539
+ message: "a siren trigger takes durationSeconds or plays, not both",
90540
+ path: ["plays"]
90541
+ });
90542
+ var SirenRuntimeStateSchema = SirenStatusSchema.extend({
90543
+ /** Ms epoch of the last successful camera read of the options (0 = never). */
90544
+ lastFetchedAt: number$1() });
90545
+ var sirenCapability = {
90546
+ name: "siren",
90547
+ scope: "device",
90548
+ deviceNative: true,
90549
+ mode: "singleton",
90550
+ deviceTypes: [DeviceType.Siren],
90551
+ methods: {
90552
+ /** The durations the camera allows, read from the camera. */
90553
+ getOptions: method(object({ deviceId: number$1().int().nonnegative() }), SirenOptionsSchema, {
90554
+ kind: "query",
90555
+ auth: "protected"
90556
+ }),
90557
+ /**
90558
+ * The play counts a rule may pick: what `getOptions` declares as a list, or
90559
+ * its range spelled out. Empty for a siren that counts seconds.
90560
+ */
90561
+ getPlayChoices: method(object({ deviceId: number$1().int().nonnegative() }), array(number$1().int().positive()), {
90562
+ kind: "query",
90563
+ auth: "protected"
90564
+ }),
90565
+ /**
90566
+ * Sound the siren for `durationSeconds` OR `plays` — never both. With
90567
+ * neither the camera default applies. A count on a siren that declares no
90568
+ * plays is refused. Answers the state at the moment of the trigger
90569
+ * (`activeUntil` included).
90570
+ */
90571
+ trigger: method(SirenTriggerInputSchema, SirenStatusSchema, {
90572
+ kind: "mutation",
90573
+ auth: "protected",
90574
+ actions: [{
90575
+ id: "siren.trigger",
90576
+ label: t("Sound the siren", "Fai suonare la sirena"),
90577
+ phrase: t("Sound {device}", "Fai suonare {device}"),
90578
+ icon: "siren",
90579
+ args: {}
90580
+ }, {
90581
+ id: "siren.triggerPlays",
90582
+ label: t("Sound the siren N times", "Fai suonare la sirena N volte"),
90583
+ phrase: t("Sound {device} {plays} times", "Fai suonare {device} {plays} volte"),
90584
+ icon: "siren",
90585
+ openArgs: [{
90586
+ key: "plays",
90587
+ label: t("Plays", "Riproduzioni"),
90588
+ offer: {
90589
+ kind: "dynamic",
90590
+ from: "method",
90591
+ method: "getPlayChoices",
90592
+ valueKind: "number"
90593
+ }
90594
+ }]
90595
+ }]
90596
+ }),
90597
+ /** Silence the siren now. */
90598
+ stop: method(object({ deviceId: number$1().int().nonnegative() }), SirenStatusSchema, {
90599
+ kind: "mutation",
90600
+ auth: "protected",
90601
+ actions: [{
90602
+ id: "siren.stop",
90603
+ label: t("Silence the siren", "Zittisci la sirena"),
90604
+ phrase: t("Silence {device}", "Zittisci {device}"),
90605
+ icon: "siren",
90606
+ effect: {
90607
+ field: "active",
90608
+ value: false
90609
+ },
90610
+ args: {}
90611
+ }]
90612
+ })
90613
+ },
90614
+ events: { onSirenChanged: {
90615
+ data: object({
90616
+ deviceId: number$1(),
90617
+ active: boolean(),
90618
+ activeUntil: number$1().nullable()
90619
+ }),
90620
+ notOperatorFacing: "the `active` state trigger phrases both edges of this change"
90621
+ } },
90622
+ status: {
90623
+ schema: SirenStatusSchema,
90624
+ kind: "command-driven"
90625
+ },
90626
+ runtimeState: SirenRuntimeStateSchema,
90627
+ /**
90628
+ * Runtime-state durability: **session** — a siren activation is a moment, not a fact to restore after a restart.
90629
+ *
90630
+ * See `RuntimeStateDurability`. Enforced by
90631
+ * `scripts/check-runtime-state-durability.ts`.
90632
+ */
90633
+ durability: "session",
90634
+ /**
90635
+ * History (D850): none — an activation is already recorded by the switch / alarm events.
90636
+ */
90637
+ history: "none",
90638
+ vocabulary: {
90639
+ noun: t("Siren", "Sirena"),
90640
+ order: 1170,
90641
+ state: [{
90642
+ kind: "boolean",
90643
+ field: "active",
90644
+ label: t("Siren sounding", "Sirena in funzione"),
90645
+ whenTrue: t("When {device} starts sounding", "Quando {device} inizia a suonare"),
90646
+ whenFalse: t("When {device} falls silent", "Quando {device} smette di suonare"),
90647
+ icon: "siren"
90648
+ }]
90649
+ }
90650
+ };
90651
+ /**
89024
90652
  * Smoke alarm sensor — boolean "is smoke currently detected" with
89025
90653
  * timestamp of the last transition. Drives Home Assistant
89026
90654
  * `binary_sensor` entries with `device_class: smoke`.
@@ -90146,6 +91774,27 @@ var SwitchStatusSchema = object({
90146
91774
  /** Ms epoch of the last state change. Useful for UI "X minutes ago". */
90147
91775
  lastChangedAt: number$1()
90148
91776
  });
91777
+ /**
91778
+ * What a switch can do, from its provider (`getOptions`). A provider that writes no
91779
+ * `getOptions` is a plain on/off switch: the defaults are the old contract.
91780
+ *
91781
+ * - `supportsSetState: false` — the switch reports its state but cannot be set (a PoE port seen only
91782
+ * through an API key). Its provider refuses `setState`; these surfaces withdraw on/off once the
91783
+ * device ANSWERED this (`switchRefusesSetState`): the device hero, the automation action picker
91784
+ * (`offeredWhen` on `switch.on` / `switch.off` / `switch.toggle`), the default `toggle`, the
91785
+ * HomeKit, Alexa and Google exporters, and `power-source` on a device the switch powers
91786
+ * (`getStatus().switchSettable`, `offeredWhen` on `powerSource.on` / `.off`, `not-settable`). A
91787
+ * read that failed or is pending changes nothing (D315).
91788
+ * - `supportsPowerCycle: true` — the device behind the switch can cut and restore its own output in
91789
+ * one native call (a PoE port's power cycle). It has no control of its own: a linked
91790
+ * `power-source.forceRestart` uses it instead of off / wait / on.
91791
+ */
91792
+ var SwitchOptionsSchema = object({
91793
+ supportsSetState: boolean().default(true),
91794
+ supportsPowerCycle: boolean().default(false)
91795
+ });
91796
+ /** The options of a provider that did not answer `getOptions`: a plain on/off switch. */
91797
+ var SWITCH_DEFAULT_OPTIONS = SwitchOptionsSchema.parse({});
90149
91798
  var switchCapability = {
90150
91799
  name: "switch",
90151
91800
  scope: "device",
@@ -90173,7 +91822,8 @@ var switchCapability = {
90173
91822
  field: "on",
90174
91823
  value: true
90175
91824
  },
90176
- args: { on: true }
91825
+ args: { on: true },
91826
+ offeredWhen: SWITCH_SETTABLE_GATE
90177
91827
  }, {
90178
91828
  id: "switch.off",
90179
91829
  label: t("Turn off", "Spegni"),
@@ -90183,9 +91833,16 @@ var switchCapability = {
90183
91833
  field: "on",
90184
91834
  value: false
90185
91835
  },
90186
- args: { on: false }
91836
+ args: { on: false },
91837
+ offeredWhen: SWITCH_SETTABLE_GATE
90187
91838
  }]
90188
91839
  }),
91840
+ getOptions: optionalMethod(object({ deviceId: number$1() }), SwitchOptionsSchema, { auth: "protected" }),
91841
+ powerCycle: optionalMethod(object({ deviceId: number$1() }), _void(), {
91842
+ kind: "mutation",
91843
+ auth: "protected",
91844
+ notOperatorFacing: "a power cycle is the forced restart of the device the switch powers (power-source), never a step of its own"
91845
+ }),
90189
91846
  toggle: optionalMethod(object({ deviceId: number$1() }), _void(), {
90190
91847
  kind: "mutation",
90191
91848
  auth: "protected",
@@ -90193,7 +91850,8 @@ var switchCapability = {
90193
91850
  id: "switch.toggle",
90194
91851
  label: t("Toggle", "Commuta"),
90195
91852
  phrase: t("Toggle {device}", "Commuta {device}"),
90196
- icon: "toggle-right"
91853
+ icon: "toggle-right",
91854
+ offeredWhen: SWITCH_SETTABLE_GATE
90197
91855
  }]
90198
91856
  })
90199
91857
  },
@@ -90215,6 +91873,16 @@ var switchCapability = {
90215
91873
  * not need to re-query the provider after a setState mutation.
90216
91874
  */
90217
91875
  runtimeState: SwitchStatusSchema,
91876
+ composedMethods: {
91877
+ getOptions: {
91878
+ kind: "answer",
91879
+ value: SWITCH_DEFAULT_OPTIONS
91880
+ },
91881
+ powerCycle: {
91882
+ kind: "refuse",
91883
+ reason: "a composed switch has no native power cycle"
91884
+ }
91885
+ },
90218
91886
  /**
90219
91887
  * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
90220
91888
  *
@@ -90388,6 +92056,26 @@ var switchCapability = {
90388
92056
  "switch.off": { icon: "plug" }
90389
92057
  },
90390
92058
  state: { on: { icon: "plug-zap" } }
92059
+ },
92060
+ [DeviceRole.PoePort]: {
92061
+ actions: {
92062
+ "switch.on": {
92063
+ label: t("Power on", "Alimenta"),
92064
+ phrase: t("Power on {device}", "Alimenta {device}"),
92065
+ icon: "plug-zap"
92066
+ },
92067
+ "switch.off": {
92068
+ label: t("Power off", "Togli alimentazione"),
92069
+ phrase: t("Power off {device}", "Togli alimentazione a {device}"),
92070
+ icon: "unplug"
92071
+ }
92072
+ },
92073
+ state: { on: {
92074
+ label: t("Powered", "Alimentata"),
92075
+ whenTrue: t("When {device} is powered", "Quando {device} viene alimentata"),
92076
+ whenFalse: t("When {device} loses power", "Quando {device} perde l’alimentazione"),
92077
+ icon: "plug-zap"
92078
+ } }
90391
92079
  }
90392
92080
  }
90393
92081
  }
@@ -90977,10 +92665,11 @@ method(_void(), SystemInfoSchema), method(_void(), HealthStatusSchema), method(_
90977
92665
  /**
90978
92666
  * tags — the registry of tag STYLES and the one place that renames or removes a
90979
92667
  * tag everywhere (D1054). A tag itself lives in the `tags` array of the record it
90980
- * labels (a core block, a scheduler, a template, an action, a device); only its
92668
+ * labels (a core block, a scheduler, a template, an action, a device, a
92669
+ * notification rule); only its
90981
92670
  * colour token and icon are registered here. Provided by the core-blocks builtin,
90982
- * the one place that knows every owner kind; devices are reached through
90983
- * `deviceManager` over `ctx.api`.
92671
+ * the one place that knows every owner kind; devices and notification rules
92672
+ * are reached through `deviceManager` / `notificationRules` over `ctx.api`.
90984
92673
  *
90985
92674
  * Tags compare trimmed and case-insensitively. `list` is the union of styled tags
90986
92675
  * and tags in use; a tag with no style answers a colour derived from its name and
@@ -90991,7 +92680,21 @@ var TagUsageCountsSchema = object({
90991
92680
  schedulers: number$1().int().nonnegative(),
90992
92681
  templates: number$1().int().nonnegative(),
90993
92682
  actions: number$1().int().nonnegative(),
90994
- devices: number$1().int().nonnegative()
92683
+ devices: number$1().int().nonnegative(),
92684
+ notificationRules: number$1().int().nonnegative()
92685
+ });
92686
+ /**
92687
+ * The counts `list` answers. An owner that could not be read (a forked addon
92688
+ * that is down, redeploying or not installed) is `null` — unknown, never `0`
92689
+ * (D393) — and `list` still answers with the other owners' tags.
92690
+ */
92691
+ var TagListCountsSchema = object({
92692
+ coreBlocks: number$1().int().nonnegative().nullable(),
92693
+ schedulers: number$1().int().nonnegative().nullable(),
92694
+ templates: number$1().int().nonnegative().nullable(),
92695
+ actions: number$1().int().nonnegative().nullable(),
92696
+ devices: number$1().int().nonnegative().nullable(),
92697
+ notificationRules: number$1().int().nonnegative().nullable()
90995
92698
  });
90996
92699
  var TagEntrySchema = object({
90997
92700
  name: TagNameSchema,
@@ -90999,7 +92702,8 @@ var TagEntrySchema = object({
90999
92702
  icon: IconKeySchema,
91000
92703
  /** `false` when the operator never chose a style: colour and icon are the derived defaults. */
91001
92704
  styled: boolean(),
91002
- counts: TagUsageCountsSchema
92705
+ /** Per owner kind; `null` = that owner could not be read on this call. */
92706
+ counts: TagListCountsSchema
91003
92707
  });
91004
92708
  method(object({}), array(TagEntrySchema), { auth: "protected" }), method(object({
91005
92709
  name: TagNameSchema,
@@ -91540,7 +93244,6 @@ method(object({ kind: TemplateKindSchema.optional() }), array(TemplateRecordSche
91540
93244
  });
91541
93245
  /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
91542
93246
  var ProfileSettingsSchemaBridge = unknown().nullable();
91543
- var ProfileSettingsBagSchema = record$1(string(), unknown());
91544
93247
  /**
91545
93248
  * A live terminal session hosted by the provider addon. Output and input do
91546
93249
  * NOT flow through the capability — they use the addon data plane
@@ -91559,7 +93262,11 @@ var TerminalSessionInfoSchema = object({
91559
93262
  cols: number$1().int().positive(),
91560
93263
  rows: number$1().int().positive(),
91561
93264
  /** ms-epoch the session's pty was spawned. */
91562
- startedAt: number$1()
93265
+ startedAt: number$1(),
93266
+ /** User id of the admin who opened it; `unattributed` when the caller was not passed. */
93267
+ openedBy: string().optional(),
93268
+ /** ms-epoch of the last pty input or output — what the idle timeout measures. */
93269
+ lastActivityAt: number$1().optional()
91563
93270
  });
91564
93271
  /**
91565
93272
  * A profile the operator may open — a pre-declared, allowlisted program
@@ -91579,39 +93286,6 @@ var TerminalProfileInfoSchema = object({
91579
93286
  /** ConfigUISchema for instance knobs, or null when the profile has none. */
91580
93287
  settingsSchema: ProfileSettingsSchemaBridge.optional()
91581
93288
  });
91582
- /**
91583
- * A durable operator-created Terminal instance. Profiles are templates; only
91584
- * an instance declares a camera.
91585
- */
91586
- var TerminalInstanceInfoSchema = object({
91587
- instanceId: string(),
91588
- cameraStableId: string(),
91589
- nodeId: string(),
91590
- /**
91591
- * False while the node the instance is bound to is not in the cluster
91592
- * topology (forgotten, renamed, re-paired). The instance is kept; the
91593
- * operator re-points it on the Terminal page.
91594
- */
91595
- nodeInCluster: boolean(),
91596
- profileId: string(),
91597
- profileLabel: string(),
91598
- name: string(),
91599
- enabled: boolean(),
91600
- executable: string(),
91601
- args: array(string()).readonly(),
91602
- cwd: string(),
91603
- environment: array(string()).readonly(),
91604
- profileSettings: ProfileSettingsBagSchema
91605
- });
91606
- var TerminalLegacyCameraSchema = object({
91607
- stableId: string(),
91608
- nodeId: string(),
91609
- profileId: string(),
91610
- profileLabel: string(),
91611
- name: string(),
91612
- /** Only legacy monitor cameras can retain their historic stable identity. */
91613
- adoptable: boolean()
91614
- });
91615
93289
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
91616
93290
  seq: number$1().int().positive(),
91617
93291
  kind: literal("data"),
@@ -91639,13 +93313,7 @@ var TerminalOutputBatchSchema = object({
91639
93313
  snapshot: string().optional(),
91640
93314
  events: array(TerminalOutputEventSchema).readonly()
91641
93315
  });
91642
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
91643
- stableId: string().min(1),
91644
- name: string().trim().min(1).max(160).optional()
91645
- }), TerminalInstanceInfoSchema, {
91646
- kind: "mutation",
91647
- auth: "admin"
91648
- }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(_void(), ServerShellStatusSchema, { auth: "admin" }), method(object({
93316
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(_void(), ServerShellStatusSchema, { auth: "admin" }), method(object({
91649
93317
  profileId: string(),
91650
93318
  cols: number$1().int().positive(),
91651
93319
  rows: number$1().int().positive(),
@@ -94363,6 +96031,427 @@ DeviceType.Camera, method(object({ deviceId: number$1().int().nonnegative() }),
94363
96031
  deviceId: number$1().int().nonnegative(),
94364
96032
  sessionId: string()
94365
96033
  }), WebrtcSessionDebugSchema, { kind: "query" });
96034
+ var WorkloadStateSchema = _enum([
96035
+ "running",
96036
+ "paused",
96037
+ "stopped",
96038
+ "starting",
96039
+ "stopping",
96040
+ "crashed"
96041
+ ]);
96042
+ /** The five kinds of workload, as roles of the `workload` device type (D1033). */
96043
+ var WORKLOAD_ROLES = [
96044
+ DeviceRole.Vm,
96045
+ DeviceRole.AppContainer,
96046
+ DeviceRole.Lxc,
96047
+ DeviceRole.App,
96048
+ DeviceRole.Host
96049
+ ];
96050
+ /**
96051
+ * What the workload uses. Every value is `null` when not reported (D393). A host
96052
+ * fills `load1` and `temperature`; its uptime is `since` while it runs.
96053
+ */
96054
+ var WorkloadResourcesSchema = object({
96055
+ /** CPU use, percent of the CPUs it may use (0–100). */
96056
+ cpuPercent: number$1().nullable().meta(readingMeta("percentage", { precision: 1 })),
96057
+ memoryUsedBytes: number$1().nullable().meta(readingMeta("information")),
96058
+ /**
96059
+ * Memory use, percent of `memoryLimitBytes`, for a source that reports a share
96060
+ * and not bytes (a Docker container's stats). Absent or `null` = not reported.
96061
+ */
96062
+ memoryPercent: number$1().nullable().optional().meta(readingMeta("percentage", { precision: 1 })),
96063
+ /** The memory it may use: the limit of a container, the RAM of a VM or host. */
96064
+ memoryLimitBytes: number$1().nullable().meta(readingMeta("information")),
96065
+ vcpus: number$1().nullable().meta(readingMeta("count")),
96066
+ diskUsedBytes: number$1().nullable().meta(readingMeta("information")),
96067
+ diskTotalBytes: number$1().nullable().meta(readingMeta("information")),
96068
+ /** Network received, kbit/s. */
96069
+ netRxKbps: number$1().nullable().meta(readingMeta("bitrate")),
96070
+ /** Network sent, kbit/s. */
96071
+ netTxKbps: number$1().nullable().meta(readingMeta("bitrate")),
96072
+ /** One-minute load average (a host). */
96073
+ load1: number$1().nullable().meta(readingMeta("index", { precision: 2 })),
96074
+ /** CPU / board temperature (a host). */
96075
+ temperature: number$1().nullable().meta(readingMeta("temperature", { precision: 1 }))
96076
+ });
96077
+ var WorkloadPortProtocolSchema = _enum(["tcp", "udp"]);
96078
+ /** One published port: the workload's own port and where the host exposes it. */
96079
+ var WorkloadPortSchema = object({
96080
+ port: number$1().int().meta(readingMeta("none")),
96081
+ /** The host port it is published on; null = not published. */
96082
+ hostPort: number$1().int().nullable().meta(readingMeta("none")),
96083
+ /** The host address it is bound to; null = every address. */
96084
+ hostIp: string().nullable(),
96085
+ protocol: WorkloadPortProtocolSchema
96086
+ });
96087
+ var WorkloadStatusSchema = object({
96088
+ /** null = unknown, never stopped (D393). */
96089
+ state: WorkloadStateSchema.nullable().meta({ label: "State" }),
96090
+ /** Epoch ms the current state began (uptime while running); null when unknown. */
96091
+ since: number$1().nullable().meta(readingMeta("none")),
96092
+ /** The `host` device this runs on, when the provider has adopted it. */
96093
+ hostDeviceId: number$1().int().nullable().meta(readingMeta("device")),
96094
+ /** The image a container runs (`nginx:1.27`). */
96095
+ image: string().nullable(),
96096
+ /** The operating system (a VM, an LXC, a host). */
96097
+ os: string().nullable(),
96098
+ /** The version or firmware it runs. */
96099
+ version: string().nullable(),
96100
+ /** Starts with its host; null when the platform does not say. */
96101
+ autostart: boolean().nullable(),
96102
+ resources: WorkloadResourcesSchema,
96103
+ ports: array(WorkloadPortSchema),
96104
+ /** The addresses it is reachable on (IPs or host names). */
96105
+ addresses: array(string()),
96106
+ /** A newer image / version exists. Installing it stays the `update` cap. */
96107
+ updateAvailable: boolean().nullable(),
96108
+ lastFetchedAt: number$1()
96109
+ });
96110
+ /**
96111
+ * What this device can do, probed by its provider (D14 honesty): a flag is
96112
+ * `true` only when the platform really serves it for THIS device.
96113
+ */
96114
+ var WorkloadOptionsSchema = object({
96115
+ supportsStart: boolean(),
96116
+ supportsStop: boolean(),
96117
+ supportsRestart: boolean(),
96118
+ /** Pause AND resume. */
96119
+ supportsPause: boolean(),
96120
+ supportsForceStop: boolean(),
96121
+ hasResources: boolean(),
96122
+ hasPorts: boolean(),
96123
+ hasAddresses: boolean(),
96124
+ hasAutostart: boolean(),
96125
+ hasUpdateCheck: boolean()
96126
+ });
96127
+ var WorkloadDeviceInputSchema = object({ deviceId: number$1().int().nonnegative() });
96128
+ var WorkloadTransitionEventDataSchema = object({
96129
+ deviceId: number$1(),
96130
+ state: WorkloadStateSchema,
96131
+ previous: WorkloadStateSchema,
96132
+ since: number$1().nullable()
96133
+ });
96134
+ EventCategory.WorkloadStarted, EventCategory.WorkloadStopped, EventCategory.WorkloadCrashed, EventCategory.WorkloadRecovered;
96135
+ var workloadCapability = {
96136
+ name: "workload",
96137
+ scope: "device",
96138
+ deviceNative: true,
96139
+ mode: "singleton",
96140
+ deviceTypes: [DeviceType.Workload],
96141
+ deviceRoles: { [DeviceType.Workload]: WORKLOAD_ROLES },
96142
+ /**
96143
+ * On / off is the state (#462): stopped or crashed is off, anything else on.
96144
+ * The owner registers `switch` through `registerPowerSwitch`; there is no
96145
+ * second on/off state. A device whose provider serves no start / stop gets no
96146
+ * switch.
96147
+ */
96148
+ power: {
96149
+ kind: "methods",
96150
+ field: "state",
96151
+ offValues: ["stopped", "crashed"],
96152
+ on: "start",
96153
+ off: "stop"
96154
+ },
96155
+ methods: {
96156
+ start: optionalMethod(WorkloadDeviceInputSchema, _void(), {
96157
+ kind: "mutation",
96158
+ auth: "protected",
96159
+ actions: [{
96160
+ id: "workload.start",
96161
+ label: t("Start", "Avvia"),
96162
+ phrase: t("Start {device}", "Avvia {device}"),
96163
+ icon: "play",
96164
+ effect: {
96165
+ field: "state",
96166
+ value: "running"
96167
+ }
96168
+ }]
96169
+ }),
96170
+ stop: optionalMethod(WorkloadDeviceInputSchema, _void(), {
96171
+ kind: "mutation",
96172
+ auth: "protected",
96173
+ actions: [{
96174
+ id: "workload.stop",
96175
+ label: t("Stop", "Arresta"),
96176
+ phrase: t("Stop {device}", "Arresta {device}"),
96177
+ icon: "square",
96178
+ effect: {
96179
+ field: "state",
96180
+ value: "stopped"
96181
+ }
96182
+ }]
96183
+ }),
96184
+ restart: optionalMethod(WorkloadDeviceInputSchema, _void(), {
96185
+ kind: "mutation",
96186
+ auth: "protected",
96187
+ actions: [{
96188
+ id: "workload.restart",
96189
+ label: t("Restart", "Riavvia"),
96190
+ phrase: t("Restart {device}", "Riavvia {device}"),
96191
+ icon: "rotate-ccw"
96192
+ }]
96193
+ }),
96194
+ pause: optionalMethod(WorkloadDeviceInputSchema, _void(), {
96195
+ kind: "mutation",
96196
+ auth: "protected",
96197
+ actions: [{
96198
+ id: "workload.pause",
96199
+ label: t("Pause", "Metti in pausa"),
96200
+ phrase: t("Pause {device}", "Metti in pausa {device}"),
96201
+ icon: "pause",
96202
+ effect: {
96203
+ field: "state",
96204
+ value: "paused"
96205
+ }
96206
+ }]
96207
+ }),
96208
+ resume: optionalMethod(WorkloadDeviceInputSchema, _void(), {
96209
+ kind: "mutation",
96210
+ auth: "protected",
96211
+ actions: [{
96212
+ id: "workload.resume",
96213
+ label: t("Resume", "Riprendi"),
96214
+ phrase: t("Resume {device}", "Riprendi {device}"),
96215
+ icon: "circle-play",
96216
+ effect: {
96217
+ field: "state",
96218
+ value: "running"
96219
+ }
96220
+ }]
96221
+ }),
96222
+ forceStop: optionalMethod(WorkloadDeviceInputSchema, _void(), {
96223
+ kind: "mutation",
96224
+ auth: "admin",
96225
+ actions: [{
96226
+ id: "workload.forceStop",
96227
+ label: t("Force stop", "Arresto forzato"),
96228
+ phrase: t("Force {device} to stop", "Forza l’arresto di {device}"),
96229
+ icon: "octagon-x",
96230
+ effect: {
96231
+ field: "state",
96232
+ value: "stopped"
96233
+ }
96234
+ }]
96235
+ }),
96236
+ /** What THIS device can do, probed — the UI is derived from it. */
96237
+ getOptions: method(WorkloadDeviceInputSchema, WorkloadOptionsSchema, { auth: "protected" })
96238
+ },
96239
+ events: {
96240
+ onStarted: {
96241
+ data: WorkloadTransitionEventDataSchema,
96242
+ trigger: {
96243
+ category: EventCategory.WorkloadStarted,
96244
+ label: t("Started", "Avviato"),
96245
+ phrase: t("When {device} starts", "Quando {device} si avvia"),
96246
+ icon: "play"
96247
+ }
96248
+ },
96249
+ onStopped: {
96250
+ data: WorkloadTransitionEventDataSchema,
96251
+ trigger: {
96252
+ category: EventCategory.WorkloadStopped,
96253
+ label: t("Stopped", "Arrestato"),
96254
+ phrase: t("When {device} stops", "Quando {device} si arresta"),
96255
+ icon: "square"
96256
+ }
96257
+ },
96258
+ onCrashed: {
96259
+ data: WorkloadTransitionEventDataSchema,
96260
+ trigger: {
96261
+ category: EventCategory.WorkloadCrashed,
96262
+ label: t("Crashed", "Arrestato in modo anomalo"),
96263
+ phrase: t("When {device} stops without being asked", "Quando {device} si arresta senza che sia stato richiesto"),
96264
+ icon: "triangle-alert"
96265
+ }
96266
+ },
96267
+ onRecovered: {
96268
+ data: WorkloadTransitionEventDataSchema,
96269
+ trigger: {
96270
+ category: EventCategory.WorkloadRecovered,
96271
+ label: t("Recovered", "Ripristinato"),
96272
+ phrase: t("When {device} runs again after a crash", "Quando {device} riparte dopo un arresto anomalo"),
96273
+ icon: "heart-pulse"
96274
+ }
96275
+ }
96276
+ },
96277
+ status: {
96278
+ schema: WorkloadStatusSchema,
96279
+ kind: "poll"
96280
+ },
96281
+ runtimeState: WorkloadStatusSchema,
96282
+ /**
96283
+ * Runtime-state durability: **session** — the provider answers on its next
96284
+ * poll; the series are recorded, so a restart that clears the slice loses
96285
+ * nothing a reader needs. The events are judged from the first state seen.
96286
+ */
96287
+ durability: "session",
96288
+ /**
96289
+ * History (D850): the state as an enum, CPU / memory / network as gauges, so
96290
+ * the charts need no per-metric child device.
96291
+ */
96292
+ history: {
96293
+ primary: "resources.cpuPercent",
96294
+ priority: 40,
96295
+ fields: {
96296
+ state: { kind: "enum" },
96297
+ "resources.cpuPercent": {
96298
+ kind: "gauge",
96299
+ unit: "%",
96300
+ deadband: 2,
96301
+ displayName: "CPU"
96302
+ },
96303
+ "resources.memoryUsedBytes": {
96304
+ kind: "gauge",
96305
+ unit: "bytes",
96306
+ displayName: "Memory used"
96307
+ },
96308
+ "resources.memoryPercent": {
96309
+ kind: "gauge",
96310
+ unit: "%",
96311
+ deadband: 2,
96312
+ displayName: "Memory"
96313
+ },
96314
+ "resources.netRxKbps": {
96315
+ group: "network",
96316
+ kind: "gauge",
96317
+ unit: "kbps",
96318
+ displayName: "Network received"
96319
+ },
96320
+ "resources.netTxKbps": {
96321
+ group: "network",
96322
+ kind: "gauge",
96323
+ unit: "kbps",
96324
+ displayName: "Network sent"
96325
+ }
96326
+ }
96327
+ },
96328
+ volatileStateFields: ["lastFetchedAt"],
96329
+ vocabulary: {
96330
+ noun: t("Workload", "Carico di lavoro"),
96331
+ order: 2400,
96332
+ state: [
96333
+ {
96334
+ kind: "enum",
96335
+ field: "state",
96336
+ label: t("State", "Stato"),
96337
+ values: [
96338
+ {
96339
+ value: "running",
96340
+ label: t("Running", "In esecuzione"),
96341
+ phrase: t("When {device} is running", "Quando {device} è in esecuzione")
96342
+ },
96343
+ {
96344
+ value: "paused",
96345
+ label: t("Paused", "In pausa")
96346
+ },
96347
+ {
96348
+ value: "stopped",
96349
+ label: t("Stopped", "Arrestato"),
96350
+ phrase: t("When {device} is stopped", "Quando {device} è arrestato")
96351
+ },
96352
+ {
96353
+ value: "starting",
96354
+ label: t("Starting", "In avvio")
96355
+ },
96356
+ {
96357
+ value: "stopping",
96358
+ label: t("Stopping", "In arresto")
96359
+ },
96360
+ {
96361
+ value: "crashed",
96362
+ label: t("Crashed", "Arrestato in modo anomalo"),
96363
+ phrase: t("When {device} has crashed", "Quando {device} è arrestato in modo anomalo")
96364
+ }
96365
+ ],
96366
+ icon: "activity"
96367
+ },
96368
+ {
96369
+ kind: "numeric",
96370
+ field: "resources.cpuPercent",
96371
+ quantity: t("the CPU use", "l'uso della CPU"),
96372
+ label: t("CPU", "CPU"),
96373
+ unit: "%",
96374
+ icon: "cpu"
96375
+ },
96376
+ {
96377
+ kind: "numeric",
96378
+ field: "resources.memoryPercent",
96379
+ quantity: t("the memory use", "l'uso della memoria"),
96380
+ label: t("Memory", "Memoria"),
96381
+ unit: "%",
96382
+ icon: "memory-stick"
96383
+ },
96384
+ {
96385
+ kind: "numeric",
96386
+ field: "resources.temperature",
96387
+ quantity: t("the temperature", "la temperatura"),
96388
+ label: t("Temperature", "Temperatura"),
96389
+ unit: "°C",
96390
+ icon: "thermometer"
96391
+ }
96392
+ ],
96393
+ overrides: { byRole: {
96394
+ [DeviceRole.Vm]: {
96395
+ actions: { "workload.start": { icon: "monitor" } },
96396
+ state: { state: { icon: "monitor" } }
96397
+ },
96398
+ [DeviceRole.AppContainer]: {
96399
+ actions: { "workload.start": { icon: "container" } },
96400
+ state: { state: { icon: "container" } }
96401
+ },
96402
+ [DeviceRole.Lxc]: {
96403
+ actions: { "workload.start": { icon: "box" } },
96404
+ state: { state: { icon: "box" } }
96405
+ },
96406
+ [DeviceRole.App]: {
96407
+ actions: { "workload.start": { icon: "app-window" } },
96408
+ state: { state: { icon: "app-window" } }
96409
+ },
96410
+ [DeviceRole.Host]: {
96411
+ actions: {
96412
+ "workload.start": {
96413
+ label: t("Power on", "Accendi"),
96414
+ phrase: t("Power on {device}", "Accendi {device}"),
96415
+ icon: "power"
96416
+ },
96417
+ "workload.stop": {
96418
+ label: t("Shut down", "Spegni"),
96419
+ phrase: t("Shut down {device}", "Spegni {device}"),
96420
+ icon: "power-off"
96421
+ },
96422
+ "workload.restart": {
96423
+ label: t("Reboot", "Riavvia"),
96424
+ phrase: t("Reboot {device}", "Riavvia {device}"),
96425
+ icon: "refresh-cw"
96426
+ }
96427
+ },
96428
+ state: { state: { icon: "server" } },
96429
+ events: {
96430
+ onStarted: {
96431
+ label: t("Came online", "Tornato in linea"),
96432
+ phrase: t("When {device} comes online", "Quando {device} torna in linea"),
96433
+ icon: "server"
96434
+ },
96435
+ onStopped: {
96436
+ label: t("Shut down", "Spento"),
96437
+ phrase: t("When {device} shuts down", "Quando {device} si spegne"),
96438
+ icon: "server-off"
96439
+ },
96440
+ onCrashed: {
96441
+ label: t("Went down", "Caduto"),
96442
+ phrase: t("When {device} goes down unexpectedly", "Quando {device} cade inaspettatamente"),
96443
+ icon: "server-crash"
96444
+ },
96445
+ onRecovered: {
96446
+ label: t("Came online", "Tornato in linea"),
96447
+ phrase: t("When {device} comes back online after going down", "Quando {device} torna in linea dopo essere caduto"),
96448
+ icon: "server"
96449
+ }
96450
+ }
96451
+ }
96452
+ } }
96453
+ }
96454
+ };
94366
96455
  /**
94367
96456
  * Per-zone occupancy aggregation produced by the analytics frame
94368
96457
  * processor on every inference result. Covers the full combinatorial
@@ -95507,6 +97596,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
95507
97596
  irTransmitter: irTransmitterCapability,
95508
97597
  lawnMowerControl: lawnMowerControlCapability,
95509
97598
  lockControl: lockControlCapability,
97599
+ lowPowerSleep: lowPowerSleepCapability,
95510
97600
  mediaPlayer: mediaPlayerCapability,
95511
97601
  meter: meterCapability,
95512
97602
  motion: motionCapability,
@@ -95531,6 +97621,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
95531
97621
  runningState: runningStateCapability,
95532
97622
  sceneMonitor: sceneMonitorCapability,
95533
97623
  scriptRunner: scriptRunnerCapability,
97624
+ siren: sirenCapability,
95534
97625
  smoke: smokeCapability,
95535
97626
  streamCatalog: streamCatalogCapability,
95536
97627
  streamParams: streamParamsCapability,
@@ -95546,11 +97637,65 @@ var DEVICE_LOCAL_STATE_CAPS = {
95546
97637
  waterHeater: waterHeaterCapability,
95547
97638
  weather: weatherCapability,
95548
97639
  weatherStation: weatherStationCapability,
97640
+ workload: workloadCapability,
95549
97641
  zoneAnalytics: zoneAnalyticsCapability,
95550
97642
  zoneRules: zoneRulesCapability,
95551
97643
  zones: zonesCapability
95552
97644
  };
95553
97645
  /**
97646
+ * Normalise `raw` and declare it: every kind it carries replaces the stored one,
97647
+ * every kind it lacks is removed, except the kinds in `options.unread` (a failed
97648
+ * read keeps what was stored) — pass everything the provider read in one call.
97649
+ */
97650
+ async function declareDeviceIdentifiers(deps, raw, options = {}) {
97651
+ const { deviceId, logger, writer } = deps;
97652
+ const { unread, ...normaliseOptions } = options;
97653
+ const { identifiers, rejected } = normaliseIdentifiers(raw, normaliseOptions);
97654
+ for (const r of rejected) logger.warn("identifier refused — not declared", {
97655
+ tags: { deviceId },
97656
+ meta: {
97657
+ key: r.key,
97658
+ value: r.value,
97659
+ reason: r.reason
97660
+ }
97661
+ });
97662
+ const unreadKinds = new Set(unread ?? []);
97663
+ if (isEmptyIdentifiers(identifiers) && DEVICE_IDENTIFIER_KEYS.every((key) => unreadKinds.has(key))) {
97664
+ logger.debug("no identifier read — nothing declared", { tags: { deviceId } });
97665
+ return {
97666
+ outcome: "nothing-to-declare",
97667
+ identifiers
97668
+ };
97669
+ }
97670
+ if (writer === void 0) {
97671
+ logger.warn("identifiers not declared — device-manager unreachable", { tags: { deviceId } });
97672
+ return {
97673
+ outcome: "unavailable",
97674
+ identifiers
97675
+ };
97676
+ }
97677
+ try {
97678
+ await writer.mutate({
97679
+ deviceId,
97680
+ identifiers,
97681
+ ...unread !== void 0 && unread.length > 0 ? { unread } : {}
97682
+ });
97683
+ return {
97684
+ outcome: "declared",
97685
+ identifiers
97686
+ };
97687
+ } catch (err) {
97688
+ logger.warn("identifiers not declared — setIdentifiers failed", {
97689
+ tags: { deviceId },
97690
+ meta: { error: errMsg(err) }
97691
+ });
97692
+ return {
97693
+ outcome: "failed",
97694
+ identifiers
97695
+ };
97696
+ }
97697
+ }
97698
+ /**
95554
97699
  * The edge between two readings, or `null` for no edge.
95555
97700
  *
95556
97701
  * - `null`/cold → `true` is a START (a fault already open at boot is one);
@@ -95602,6 +97747,8 @@ var BaseDevice = class {
95602
97747
  id;
95603
97748
  stableId;
95604
97749
  type;
97750
+ /** True when another process owns the base slices (`options.deviceStatus: 'external'`). */
97751
+ statusIsExternal;
95605
97752
  name;
95606
97753
  parentDeviceId;
95607
97754
  role;
@@ -95750,21 +97897,26 @@ var BaseDevice = class {
95750
97897
  };
95751
97898
  this.runtimeState = DeviceRuntimeState.fromInitial(initial, writer, onWriteFailed);
95752
97899
  ctx.bindRuntimeState?.(this.runtimeState);
95753
- ctx.registerNativeCap?.(deviceStatusCapability, {});
95754
- const seed = {
95755
- online: true,
95756
- lastChangedAt: Date.now()
95757
- };
95758
- this.runtimeState.setCapState("device-status", seed);
95759
- ctx.registerNativeCap?.(featureProbeCapability, {});
95760
- this.runtimeState.setCapState("feature-probe", {
95761
- flags: {},
95762
- deviceType: null,
95763
- model: null,
95764
- channelCount: null,
95765
- lastProbedAt: 0,
95766
- lastFetchedAt: 0
95767
- });
97900
+ this.statusIsExternal = options.deviceStatus === "external";
97901
+ if (!this.statusIsExternal) ctx.registerNativeCap?.(deviceStatusCapability, {});
97902
+ if (!this.statusIsExternal) {
97903
+ const seed = {
97904
+ online: true,
97905
+ lastChangedAt: Date.now()
97906
+ };
97907
+ this.runtimeState.setCapState("device-status", seed);
97908
+ }
97909
+ if (!this.statusIsExternal) {
97910
+ ctx.registerNativeCap?.(featureProbeCapability, {});
97911
+ this.runtimeState.setCapState("feature-probe", {
97912
+ flags: {},
97913
+ deviceType: null,
97914
+ model: null,
97915
+ channelCount: null,
97916
+ lastProbedAt: 0,
97917
+ lastFetchedAt: 0
97918
+ });
97919
+ }
95768
97920
  }
95769
97921
  deviceActions = /* @__PURE__ */ new Map();
95770
97922
  /** Declare a device custom action + its typed handler. Idempotent per name. */
@@ -95792,7 +97944,7 @@ var BaseDevice = class {
95792
97944
  * override to gate side effects on the transition.
95793
97945
  */
95794
97946
  markOnline(online) {
95795
- if (this.online === online) return;
97947
+ if (this.statusIsExternal || this.online === online) return;
95796
97948
  const next = {
95797
97949
  online,
95798
97950
  lastChangedAt: Date.now()
@@ -95862,6 +98014,24 @@ var BaseDevice = class {
95862
98014
  }));
95863
98015
  }
95864
98016
  /**
98017
+ * Declare this device's identifiers (D1059): MAC(s), serial, vendor uid,
98018
+ * machine uuid, hostname, IP — what a later step matches across integrations.
98019
+ * Normalises `raw` (`normaliseIdentifiers`), logs every refused value, and
98020
+ * writes the result through `device-manager.setIdentifiers`, which accepts it
98021
+ * only from the provider that owns this device. Each kind it carries replaces
98022
+ * the stored one and each kind it lacks is removed — except the kinds listed in
98023
+ * `options.unread` (reads that FAILED), which keep their stored value. Pass
98024
+ * everything read in one call; a call where every kind is unread writes
98025
+ * nothing. Best-effort: never throws.
98026
+ */
98027
+ async declareIdentifiers(raw, options) {
98028
+ return declareDeviceIdentifiers({
98029
+ deviceId: this.id,
98030
+ logger: this.ctx.logger,
98031
+ writer: this.ctx.api.deviceManager?.setIdentifiers
98032
+ }, raw, options);
98033
+ }
98034
+ /**
95865
98035
  * Re-publish the device's current `features` array to the persisted
95866
98036
  * meta blob. Drivers call this after a probe finishes when the live
95867
98037
  * `features` getter has gained new flags (e.g. `hasIntercom` flips
@@ -96066,6 +98236,7 @@ var BaseDevice = class {
96066
98236
  * `lastProbedAt`) once their probe actually succeeds.
96067
98237
  */
96068
98238
  async onProbe() {
98239
+ if (this.statusIsExternal) return;
96069
98240
  const base = this.runtimeState.getCapState("feature-probe") ?? {
96070
98241
  flags: {},
96071
98242
  deviceType: null,
@@ -96905,8 +99076,23 @@ var BaseDeviceProvider = class extends BaseAddon {
96905
99076
  return toDeviceSummary(device, this.addonId);
96906
99077
  }
96907
99078
  };
99079
+ /**
99080
+ * The `resync` provider of an adopted container (#459, Q6): the work is the
99081
+ * owning addon's `device-adoption.resync`, reached through
99082
+ * `deviceManager.adoptionResync`, which also owns the "resync from zero" child
99083
+ * purge. Registering this is what makes `DeviceFeature.Resyncable` true.
99084
+ */
99085
+ function resyncThroughAdoption(deviceManager, ownDeviceId) {
99086
+ return { resync: async ({ deviceId, resetToSource }) => {
99087
+ if (deviceId !== ownDeviceId) throw new Error(`resync: deviceId mismatch, expected ${ownDeviceId}, got ${deviceId}`);
99088
+ return deviceManager.adoptionResync.mutate({
99089
+ camDeviceId: deviceId,
99090
+ ...resetToSource !== void 0 ? { resetToSource } : {}
99091
+ });
99092
+ } };
99093
+ }
96908
99094
  DeviceType.HeatPump;
96909
- DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
99095
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Camera, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
96910
99096
  new Set(Object.values(DeviceType));
96911
99097
  /** Parses the raw slice with the cap's own schema; `undefined` when it does not parse. */
96912
99098
  function contribution(cap, schema, build) {
@@ -97115,8 +99301,8 @@ var ALARM_MODES = [
97115
99301
  "vacation",
97116
99302
  "custom_bypass"
97117
99303
  ];
97118
- function alarmControls(state, modes, requiresCode) {
97119
- if (requiresCode) return [];
99304
+ function alarmControls(state, modes, codeRequired) {
99305
+ if (codeRequired) return [];
97120
99306
  const disarm = asAction(action("alarm.disarm", t("Disarm", "Disinserisci"), "shield-off", "alarm-panel", "disarm", {}, "primary"));
97121
99307
  const arm = (primaryFirst) => modes.map((mode, i) => asAction(action(`alarm.arm.${mode}`, ARM_LABELS[mode], "shield-check", "alarm-panel", "arm", { mode }, primaryFirst && i === 0 ? "primary" : "normal")));
97122
99308
  switch (state) {
@@ -97136,7 +99322,7 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
97136
99322
  const modes = slice === void 0 ? ALARM_MODES : slice.availableModes;
97137
99323
  return {
97138
99324
  reading: reading$1("alarm-panel", words?.state ?? "unknown", false, words?.title),
97139
- rows: [row$1("alarm", state === "triggered" ? "shield-alert" : state === "disarmed" ? "shield-off" : "shield-check", joinText([words?.title ?? NOT_REPORTED, since]), alarmControls(state, modes, slice?.requiresCode ?? false))],
99325
+ rows: [row$1("alarm", state === "triggered" ? "shield-alert" : state === "disarmed" ? "shield-off" : "shield-check", joinText([words?.title ?? NOT_REPORTED, since]), alarmControls(state, modes, slice?.codeRequired !== false))],
97140
99326
  ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] },
97141
99327
  ...words === null ? {} : { tiles: {
97142
99328
  left: [{
@@ -98962,7 +101148,7 @@ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pu
98962
101148
  ...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
98963
101149
  ...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
98964
101150
  ];
98965
- DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
101151
+ DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
98966
101152
  /**
98967
101153
  * Who looks like what (D1023). One look per {@link DeviceType}, refined by a
98968
101154
  * {@link DeviceRole} where the role changes how the device reads (a leak
@@ -99606,8 +101792,8 @@ lookOf({
99606
101792
  standby: MUTED
99607
101793
  });
99608
101794
  DeviceType.Climate;
99609
- DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
99610
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
101795
+ DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
101796
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
99611
101797
  Object.freeze({
99612
101798
  "accessories.getStatus": {
99613
101799
  capName: "accessories",
@@ -100519,13 +102705,6 @@ Object.freeze({
100519
102705
  access: "view",
100520
102706
  role: "viewer"
100521
102707
  },
100522
- "battery.wakeForStream": {
100523
- capName: "battery",
100524
- capScope: "device",
100525
- addonId: null,
100526
- access: "create",
100527
- role: "viewer"
100528
- },
100529
102708
  "binary.getStatus": {
100530
102709
  capName: "binary",
100531
102710
  capScope: "device",
@@ -101625,6 +103804,13 @@ Object.freeze({
101625
103804
  access: "delete",
101626
103805
  role: "admin"
101627
103806
  },
103807
+ "deviceHistory.deleteSeriesRange": {
103808
+ capName: "device-history",
103809
+ capScope: "system",
103810
+ addonId: null,
103811
+ access: "delete",
103812
+ role: "admin"
103813
+ },
101628
103814
  "deviceHistory.getDeviceEnabled": {
101629
103815
  capName: "device-history",
101630
103816
  capScope: "system",
@@ -102045,6 +104231,13 @@ Object.freeze({
102045
104231
  access: "view",
102046
104232
  role: "admin"
102047
104233
  },
104234
+ "deviceManager.listIdentityCandidates": {
104235
+ capName: "device-manager",
104236
+ capScope: "system",
104237
+ addonId: null,
104238
+ access: "view",
104239
+ role: "admin"
104240
+ },
102048
104241
  "deviceManager.listLocationDescriptions": {
102049
104242
  capName: "device-manager",
102050
104243
  capScope: "system",
@@ -102262,6 +104455,13 @@ Object.freeze({
102262
104455
  access: "create",
102263
104456
  role: "admin"
102264
104457
  },
104458
+ "deviceManager.setIdentifiers": {
104459
+ capName: "device-manager",
104460
+ capScope: "system",
104461
+ addonId: null,
104462
+ access: "create",
104463
+ role: "admin"
104464
+ },
102265
104465
  "deviceManager.setIntegrationId": {
102266
104466
  capName: "device-manager",
102267
104467
  capScope: "system",
@@ -104159,6 +106359,20 @@ Object.freeze({
104159
106359
  access: "view",
104160
106360
  role: "admin"
104161
106361
  },
106362
+ "lowPowerSleep.getStatus": {
106363
+ capName: "low-power-sleep",
106364
+ capScope: "device",
106365
+ addonId: null,
106366
+ access: "view",
106367
+ role: "viewer"
106368
+ },
106369
+ "lowPowerSleep.wakeUp": {
106370
+ capName: "low-power-sleep",
106371
+ capScope: "device",
106372
+ addonId: null,
106373
+ access: "create",
106374
+ role: "viewer"
106375
+ },
104162
106376
  "mediaPlayer.channelDown": {
104163
106377
  capName: "media-player",
104164
106378
  capScope: "device",
@@ -105146,6 +107360,13 @@ Object.freeze({
105146
107360
  access: "view",
105147
107361
  role: "admin"
105148
107362
  },
107363
+ "notificationRules.listRuleTags": {
107364
+ capName: "notification-rules",
107365
+ capScope: "system",
107366
+ addonId: null,
107367
+ access: "view",
107368
+ role: "admin"
107369
+ },
105149
107370
  "notificationRules.listSnoozes": {
105150
107371
  capName: "notification-rules",
105151
107372
  capScope: "system",
@@ -105202,6 +107423,13 @@ Object.freeze({
105202
107423
  access: "create",
105203
107424
  role: "admin"
105204
107425
  },
107426
+ "notificationRules.setRuleTags": {
107427
+ capName: "notification-rules",
107428
+ capScope: "system",
107429
+ addonId: null,
107430
+ access: "create",
107431
+ role: "admin"
107432
+ },
105205
107433
  "notificationRules.testRule": {
105206
107434
  capName: "notification-rules",
105207
107435
  capScope: "system",
@@ -106441,6 +108669,13 @@ Object.freeze({
106441
108669
  access: "view",
106442
108670
  role: "admin"
106443
108671
  },
108672
+ "pipelineOrchestrator.getHealthDigest": {
108673
+ capName: "pipeline-orchestrator",
108674
+ capScope: "system",
108675
+ addonId: null,
108676
+ access: "view",
108677
+ role: "admin"
108678
+ },
106444
108679
  "pipelineOrchestrator.getIngestOwner": {
106445
108680
  capName: "pipeline-orchestrator",
106446
108681
  capScope: "system",
@@ -107813,6 +110048,13 @@ Object.freeze({
107813
110048
  access: "view",
107814
110049
  role: "admin"
107815
110050
  },
110051
+ "resync.resync": {
110052
+ capName: "resync",
110053
+ capScope: "device",
110054
+ addonId: null,
110055
+ access: "create",
110056
+ role: "admin"
110057
+ },
107816
110058
  "runningState.getStatus": {
107817
110059
  capName: "running-state",
107818
110060
  capScope: "device",
@@ -108156,6 +110398,41 @@ Object.freeze({
108156
110398
  access: "create",
108157
110399
  role: "admin"
108158
110400
  },
110401
+ "siren.getOptions": {
110402
+ capName: "siren",
110403
+ capScope: "device",
110404
+ addonId: null,
110405
+ access: "view",
110406
+ role: "viewer"
110407
+ },
110408
+ "siren.getPlayChoices": {
110409
+ capName: "siren",
110410
+ capScope: "device",
110411
+ addonId: null,
110412
+ access: "view",
110413
+ role: "viewer"
110414
+ },
110415
+ "siren.getStatus": {
110416
+ capName: "siren",
110417
+ capScope: "device",
110418
+ addonId: null,
110419
+ access: "view",
110420
+ role: "viewer"
110421
+ },
110422
+ "siren.stop": {
110423
+ capName: "siren",
110424
+ capScope: "device",
110425
+ addonId: null,
110426
+ access: "create",
110427
+ role: "viewer"
110428
+ },
110429
+ "siren.trigger": {
110430
+ capName: "siren",
110431
+ capScope: "device",
110432
+ addonId: null,
110433
+ access: "create",
110434
+ role: "viewer"
110435
+ },
108159
110436
  "smoke.getStatus": {
108160
110437
  capName: "smoke",
108161
110438
  capScope: "device",
@@ -108947,6 +111224,13 @@ Object.freeze({
108947
111224
  access: "view",
108948
111225
  role: "viewer"
108949
111226
  },
111227
+ "switch.getOptions": {
111228
+ capName: "switch",
111229
+ capScope: "device",
111230
+ addonId: null,
111231
+ access: "view",
111232
+ role: "viewer"
111233
+ },
108950
111234
  "switch.getStatus": {
108951
111235
  capName: "switch",
108952
111236
  capScope: "device",
@@ -108954,6 +111238,13 @@ Object.freeze({
108954
111238
  access: "view",
108955
111239
  role: "viewer"
108956
111240
  },
111241
+ "switch.powerCycle": {
111242
+ capName: "switch",
111243
+ capScope: "device",
111244
+ addonId: null,
111245
+ access: "create",
111246
+ role: "viewer"
111247
+ },
108957
111248
  "switch.setState": {
108958
111249
  capName: "switch",
108959
111250
  capScope: "device",
@@ -109157,13 +111448,6 @@ Object.freeze({
109157
111448
  access: "create",
109158
111449
  role: "admin"
109159
111450
  },
109160
- "terminalSession.adoptLegacyMonitor": {
109161
- capName: "terminal-session",
109162
- capScope: "system",
109163
- addonId: null,
109164
- access: "create",
109165
- role: "admin"
109166
- },
109167
111451
  "terminalSession.close": {
109168
111452
  capName: "terminal-session",
109169
111453
  capScope: "system",
@@ -109171,13 +111455,6 @@ Object.freeze({
109171
111455
  access: "create",
109172
111456
  role: "admin"
109173
111457
  },
109174
- "terminalSession.listLegacyCameras": {
109175
- capName: "terminal-session",
109176
- capScope: "system",
109177
- addonId: null,
109178
- access: "view",
109179
- role: "admin"
109180
- },
109181
111458
  "terminalSession.listProfiles": {
109182
111459
  capName: "terminal-session",
109183
111460
  capScope: "system",
@@ -110039,6 +112316,62 @@ Object.freeze({
110039
112316
  access: "view",
110040
112317
  role: "viewer"
110041
112318
  },
112319
+ "workload.forceStop": {
112320
+ capName: "workload",
112321
+ capScope: "device",
112322
+ addonId: null,
112323
+ access: "create",
112324
+ role: "admin"
112325
+ },
112326
+ "workload.getOptions": {
112327
+ capName: "workload",
112328
+ capScope: "device",
112329
+ addonId: null,
112330
+ access: "view",
112331
+ role: "viewer"
112332
+ },
112333
+ "workload.getStatus": {
112334
+ capName: "workload",
112335
+ capScope: "device",
112336
+ addonId: null,
112337
+ access: "view",
112338
+ role: "viewer"
112339
+ },
112340
+ "workload.pause": {
112341
+ capName: "workload",
112342
+ capScope: "device",
112343
+ addonId: null,
112344
+ access: "create",
112345
+ role: "viewer"
112346
+ },
112347
+ "workload.restart": {
112348
+ capName: "workload",
112349
+ capScope: "device",
112350
+ addonId: null,
112351
+ access: "create",
112352
+ role: "viewer"
112353
+ },
112354
+ "workload.resume": {
112355
+ capName: "workload",
112356
+ capScope: "device",
112357
+ addonId: null,
112358
+ access: "create",
112359
+ role: "viewer"
112360
+ },
112361
+ "workload.start": {
112362
+ capName: "workload",
112363
+ capScope: "device",
112364
+ addonId: null,
112365
+ access: "create",
112366
+ role: "viewer"
112367
+ },
112368
+ "workload.stop": {
112369
+ capName: "workload",
112370
+ capScope: "device",
112371
+ addonId: null,
112372
+ access: "create",
112373
+ role: "viewer"
112374
+ },
110042
112375
  "zoneAnalytics.getCameraHistory": {
110043
112376
  capName: "zone-analytics",
110044
112377
  capScope: "device",
@@ -110117,7 +112450,7 @@ Object.freeze({
110117
112450
  role: "admin"
110118
112451
  }
110119
112452
  });
110120
- DeviceFeature.BatteryOperated;
112453
+ DeviceFeature.Sleeps;
110121
112454
  function bound(cap, methods = [], authority = "reported") {
110122
112455
  return {
110123
112456
  kind: "cap",
@@ -110129,11 +112462,11 @@ function bound(cap, methods = [], authority = "reported") {
110129
112462
  function derived(cap, methods = []) {
110130
112463
  return bound(cap, methods, "derived");
110131
112464
  }
110132
- DeviceFeature.BatteryOperated, DeviceFeature.Rebootable, derived("reboot", ["reboot"]), DeviceFeature.Resyncable, DeviceFeature.NativeSnapshot, DeviceFeature.DoorbellButton, derived("doorbell"), DeviceFeature.TwoWayAudio, derived("intercom", [
112465
+ DeviceFeature.BatteryOperated, DeviceFeature.Sleeps, derived("low-power-sleep", ["wakeUp"]), DeviceFeature.Rebootable, derived("reboot", ["reboot"]), DeviceFeature.Resyncable, derived("resync", ["resync"]), DeviceFeature.NativeSnapshot, DeviceFeature.DoorbellButton, derived("doorbell"), DeviceFeature.TwoWayAudio, derived("intercom", [
110133
112466
  "startTalkSession",
110134
112467
  "pushTalkAudio",
110135
112468
  "endTalkSession"
110136
- ]), DeviceFeature.PanTiltZoom, derived("ptz"), DeviceFeature.PtzAutotrack, derived("ptz-autotrack"), DeviceFeature.MotionTrigger, derived("motion-trigger", ["setMotionTrigger"]), DeviceFeature.TimedRun, derived("timed-run", ["runFor"]), DeviceFeature.Switch, DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired, DeviceFeature.ClimateDualSetpoint, DeviceFeature.ClimateHumidity, DeviceFeature.ClimateFanMode, DeviceFeature.ClimatePreset, DeviceFeature.ClimateSwingVertical, DeviceFeature.ClimateSwingHorizontal, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.CoverStoppable, DeviceFeature.ValvePositionable, DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.LockPinRequired, DeviceFeature.LockOpen, DeviceFeature.MediaPlayerSeek, DeviceFeature.MediaPlayerVolume, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerShuffle, DeviceFeature.MediaPlayerRepeat, DeviceFeature.MediaPlayerSelectSource, DeviceFeature.MediaPlayerPlayMedia, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerPower, DeviceFeature.AlarmPinRequired, DeviceFeature.PresenceGps, DeviceFeature.NotifierImage, DeviceFeature.NotifierPriority, DeviceFeature.NotifierData, DeviceFeature.NotifierActions, DeviceFeature.NotifierRecipients, DeviceFeature.ScriptVariables, DeviceFeature.AutomationSkipCondition, DeviceFeature.VacuumHasMap, DeviceFeature.VacuumHasAi, DeviceFeature.MowerHasMap, DeviceFeature.MowerHasTargetedMowing, DeviceFeature.Navigation, derived("navigation"), DeviceFeature.NetworkLink, derived("network-link");
112469
+ ]), DeviceFeature.PanTiltZoom, derived("ptz"), DeviceFeature.PtzAutotrack, derived("ptz-autotrack"), DeviceFeature.MotionTrigger, derived("motion-trigger", ["setMotionTrigger"]), DeviceFeature.TimedRun, derived("timed-run", ["runFor"]), DeviceFeature.Switch, DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired, DeviceFeature.ClimateDualSetpoint, DeviceFeature.ClimateHumidity, DeviceFeature.ClimateFanMode, DeviceFeature.ClimatePreset, DeviceFeature.ClimateSwingVertical, DeviceFeature.ClimateSwingHorizontal, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.CoverStoppable, DeviceFeature.ValvePositionable, DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.LockOpen, DeviceFeature.MediaPlayerSeek, DeviceFeature.MediaPlayerVolume, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerShuffle, DeviceFeature.MediaPlayerRepeat, DeviceFeature.MediaPlayerSelectSource, DeviceFeature.MediaPlayerPlayMedia, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerPower, DeviceFeature.PresenceGps, DeviceFeature.NotifierImage, DeviceFeature.NotifierPriority, DeviceFeature.NotifierData, DeviceFeature.NotifierActions, DeviceFeature.NotifierRecipients, DeviceFeature.ScriptVariables, DeviceFeature.AutomationSkipCondition, DeviceFeature.VacuumHasAi, DeviceFeature.MowerHasTargetedMowing, DeviceFeature.Navigation, derived("navigation"), DeviceFeature.NetworkLink, derived("network-link");
110137
112470
  var ALL_FEATURES = Object.values(DeviceFeature);
110138
112471
  new Set(ALL_FEATURES);
110139
112472
  DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
@@ -110175,8 +112508,8 @@ function offered(received) {
110175
112508
  };
110176
112509
  }
110177
112510
  offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
110178
- DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, 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.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
110179
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
112511
+ DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, 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.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
112512
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
110180
112513
  new Set(Object.values(DeviceType));
110181
112514
  new Set(Object.values(DeviceRole));
110182
112515
  var PowerSwitchRefusedError = class extends Error {
@@ -110472,11 +112805,6 @@ Object.freeze({
110472
112805
  form: "single",
110473
112806
  optional: false
110474
112807
  }],
110475
- "battery.wakeForStream": [{
110476
- name: "deviceId",
110477
- form: "single",
110478
- optional: false
110479
- }],
110480
112808
  "binary.getStatus": [{
110481
112809
  name: "deviceId",
110482
112810
  form: "single",
@@ -110807,6 +113135,11 @@ Object.freeze({
110807
113135
  form: "single",
110808
113136
  optional: false
110809
113137
  }],
113138
+ "deviceHistory.deleteSeriesRange": [{
113139
+ name: "deviceId",
113140
+ form: "single",
113141
+ optional: false
113142
+ }],
110810
113143
  "deviceHistory.getDeviceEnabled": [{
110811
113144
  name: "deviceId",
110812
113145
  form: "single",
@@ -111016,6 +113349,11 @@ Object.freeze({
111016
113349
  form: "single",
111017
113350
  optional: false
111018
113351
  }],
113352
+ "deviceManager.setIdentifiers": [{
113353
+ name: "deviceId",
113354
+ form: "single",
113355
+ optional: false
113356
+ }],
111019
113357
  "deviceManager.setIntegrationId": [{
111020
113358
  name: "deviceId",
111021
113359
  form: "single",
@@ -111650,6 +113988,16 @@ Object.freeze({
111650
113988
  form: "single",
111651
113989
  optional: true
111652
113990
  }],
113991
+ "lowPowerSleep.getStatus": [{
113992
+ name: "deviceId",
113993
+ form: "single",
113994
+ optional: false
113995
+ }],
113996
+ "lowPowerSleep.wakeUp": [{
113997
+ name: "deviceId",
113998
+ form: "single",
113999
+ optional: false
114000
+ }],
111653
114001
  "mediaPlayer.channelDown": [{
111654
114002
  name: "deviceId",
111655
114003
  form: "single",
@@ -112935,6 +115283,11 @@ Object.freeze({
112935
115283
  form: "single",
112936
115284
  optional: false
112937
115285
  }],
115286
+ "resync.resync": [{
115287
+ name: "deviceId",
115288
+ form: "single",
115289
+ optional: false
115290
+ }],
112938
115291
  "runningState.getStatus": [{
112939
115292
  name: "deviceId",
112940
115293
  form: "single",
@@ -113005,6 +115358,31 @@ Object.freeze({
113005
115358
  form: "single",
113006
115359
  optional: false
113007
115360
  }],
115361
+ "siren.getOptions": [{
115362
+ name: "deviceId",
115363
+ form: "single",
115364
+ optional: false
115365
+ }],
115366
+ "siren.getPlayChoices": [{
115367
+ name: "deviceId",
115368
+ form: "single",
115369
+ optional: false
115370
+ }],
115371
+ "siren.getStatus": [{
115372
+ name: "deviceId",
115373
+ form: "single",
115374
+ optional: false
115375
+ }],
115376
+ "siren.stop": [{
115377
+ name: "deviceId",
115378
+ form: "single",
115379
+ optional: false
115380
+ }],
115381
+ "siren.trigger": [{
115382
+ name: "deviceId",
115383
+ form: "single",
115384
+ optional: false
115385
+ }],
113008
115386
  "smoke.getStatus": [{
113009
115387
  name: "deviceId",
113010
115388
  form: "single",
@@ -113172,11 +115550,21 @@ Object.freeze({
113172
115550
  form: "single",
113173
115551
  optional: false
113174
115552
  }],
115553
+ "switch.getOptions": [{
115554
+ name: "deviceId",
115555
+ form: "single",
115556
+ optional: false
115557
+ }],
113175
115558
  "switch.getStatus": [{
113176
115559
  name: "deviceId",
113177
115560
  form: "single",
113178
115561
  optional: false
113179
115562
  }],
115563
+ "switch.powerCycle": [{
115564
+ name: "deviceId",
115565
+ form: "single",
115566
+ optional: false
115567
+ }],
113180
115568
  "switch.setState": [{
113181
115569
  name: "deviceId",
113182
115570
  form: "single",
@@ -113417,6 +115805,46 @@ Object.freeze({
113417
115805
  form: "single",
113418
115806
  optional: false
113419
115807
  }],
115808
+ "workload.forceStop": [{
115809
+ name: "deviceId",
115810
+ form: "single",
115811
+ optional: false
115812
+ }],
115813
+ "workload.getOptions": [{
115814
+ name: "deviceId",
115815
+ form: "single",
115816
+ optional: false
115817
+ }],
115818
+ "workload.getStatus": [{
115819
+ name: "deviceId",
115820
+ form: "single",
115821
+ optional: false
115822
+ }],
115823
+ "workload.pause": [{
115824
+ name: "deviceId",
115825
+ form: "single",
115826
+ optional: false
115827
+ }],
115828
+ "workload.restart": [{
115829
+ name: "deviceId",
115830
+ form: "single",
115831
+ optional: false
115832
+ }],
115833
+ "workload.resume": [{
115834
+ name: "deviceId",
115835
+ form: "single",
115836
+ optional: false
115837
+ }],
115838
+ "workload.start": [{
115839
+ name: "deviceId",
115840
+ form: "single",
115841
+ optional: false
115842
+ }],
115843
+ "workload.stop": [{
115844
+ name: "deviceId",
115845
+ form: "single",
115846
+ optional: false
115847
+ }],
113420
115848
  "zoneAnalytics.getCameraHistory": [{
113421
115849
  name: "deviceId",
113422
115850
  form: "single",
@@ -114633,6 +117061,8 @@ var TimelapseRuleInputSchema = object({
114633
117061
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
114634
117062
  priority: PriorityField.default(3),
114635
117063
  /** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
117064
+ /** Operator labels (D1054) — optional and NEVER defaulted: an absent key leaves the stored tags alone; `[]` clears them. Admin-only. */
117065
+ tags: TagsFieldSchema.optional(),
114636
117066
  targetOverrides: NcTargetOverridesSchema.optional()
114637
117067
  });
114638
117068
  object({
@@ -114651,6 +117081,8 @@ object({
114651
117081
  reportClasses: ReportClassesField.optional(),
114652
117082
  priority: PriorityField.optional(),
114653
117083
  /** Per-target settings keyed by target id (D1032) — absent = every target follows the rule. */
117084
+ /** Absent = keep the stored tags; `[]` clears them (D1054). Never defaulted. */
117085
+ tags: TagsFieldSchema.optional(),
114654
117086
  targetOverrides: NcTargetOverridesSchema.optional()
114655
117087
  });
114656
117088
  TimelapseRuleInputSchema.extend({
@@ -144633,6 +147065,7 @@ var HmContainerDevice = class HmContainerDevice extends BaseDevice {
144633
147065
  constructor(ctx) {
144634
147066
  const cfg = hmContainerSchema.parse(ctx.persistedConfig ?? {});
144635
147067
  super(ctx, hmContainerSchema, { type: DeviceType.Container });
147068
+ this.ctx.registerNativeCap(resyncCapability, resyncThroughAdoption(this.ctx.api.deviceManager, this.id));
144636
147069
  this.address = cfg.address;
144637
147070
  this.integrationId = cfg.integrationId;
144638
147071
  const hmDevice = this.resolveHmDevice();
@@ -145225,6 +147658,7 @@ var HomematicGatewayDevice = class extends BaseDevice {
145225
147658
  const patch = gatewayMetadataPatch({ host: session.getConnection().host });
145226
147659
  const key = JSON.stringify(patch);
145227
147660
  if (key === this.lastMetadataKey) return;
147661
+ await this.declareIdentifiers({ host: session.getConnection().host });
145228
147662
  const action = this.ctx.api.deviceManager?.setMetadata;
145229
147663
  if (action === void 0) return;
145230
147664
  try {