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