camstack 1.2.81 → 1.2.83

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.
@@ -26454,7 +26454,20 @@ var RecentTracksQueryInput = external_exports.object({
26454
26454
  projection: TrackProjectionSchema.optional(),
26455
26455
  /** Include stationary-promoted rows (parked objects). Default false: the
26456
26456
  * feed lists passages; parking records live on the stationary registry. */
26457
- includeStationary: external_exports.boolean().optional()
26457
+ includeStationary: external_exports.boolean().optional(),
26458
+ /**
26459
+ * Restrict to these track classes. ABSENT or EMPTY means no filter.
26460
+ *
26461
+ * The same filter `listTracks` takes, because the timeline's class chips must
26462
+ * mean the same thing whether the scope is one camera or twelve. Until this
26463
+ * existed the scoped feed downloaded a page and narrowed it on the phone
26464
+ * while the single-camera path narrowed the read — one filter, two costs.
26465
+ *
26466
+ * A SUPERSET prefilter on `classes[]`, like its single-camera twin: rows
26467
+ * whose class list is unreadable are kept, and the client's rule stays the
26468
+ * exact one.
26469
+ */
26470
+ classes: external_exports.array(external_exports.string()).optional()
26458
26471
  });
26459
26472
  var RecentTracksPageSchema = external_exports.object({
26460
26473
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
@@ -26765,7 +26778,21 @@ var pipelineAnalyticsCapability = {
26765
26778
  /** Include stationary-promoted rows (parked objects handed to the
26766
26779
  * stationary registry). Default false: the timeline lists passages,
26767
26780
  * not parking records (operator decision, 2026-08-15). */
26768
- includeStationary: external_exports.boolean().optional()
26781
+ includeStationary: external_exports.boolean().optional(),
26782
+ /**
26783
+ * Restrict to these track classes. ABSENT or EMPTY means no filter.
26784
+ *
26785
+ * Added 2026-09-03: the timeline's class chips filtered in the CLIENT,
26786
+ * on a day of rows already downloaded. The zone filter had been moved
26787
+ * here for exactly that reason — and it is also what lets the rows come
26788
+ * back `slim` — but the class filter was left behind, so a narrow
26789
+ * selection was still a wide read followed by a wide discard.
26790
+ *
26791
+ * Empty is "show all", not "nothing matches": a chip row with nothing
26792
+ * selected is an operator who has not narrowed anything, and an empty
26793
+ * timeline would read as a camera that saw nothing.
26794
+ */
26795
+ classes: external_exports.array(external_exports.string()).optional()
26769
26796
  }), external_exports.array(TrackSchema).readonly()),
