camstack 1.2.81 → 1.2.82

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.
@@ -26765,7 +26765,21 @@ var pipelineAnalyticsCapability = {
26765
26765
  /** Include stationary-promoted rows (parked objects handed to the
26766
26766
  * stationary registry). Default false: the timeline lists passages,
26767
26767
  * not parking records (operator decision, 2026-08-15). */
26768
- includeStationary: external_exports.boolean().optional()
26768
+ includeStationary: external_exports.boolean().optional(),
26769
+ /**
26770
+ * Restrict to these track classes. ABSENT or EMPTY means no filter.
26771
+ *
26772
+ * Added 2026-09-03: the timeline's class chips filtered in the CLIENT,
26773
+ * on a day of rows already downloaded. The zone filter had been moved
26774
+ * here for exactly that reason — and it is also what lets the rows come
26775
+ * back `slim` — but the class filter was left behind, so a narrow
26776
+ * selection was still a wide read followed by a wide discard.
26777
+ *
26778
+ * Empty is "show all", not "nothing matches": a chip row with nothing
26779
+ * selected is an operator who has not narrowed anything, and an empty
26780
+ * timeline would read as a camera that saw nothing.
26781
+ */
26782
+ classes: external_exports.array(external_exports.string()).optional()
26769
26783
  }), external_exports.array(TrackSchema).readonly()),
