camstack 1.2.80 → 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.
@@ -22458,18 +22458,6 @@ var ContainerMemoryPointSchema = external_exports.object({
22458
22458
  */
22459
22459
  gpuShmemBytes: external_exports.number().nullable()
22460
22460
  }).extend({ atMs: external_exports.number() });
22461
- var DumpHeapSnapshotInputSchema = external_exports.object({
22462
- /** The addon whose runner should dump a heap snapshot. */
22463
- addonId: external_exports.string()
22464
- });
22465
- var DumpHeapSnapshotResultSchema = external_exports.object({
22466
- success: external_exports.boolean(),
22467
- /** Path of the written .heapsnapshot inside the runner's container/host. */
22468
- path: external_exports.string().optional(),
22469
- /** Process pid that was signalled. */
22470
- pid: external_exports.number().optional(),
22471
- reason: external_exports.string().optional()
22472
- });
22473
22461
  var LoadPointSchema = external_exports.object({
22474
22462
  /** Bucket START, or the snapshot's own timestamp when unreduced. */
22475
22463
  atMs: external_exports.number(),
@@ -22643,19 +22631,7 @@ var metricsProviderCapability = {
22643
22631
  * agent's ring alone (`durable: false`). Empty is a legitimate answer: a
22644
22632
  * node nobody has heard from has no series, and saying so is the truth.
22645
22633
  */
22646
- getLoadSeries: method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema),
22647
- /**
22648
- * Tell the addon's forked runner to write a V8 heap snapshot to disk (via
22649
- * SIGUSR2 — the runner's diagnostic handler). Also logs its
22650
- * `process.memoryUsage()` + heap-space breakdown. Resolves the pid from
22651
- * `$process.list`, so it can only reach a runner this node spawned. Use
22652
- * for deep per-addon memory attribution; copy the returned path off the
22653
- * node to analyze.
22654
- */
22655
- dumpHeapSnapshot: method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
22656
- kind: "mutation",
22657
- auth: "admin"
22658
- })
22634
+ getLoadSeries: method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema)
22659
22635
  }
22660
22636
  };
22661
22637
  var ModelConvertInputSchema = external_exports.object({
@@ -26301,7 +26277,8 @@ var MediaFileKindEnum = external_exports.enum([
26301
26277
  "plateCrop",
26302
26278
  "keyFrame",
26303
26279
  "keyFrameSmall",
26304
- "thumbnailSmall"
26280
+ "thumbnailSmall",
26281
+ "sceneFrame"
26305
26282
  ]);
26306
26283
  var MediaFileRefSchema = external_exports.object({
26307
26284
  key: external_exports.string(),
@@ -26788,7 +26765,21 @@ var pipelineAnalyticsCapability = {
26788
26765
  /** Include stationary-promoted rows (parked objects handed to the
26789
26766
  * stationary registry). Default false: the timeline lists passages,
26790
26767
  * not parking records (operator decision, 2026-08-15). */
26791
- 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()
26792
26783
  }), external_exports.array(TrackSchema).readonly()),
26793
26784
  /**
26794
26785
  * Batched cluster-wide track listing — ONE call for the events page /
@@ -41802,12 +41793,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
41802
41793
  addonId: null,
41803
41794
  access: "view"
41804
41795
  },
41805
- "metricsProvider.dumpHeapSnapshot": {
41806
- capName: "metrics-provider",
41807
- capScope: "system",
41808
- addonId: null,
41809
- access: "create"
41810
- },
41811
41796
  "metricsProvider.getAddonStats": {
41812
41797
  capName: "metrics-provider",
41813
41798
  capScope: "system",
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runDiscover
4
- } from "./chunk-LET3IUN4.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-LORD77DB.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-LORD77DB.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-FLS35SXF.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-LET3IUN4.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-KItAWyKG.js
23637
- var require_dist_KItAWyKG = __commonJS({
23638
- "../system/dist/dist-KItAWyKG.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) {
@@ -33168,18 +33168,6 @@ var require_dist_KItAWyKG = __commonJS({
33168
33168
  */
33169
33169
  gpuShmemBytes: zod.z.number().nullable()
33170
33170
  }).extend({ atMs: zod.z.number() });