26770
26797
  /**
26771
26798
  * Batched cluster-wide track listing — ONE call for the events page /
@@ -31716,8 +31743,22 @@ var automationControlCapability = {
31716
31743
  durability: "session"
31717
31744
  };
31718
31745
  var BatteryStatusSchema = external_exports.object({
31719
- /** 0..100 inclusive. Firmware-reported. */
31720
- percentage: external_exports.number().min(0).max(100),
31746
+ /**
31747
+ * 0..100 inclusive, firmware-reported. **`null` means NOT YET KNOWN** — the
31748
+ * provider has registered the capability but no reading has landed.
31749
+ *
31750
+ * It is nullable because it was not, and the only value a provider could
31751
+ * seed with was `0`. A battery camera behind an NVR therefore announced
31752
+ * itself at 0% on every start and corrected itself a moment later, which is
31753
+ * indistinguishable from a real flat battery: it fires the low-battery alert
31754
+ * every time the hub restarts. Unknown is not empty (D315), and on a battery
31755
+ * reading the difference is an alarm.
31756
+ *
31757
+ * `vacuum-control` and `lawn-mower-control` already model it this way.
31758
+ * Consumers must SKIP a null rather than coerce it — `battery-band` already
31759
+ * declines to band a non-finite reading, which is the correct shape.
31760
+ */
31761
+ percentage: external_exports.number().min(0).max(100).nullable(),
31721
31762
  /**
31722
31763
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
31723
31764
  * Reolink-specific for the Solar Panel 2 accessory (will become
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-U3YITXU5.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-FITGLHP4.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-FITGLHP4.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-F573GVRC.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-U3YITXU5.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-C7qWwrK1.js
23637
+ var require_dist_C7qWwrK1 = __commonJS({
23638
+ "../system/dist/dist-C7qWwrK1.js"(exports) {
23639
23639
  "use strict";
23640
23640
  var zod = require_zod();
23641
23641
  var EventCategory = /* @__PURE__ */ (function(EventCategory2) {
@@ -37159,7 +37159,20 @@ var require_dist_DkVaJ5vG = __commonJS({
37159
37159
  projection: TrackProjectionSchema.optional(),
37160
37160
  /** Include stationary-promoted rows (parked objects). Default false: the
37161
37161
  * feed lists passages; parking records live on the stationary registry. */
37162
- includeStationary: zod.z.boolean().optional()
37162
+ includeStationary: zod.z.boolean().optional(),
37163
+ /**
37164
+ * Restrict to these track classes. ABSENT or EMPTY means no filter.
37165
+ *
37166
+ * The same filter `listTracks` takes, because the timeline's class chips must
37167
+ * mean the same thing whether the scope is one camera or twelve. Until this
37168
+ * existed the scoped feed downloaded a page and narrowed it on the phone
37169
+ * while the single-camera path narrowed the read — one filter, two costs.
37170
+ *
37171
+ * A SUPERSET prefilter on `classes[]`, like its single-camera twin: rows
37172
+ * whose class list is unreadable are kept, and the client's rule stays the
37173
+ * exact one.
37174
+ */
37175
+ classes: zod.z.array(zod.z.string()).optional()
37163
37176
  });
37164
37177
  var RecentTracksPageSchema = zod.z.object({
37165
37178
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
@@ -37470,7 +37483,21 @@ var require_dist_DkVaJ5vG = __commonJS({
37470
37483
  /** Include stationary-promoted rows (parked objects handed to the
37471
37484
  * stationary registry). Default false: the timeline lists passages,
37472
37485
  * not parking records (operator decision, 2026-08-15). */
37473
- includeStationary: zod.z.boolean().optional()
37486
+ includeStationary: zod.z.boolean().optional(),
37487
+ /**
37488
+ * Restrict to these track classes. ABSENT or EMPTY means no filter.
37489
+ *
37490
+ * Added 2026-09-03: the timeline's class chips filtered in the CLIENT,
37491
+ * on a day of rows already downloaded. The zone filter had been moved
37492
+ * here for exactly that reason — and it is also what lets the rows come
37493
+ * back `slim` — but the class filter was left behind, so a narrow
37494
+ * selection was still a wide read followed by a wide discard.
37495
+ *
37496
+ * Empty is "show all", not "nothing matches": a chip row with nothing
37497
+ * selected is an operator who has not narrowed anything, and an empty
37498
+ * timeline would read as a camera that saw nothing.
37499
+ */
37500
+ classes: zod.z.array(zod.z.string()).optional()
37474
37501
  }), zod.z.array(TrackSchema).readonly()),
37475
37502
  /**
37476
37503
  * Batched cluster-wide track listing — ONE call for the events page /
@@ -42276,8 +42303,22 @@ var require_dist_DkVaJ5vG = __commonJS({
42276
42303
  durability: "session"
42277
42304
  };
42278
42305
  var BatteryStatusSchema = zod.z.object({
42279
- /** 0..100 inclusive. Firmware-reported. */
42280
- percentage: zod.z.number().min(0).max(100),
42306
+ /**
42307
+ * 0..100 inclusive, firmware-reported. **`null` means NOT YET KNOWN** — the
42308
+ * provider has registered the capability but no reading has landed.
42309
+ *
42310
+ * It is nullable because it was not, and the only value a provider could
42311
+ * seed with was `0`. A battery camera behind an NVR therefore announced
42312
+ * itself at 0% on every start and corrected itself a moment later, which is
42313
+ * indistinguishable from a real flat battery: it fires the low-battery alert
42314
+ * every time the hub restarts. Unknown is not empty (D315), and on a battery
42315
+ * reading the difference is an alarm.
42316
+ *
42317
+ * `vacuum-control` and `lawn-mower-control` already model it this way.
42318
+ * Consumers must SKIP a null rather than coerce it — `battery-band` already
42319
+ * declines to band a non-finite reading, which is the correct shape.
42320
+ */
42321
+ percentage: zod.z.number().min(0).max(100).nullable(),
42281
42322
  /**
42282
42323
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
42283
42324
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -50040,6 +50081,44 @@ var require_dist_DkVaJ5vG = __commonJS({
50040
50081
  "ffmpeg.threadCount": 0,
50041
50082
  "auth.tokenExpiry": "30d"
50042
50083
  };
50084
+ var CONTAINER_CHILD_PRIORITY = [
50085
+ "media-player",
50086
+ "alarm-panel",
50087
+ "thermostat",
50088
+ "climate",
50089
+ "humidifier",
50090
+ "water-heater",
50091
+ "lock",
50092
+ "cover",
50093
+ "valve",
50094
+ "fan",
50095
+ "vacuum",
50096
+ "lawn-mower",
50097
+ "light",
50098
+ "switch",
50099
+ "siren",
50100
+ "button",
50101
+ "control",
50102
+ "notifier",
50103
+ "script",
50104
+ "automation",
50105
+ "update",
50106
+ "presence",
50107
+ "weather",
50108
+ "image",
50109
+ "sensor"
50110
+ ];
50111
+ function rank(type) {
50112
+ const i = CONTAINER_CHILD_PRIORITY.indexOf(type);
50113
+ return i === -1 ? CONTAINER_CHILD_PRIORITY.length : i;
50114
+ }
50115
+ function resolveContainerPrimaryChild(children, overrideEntityId) {
50116
+ if (overrideEntityId !== void 0 && overrideEntityId !== null) {
50117
+ const picked = children.find((c) => c.stableId === overrideEntityId) ?? children.find((c) => c.entityId !== void 0 && c.entityId === overrideEntityId);
50118
+ if (picked !== void 0) return picked;
50119
+ }
50120
+ return [...children].toSorted((a, b) => rank(a.type) - rank(b.type))[0] ?? null;
50121
+ }
50043
50122
  var AccessoryKind = {
50044
50123
  Siren: DeviceRole.Siren,
50045
50124
  Floodlight: DeviceRole.Floodlight,
@@ -59661,6 +59740,12 @@ var require_dist_DkVaJ5vG = __commonJS({
59661
59740
  return resolveCapMount;
59662
59741
  }
59663
59742
  });
59743
+ Object.defineProperty(exports, "resolveContainerPrimaryChild", {
59744
+ enumerable: true,
59745
+ get: function() {
59746
+ return resolveContainerPrimaryChild;
59747
+ }
59748
+ });
59664
59749
  Object.defineProperty(exports, "resolveMethodAuth", {
59665
59750
  enumerable: true,
59666
59751
  get: function() {
@@ -59769,7 +59854,7 @@ var require_alerts_addon = __commonJS({
59769
59854
  [Symbol.toStringTag]: { value: "Module" }
59770
59855
  });
59771
59856
  require_chunk_Cek0wNdY();
59772
- var require_dist10 = require_dist_DkVaJ5vG();
59857
+ var require_dist10 = require_dist_C7qWwrK1();
59773
59858
  function selectExpired(alerts, cutoffMs) {
59774
59859
  return alerts.filter((a) => a.createdAt < cutoffMs).sort((a, b) => a.createdAt - b.createdAt).map((a) => a.id);
59775
59860
  }
@@ -60588,7 +60673,7 @@ var require_console_logging = __commonJS({
60588
60673
  [Symbol.toStringTag]: { value: "Module" }
60589
60674
  });
60590
60675
  require_chunk_Cek0wNdY();
60591
- var require_dist10 = require_dist_DkVaJ5vG();
60676
+ var require_dist10 = require_dist_C7qWwrK1();
60592
60677
  var require_formatter = require_formatter_DqAKDlvN();
60593
60678
  var LEVEL_RANK = {
60594
60679
  debug: 0,
@@ -60682,7 +60767,7 @@ var require_core_blocks_addon = __commonJS({
60682
60767
  "use strict";
60683
60768
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
60684
60769
  var require_chunk = require_chunk_Cek0wNdY();
60685
- var require_dist10 = require_dist_DkVaJ5vG();
60770
+ var require_dist10 = require_dist_C7qWwrK1();
60686
60771
  var node_crypto = __require("crypto");
60687
60772
  var node_fs_promises = __require("fs/promises");
60688
60773
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
@@ -61579,11 +61664,11 @@ var require_core_blocks = __commonJS({
61579
61664
  }
61580
61665
  });
61581
61666
 
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) {
61667
+ // ../system/dist/retired-settings-keys-3soU9pfP.js
61668
+ var require_retired_settings_keys_3soU9pfP = __commonJS({
61669
+ "../system/dist/retired-settings-keys-3soU9pfP.js"(exports) {
61585
61670
  "use strict";
61586
- var require_dist10 = require_dist_DkVaJ5vG();
61671
+ var require_dist10 = require_dist_C7qWwrK1();
61587
61672
  function settingsStoreIsAuthoritativeHere(env) {
61588
61673
  const raw = (env["CAMSTACK_ROLE"] ?? "").trim().toLowerCase();
61589
61674
  return raw === "" || raw === "hub";
@@ -63797,8 +63882,8 @@ var require_device_manager_addon = __commonJS({
63797
63882
  [Symbol.toStringTag]: { value: "Module" }
63798
63883
  });
63799
63884
  require_chunk_Cek0wNdY();
63800
- var require_dist10 = require_dist_DkVaJ5vG();
63801
- var require_retired_settings_keys = require_retired_settings_keys_B1ij_xtH();
63885
+ var require_dist10 = require_dist_C7qWwrK1();
63886
+ var require_retired_settings_keys = require_retired_settings_keys_3soU9pfP();
63802
63887
  var node_crypto = __require("crypto");
63803
63888
  var _camstack_types_node = require_node();
63804
63889
  var JOB_HISTORY = 20;
@@ -65438,8 +65523,12 @@ var require_device_manager_addon = __commonJS({
65438
65523
  }
65439
65524
  const nextVisited = new Set(visited);
65440
65525
  nextVisited.add(id);
65441
- const children = byParent.get(id) ?? [];
65442
- for (const child of children) expandContainer(child.id, byId, byParent, nextVisited, out);
65526
+ const primary = require_dist10.resolveContainerPrimaryChild((byParent.get(id) ?? []).map((c) => ({
65527
+ id: c.id,
65528
+ stableId: c.stableId,
65529
+ type: c.type
65530
+ })), byId.get(id)?.primaryChildEntityId);
65531
+ if (primary !== null) expandContainer(primary.id, byId, byParent, nextVisited, out);
65443
65532
  }
65444
65533
  function resolveLinkedDeviceIds(params) {
65445
65534
  const { selfId, selfLocation, config, candidates } = params;
@@ -68834,7 +68923,7 @@ var require_hub_forwarder = __commonJS({
68834
68923
  [Symbol.toStringTag]: { value: "Module" }
68835
68924
  });
68836
68925
  require_chunk_Cek0wNdY();
68837
- var require_dist10 = require_dist_DkVaJ5vG();
68926
+ var require_dist10 = require_dist_C7qWwrK1();
68838
68927
  var require_formatter = require_formatter_DqAKDlvN();
68839
68928
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
68840
68929
  var HubForwarderDestination = class {
@@ -68971,7 +69060,7 @@ var require_liveness_monitor_addon = __commonJS({
68971
69060
  "use strict";
68972
69061
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
68973
69062
  require_chunk_Cek0wNdY();
68974
- var require_dist10 = require_dist_DkVaJ5vG();
69063
+ var require_dist10 = require_dist_C7qWwrK1();
68975
69064
  var NO_DEVICES = "liveness:no-devices";
68976
69065
  var ALL_OFFLINE = "liveness:all-devices-offline";
68977
69066
  var NO_FOOTAGE_PREFIX = "liveness:no-footage:";
@@ -69161,7 +69250,7 @@ var require_local_auth_addon = __commonJS({
69161
69250
  [Symbol.toStringTag]: { value: "Module" }
69162
69251
  });
69163
69252
  var require_chunk = require_chunk_Cek0wNdY();
69164
- var require_dist10 = require_dist_DkVaJ5vG();
69253
+ var require_dist10 = require_dist_C7qWwrK1();
69165
69254
  var node_crypto = __require("crypto");
69166
69255
  node_crypto = require_chunk.__toESM(node_crypto);
69167
69256
  var crypto$1 = __require("crypto");
@@ -76974,7 +77063,7 @@ var require_loki_logging = __commonJS({
76974
77063
  [Symbol.toStringTag]: { value: "Module" }
76975
77064
  });
76976
77065
  require_chunk_Cek0wNdY();
76977
- var require_dist10 = require_dist_DkVaJ5vG();
77066
+ var require_dist10 = require_dist_C7qWwrK1();
76978
77067
  function sanitizeLabelName(raw) {
76979
77068
  const replaced = raw.replaceAll(/[^a-zA-Z0-9_]/g, "_");
76980
77069
  return /^[a-zA-Z_]/.test(replaced) ? replaced : `_${replaced}`;
@@ -77539,7 +77628,7 @@ var require_native_metrics_addon = __commonJS({
77539
77628
  [Symbol.toStringTag]: { value: "Module" }
77540
77629
  });
77541
77630
  var require_chunk = require_chunk_Cek0wNdY();
77542
- var require_dist10 = require_dist_DkVaJ5vG();
77631
+ var require_dist10 = require_dist_C7qWwrK1();
77543
77632
  var node_fs_promises = __require("fs/promises");
77544
77633
  var node_child_process = __require("child_process");
77545
77634
  var node_util = __require("util");
@@ -80123,7 +80212,7 @@ var require_filesystem_storage_addon = __commonJS({
80123
80212
  [Symbol.toStringTag]: { value: "Module" }
80124
80213
  });
80125
80214
  var require_chunk = require_chunk_Cek0wNdY();
80126
- var require_dist10 = require_dist_DkVaJ5vG();
80215
+ var require_dist10 = require_dist_C7qWwrK1();
80127
80216
  var node_crypto = __require("crypto");
80128
80217
  var node_fs_promises = __require("fs/promises");
80129
80218
  var node_path = __require("path");
@@ -81239,8 +81328,8 @@ var require_sqlite_settings_addon = __commonJS({
81239
81328
  [Symbol.toStringTag]: { value: "Module" }
81240
81329
  });
81241
81330
  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();
81331
+ var require_dist10 = require_dist_C7qWwrK1();
81332
+ var require_retired_settings_keys = require_retired_settings_keys_3soU9pfP();
81244
81333
  var node_crypto = __require("crypto");
81245
81334
  var node_fs = __require("fs");
81246
81335
  var node_module = __require("module");
@@ -81633,6 +81722,14 @@ var require_sqlite_settings_addon = __commonJS({
81633
81722
  clauses.push(`${expr} IN (${values.map(() => "?").join(", ")})`);
81634
81723
  for (const v of values) params.push(serialize2(v));
81635
81724
  }
81725
+ for (const [field, values] of Object.entries(filter?.whereJsonArrayAny ?? {})) {
81726
+ const expr = resolve(field);
81727
+ if (expr === null) continue;
81728
+ if (values.length === 0) continue;
81729
+ const placeholders = values.map(() => "?").join(", ");
81730
+ clauses.push(`(${expr} IS NULL OR NOT json_valid(${expr}) OR EXISTS (SELECT 1 FROM json_each(${expr}) WHERE value IN (${placeholders})))`);
81731
+ for (const v of values) params.push(serialize2(v));
81732
+ }
81636
81733
  for (const [field, [low, high]] of Object.entries(filter?.whereBetween ?? {})) {
81637
81734
  const expr = resolve(field);
81638
81735
  if (expr === null) continue;
@@ -83722,7 +83819,7 @@ var require_storage_orchestrator_addon = __commonJS({
83722
83819
  [Symbol.toStringTag]: { value: "Module" }
83723
83820
  });
83724
83821
  var require_chunk = require_chunk_Cek0wNdY();
83725
- var require_dist10 = require_dist_DkVaJ5vG();
83822
+ var require_dist10 = require_dist_C7qWwrK1();
83726
83823
  var require_hub_cap_forward = require_hub_cap_forward_DmHNjbB0();
83727
83824
  var zod = require_zod();
83728
83825
  var node_crypto = __require("crypto");
@@ -86673,7 +86770,7 @@ var require_system_config_addon = __commonJS({
86673
86770
  [Symbol.toStringTag]: { value: "Module" }
86674
86771
  });
86675
86772
  require_chunk_Cek0wNdY();
86676
- var require_dist10 = require_dist_DkVaJ5vG();
86773
+ var require_dist10 = require_dist_C7qWwrK1();
86677
86774
  var SECTION_TITLES = {
86678
86775
  server: "Server",
86679
86776
  auth: "Authentication"
@@ -104734,7 +104831,7 @@ var require_winston_logging = __commonJS({
104734
104831
  [Symbol.toStringTag]: { value: "Module" }
104735
104832
  });
104736
104833
  var require_chunk = require_chunk_Cek0wNdY();
104737
- var require_dist10 = require_dist_DkVaJ5vG();
104834
+ var require_dist10 = require_dist_C7qWwrK1();
104738
104835
  var require_formatter = require_formatter_DqAKDlvN();
104739
104836
  var node_path = __require("path");
104740
104837
  node_path = require_chunk.__toESM(node_path);
@@ -117234,12 +117331,12 @@ var require_dist2 = __commonJS({
117234
117331
  }
117235
117332
  });
117236
117333
 
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) {
117334
+ // ../system/dist/manifest-system-deps-PAIfmNun.js
117335
+ var require_manifest_system_deps_PAIfmNun = __commonJS({
117336
+ "../system/dist/manifest-system-deps-PAIfmNun.js"(exports) {
117240
117337
  "use strict";
117241
117338
  var require_chunk = require_chunk_Cek0wNdY();
117242
- require_dist_DkVaJ5vG();
117339
+ require_dist_C7qWwrK1();
117243
117340
  require_hub_cap_forward_DmHNjbB0();
117244
117341
  var node_crypto = __require("crypto");
117245
117342
  node_crypto = require_chunk.__toESM(node_crypto);
@@ -129306,7 +129403,7 @@ var require_dist3 = __commonJS({
129306
129403
  "use strict";
129307
129404
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
129308
129405
  var require_chunk = require_chunk_Cek0wNdY();
129309
- var require_dist10 = require_dist_DkVaJ5vG();
129406
+ var require_dist10 = require_dist_C7qWwrK1();
129310
129407
  var require_builtins_alerts_alerts_addon = require_alerts_addon();
129311
129408
  require_alerts();
129312
129409
  var require_formatter = require_formatter_DqAKDlvN();
@@ -129333,7 +129430,7 @@ var require_dist3 = __commonJS({
129333
129430
  var require_builtins_winston_logging_index = require_winston_logging();
129334
129431
  var require_file_data_plane = require_file_data_plane_DO8KbxCe();
129335
129432
  var require_tls$1 = require_tls_BxQlomxd();
129336
- var require_manifest_system_deps = require_manifest_system_deps_BbB94ozU();
129433
+ var require_manifest_system_deps = require_manifest_system_deps_PAIfmNun();
129337
129434
  var require_resource_monitor = require_resource_monitor_CdnzxBLP();
129338
129435
  var require_custom_action_registry = require_custom_action_registry_jY0NOZK8();
129339
129436
  var zod = require_zod();
@@ -210762,11 +210859,11 @@ var require_dist4 = __commonJS({
210762
210859
  px: streamPixels(s.metadata ?? {})
210763
210860
  })).toSorted((a, b) => b.px - a.px);
210764
210861
  const result = Array.from({ length: streams.length });
210765
- for (let rank = 0; rank < sorted.length; rank++) {
210766
- const { s, i } = sorted[rank];
210862
+ for (let rank2 = 0; rank2 < sorted.length; rank2++) {
210863
+ const { s, i } = sorted[rank2];
210767
210864
  let quality;
210768
- if (rank === 0) quality = "high";
210769
- else if (rank === sorted.length - 1) quality = "low";
210865
+ if (rank2 === 0) quality = "high";
210866
+ else if (rank2 === sorted.length - 1) quality = "low";
210770
210867
  else quality = "mid";
210771
210868
  result[i] = {
210772
210869
  ...s,
@@ -224195,7 +224292,20 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
224195
224292
  projection: TrackProjectionSchema.optional(),
224196
224293
  /** Include stationary-promoted rows (parked objects). Default false: the
224197
224294
  * feed lists passages; parking records live on the stationary registry. */
224198
- includeStationary: zod.z.boolean().optional()
224295
+ includeStationary: zod.z.boolean().optional(),
224296
+ /**
224297
+ * Restrict to these track classes. ABSENT or EMPTY means no filter.
224298
+ *
224299
+ * The same filter `listTracks` takes, because the timeline's class chips must
224300
+ * mean the same thing whether the scope is one camera or twelve. Until this
224301
+ * existed the scoped feed downloaded a page and narrowed it on the phone
224302
+ * while the single-camera path narrowed the read — one filter, two costs.
224303
+ *
224304
+ * A SUPERSET prefilter on `classes[]`, like its single-camera twin: rows
224305
+ * whose class list is unreadable are kept, and the client's rule stays the
224306
+ * exact one.
224307
+ */
224308
+ classes: zod.z.array(zod.z.string()).optional()
224199
224309
  });
224200
224310
  var RecentTracksPageSchema = zod.z.object({
224201
224311
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
@@ -224507,7 +224617,21 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
224507
224617
  /** Include stationary-promoted rows (parked objects handed to the
224508
224618
  * stationary registry). Default false: the timeline lists passages,
224509
224619
  * not parking records (operator decision, 2026-08-15). */
224510
- includeStationary: zod.z.boolean().optional()
224620
+ includeStationary: zod.z.boolean().optional(),
224621
+ /**
224622
+ * Restrict to these track classes. ABSENT or EMPTY means no filter.
224623
+ *
224624
+ * Added 2026-09-03: the timeline's class chips filtered in the CLIENT,
224625
+ * on a day of rows already downloaded. The zone filter had been moved
224626
+ * here for exactly that reason — and it is also what lets the rows come
224627
+ * back `slim` — but the class filter was left behind, so a narrow
224628
+ * selection was still a wide read followed by a wide discard.
224629
+ *
224630
+ * Empty is "show all", not "nothing matches": a chip row with nothing
224631
+ * selected is an operator who has not narrowed anything, and an empty
224632
+ * timeline would read as a camera that saw nothing.
224633
+ */
224634
+ classes: zod.z.array(zod.z.string()).optional()
224511
224635
  }), zod.z.array(TrackSchema).readonly()),