26770
26784
  /**
26771
26785
  * Batched cluster-wide track listing — ONE call for the events page /
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runDiscover
4
- } from "./chunk-QSGSW74H.js";
4
+ } from "./chunk-GLXEXFJW.js";
5
5
  import "./chunk-LMMQX4CK.js";
6
6
 
7
7
  // src/cli.ts
@@ -38,7 +38,7 @@ async function runServe(args) {
38
38
  ...typeof values.data === "string" ? { data: values.data } : {}
39
39
  };
40
40
  Object.assign(process.env, buildServeEnv(opts));
41
- await import("./launcher-RKRQJIVN.js");
41
+ await import("./launcher-DD66RRLG.js");
42
42
  }
43
43
 
44
44
  // src/commands/agent.ts
@@ -83,7 +83,7 @@ async function runAgent(args) {
83
83
  ...typeof values.port === "string" ? { port: values.port } : {}
84
84
  };
85
85
  Object.assign(process.env, buildAgentEnv(opts));
86
- await import("./launcher-RKRQJIVN.js");
86
+ await import("./launcher-DD66RRLG.js");
87
87
  }
88
88
 
89
89
  // src/commands/setup.ts
@@ -1130,7 +1130,7 @@ function isUnknown(_value) {
1130
1130
  return true;
1131
1131
  }
1132
1132
  async function resolveServerInteractive(presetNamespace) {
1133
- const { discoverNodes, resolveHubFromDiscovered, filterHubNodes, DEFAULT_HUB_HTTPS_PORT } = await import("./discover-JG76SRMM.js");
1133
+ const { discoverNodes, resolveHubFromDiscovered, filterHubNodes, DEFAULT_HUB_HTTPS_PORT } = await import("./discover-JZRN6RUI.js");
1134
1134
  if (presetNamespace) {
1135
1135
  const spinner4 = clack.spinner();
1136
1136
  spinner4.start(`Discovering hub on LAN (namespace "${presetNamespace}")`);
@@ -5,7 +5,7 @@ import {
5
5
  filterHubNodes,
6
6
  resolveHubFromDiscovered,
7
7
  runDiscover
8
- } from "./chunk-QSGSW74H.js";
8
+ } from "./chunk-GLXEXFJW.js";
9
9
  import "./chunk-LMMQX4CK.js";
10
10
  export {
11
11
  DEFAULT_HUB_HTTPS_PORT,
@@ -23633,9 +23633,9 @@ var require_zod = __commonJS({
23633
23633
  }
23634
23634
  });
23635
23635
 
23636
- // ../system/dist/dist-DkVaJ5vG.js
23637
- var require_dist_DkVaJ5vG = __commonJS({
23638
- "../system/dist/dist-DkVaJ5vG.js"(exports) {
23636
+ // ../system/dist/dist-C0IXtI_E.js
23637
+ var require_dist_C0IXtI_E = __commonJS({
23638
+ "../system/dist/dist-C0IXtI_E.js"(exports) {
23639
23639
  "use strict";
23640
23640
  var zod = require_zod();
23641
23641
  var EventCategory = /* @__PURE__ */ (function(EventCategory2) {
@@ -37470,7 +37470,21 @@ var require_dist_DkVaJ5vG = __commonJS({
37470
37470
  /** Include stationary-promoted rows (parked objects handed to the
37471
37471
  * stationary registry). Default false: the timeline lists passages,
37472
37472
  * not parking records (operator decision, 2026-08-15). */
37473
- includeStationary: zod.z.boolean().optional()
37473
+ includeStationary: zod.z.boolean().optional(),
37474
+ /**
37475
+ * Restrict to these track classes. ABSENT or EMPTY means no filter.
37476
+ *
37477
+ * Added 2026-09-03: the timeline's class chips filtered in the CLIENT,
37478
+ * on a day of rows already downloaded. The zone filter had been moved
37479
+ * here for exactly that reason — and it is also what lets the rows come
37480
+ * back `slim` — but the class filter was left behind, so a narrow
37481
+ * selection was still a wide read followed by a wide discard.
37482
+ *
37483
+ * Empty is "show all", not "nothing matches": a chip row with nothing
37484
+ * selected is an operator who has not narrowed anything, and an empty
37485
+ * timeline would read as a camera that saw nothing.
37486
+ */
37487
+ classes: zod.z.array(zod.z.string()).optional()
37474
37488
  }), zod.z.array(TrackSchema).readonly()),
37475
37489
  /**
37476
37490
  * Batched cluster-wide track listing — ONE call for the events page /
@@ -50040,6 +50054,44 @@ var require_dist_DkVaJ5vG = __commonJS({
50040
50054
  "ffmpeg.threadCount": 0,
50041
50055
  "auth.tokenExpiry": "30d"
50042
50056
  };
50057
+ var CONTAINER_CHILD_PRIORITY = [
50058
+ "media-player",
50059
+ "alarm-panel",
50060
+ "thermostat",
50061
+ "climate",
50062
+ "humidifier",
50063
+ "water-heater",
50064
+ "lock",
50065
+ "cover",
50066
+ "valve",
50067
+ "fan",
50068
+ "vacuum",
50069
+ "lawn-mower",
50070
+ "light",
50071
+ "switch",
50072
+ "siren",
50073
+ "button",
50074
+ "control",
50075
+ "notifier",
50076
+ "script",
50077
+ "automation",
50078
+ "update",
50079
+ "presence",
50080
+ "weather",
50081
+ "image",
50082
+ "sensor"
50083
+ ];
50084
+ function rank(type) {
50085
+ const i = CONTAINER_CHILD_PRIORITY.indexOf(type);
50086
+ return i === -1 ? CONTAINER_CHILD_PRIORITY.length : i;
50087
+ }
50088
+ function resolveContainerPrimaryChild(children, overrideEntityId) {
50089
+ if (overrideEntityId !== void 0 && overrideEntityId !== null) {
50090
+ const picked = children.find((c) => c.entityId === overrideEntityId);
50091
+ if (picked !== void 0) return picked;
50092
+ }
50093
+ return [...children].toSorted((a, b) => rank(a.type) - rank(b.type))[0] ?? null;
50094
+ }
50043
50095
  var AccessoryKind = {
50044
50096
  Siren: DeviceRole.Siren,
50045
50097
  Floodlight: DeviceRole.Floodlight,
@@ -59661,6 +59713,12 @@ var require_dist_DkVaJ5vG = __commonJS({
59661
59713
  return resolveCapMount;
59662
59714
  }
59663
59715
  });
59716
+ Object.defineProperty(exports, "resolveContainerPrimaryChild", {
59717
+ enumerable: true,
59718
+ get: function() {
59719
+ return resolveContainerPrimaryChild;
59720
+ }
59721
+ });
59664
59722
  Object.defineProperty(exports, "resolveMethodAuth", {
59665
59723
  enumerable: true,
59666
59724
  get: function() {
@@ -59769,7 +59827,7 @@ var require_alerts_addon = __commonJS({
59769
59827
  [Symbol.toStringTag]: { value: "Module" }
59770
59828
  });
59771
59829
  require_chunk_Cek0wNdY();
59772
- var require_dist10 = require_dist_DkVaJ5vG();
59830
+ var require_dist10 = require_dist_C0IXtI_E();
59773
59831
  function selectExpired(alerts, cutoffMs) {
59774
59832
  return alerts.filter((a) => a.createdAt < cutoffMs).sort((a, b) => a.createdAt - b.createdAt).map((a) => a.id);
59775
59833
  }
@@ -60588,7 +60646,7 @@ var require_console_logging = __commonJS({
60588
60646
  [Symbol.toStringTag]: { value: "Module" }
60589
60647
  });
60590
60648
  require_chunk_Cek0wNdY();
60591
- var require_dist10 = require_dist_DkVaJ5vG();
60649
+ var require_dist10 = require_dist_C0IXtI_E();
60592
60650
  var require_formatter = require_formatter_DqAKDlvN();
60593
60651
  var LEVEL_RANK = {
60594
60652
  debug: 0,
@@ -60682,7 +60740,7 @@ var require_core_blocks_addon = __commonJS({
60682
60740
  "use strict";
60683
60741
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
60684
60742
  var require_chunk = require_chunk_Cek0wNdY();
60685
- var require_dist10 = require_dist_DkVaJ5vG();
60743
+ var require_dist10 = require_dist_C0IXtI_E();
60686
60744
  var node_crypto = __require("crypto");
60687
60745
  var node_fs_promises = __require("fs/promises");
60688
60746
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
@@ -61579,11 +61637,11 @@ var require_core_blocks = __commonJS({
61579
61637
  }
61580
61638
  });
61581
61639
 
61582
- // ../system/dist/retired-settings-keys-B1ij-xtH.js
61583
- var require_retired_settings_keys_B1ij_xtH = __commonJS({
61584
- "../system/dist/retired-settings-keys-B1ij-xtH.js"(exports) {
61640
+ // ../system/dist/retired-settings-keys-eLv_RCfp.js
61641
+ var require_retired_settings_keys_eLv_RCfp = __commonJS({
61642
+ "../system/dist/retired-settings-keys-eLv_RCfp.js"(exports) {
61585
61643
  "use strict";
61586
- var require_dist10 = require_dist_DkVaJ5vG();
61644
+ var require_dist10 = require_dist_C0IXtI_E();
61587
61645
  function settingsStoreIsAuthoritativeHere(env) {
61588
61646
  const raw = (env["CAMSTACK_ROLE"] ?? "").trim().toLowerCase();
61589
61647
  return raw === "" || raw === "hub";
@@ -63797,8 +63855,8 @@ var require_device_manager_addon = __commonJS({
63797
63855
  [Symbol.toStringTag]: { value: "Module" }
63798
63856
  });
63799
63857
  require_chunk_Cek0wNdY();
63800
- var require_dist10 = require_dist_DkVaJ5vG();
63801
- var require_retired_settings_keys = require_retired_settings_keys_B1ij_xtH();
63858
+ var require_dist10 = require_dist_C0IXtI_E();
63859
+ var require_retired_settings_keys = require_retired_settings_keys_eLv_RCfp();
63802
63860
  var node_crypto = __require("crypto");
63803
63861
  var _camstack_types_node = require_node();
63804
63862
  var JOB_HISTORY = 20;
@@ -65438,8 +65496,12 @@ var require_device_manager_addon = __commonJS({
65438
65496
  }
65439
65497
  const nextVisited = new Set(visited);
65440
65498
  nextVisited.add(id);
65441
- const children = byParent.get(id) ?? [];
65442
- for (const child of children) expandContainer(child.id, byId, byParent, nextVisited, out);
65499
+ const primary = require_dist10.resolveContainerPrimaryChild((byParent.get(id) ?? []).map((c) => ({
65500
+ id: c.id,
65501
+ entityId: String(c.id),
65502
+ type: c.type
65503
+ })), void 0);
65504
+ if (primary !== null) expandContainer(primary.id, byId, byParent, nextVisited, out);
65443
65505
  }
65444
65506
  function resolveLinkedDeviceIds(params) {
65445
65507
  const { selfId, selfLocation, config, candidates } = params;
@@ -68834,7 +68896,7 @@ var require_hub_forwarder = __commonJS({
68834
68896
  [Symbol.toStringTag]: { value: "Module" }
68835
68897
  });
68836
68898
  require_chunk_Cek0wNdY();
68837
- var require_dist10 = require_dist_DkVaJ5vG();
68899
+ var require_dist10 = require_dist_C0IXtI_E();
68838
68900
  var require_formatter = require_formatter_DqAKDlvN();
68839
68901
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
68840
68902
  var HubForwarderDestination = class {
@@ -68971,7 +69033,7 @@ var require_liveness_monitor_addon = __commonJS({
68971
69033
  "use strict";
68972
69034
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
68973
69035
  require_chunk_Cek0wNdY();
68974
- var require_dist10 = require_dist_DkVaJ5vG();
69036
+ var require_dist10 = require_dist_C0IXtI_E();
68975
69037
  var NO_DEVICES = "liveness:no-devices";
68976
69038
  var ALL_OFFLINE = "liveness:all-devices-offline";
68977
69039
  var NO_FOOTAGE_PREFIX = "liveness:no-footage:";
@@ -69161,7 +69223,7 @@ var require_local_auth_addon = __commonJS({
69161
69223
  [Symbol.toStringTag]: { value: "Module" }
69162
69224
  });
69163
69225
  var require_chunk = require_chunk_Cek0wNdY();
69164
- var require_dist10 = require_dist_DkVaJ5vG();
69226
+ var require_dist10 = require_dist_C0IXtI_E();
69165
69227
  var node_crypto = __require("crypto");
69166
69228
  node_crypto = require_chunk.__toESM(node_crypto);
69167
69229
  var crypto$1 = __require("crypto");
@@ -76974,7 +77036,7 @@ var require_loki_logging = __commonJS({
76974
77036
  [Symbol.toStringTag]: { value: "Module" }
76975
77037
  });
76976
77038
  require_chunk_Cek0wNdY();
76977
- var require_dist10 = require_dist_DkVaJ5vG();
77039
+ var require_dist10 = require_dist_C0IXtI_E();
76978
77040
  function sanitizeLabelName(raw) {
76979
77041
  const replaced = raw.replaceAll(/[^a-zA-Z0-9_]/g, "_");
76980
77042
  return /^[a-zA-Z_]/.test(replaced) ? replaced : `_${replaced}`;
@@ -77539,7 +77601,7 @@ var require_native_metrics_addon = __commonJS({
77539
77601
  [Symbol.toStringTag]: { value: "Module" }
77540
77602
  });
77541
77603
  var require_chunk = require_chunk_Cek0wNdY();
77542
- var require_dist10 = require_dist_DkVaJ5vG();
77604
+ var require_dist10 = require_dist_C0IXtI_E();
77543
77605
  var node_fs_promises = __require("fs/promises");
77544
77606
  var node_child_process = __require("child_process");
77545
77607
  var node_util = __require("util");
@@ -80123,7 +80185,7 @@ var require_filesystem_storage_addon = __commonJS({
80123
80185
  [Symbol.toStringTag]: { value: "Module" }
80124
80186
  });
80125
80187
  var require_chunk = require_chunk_Cek0wNdY();
80126
- var require_dist10 = require_dist_DkVaJ5vG();
80188
+ var require_dist10 = require_dist_C0IXtI_E();
80127
80189
  var node_crypto = __require("crypto");
80128
80190
  var node_fs_promises = __require("fs/promises");
80129
80191
  var node_path = __require("path");
@@ -81239,8 +81301,8 @@ var require_sqlite_settings_addon = __commonJS({
81239
81301
  [Symbol.toStringTag]: { value: "Module" }
81240
81302
  });
81241
81303
  var require_chunk = require_chunk_Cek0wNdY();
81242
- var require_dist10 = require_dist_DkVaJ5vG();
81243
- var require_retired_settings_keys = require_retired_settings_keys_B1ij_xtH();
81304
+ var require_dist10 = require_dist_C0IXtI_E();
81305
+ var require_retired_settings_keys = require_retired_settings_keys_eLv_RCfp();
81244
81306
  var node_crypto = __require("crypto");
81245
81307
  var node_fs = __require("fs");
81246
81308
  var node_module = __require("module");
@@ -81633,6 +81695,14 @@ var require_sqlite_settings_addon = __commonJS({
81633
81695
  clauses.push(`${expr} IN (${values.map(() => "?").join(", ")})`);
81634
81696
  for (const v of values) params.push(serialize2(v));
81635
81697
  }
81698
+ for (const [field, values] of Object.entries(filter?.whereJsonArrayAny ?? {})) {
81699
+ const expr = resolve(field);
81700
+ if (expr === null) continue;
81701
+ if (values.length === 0) continue;
81702
+ const placeholders = values.map(() => "?").join(", ");
81703
+ clauses.push(`(${expr} IS NULL OR NOT json_valid(${expr}) OR EXISTS (SELECT 1 FROM json_each(${expr}) WHERE value IN (${placeholders})))`);
81704
+ for (const v of values) params.push(serialize2(v));
81705
+ }
81636
81706
  for (const [field, [low, high]] of Object.entries(filter?.whereBetween ?? {})) {
81637
81707
  const expr = resolve(field);
81638
81708
  if (expr === null) continue;
@@ -83722,7 +83792,7 @@ var require_storage_orchestrator_addon = __commonJS({
83722
83792
  [Symbol.toStringTag]: { value: "Module" }
83723
83793
  });
83724
83794
  var require_chunk = require_chunk_Cek0wNdY();
83725
- var require_dist10 = require_dist_DkVaJ5vG();
83795
+ var require_dist10 = require_dist_C0IXtI_E();
83726
83796
  var require_hub_cap_forward = require_hub_cap_forward_DmHNjbB0();
83727
83797
  var zod = require_zod();
83728
83798
  var node_crypto = __require("crypto");
@@ -86673,7 +86743,7 @@ var require_system_config_addon = __commonJS({
86673
86743
  [Symbol.toStringTag]: { value: "Module" }
86674
86744
  });
86675
86745
  require_chunk_Cek0wNdY();
86676
- var require_dist10 = require_dist_DkVaJ5vG();
86746
+ var require_dist10 = require_dist_C0IXtI_E();
86677
86747
  var SECTION_TITLES = {
86678
86748
  server: "Server",
86679
86749
  auth: "Authentication"
@@ -104734,7 +104804,7 @@ var require_winston_logging = __commonJS({
104734
104804
  [Symbol.toStringTag]: { value: "Module" }
104735
104805
  });
104736
104806
  var require_chunk = require_chunk_Cek0wNdY();
104737
- var require_dist10 = require_dist_DkVaJ5vG();
104807
+ var require_dist10 = require_dist_C0IXtI_E();
104738
104808
  var require_formatter = require_formatter_DqAKDlvN();
104739
104809
  var node_path = __require("path");
104740
104810
  node_path = require_chunk.__toESM(node_path);
@@ -117234,12 +117304,12 @@ var require_dist2 = __commonJS({
117234
117304
  }
117235
117305
  });
117236
117306
 
117237
- // ../system/dist/manifest-system-deps-BbB94ozU.js
117238
- var require_manifest_system_deps_BbB94ozU = __commonJS({
117239
- "../system/dist/manifest-system-deps-BbB94ozU.js"(exports) {
117307
+ // ../system/dist/manifest-system-deps-D6ncx0jA.js
117308
+ var require_manifest_system_deps_D6ncx0jA = __commonJS({
117309
+ "../system/dist/manifest-system-deps-D6ncx0jA.js"(exports) {
117240
117310
  "use strict";
117241
117311
  var require_chunk = require_chunk_Cek0wNdY();
117242
- require_dist_DkVaJ5vG();
117312
+ require_dist_C0IXtI_E();
117243
117313
  require_hub_cap_forward_DmHNjbB0();
117244
117314
  var node_crypto = __require("crypto");
117245
117315
  node_crypto = require_chunk.__toESM(node_crypto);
@@ -129306,7 +129376,7 @@ var require_dist3 = __commonJS({
129306
129376
  "use strict";
129307
129377
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
129308
129378
  var require_chunk = require_chunk_Cek0wNdY();
129309
- var require_dist10 = require_dist_DkVaJ5vG();
129379
+ var require_dist10 = require_dist_C0IXtI_E();
129310
129380
  var require_builtins_alerts_alerts_addon = require_alerts_addon();
129311
129381
  require_alerts();
129312
129382
  var require_formatter = require_formatter_DqAKDlvN();
@@ -129333,7 +129403,7 @@ var require_dist3 = __commonJS({
129333
129403
  var require_builtins_winston_logging_index = require_winston_logging();
129334
129404
  var require_file_data_plane = require_file_data_plane_DO8KbxCe();
129335
129405
  var require_tls$1 = require_tls_BxQlomxd();
129336
- var require_manifest_system_deps = require_manifest_system_deps_BbB94ozU();
129406
+ var require_manifest_system_deps = require_manifest_system_deps_D6ncx0jA();
129337
129407
  var require_resource_monitor = require_resource_monitor_CdnzxBLP();
129338
129408
  var require_custom_action_registry = require_custom_action_registry_jY0NOZK8();
129339
129409
  var zod = require_zod();
@@ -210762,11 +210832,11 @@ var require_dist4 = __commonJS({
210762
210832
  px: streamPixels(s.metadata ?? {})
210763
210833
  })).toSorted((a, b) => b.px - a.px);
210764
210834
  const result = Array.from({ length: streams.length });
210765
- for (let rank = 0; rank < sorted.length; rank++) {
210766
- const { s, i } = sorted[rank];
210835
+ for (let rank2 = 0; rank2 < sorted.length; rank2++) {
210836
+ const { s, i } = sorted[rank2];
210767
210837
  let quality;
210768
- if (rank === 0) quality = "high";
210769
- else if (rank === sorted.length - 1) quality = "low";
210838
+ if (rank2 === 0) quality = "high";
210839
+ else if (rank2 === sorted.length - 1) quality = "low";
210770
210840
  else quality = "mid";
210771
210841
  result[i] = {
210772
210842
  ...s,
@@ -224507,7 +224577,21 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
224507
224577
  /** Include stationary-promoted rows (parked objects handed to the
224508
224578
  * stationary registry). Default false: the timeline lists passages,
224509
224579
  * not parking records (operator decision, 2026-08-15). */
224510
- includeStationary: zod.z.boolean().optional()
224580
+ includeStationary: zod.z.boolean().optional(),
224581
+ /**
224582
+ * Restrict to these track classes. ABSENT or EMPTY means no filter.
224583
+ *
224584
+ * Added 2026-09-03: the timeline's class chips filtered in the CLIENT,
224585
+ * on a day of rows already downloaded. The zone filter had been moved
224586
+ * here for exactly that reason — and it is also what lets the rows come
224587
+ * back `slim` — but the class filter was left behind, so a narrow
224588
+ * selection was still a wide read followed by a wide discard.
224589
+ *
224590
+ * Empty is "show all", not "nothing matches": a chip row with nothing
224591
+ * selected is an operator who has not narrowed anything, and an empty
224592
+ * timeline would read as a camera that saw nothing.
224593
+ */
224594
+ classes: zod.z.array(zod.z.string()).optional()
224511
224595
  }), zod.z.array(TrackSchema).readonly()),