33171
- var DumpHeapSnapshotInputSchema = zod.z.object({
33172
- /** The addon whose runner should dump a heap snapshot. */
33173
- addonId: zod.z.string()
33174
- });
33175
- var DumpHeapSnapshotResultSchema = zod.z.object({
33176
- success: zod.z.boolean(),
33177
- /** Path of the written .heapsnapshot inside the runner's container/host. */
33178
- path: zod.z.string().optional(),
33179
- /** Process pid that was signalled. */
33180
- pid: zod.z.number().optional(),
33181
- reason: zod.z.string().optional()
33182
- });
33183
33171
  var LoadPointSchema = zod.z.object({
33184
33172
  /** Bucket START, or the snapshot's own timestamp when unreduced. */
33185
33173
  atMs: zod.z.number(),
@@ -33353,19 +33341,7 @@ var require_dist_KItAWyKG = __commonJS({
33353
33341
  * agent's ring alone (`durable: false`). Empty is a legitimate answer: a
33354
33342
  * node nobody has heard from has no series, and saying so is the truth.
33355
33343
  */
33356
- getLoadSeries: method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema),
33357
- /**
33358
- * Tell the addon's forked runner to write a V8 heap snapshot to disk (via
33359
- * SIGUSR2 — the runner's diagnostic handler). Also logs its
33360
- * `process.memoryUsage()` + heap-space breakdown. Resolves the pid from
33361
- * `$process.list`, so it can only reach a runner this node spawned. Use
33362
- * for deep per-addon memory attribution; copy the returned path off the
33363
- * node to analyze.
33364
- */
33365
- dumpHeapSnapshot: method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
33366
- kind: "mutation",
33367
- auth: "admin"
33368
- })
33344
+ getLoadSeries: method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema)
33369
33345
  }
33370
33346
  };