224512
224636
  /**
224513
224637
  * Batched cluster-wide track listing — ONE call for the events page /
@@ -229479,8 +229603,22 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
229479
229603
  durability: "session"
229480
229604
  };
229481
229605
  var BatteryStatusSchema = zod.z.object({
229482
- /** 0..100 inclusive. Firmware-reported. */
229483
- percentage: zod.z.number().min(0).max(100),
229606
+ /**
229607
+ * 0..100 inclusive, firmware-reported. **`null` means NOT YET KNOWN** — the
229608
+ * provider has registered the capability but no reading has landed.
229609
+ *
229610
+ * It is nullable because it was not, and the only value a provider could
229611
+ * seed with was `0`. A battery camera behind an NVR therefore announced
229612
+ * itself at 0% on every start and corrected itself a moment later, which is
229613
+ * indistinguishable from a real flat battery: it fires the low-battery alert
229614
+ * every time the hub restarts. Unknown is not empty (D315), and on a battery
229615
+ * reading the difference is an alarm.
229616
+ *
229617
+ * `vacuum-control` and `lawn-mower-control` already model it this way.
229618
+ * Consumers must SKIP a null rather than coerce it — `battery-band` already
229619
+ * declines to band a non-finite reading, which is the correct shape.
229620
+ */
229621
+ percentage: zod.z.number().min(0).max(100).nullable(),
229484
229622
  /**
229485
229623
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
229486
229624
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -237339,6 +237477,44 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
237339
237477
  "ffmpeg.threadCount": 0,
237340
237478
  "auth.tokenExpiry": "30d"
237341
237479
  };
237480
+ var CONTAINER_CHILD_PRIORITY = [
237481
+ "media-player",
237482
+ "alarm-panel",
237483
+ "thermostat",
237484
+ "climate",
237485
+ "humidifier",
237486
+ "water-heater",
237487
+ "lock",
237488
+ "cover",
237489
+ "valve",
237490
+ "fan",
237491
+ "vacuum",
237492
+ "lawn-mower",
237493
+ "light",
237494
+ "switch",
237495
+ "siren",
237496
+ "button",
237497
+ "control",
237498
+ "notifier",
237499
+ "script",
237500
+ "automation",
237501
+ "update",
237502
+ "presence",
237503
+ "weather",
237504
+ "image",
237505
+ "sensor"
237506
+ ];
237507
+ function rank(type) {
237508
+ const i = CONTAINER_CHILD_PRIORITY.indexOf(type);
237509
+ return i === -1 ? CONTAINER_CHILD_PRIORITY.length : i;
237510
+ }
237511
+ function resolveContainerPrimaryChild(children, overrideEntityId) {
237512
+ if (overrideEntityId !== void 0 && overrideEntityId !== null) {
237513
+ const picked = children.find((c) => c.stableId === overrideEntityId) ?? children.find((c) => c.entityId !== void 0 && c.entityId === overrideEntityId);
237514
+ if (picked !== void 0) return picked;
237515
+ }
237516
+ return [...children].toSorted((a, b) => rank(a.type) - rank(b.type))[0] ?? null;
237517
+ }
237342
237518
  var AccessoryKind = {
237343
237519
  Siren: require_sleep.DeviceRole.Siren,
237344
237520
  Floodlight: require_sleep.DeviceRole.Floodlight,
@@ -252716,6 +252892,7 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
252716
252892
  exports.COCO_80_LABELS = COCO_80_LABELS;
252717
252893
  exports.COCO_TO_MACRO = COCO_TO_MACRO;
252718
252894
  exports.CONNECTION_TEST_TIMEOUT_MS = CONNECTION_TEST_TIMEOUT_MS;
252895
+ exports.CONTAINER_CHILD_PRIORITY = CONTAINER_CHILD_PRIORITY;
252719
252896
  exports.CORE_BLOCKS_ADDON_ID = CORE_BLOCKS_ADDON_ID;
252720
252897
  exports.CORE_BLOCK_ADDON_PREFIX = CORE_BLOCK_ADDON_PREFIX;
252721
252898
  exports.CamProfileSchema = require_sleep.CamProfileSchema;
@@ -253954,6 +254131,7 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
253954
254131
  exports.resolveBucketMs = resolveBucketMs;
253955
254132
  exports.resolveCapMount = require_sleep.resolveCapMount;
253956
254133
  exports.resolveClusterStepModelId = resolveClusterStepModelId;
254134
+ exports.resolveContainerPrimaryChild = resolveContainerPrimaryChild;
253957
254135
  exports.resolveDetectionRuntime = resolveDetectionRuntime;
253958
254136
  exports.resolveDeviceControlKind = resolveDeviceControlKind;
253959
254137
  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.83",
4
4
  "description": "CLI tool for managing and running CamStack server",
5
5
  "keywords": [
6
6
  "camstack",