224512
224596
  /**
224513
224597
  * Batched cluster-wide track listing — ONE call for the events page /
@@ -237339,6 +237423,44 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
237339
237423
  "ffmpeg.threadCount": 0,
237340
237424
  "auth.tokenExpiry": "30d"
237341
237425
  };
237426
+ var CONTAINER_CHILD_PRIORITY = [
237427
+ "media-player",
237428
+ "alarm-panel",
237429
+ "thermostat",
237430
+ "climate",
237431
+ "humidifier",
237432
+ "water-heater",
237433
+ "lock",
237434
+ "cover",
237435
+ "valve",
237436
+ "fan",
237437
+ "vacuum",
237438
+ "lawn-mower",
237439
+ "light",
237440
+ "switch",
237441
+ "siren",
237442
+ "button",
237443
+ "control",
237444
+ "notifier",
237445
+ "script",
237446
+ "automation",
237447
+ "update",
237448
+ "presence",
237449
+ "weather",
237450
+ "image",
237451
+ "sensor"
237452
+ ];
237453
+ function rank(type) {
237454
+ const i = CONTAINER_CHILD_PRIORITY.indexOf(type);
237455
+ return i === -1 ? CONTAINER_CHILD_PRIORITY.length : i;
237456
+ }
237457
+ function resolveContainerPrimaryChild(children, overrideEntityId) {
237458
+ if (overrideEntityId !== void 0 && overrideEntityId !== null) {
237459
+ const picked = children.find((c) => c.entityId === overrideEntityId);
237460
+ if (picked !== void 0) return picked;
237461
+ }
237462
+ return [...children].toSorted((a, b) => rank(a.type) - rank(b.type))[0] ?? null;
237463
+ }
237342
237464
  var AccessoryKind = {
237343
237465
  Siren: require_sleep.DeviceRole.Siren,
237344
237466
  Floodlight: require_sleep.DeviceRole.Floodlight,
@@ -252716,6 +252838,7 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
252716
252838
  exports.COCO_80_LABELS = COCO_80_LABELS;
252717
252839
  exports.COCO_TO_MACRO = COCO_TO_MACRO;
252718
252840
  exports.CONNECTION_TEST_TIMEOUT_MS = CONNECTION_TEST_TIMEOUT_MS;
252841
+ exports.CONTAINER_CHILD_PRIORITY = CONTAINER_CHILD_PRIORITY;
252719
252842
  exports.CORE_BLOCKS_ADDON_ID = CORE_BLOCKS_ADDON_ID;
252720
252843
  exports.CORE_BLOCK_ADDON_PREFIX = CORE_BLOCK_ADDON_PREFIX;
252721
252844
  exports.CamProfileSchema = require_sleep.CamProfileSchema;
@@ -253954,6 +254077,7 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
253954
254077
  exports.resolveBucketMs = resolveBucketMs;
253955
254078
  exports.resolveCapMount = require_sleep.resolveCapMount;
253956
254079
  exports.resolveClusterStepModelId = resolveClusterStepModelId;
254080
+ exports.resolveContainerPrimaryChild = resolveContainerPrimaryChild;
253957
254081
  exports.resolveDetectionRuntime = resolveDetectionRuntime;
253958
254082
  exports.resolveDeviceControlKind = resolveDeviceControlKind;
253959
254083
  exports.resolveDeviceProfile = resolveDeviceProfile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstack",
3
- "version": "1.2.81",
3
+ "version": "1.2.82",
4
4
  "description": "CLI tool for managing and running CamStack server",
5
5
  "keywords": [
6
6
  "camstack",