33371
33347
  var modelConvertCapability = {
@@ -37007,7 +36983,8 @@ var require_dist_KItAWyKG = __commonJS({
37007
36983
  "plateCrop",
37008
36984
  "keyFrame",
37009
36985
  "keyFrameSmall",
37010
- "thumbnailSmall"
36986
+ "thumbnailSmall",
36987
+ "sceneFrame"
37011
36988
  ]);
37012
36989
  var MediaFileSchema = zod.z.object({
37013
36990
  key: zod.z.string(),
@@ -37493,7 +37470,21 @@ var require_dist_KItAWyKG = __commonJS({
37493
37470
  /** Include stationary-promoted rows (parked objects handed to the
37494
37471
  * stationary registry). Default false: the timeline lists passages,
37495
37472
  * not parking records (operator decision, 2026-08-15). */
37496
- 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()
37497
37488
  }), zod.z.array(TrackSchema).readonly()),
37498
37489
  /**
37499
37490
  * Batched cluster-wide track listing — ONE call for the events page /
@@ -50063,6 +50054,44 @@ var require_dist_KItAWyKG = __commonJS({
50063
50054
  "ffmpeg.threadCount": 0,
50064
50055
  "auth.tokenExpiry": "30d"
50065
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
+ }
50066
50095
  var AccessoryKind = {
50067
50096
  Siren: DeviceRole.Siren,
50068
50097
  Floodlight: DeviceRole.Floodlight,
@@ -53128,12 +53157,6 @@ var require_dist_KItAWyKG = __commonJS({
53128
53157
  addonId: null,
53129
53158
  access: "view"
53130
53159
  },
53131
- "metricsProvider.dumpHeapSnapshot": {
53132
- capName: "metrics-provider",
53133
- capScope: "system",
53134
- addonId: null,
53135
- access: "create"
53136
- },
53137
53160
  "metricsProvider.getAddonStats": {
53138
53161
  capName: "metrics-provider",
53139
53162
  capScope: "system",
@@ -59690,6 +59713,12 @@ var require_dist_KItAWyKG = __commonJS({
59690
59713
  return resolveCapMount;
59691
59714
  }
59692
59715
  });
59716
+ Object.defineProperty(exports, "resolveContainerPrimaryChild", {
59717
+ enumerable: true,
59718
+ get: function() {
59719
+ return resolveContainerPrimaryChild;
59720
+ }
59721
+ });
59693
59722
  Object.defineProperty(exports, "resolveMethodAuth", {
59694
59723
  enumerable: true,
59695
59724
  get: function() {
@@ -59798,7 +59827,7 @@ var require_alerts_addon = __commonJS({
59798
59827
  [Symbol.toStringTag]: { value: "Module" }
59799
59828
  });
59800
59829
  require_chunk_Cek0wNdY();
59801
- var require_dist10 = require_dist_KItAWyKG();
59830
+ var require_dist10 = require_dist_C0IXtI_E();
59802
59831
  function selectExpired(alerts, cutoffMs) {
59803
59832
  return alerts.filter((a) => a.createdAt < cutoffMs).sort((a, b) => a.createdAt - b.createdAt).map((a) => a.id);
59804
59833
  }
@@ -60617,7 +60646,7 @@ var require_console_logging = __commonJS({
60617
60646
  [Symbol.toStringTag]: { value: "Module" }
60618
60647
  });
60619
60648
  require_chunk_Cek0wNdY();
60620
- var require_dist10 = require_dist_KItAWyKG();
60649
+ var require_dist10 = require_dist_C0IXtI_E();
60621
60650
  var require_formatter = require_formatter_DqAKDlvN();
60622
60651
  var LEVEL_RANK = {
60623
60652
  debug: 0,
@@ -60711,7 +60740,7 @@ var require_core_blocks_addon = __commonJS({
60711
60740
  "use strict";
60712
60741
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
60713
60742
  var require_chunk = require_chunk_Cek0wNdY();
60714
- var require_dist10 = require_dist_KItAWyKG();
60743
+ var require_dist10 = require_dist_C0IXtI_E();
60715
60744
  var node_crypto = __require("crypto");
60716
60745
  var node_fs_promises = __require("fs/promises");
60717
60746
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
@@ -61608,11 +61637,11 @@ var require_core_blocks = __commonJS({
61608
61637
  }
61609
61638
  });
61610
61639
 
61611
- // ../system/dist/retired-settings-keys-DfNTZPhu.js
61612
- var require_retired_settings_keys_DfNTZPhu = __commonJS({
61613
- "../system/dist/retired-settings-keys-DfNTZPhu.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) {
61614
61643
  "use strict";
61615
- var require_dist10 = require_dist_KItAWyKG();
61644
+ var require_dist10 = require_dist_C0IXtI_E();
61616
61645
  function settingsStoreIsAuthoritativeHere(env) {
61617
61646
  const raw = (env["CAMSTACK_ROLE"] ?? "").trim().toLowerCase();
61618
61647
  return raw === "" || raw === "hub";
@@ -63826,8 +63855,8 @@ var require_device_manager_addon = __commonJS({
63826
63855
  [Symbol.toStringTag]: { value: "Module" }
63827
63856
  });
63828
63857
  require_chunk_Cek0wNdY();
63829
- var require_dist10 = require_dist_KItAWyKG();
63830
- var require_retired_settings_keys = require_retired_settings_keys_DfNTZPhu();
63858
+ var require_dist10 = require_dist_C0IXtI_E();
63859
+ var require_retired_settings_keys = require_retired_settings_keys_eLv_RCfp();
63831
63860
  var node_crypto = __require("crypto");
63832
63861
  var _camstack_types_node = require_node();
63833
63862
  var JOB_HISTORY = 20;
@@ -65467,8 +65496,12 @@ var require_device_manager_addon = __commonJS({
65467
65496
  }
65468
65497
  const nextVisited = new Set(visited);
65469
65498
  nextVisited.add(id);
65470
- const children = byParent.get(id) ?? [];
65471
- 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);
65472
65505
  }
65473
65506
  function resolveLinkedDeviceIds(params) {
65474
65507
  const { selfId, selfLocation, config, candidates } = params;
@@ -68863,7 +68896,7 @@ var require_hub_forwarder = __commonJS({
68863
68896
  [Symbol.toStringTag]: { value: "Module" }
68864
68897
  });
68865
68898
  require_chunk_Cek0wNdY();
68866
- var require_dist10 = require_dist_KItAWyKG();
68899
+ var require_dist10 = require_dist_C0IXtI_E();
68867
68900
  var require_formatter = require_formatter_DqAKDlvN();
68868
68901
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
68869
68902
  var HubForwarderDestination = class {
@@ -69000,7 +69033,7 @@ var require_liveness_monitor_addon = __commonJS({
69000
69033
  "use strict";
69001
69034
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
69002
69035
  require_chunk_Cek0wNdY();
69003
- var require_dist10 = require_dist_KItAWyKG();
69036
+ var require_dist10 = require_dist_C0IXtI_E();
69004
69037
  var NO_DEVICES = "liveness:no-devices";
69005
69038
  var ALL_OFFLINE = "liveness:all-devices-offline";
69006
69039
  var NO_FOOTAGE_PREFIX = "liveness:no-footage:";
@@ -69190,7 +69223,7 @@ var require_local_auth_addon = __commonJS({
69190
69223
  [Symbol.toStringTag]: { value: "Module" }
69191
69224
  });
69192
69225
  var require_chunk = require_chunk_Cek0wNdY();
69193
- var require_dist10 = require_dist_KItAWyKG();
69226
+ var require_dist10 = require_dist_C0IXtI_E();
69194
69227
  var node_crypto = __require("crypto");
69195
69228
  node_crypto = require_chunk.__toESM(node_crypto);
69196
69229
  var crypto$1 = __require("crypto");
@@ -77003,7 +77036,7 @@ var require_loki_logging = __commonJS({
77003
77036
  [Symbol.toStringTag]: { value: "Module" }
77004
77037
  });
77005
77038
  require_chunk_Cek0wNdY();
77006
- var require_dist10 = require_dist_KItAWyKG();
77039
+ var require_dist10 = require_dist_C0IXtI_E();
77007
77040
  function sanitizeLabelName(raw) {
77008
77041
  const replaced = raw.replaceAll(/[^a-zA-Z0-9_]/g, "_");
77009
77042
  return /^[a-zA-Z_]/.test(replaced) ? replaced : `_${replaced}`;
@@ -77568,7 +77601,7 @@ var require_native_metrics_addon = __commonJS({
77568
77601
  [Symbol.toStringTag]: { value: "Module" }
77569
77602
  });
77570
77603
  var require_chunk = require_chunk_Cek0wNdY();
77571
- var require_dist10 = require_dist_KItAWyKG();
77604
+ var require_dist10 = require_dist_C0IXtI_E();
77572
77605
  var node_fs_promises = __require("fs/promises");
77573
77606
  var node_child_process = __require("child_process");
77574
77607
  var node_util = __require("util");
@@ -79677,8 +79710,7 @@ var require_native_metrics_addon = __commonJS({
79677
79710
  listAddonInstances: () => this.listAddonInstances(),
79678
79711
  getAddonStats: (params) => this.getAddonStats(params.addonId),
79679
79712
  listNodeProcesses: () => this.listNodeProcesses(),
79680
- getLoadSeries: (params) => this.readLoadSeries(params),
79681
- dumpHeapSnapshot: (params) => this.dumpHeapSnapshot(params)
79713
+ getLoadSeries: (params) => this.readLoadSeries(params)
79682
79714
  };
79683
79715
  this.applyLoadSeriesConfig();
79684
79716
  if (this.isHub) {
@@ -80012,43 +80044,6 @@ var require_native_metrics_addon = __commonJS({
80012
80044
  * and signals it; the runner writes `/tmp/heap-<sanitized nodeId>.heapsnapshot`
80013
80045
  * and logs its memoryUsage + heap-space breakdown. '$hub' targets this process.
80014
80046
  */
80015
- async dumpHeapSnapshot(input) {
80016
- const sanitize = (nodeId2) => nodeId2.replace(/[^\w.-]/g, "_");
80017
- let pid;
80018
- let nodeId;
80019
- if (input.addonId === "$hub") {
80020
- pid = process.pid;
80021
- nodeId = this.ctx.kernel.cluster?.broker?.nodeID ?? "$hub";
80022
- } else {
80023
- const target = (await this.listWorkerInstances()).find((w) => w.addonId === input.addonId);
80024
- if (!target) return {
80025
- success: false,
80026
- reason: `no runner process for addon '${input.addonId}'`
80027
- };
80028
- pid = target.pid;
80029
- nodeId = target.nodeId;
80030
- }
80031
- const path = `/tmp/heap-${sanitize(nodeId)}.heapsnapshot`;
80032
- try {
80033
- process.kill(pid, "SIGUSR2");
80034
- this.ctx.logger.info("Requested heap snapshot from runner", { meta: {
80035
- addonId: input.addonId,
80036
- pid,
80037
- path
80038
- } });
80039
- return {
80040
- success: true,
80041
- pid,
80042
- path
80043
- };
80044
- } catch (err) {
80045
- return {
80046
- success: false,
80047
- reason: err instanceof Error ? err.message : String(err),
80048
- pid
80049
- };
80050
- }
80051
- }
80052
80047
  /** Raw `ps` scan returning every pid + command + resource stats. */
80053
80048
  async runPs() {
80054
80049
  try {
@@ -80190,7 +80185,7 @@ var require_filesystem_storage_addon = __commonJS({
80190
80185
  [Symbol.toStringTag]: { value: "Module" }
80191
80186
  });
80192
80187
  var require_chunk = require_chunk_Cek0wNdY();
80193
- var require_dist10 = require_dist_KItAWyKG();
80188
+ var require_dist10 = require_dist_C0IXtI_E();
80194
80189
  var node_crypto = __require("crypto");
80195
80190
  var node_fs_promises = __require("fs/promises");
80196
80191
  var node_path = __require("path");
@@ -81306,8 +81301,8 @@ var require_sqlite_settings_addon = __commonJS({
81306
81301
  [Symbol.toStringTag]: { value: "Module" }
81307
81302
  });
81308
81303
  var require_chunk = require_chunk_Cek0wNdY();
81309
- var require_dist10 = require_dist_KItAWyKG();
81310
- var require_retired_settings_keys = require_retired_settings_keys_DfNTZPhu();
81304
+ var require_dist10 = require_dist_C0IXtI_E();
81305
+ var require_retired_settings_keys = require_retired_settings_keys_eLv_RCfp();
81311
81306
  var node_crypto = __require("crypto");
81312
81307
  var node_fs = __require("fs");
81313
81308
  var node_module = __require("module");
@@ -81700,6 +81695,14 @@ var require_sqlite_settings_addon = __commonJS({
81700
81695
  clauses.push(`${expr} IN (${values.map(() => "?").join(", ")})`);
81701
81696
  for (const v of values) params.push(serialize2(v));
81702
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
+ }
81703
81706
  for (const [field, [low, high]] of Object.entries(filter?.whereBetween ?? {})) {
81704
81707
  const expr = resolve(field);
81705
81708
  if (expr === null) continue;
@@ -83789,7 +83792,7 @@ var require_storage_orchestrator_addon = __commonJS({
83789
83792
  [Symbol.toStringTag]: { value: "Module" }
83790
83793
  });
83791
83794
  var require_chunk = require_chunk_Cek0wNdY();
83792
- var require_dist10 = require_dist_KItAWyKG();
83795
+ var require_dist10 = require_dist_C0IXtI_E();
83793
83796
  var require_hub_cap_forward = require_hub_cap_forward_DmHNjbB0();
83794
83797
  var zod = require_zod();
83795
83798
  var node_crypto = __require("crypto");
@@ -86740,7 +86743,7 @@ var require_system_config_addon = __commonJS({
86740
86743
  [Symbol.toStringTag]: { value: "Module" }
86741
86744
  });
86742
86745
  require_chunk_Cek0wNdY();
86743
- var require_dist10 = require_dist_KItAWyKG();
86746
+ var require_dist10 = require_dist_C0IXtI_E();
86744
86747
  var SECTION_TITLES = {
86745
86748
  server: "Server",
86746
86749
  auth: "Authentication"
@@ -104801,7 +104804,7 @@ var require_winston_logging = __commonJS({
104801
104804
  [Symbol.toStringTag]: { value: "Module" }
104802
104805
  });
104803
104806
  var require_chunk = require_chunk_Cek0wNdY();
104804
- var require_dist10 = require_dist_KItAWyKG();
104807
+ var require_dist10 = require_dist_C0IXtI_E();
104805
104808
  var require_formatter = require_formatter_DqAKDlvN();
104806
104809
  var node_path = __require("path");
104807
104810
  node_path = require_chunk.__toESM(node_path);
@@ -117301,12 +117304,12 @@ var require_dist2 = __commonJS({
117301
117304
  }
117302
117305
  });
117303
117306
 
117304
- // ../system/dist/manifest-system-deps-DU0BvqV-.js
117305
- var require_manifest_system_deps_DU0BvqV = __commonJS({
117306
- "../system/dist/manifest-system-deps-DU0BvqV-.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) {
117307
117310
  "use strict";
117308
117311
  var require_chunk = require_chunk_Cek0wNdY();
117309
- require_dist_KItAWyKG();
117312
+ require_dist_C0IXtI_E();
117310
117313
  require_hub_cap_forward_DmHNjbB0();
117311
117314
  var node_crypto = __require("crypto");
117312
117315
  node_crypto = require_chunk.__toESM(node_crypto);
@@ -117591,16 +117594,9 @@ var require_manifest_system_deps_DU0BvqV = __commonJS({
117591
117594
  if (selected.length === 0) return "";
117592
117595
  return ` ${selected.map((s) => `${heapSpaceField(s.name)}=${mb(s.usedBytes)}MB`).join(" ")}`;
117593
117596
  }
117594
- var RUNNER_HEAP_SNAPSHOT_ENV = "CAMSTACK_RUNNER_HEAP_SNAPSHOT";
117595
- function heapSnapshotAuthorised(env = process.env) {
117596
- return env[RUNNER_HEAP_SNAPSHOT_ENV] === "on";
117597
- }
117598
117597
  var defaultDeps = {
117599
117598
  readMemory: () => process.memoryUsage(),
117600
117599
  readSpaces: readHeapSpaces,
117601
- writeSnapshot: (path) => {
117602
- node_v8.writeHeapSnapshot(path);
117603
- },
117604
117600
  env: process.env
117605
117601
  };
117606
117602
  function emitHeapDiagnosticReport(request, deps = defaultDeps) {
@@ -117611,16 +117607,6 @@ var require_manifest_system_deps_DU0BvqV = __commonJS({
117611
117607
  } catch (error) {
117612
117608
  request.sink.warn(`[mem] node="${request.label}" space report failed: ${error instanceof Error ? error.message : String(error)}`);
117613
117609
  }
117614
- if (!heapSnapshotAuthorised(deps.env)) {
117615
- request.sink.info(`[mem] node="${request.label}" heap snapshot NOT taken \u2014 it is an admin mutation (a multi-GB write and a stop-the-world walk of the heap). The per-space breakdown above is the free half and needs no authorisation. Set ${RUNNER_HEAP_SNAPSHOT_ENV}=on for this runner and signal again to take one.`);
117616
- return;
117617
- }
117618
- try {
117619
- deps.writeSnapshot(request.snapshotPath);
117620
- request.sink.info(`[mem] node="${request.label}" heap snapshot written -> ${request.snapshotPath}`);
117621
- } catch (error) {
117622
- request.sink.warn(`[mem] node="${request.label}" snapshot failed: ${error instanceof Error ? error.message : String(error)}`);
117623
- }
117624
117610
  }
117625
117611
  var HUB_MAIN_HEAP_WATCH_LABEL = "hub-main";
117626
117612
  var HEAP_WATCH_INTERVAL_MS = 6e4;
@@ -125006,12 +124992,6 @@ var require_manifest_system_deps_DU0BvqV = __commonJS({
125006
124992
  return RSS_BUDGET_RELEASE_RATIO;
125007
124993
  }
125008
124994
  });
125009
- Object.defineProperty(exports, "RUNNER_HEAP_SNAPSHOT_ENV", {
125010
- enumerable: true,
125011
- get: function() {
125012
- return RUNNER_HEAP_SNAPSHOT_ENV;
125013
- }
125014
- });
125015
124995
  Object.defineProperty(exports, "RUNNER_HEAP_WATCH_INTERVAL_MS", {
125016
124996
  enumerable: true,
125017
124997
  get: function() {
@@ -125378,12 +125358,6 @@ var require_manifest_system_deps_DU0BvqV = __commonJS({
125378
125358
  return getWorkerNativeCapSnapshot;
125379
125359
  }
125380
125360
  });
125381
- Object.defineProperty(exports, "heapSnapshotAuthorised", {
125382
- enumerable: true,
125383
- get: function() {
125384
- return heapSnapshotAuthorised;
125385
- }
125386
- });
125387
125361
  Object.defineProperty(exports, "heapSpaceField", {
125388
125362
  enumerable: true,
125389
125363
  get: function() {
@@ -129402,7 +129376,7 @@ var require_dist3 = __commonJS({
129402
129376
  "use strict";
129403
129377
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
129404
129378
  var require_chunk = require_chunk_Cek0wNdY();
129405
- var require_dist10 = require_dist_KItAWyKG();
129379
+ var require_dist10 = require_dist_C0IXtI_E();
129406
129380
  var require_builtins_alerts_alerts_addon = require_alerts_addon();
129407
129381
  require_alerts();
129408
129382
  var require_formatter = require_formatter_DqAKDlvN();
@@ -129429,7 +129403,7 @@ var require_dist3 = __commonJS({
129429
129403
  var require_builtins_winston_logging_index = require_winston_logging();
129430
129404
  var require_file_data_plane = require_file_data_plane_DO8KbxCe();
129431
129405
  var require_tls$1 = require_tls_BxQlomxd();
129432
- var require_manifest_system_deps = require_manifest_system_deps_DU0BvqV();
129406
+ var require_manifest_system_deps = require_manifest_system_deps_D6ncx0jA();
129433
129407
  var require_resource_monitor = require_resource_monitor_CdnzxBLP();
129434
129408
  var require_custom_action_registry = require_custom_action_registry_jY0NOZK8();
129435
129409
  var zod = require_zod();
@@ -209786,7 +209760,6 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
209786
209760
  exports.RESTART_MARKER_FILE = RESTART_MARKER_FILE;
209787
209761
  exports.RSS_BUDGET_REANNOUNCE_MIN_MS = require_manifest_system_deps.RSS_BUDGET_REANNOUNCE_MIN_MS;
209788
209762
  exports.RSS_BUDGET_RELEASE_RATIO = require_manifest_system_deps.RSS_BUDGET_RELEASE_RATIO;
209789
- exports.RUNNER_HEAP_SNAPSHOT_ENV = require_manifest_system_deps.RUNNER_HEAP_SNAPSHOT_ENV;
209790
209763
  exports.RUNNER_HEAP_WATCH_INTERVAL_MS = require_manifest_system_deps.RUNNER_HEAP_WATCH_INTERVAL_MS;
209791
209764
  exports.RUNNER_RSS_BUDGET_ENV = require_manifest_system_deps.RUNNER_RSS_BUDGET_ENV;
209792
209765
  exports.RUNTIME_DEFAULTS = require_dist10.RUNTIME_DEFAULTS;
@@ -209977,7 +209950,6 @@ globstar while`, t, d, e, f, m), this.matchOne(t.slice(d), e.slice(f), s)) retur
209977
209950
  exports.getWorkerDeviceRegistry = require_manifest_system_deps.getWorkerDeviceRegistry;
209978
209951
  exports.hasDotNode = hasDotNode;
209979
209952
  exports.hashClusterSecret = hashClusterSecret;
209980
- exports.heapSnapshotAuthorised = require_manifest_system_deps.heapSnapshotAuthorised;
209981
209953
  exports.heapSpaceField = require_manifest_system_deps.heapSpaceField;
209982
209954
  exports.hubMainRssBudget = require_manifest_system_deps.hubMainRssBudget;
209983
209955
  exports.installManifestNativeDeps = require_manifest_system_deps.installManifestNativeDeps;
@@ -210860,11 +210832,11 @@ var require_dist4 = __commonJS({
210860
210832
  px: streamPixels(s.metadata ?? {})
210861
210833
  })).toSorted((a, b) => b.px - a.px);
210862
210834
  const result = Array.from({ length: streams.length });
210863
- for (let rank = 0; rank < sorted.length; rank++) {
210864
- const { s, i } = sorted[rank];
210835
+ for (let rank2 = 0; rank2 < sorted.length; rank2++) {
210836
+ const { s, i } = sorted[rank2];
210865
210837
  let quality;
210866
- if (rank === 0) quality = "high";
210867
- else if (rank === sorted.length - 1) quality = "low";
210838
+ if (rank2 === 0) quality = "high";
210839
+ else if (rank2 === sorted.length - 1) quality = "low";
210868
210840
  else quality = "mid";
210869
210841
  result[i] = {
210870
210842
  ...s,
@@ -219498,18 +219470,6 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
219498
219470
  */
219499
219471
  gpuShmemBytes: zod.z.number().nullable()
219500
219472
  }).extend({ atMs: zod.z.number() });
219501
- var DumpHeapSnapshotInputSchema = zod.z.object({
219502
- /** The addon whose runner should dump a heap snapshot. */
219503
- addonId: zod.z.string()
219504
- });
219505
- var DumpHeapSnapshotResultSchema = zod.z.object({
219506
- success: zod.z.boolean(),
219507
- /** Path of the written .heapsnapshot inside the runner's container/host. */
219508
- path: zod.z.string().optional(),
219509
- /** Process pid that was signalled. */
219510
- pid: zod.z.number().optional(),
219511
- reason: zod.z.string().optional()
219512
- });
219513
219473
  var LoadPointSchema = zod.z.object({
219514
219474
  /** Bucket START, or the snapshot's own timestamp when unreduced. */
219515
219475
  atMs: zod.z.number(),
@@ -219683,19 +219643,7 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
219683
219643
  * agent's ring alone (`durable: false`). Empty is a legitimate answer: a
219684
219644
  * node nobody has heard from has no series, and saying so is the truth.
219685
219645
  */
219686
- getLoadSeries: require_sleep.method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema),
219687
- /**
219688
- * Tell the addon's forked runner to write a V8 heap snapshot to disk (via
219689
- * SIGUSR2 — the runner's diagnostic handler). Also logs its
219690
- * `process.memoryUsage()` + heap-space breakdown. Resolves the pid from
219691
- * `$process.list`, so it can only reach a runner this node spawned. Use
219692
- * for deep per-addon memory attribution; copy the returned path off the
219693
- * node to analyze.
219694
- */
219695
- dumpHeapSnapshot: require_sleep.method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
219696
- kind: "mutation",
219697
- auth: "admin"
219698
- })
219646
+ getLoadSeries: require_sleep.method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema)
219699
219647
  }
219700
219648
  };
219701
219649
  var ModelConvertInputSchema = zod.z.object({
@@ -224140,7 +224088,8 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
224140
224088
  "plateCrop",
224141
224089
  "keyFrame",
224142
224090
  "keyFrameSmall",
224143
- "thumbnailSmall"
224091
+ "thumbnailSmall",
224092
+ "sceneFrame"
224144
224093
  ]);
224145
224094
  var MediaFileRefSchema = zod.z.object({
224146
224095
  key: zod.z.string(),
@@ -224628,7 +224577,21 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
224628
224577
  /** Include stationary-promoted rows (parked objects handed to the
224629
224578
  * stationary registry). Default false: the timeline lists passages,
224630
224579
  * not parking records (operator decision, 2026-08-15). */
224631
- 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()
224632
224595
  }), zod.z.array(TrackSchema).readonly()),
224633
224596
  /**
224634
224597
  * Batched cluster-wide track listing — ONE call for the events page /
@@ -237460,6 +237423,44 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
237460
237423
  "ffmpeg.threadCount": 0,
237461
237424
  "auth.tokenExpiry": "30d"
237462
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
+ }
237463
237464
  var AccessoryKind = {
237464
237465
  Siren: require_sleep.DeviceRole.Siren,
237465
237466
  Floodlight: require_sleep.DeviceRole.Floodlight,
@@ -243373,12 +243374,6 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
243373
243374
  addonId: null,
243374
243375
  access: "view"
243375
243376
  },
243376
- "metricsProvider.dumpHeapSnapshot": {
243377
- capName: "metrics-provider",
243378
- capScope: "system",
243379
- addonId: null,
243380
- access: "create"
243381
- },
243382
243377
  "metricsProvider.getAddonStats": {
243383
243378
  capName: "metrics-provider",
243384
243379
  capScope: "system",
@@ -249743,8 +249738,7 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
249743
249738
  listAddonInstances: (input) => dispatch("metricsProvider", "listAddonInstances", "query", input),
249744
249739
  getAddonStats: (input) => dispatch("metricsProvider", "getAddonStats", "query", input),
249745
249740
  listNodeProcesses: (input) => dispatch("metricsProvider", "listNodeProcesses", "query", input),
249746
- getLoadSeries: (input) => dispatch("metricsProvider", "getLoadSeries", "query", input),
249747
- dumpHeapSnapshot: (input) => dispatch("metricsProvider", "dumpHeapSnapshot", "mutation", input)
249741
+ getLoadSeries: (input) => dispatch("metricsProvider", "getLoadSeries", "query", input)
249748
249742
  },
249749
249743
  mqttBroker: {
249750
249744
  listBrokers: (input) => dispatch("mqttBroker", "listBrokers", "query", input),
@@ -252844,6 +252838,7 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
252844
252838
  exports.COCO_80_LABELS = COCO_80_LABELS;
252845
252839
  exports.COCO_TO_MACRO = COCO_TO_MACRO;
252846
252840
  exports.CONNECTION_TEST_TIMEOUT_MS = CONNECTION_TEST_TIMEOUT_MS;
252841
+ exports.CONTAINER_CHILD_PRIORITY = CONTAINER_CHILD_PRIORITY;
252847
252842
  exports.CORE_BLOCKS_ADDON_ID = CORE_BLOCKS_ADDON_ID;
252848
252843
  exports.CORE_BLOCK_ADDON_PREFIX = CORE_BLOCK_ADDON_PREFIX;
252849
252844
  exports.CamProfileSchema = require_sleep.CamProfileSchema;
@@ -254082,6 +254077,7 @@ ${recipe.triggers.map((t, i) => emitTrigger(t, i)).join("\n\n")}
254082
254077
  exports.resolveBucketMs = resolveBucketMs;
254083
254078
  exports.resolveCapMount = require_sleep.resolveCapMount;
254084
254079
  exports.resolveClusterStepModelId = resolveClusterStepModelId;
254080
+ exports.resolveContainerPrimaryChild = resolveContainerPrimaryChild;
254085
254081
  exports.resolveDetectionRuntime = resolveDetectionRuntime;
254086
254082
  exports.resolveDeviceControlKind = resolveDeviceControlKind;
254087
254083
  exports.resolveDeviceProfile = resolveDeviceProfile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstack",
3
- "version": "1.2.80",
3
+ "version": "1.2.82",
4
4
  "description": "CLI tool for managing and running CamStack server",
5
5
  "keywords": [
6
6
  "camstack",