@camstack/addon-pipeline 1.1.58 → 1.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/audio-analyzer/index.js +4 -4
  2. package/dist/audio-analyzer/index.mjs +2 -2
  3. package/dist/detection-pipeline/index.js +48 -10
  4. package/dist/detection-pipeline/index.mjs +42 -4
  5. package/dist/{dist-CnwwDzX3.mjs → dist-CcqqznPf.mjs} +244 -14
  6. package/dist/{dist-Bn6Uq4vq.js → dist-DynD1EC-.js} +249 -13
  7. package/dist/{model-download-service-C-IHWnXx-3Mmeob3l.mjs → model-download-service-Cp9f4dk6-0wh7OK3s.mjs} +2 -2
  8. package/dist/{model-download-service-C-IHWnXx-D326YNnt.js → model-download-service-Cp9f4dk6-Cp_GTKTw.js} +2 -2
  9. package/dist/motion-wasm/index.js +1 -1
  10. package/dist/motion-wasm/index.mjs +1 -1
  11. package/dist/pipeline-runner/index.js +123 -4
  12. package/dist/pipeline-runner/index.mjs +122 -3
  13. package/dist/recorder/index.js +1021 -7
  14. package/dist/recorder/index.mjs +1018 -5
  15. package/dist/session-decode/decode-worker-child.js +14 -1
  16. package/dist/session-decode/decode-worker-child.mjs +14 -1
  17. package/dist/{hub-hostname-cCknRYKj.mjs → sheet-geometry-BR-ip0CP.js} +56 -1
  18. package/dist/{hub-hostname-DAJXlOgV.js → sheet-geometry-DcpuGTCm.mjs} +39 -6
  19. package/dist/{step-definitions-DhEe57Wn.mjs → step-definitions-CvwB_Otk.mjs} +1 -1
  20. package/dist/{step-definitions-D7NOrnzz.js → step-definitions-DhhwklAL.js} +1 -1
  21. package/dist/stream-broker/_stub.js +2 -2
  22. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-B8FQ1e0a.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-B07QYb7Q.mjs} +3 -3
  23. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DYQ6RHcb.mjs +26 -0
  24. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DSXctoaw.mjs +26 -0
  25. package/dist/stream-broker/{hostInit-D1Vdyu-4.mjs → hostInit-C02YjaoP.mjs} +3 -3
  26. package/dist/stream-broker/index.js +622 -149
  27. package/dist/stream-broker/index.mjs +622 -149
  28. package/dist/stream-broker/remoteEntry.js +1 -1
  29. package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-CG5EE0W4.js → MaskShapeCanvas-DI4BY7W2-ColkZGA1.js} +1 -1
  30. package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-BFeLUNOl.js → MotionZonesSettings-NcxxQN8r-BIzNJmu0.js} +1 -1
  31. package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-pQQunq1F.js → PrivacyMaskSettings-APgPLF7p-BHuYOg7Q.js} +1 -1
  32. package/embed-dist/assets/index-n1_ZSmy0.js +81 -0
  33. package/embed-dist/index.html +1 -1
  34. package/package.json +1 -1
  35. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Ba7Eyd47.mjs +0 -26
  36. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-TWCUWhCm.mjs +0 -26
  37. package/embed-dist/assets/index-BxqQ931j.js +0 -81
@@ -3,9 +3,9 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-D6vf50IK.js");
6
- const require_dist = require("../dist-Bn6Uq4vq.js");
6
+ const require_dist = require("../dist-DynD1EC-.js");
7
7
  const require_node_topology_platform = require("../node-topology-platform-CFZ7F4xW.js");
8
- const require_model_download_service_C_IHWnXx = require("../model-download-service-C-IHWnXx-D326YNnt.js");
8
+ const require_model_download_service_Cp9f4dk6 = require("../model-download-service-Cp9f4dk6-Cp_GTKTw.js");
9
9
  let node_fs = require("node:fs");
10
10
  node_fs = require_chunk.__toESM(node_fs);
11
11
  let node_path = require("node:path");
@@ -84,7 +84,7 @@ var YamnetPythonPipeline = class {
84
84
  url: YAMNET_MODEL_URL,
85
85
  dest: modelPath
86
86
  } });
87
- await require_model_download_service_C_IHWnXx.downloadFile(YAMNET_MODEL_URL, modelPath);
87
+ await require_model_download_service_Cp9f4dk6.downloadFile(YAMNET_MODEL_URL, modelPath);
88
88
  this.log.info("YAMNet ONNX model downloaded", { meta: { sizeBytes: node_fs.statSync(modelPath).size } });
89
89
  }
90
90
  if (!node_fs.existsSync(labelsPath)) {
@@ -92,7 +92,7 @@ var YamnetPythonPipeline = class {
92
92
  url: YAMNET_LABELS_URL,
93
93
  dest: labelsPath
94
94
  } });
95
- await require_model_download_service_C_IHWnXx.downloadFile(YAMNET_LABELS_URL, labelsPath);
95
+ await require_model_download_service_Cp9f4dk6.downloadFile(YAMNET_LABELS_URL, labelsPath);
96
96
  }
97
97
  const pythonDir = resolveAudioPythonDir();
98
98
  if (this.installPythonRequirements) await this.installPythonRequirements(node_path.join(pythonDir, "requirements-audio.txt"));
@@ -1,7 +1,7 @@
1
1
  import { t as __require } from "../chunk-BdkLduGY.mjs";
2
- import { C as mapAudioLabelToMacro, H as hydrateSchema, I as errMsg, L as BaseAddon, h as audioAnalyzerCapability, l as HF_BASE_URL, m as audioAnalysisCapability, n as AUDIO_BACKEND_CHOICES, o as DEFAULT_AUDIO_ANALYZER_CONFIG } from "../dist-CnwwDzX3.mjs";
2
+ import { C as mapAudioLabelToMacro, L as errMsg, R as BaseAddon, U as hydrateSchema, h as audioAnalyzerCapability, l as HF_BASE_URL, m as audioAnalysisCapability, n as AUDIO_BACKEND_CHOICES, o as DEFAULT_AUDIO_ANALYZER_CONFIG } from "../dist-CcqqznPf.mjs";
3
3
  import { t as pickNodePlatformArch } from "../node-topology-platform-BkR_k6WT.mjs";
4
- import { r as downloadFile } from "../model-download-service-C-IHWnXx-3Mmeob3l.mjs";
4
+ import { r as downloadFile } from "../model-download-service-Cp9f4dk6-0wh7OK3s.mjs";
5
5
  import * as fs from "node:fs";
6
6
  import * as path$1 from "node:path";
7
7
  //#region src/audio-analyzer/audio-pipeline.ts
@@ -3,10 +3,10 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-D6vf50IK.js");
6
- const require_dist = require("../dist-Bn6Uq4vq.js");
7
- const require_step_definitions = require("../step-definitions-D7NOrnzz.js");
6
+ const require_dist = require("../dist-DynD1EC-.js");
7
+ const require_step_definitions = require("../step-definitions-DhhwklAL.js");
8
8
  const require_node_topology_platform = require("../node-topology-platform-CFZ7F4xW.js");
9
- const require_model_download_service_C_IHWnXx = require("../model-download-service-C-IHWnXx-D326YNnt.js");
9
+ const require_model_download_service_Cp9f4dk6 = require("../model-download-service-Cp9f4dk6-Cp_GTKTw.js");
10
10
  let node_child_process = require("node:child_process");
11
11
  let sharp = require("sharp");
12
12
  sharp = require_chunk.__toESM(sharp);
@@ -3690,6 +3690,15 @@ var ONNX_FLOOR = {
3690
3690
  */
3691
3691
  var PROBE_READY_TIMEOUT_MS = 12e4;
3692
3692
  /**
3693
+ * Bound for the direct `platformProbe.getCapabilities` reconcile RPC issued
3694
+ * when the readiness gate times out (D8: readiness events are telemetry —
3695
+ * lossy — so a timed-out registry wait is reconciled against the provider
3696
+ * itself before conceding to the conservative floor). `getCapabilities`
3697
+ * resolves only once the probe is complete, so an answer IS readiness; the
3698
+ * race bound keeps a wedged transport from wedging `setApi`.
3699
+ */
3700
+ var PROBE_DIRECT_RPC_TIMEOUT_MS = 6e4;
3701
+ /**
3693
3702
  * Build the onnx-cpu floor pick using `pickBestRuntime` with a null hardware
3694
3703
  * env. Used wherever the old `detectBestEngine()` sync probe fell back — the
3695
3704
  * result is identical (onnx / cpu) but is now derived through the shared rules
@@ -3922,7 +3931,11 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
3922
3931
  nodeId
3923
3932
  }, { timeoutMs: PROBE_READY_TIMEOUT_MS });
3924
3933
  } catch (err) {
3925
- this.log.warn("platform-probe readiness gate timed out conservative engine pick (floor is not persisted)", { meta: {
3934
+ if (await this.probePlatformReadinessDirect()) this.log.info("platform-probe readiness reconciled via direct probe RPC (ready event lost)", { meta: {
3935
+ nodeId,
3936
+ timeoutMs: PROBE_READY_TIMEOUT_MS
3937
+ } });
3938
+ else this.log.warn("platform-probe readiness gate timed out — conservative engine pick (floor is not persisted)", { meta: {
3926
3939
  nodeId,
3927
3940
  timeoutMs: PROBE_READY_TIMEOUT_MS,
3928
3941
  error: require_dist.errMsg(err)
@@ -3933,6 +3946,31 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
3933
3946
  this.startProvisioningForCurrentEngine();
3934
3947
  }
3935
3948
  /**
3949
+ * Authoritative platform-probe reconcile: query the probe provider
3950
+ * DIRECTLY over the cap plane. The RPC resolves only once the async
3951
+ * probe has completed (`getCapabilities` awaits the probe promise), so
3952
+ * a successful answer proves readiness independent of the (lossy)
3953
+ * `system.ready-state` event stream. Mirrors the local-node branch of
3954
+ * `resolveProbeHardware` — an unpinned `getCapabilities` routes to this
3955
+ * node's own in-process provider (agent parent / hub). Bounded by
3956
+ * {@link PROBE_DIRECT_RPC_TIMEOUT_MS}; `false` on any failure.
3957
+ */
3958
+ async probePlatformReadinessDirect() {
3959
+ const api = this.addonCtx?.api;
3960
+ if (!api) return false;
3961
+ let timer;
3962
+ try {
3963
+ const bound = new Promise((resolve) => {
3964
+ timer = setTimeout(() => resolve(null), PROBE_DIRECT_RPC_TIMEOUT_MS);
3965
+ });
3966
+ return await Promise.race([api.platformProbe.getCapabilities.query(), bound]) !== null;
3967
+ } catch {
3968
+ return false;
3969
+ } finally {
3970
+ if (timer !== void 0) clearTimeout(timer);
3971
+ }
3972
+ }
3973
+ /**
3936
3974
  * Resolve the `'auto'` engine LIVE from this node's own kernel inference
3937
3975
  * resolver (`ctx.kernel.inferenceEngine`) — the runtime mirror of
3938
3976
  * `ctx.kernel.hwaccel`. Each node (hub + forked worker + remote agent)
@@ -4139,7 +4177,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
4139
4177
  if (!step.enabled) continue;
4140
4178
  const modelEntry = await this.resolveModelEntry(step.addonId, step.modelId);
4141
4179
  if (!modelEntry) continue;
4142
- if (require_model_download_service_C_IHWnXx.isModelDownloaded(this.modelsDir, modelEntry, format)) continue;
4180
+ if (require_model_download_service_Cp9f4dk6.isModelDownloaded(this.modelsDir, modelEntry, format)) continue;
4143
4181
  await this.downloadWithRetry(modelEntry, format, 3);
4144
4182
  }
4145
4183
  }
@@ -4514,7 +4552,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
4514
4552
  const formats = {};
4515
4553
  for (const [formatKey, entry] of Object.entries(m.formats)) {
4516
4554
  if (!entry) continue;
4517
- const downloaded = require_model_download_service_C_IHWnXx.isModelDownloaded(this.modelsDir, m, formatKey);
4555
+ const downloaded = require_model_download_service_Cp9f4dk6.isModelDownloaded(this.modelsDir, m, formatKey);
4518
4556
  formats[formatKey] = {
4519
4557
  url: entry.url,
4520
4558
  sizeMB: entry.sizeMB,
@@ -4637,7 +4675,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
4637
4675
  const { modelId, format, addonId } = input;
4638
4676
  const modelEntry = await this.resolveModelEntry(addonId, modelId);
4639
4677
  if (!modelEntry) throw new Error(`Model "${modelId}" not found in step "${addonId}" catalog`);
4640
- if (!require_model_download_service_C_IHWnXx.deleteModelFromDisk(this.modelsDir, modelEntry, format)) throw new Error(`Model "${modelId}" (${format}) is not downloaded — nothing to delete`);
4678
+ if (!require_model_download_service_Cp9f4dk6.deleteModelFromDisk(this.modelsDir, modelEntry, format)) throw new Error(`Model "${modelId}" (${format}) is not downloaded — nothing to delete`);
4641
4679
  this.log.info("Model deleted from disk", { meta: {
4642
4680
  modelId,
4643
4681
  format
@@ -5193,7 +5231,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
5193
5231
  const format = this.currentEngine?.format ?? "onnx";
5194
5232
  for (const step of needed) {
5195
5233
  const modelEntry = await this.resolveModelEntry(step.addonId, step.modelId);
5196
- if (modelEntry && !require_model_download_service_C_IHWnXx.isModelDownloaded(this.modelsDir, modelEntry, format)) {
5234
+ if (modelEntry && !require_model_download_service_Cp9f4dk6.isModelDownloaded(this.modelsDir, modelEntry, format)) {
5197
5235
  this.log.info("Downloading model for step", { meta: {
5198
5236
  modelId: step.modelId,
5199
5237
  format,
@@ -5218,7 +5256,7 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
5218
5256
  /** Download a model with retry + exponential backoff */
5219
5257
  async downloadWithRetry(entry, format, maxRetries, onProgress) {
5220
5258
  for (let attempt = 1; attempt <= maxRetries; attempt++) try {
5221
- await require_model_download_service_C_IHWnXx.ensureModel(this.modelsDir, entry, format, onProgress);
5259
+ await require_model_download_service_Cp9f4dk6.ensureModel(this.modelsDir, entry, format, onProgress);
5222
5260
  this.log.info("Model downloaded successfully", { meta: { modelId: entry.id } });
5223
5261
  return;
5224
5262
  } catch (err) {
@@ -6024,7 +6062,7 @@ function buildSchemaSlots(format, modelsDir, customByStep) {
6024
6062
  id: m.id,
6025
6063
  name: m.name,
6026
6064
  formats: Object.fromEntries(Object.entries(m.formats).map(([f, entry]) => [f, {
6027
- downloaded: require_model_download_service_C_IHWnXx.isModelDownloaded(modelsDir, m, f),
6065
+ downloaded: require_model_download_service_Cp9f4dk6.isModelDownloaded(modelsDir, m, f),
6028
6066
  sizeMB: entry.sizeMB
6029
6067
  }])),
6030
6068
  ...m.group ? { group: m.group } : {},
@@ -1,8 +1,8 @@
1
1
  import { t as __require } from "../chunk-BdkLduGY.mjs";
2
- import { D as nodePin, H as hydrateSchema, I as errMsg, K as parseJsonUnknown, L as BaseAddon, O as pipelineExecutorCapability, P as supportedRuntimes$1, V as createEvent, Y as sleep, b as detectionPipelineCapability, f as YAMNET_TO_MACRO, j as runtimeDevices$1, st as EventCategory, t as APPLE_SA_TO_MACRO, v as defaultDeviceFor$1, x as evaluateZoneRules } from "../dist-CnwwDzX3.mjs";
3
- import { a as getStepDefinition, i as getStep, n as ALL_STEPS, o as resolveModelForFormat, r as getDefaultModelForFormat, t as ALL_PIPELINE_STEPS } from "../step-definitions-DhEe57Wn.mjs";
2
+ import { D as nodePin, F as supportedRuntimes$1, H as createEvent, L as errMsg, M as runtimeDevices$1, O as pipelineExecutorCapability, R as BaseAddon, U as hydrateSchema, X as sleep, b as detectionPipelineCapability, ct as EventCategory, f as YAMNET_TO_MACRO, q as parseJsonUnknown, t as APPLE_SA_TO_MACRO, v as defaultDeviceFor$1, x as evaluateZoneRules } from "../dist-CcqqznPf.mjs";
3
+ import { a as getStepDefinition, i as getStep, n as ALL_STEPS, o as resolveModelForFormat, r as getDefaultModelForFormat, t as ALL_PIPELINE_STEPS } from "../step-definitions-CvwB_Otk.mjs";
4
4
  import { t as pickNodePlatformArch } from "../node-topology-platform-BkR_k6WT.mjs";
5
- import { a as isModelDownloaded, i as ensureModel, n as deleteModelFromDisk } from "../model-download-service-C-IHWnXx-3Mmeob3l.mjs";
5
+ import { a as isModelDownloaded, i as ensureModel, n as deleteModelFromDisk } from "../model-download-service-Cp9f4dk6-0wh7OK3s.mjs";
6
6
  import { spawn } from "node:child_process";
7
7
  import sharp from "sharp";
8
8
  import * as fs from "node:fs";
@@ -3682,6 +3682,15 @@ var ONNX_FLOOR = {
3682
3682
  */
3683
3683
  var PROBE_READY_TIMEOUT_MS = 12e4;
3684
3684
  /**
3685
+ * Bound for the direct `platformProbe.getCapabilities` reconcile RPC issued
3686
+ * when the readiness gate times out (D8: readiness events are telemetry —
3687
+ * lossy — so a timed-out registry wait is reconciled against the provider
3688
+ * itself before conceding to the conservative floor). `getCapabilities`
3689
+ * resolves only once the probe is complete, so an answer IS readiness; the
3690
+ * race bound keeps a wedged transport from wedging `setApi`.
3691
+ */
3692
+ var PROBE_DIRECT_RPC_TIMEOUT_MS = 6e4;
3693
+ /**
3685
3694
  * Build the onnx-cpu floor pick using `pickBestRuntime` with a null hardware
3686
3695
  * env. Used wherever the old `detectBestEngine()` sync probe fell back — the
3687
3696
  * result is identical (onnx / cpu) but is now derived through the shared rules
@@ -3914,7 +3923,11 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
3914
3923
  nodeId
3915
3924
  }, { timeoutMs: PROBE_READY_TIMEOUT_MS });
3916
3925
  } catch (err) {
3917
- this.log.warn("platform-probe readiness gate timed out conservative engine pick (floor is not persisted)", { meta: {
3926
+ if (await this.probePlatformReadinessDirect()) this.log.info("platform-probe readiness reconciled via direct probe RPC (ready event lost)", { meta: {
3927
+ nodeId,
3928
+ timeoutMs: PROBE_READY_TIMEOUT_MS
3929
+ } });
3930
+ else this.log.warn("platform-probe readiness gate timed out — conservative engine pick (floor is not persisted)", { meta: {
3918
3931
  nodeId,
3919
3932
  timeoutMs: PROBE_READY_TIMEOUT_MS,
3920
3933
  error: errMsg(err)
@@ -3925,6 +3938,31 @@ var DetectionPipelineProvider = class DetectionPipelineProvider {
3925
3938
  this.startProvisioningForCurrentEngine();
3926
3939
  }
3927
3940
  /**
3941
+ * Authoritative platform-probe reconcile: query the probe provider
3942
+ * DIRECTLY over the cap plane. The RPC resolves only once the async
3943
+ * probe has completed (`getCapabilities` awaits the probe promise), so
3944
+ * a successful answer proves readiness independent of the (lossy)
3945
+ * `system.ready-state` event stream. Mirrors the local-node branch of
3946
+ * `resolveProbeHardware` — an unpinned `getCapabilities` routes to this
3947
+ * node's own in-process provider (agent parent / hub). Bounded by
3948
+ * {@link PROBE_DIRECT_RPC_TIMEOUT_MS}; `false` on any failure.
3949
+ */
3950
+ async probePlatformReadinessDirect() {
3951
+ const api = this.addonCtx?.api;
3952
+ if (!api) return false;
3953
+ let timer;
3954
+ try {
3955
+ const bound = new Promise((resolve) => {
3956
+ timer = setTimeout(() => resolve(null), PROBE_DIRECT_RPC_TIMEOUT_MS);
3957
+ });
3958
+ return await Promise.race([api.platformProbe.getCapabilities.query(), bound]) !== null;
3959
+ } catch {
3960
+ return false;
3961
+ } finally {
3962
+ if (timer !== void 0) clearTimeout(timer);
3963
+ }
3964
+ }
3965
+ /**
3928
3966
  * Resolve the `'auto'` engine LIVE from this node's own kernel inference
3929
3967
  * resolver (`ctx.kernel.inferenceEngine`) — the runtime mirror of
3930
3968
  * `ctx.kernel.hwaccel`. Each node (hub + forked worker + remote agent)
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-CFZs3jI4.mjs
1
+ //#region ../types/dist/event-category-H4AVePnn.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -148,6 +148,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
148
148
  EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
149
149
  EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
150
150
  EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
151
+ /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
152
+ * thumb is a scrub gap the recorder's keyframe backfill covers. */
153
+ EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
151
154
  EventCategory["DetectionEvent"] = "detection.event";
152
155
  EventCategory["SessionTrackNew"] = "session.track.new";
153
156
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -7376,6 +7379,65 @@ var RecordingRetentionSchema = object({
7376
7379
  maxSizeGb: number().min(0).optional()
7377
7380
  });
7378
7381
  /**
7382
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7383
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7384
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7385
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7386
+ *
7387
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7388
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7389
+ * preset changed over time renders every historical window at the dims it was
7390
+ * written with.
7391
+ */
7392
+ var ScrubThumbnailPresetSchema = _enum([
7393
+ "minimal",
7394
+ "low",
7395
+ "standard",
7396
+ "high",
7397
+ "max"
7398
+ ]);
7399
+ /**
7400
+ * Preset → tile geometry + JPEG quality. Every step is 16:9; the graduated
7401
+ * ladder trades sheet size (and remote fetch cost) for scrub crispness.
7402
+ * `standard` matches the shipped `sheet-geometry`/`sheet-composer` defaults
7403
+ * (480×270 q72), so an unset config is byte-identical to today. The map is
7404
+ * strictly monotone in resolution AND quality across the ordered steps.
7405
+ */
7406
+ var SCRUB_THUMBNAIL_PRESETS = {
7407
+ minimal: {
7408
+ tileWidth: 240,
7409
+ tileHeight: 135,
7410
+ quality: 55
7411
+ },
7412
+ low: {
7413
+ tileWidth: 320,
7414
+ tileHeight: 180,
7415
+ quality: 60
7416
+ },
7417
+ standard: {
7418
+ tileWidth: 480,
7419
+ tileHeight: 270,
7420
+ quality: 72
7421
+ },
7422
+ high: {
7423
+ tileWidth: 640,
7424
+ tileHeight: 360,
7425
+ quality: 80
7426
+ },
7427
+ max: {
7428
+ tileWidth: 960,
7429
+ tileHeight: 540,
7430
+ quality: 85
7431
+ }
7432
+ };
7433
+ /**
7434
+ * Resolve the geometry for a recording config's scrub-thumbnail preset,
7435
+ * defaulting to `standard` when unset. Pure — no I/O.
7436
+ */
7437
+ function resolveScrubThumbnailGeometry(preset) {
7438
+ return SCRUB_THUMBNAIL_PRESETS[preset ?? "standard"];
7439
+ }
7440
+ /**
7379
7441
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7380
7442
  *
7381
7443
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7412,7 +7474,14 @@ var RecordingConfigSchema = object({
7412
7474
  * derived into bands once via `migrateConfigToBands`.
7413
7475
  */
7414
7476
  bands: array(RecordingBandSchema).optional(),
7415
- retention: RecordingRetentionSchema.optional()
7477
+ retention: RecordingRetentionSchema.optional(),
7478
+ /**
7479
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7480
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7481
+ * windows only — existing sheets are immutable, and each window's index
7482
+ * carries its own tile dims so mixed-preset history renders correctly.
7483
+ */
7484
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7416
7485
  });
7417
7486
  /** All seven weekdays (0 = Sunday … 6 = Saturday), used when a schedule omits a
7418
7487
  * weekday filter. */
@@ -10738,7 +10807,7 @@ object({
10738
10807
  deviceId: number(),
10739
10808
  timestamp: number()
10740
10809
  });
10741
- DeviceType.Button;
10810
+ DeviceType.Button, DeviceType.Camera;
10742
10811
  /**
10743
10812
  * Enum-state sensor — a string value picked from a finite option set.
10744
10813
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -15569,6 +15638,14 @@ var ConfigEntrySchema = object({
15569
15638
  value: unknown(),
15570
15639
  description: string().optional()
15571
15640
  });
15641
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
15642
+ /** One resolved linked device — the compact projection consumers need. */
15643
+ var LinkedDeviceSchema = object({
15644
+ deviceId: number(),
15645
+ name: string(),
15646
+ location: string().nullable(),
15647
+ features: array(string())
15648
+ });
15572
15649
  var SavedDeviceRowSchema = object({
15573
15650
  /** Numeric id reserved at allocateDeviceId time. */
15574
15651
  id: number(),
@@ -15790,7 +15867,10 @@ method(object({
15790
15867
  }), _void(), {
15791
15868
  kind: "mutation",
15792
15869
  auth: "admin"
15793
- }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
15870
+ }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
15871
+ mode: DeviceLinkModeSchema,
15872
+ devices: array(LinkedDeviceSchema)
15873
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
15794
15874
  deviceId: number(),
15795
15875
  values: record(string(), unknown())
15796
15876
  }), object({ success: literal(true) }), {
@@ -17059,6 +17139,61 @@ var EventKindSchema = _enum([
17059
17139
  "object",
17060
17140
  "audio"
17061
17141
  ]);
17142
+ /**
17143
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
17144
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
17145
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
17146
+ */
17147
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
17148
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
17149
+ var EventKindIconSchema = _enum([
17150
+ "motion",
17151
+ "audio",
17152
+ "person",
17153
+ "vehicle",
17154
+ "animal",
17155
+ "door",
17156
+ "pir",
17157
+ "smoke",
17158
+ "water",
17159
+ "button",
17160
+ "generic"
17161
+ ]);
17162
+ var EventKindCategorySchema = _enum([
17163
+ "motion",
17164
+ "audio",
17165
+ "detection",
17166
+ "sensor",
17167
+ "custom"
17168
+ ]);
17169
+ var EventKindDescriptorSchema = object({
17170
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
17171
+ kind: string(),
17172
+ label: string(),
17173
+ /** Hex color for timeline/legend rendering. */
17174
+ color: string(),
17175
+ icon: EventKindIconSchema,
17176
+ category: EventKindCategorySchema,
17177
+ /** Which cap + device contributes this kind. For built-ins the camera
17178
+ * itself; for sensor kinds the LINKED source device. */
17179
+ source: object({
17180
+ capName: string(),
17181
+ deviceId: number()
17182
+ })
17183
+ });
17184
+ var SensorEventSchema = object({
17185
+ id: string(),
17186
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
17187
+ * yields N rows, one per camera). */
17188
+ deviceId: number(),
17189
+ /** The linked sensor device whose state changed. */
17190
+ sourceDeviceId: number(),
17191
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
17192
+ kind: string(),
17193
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
17194
+ value: record(string(), unknown()).nullable(),
17195
+ timestamp: number()
17196
+ });
17062
17197
  var TrackPositionSchema = object({
17063
17198
  x: number(),
17064
17199
  y: number(),
@@ -17072,6 +17207,30 @@ var TrackSnapshotSchema = object({
17072
17207
  mediaKey: string()
17073
17208
  });
17074
17209
  /**
17210
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
17211
+ * divided by the track's detection-frame dims), computed at persist time.
17212
+ * Absent when the frame dims were unknown when the track was persisted
17213
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
17214
+ */
17215
+ var TrackEnvelopeSchema = object({
17216
+ minX: number(),
17217
+ minY: number(),
17218
+ maxX: number(),
17219
+ maxY: number()
17220
+ });
17221
+ /**
17222
+ * Row projection for track list queries. `full` (default) returns the
17223
+ * complete Track including the frame-rate `positions[]` history and the
17224
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
17225
+ * keeps every scalar the list surfaces actually render (ids, class(es),
17226
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
17227
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
17228
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
17229
+ * `getTrack`. Mirrors the event-store `projection` convention
17230
+ * (`getObjectEvents` et al.).
17231
+ */
17232
+ var TrackProjectionSchema = _enum(["full", "slim"]);
17233
+ /**
17075
17234
  * One audio-classification label heard on the track's camera while the
17076
17235
  * track was alive, aggregated per label. An "episode" is one persisted
17077
17236
  * audio event (the confident-classification path: score ≥ the device's
@@ -17122,7 +17281,11 @@ var TrackSchema = object({
17122
17281
  /** Audio-classification labels heard on the camera during the track's
17123
17282
  * life (score ≥ device `classificationMinScore`), aggregated per label.
17124
17283
  * Absent on legacy rows / tracks with no confident audio. */
17125
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
17284
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
17285
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
17286
+ * Populated from the persisted envelope columns on historical reads;
17287
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
17288
+ envelope: TrackEnvelopeSchema.optional()
17126
17289
  });
17127
17290
  var BaseEventFields = {
17128
17291
  id: string(),
@@ -17232,11 +17395,13 @@ var MediaFileSchema = object({
17232
17395
  sizeBytes: number(),
17233
17396
  timestamp: number()
17234
17397
  });
17398
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
17399
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
17235
17400
  var DeviceEventQueryInput = object({
17236
17401
  deviceId: number(),
17237
17402
  since: number().optional(),
17238
17403
  until: number().optional(),
17239
- limit: number().int().min(1).max(5e3).default(1e3),
17404
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
17240
17405
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
17241
17406
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
17242
17407
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -17244,6 +17409,27 @@ var DeviceEventQueryInput = object({
17244
17409
  projection: _enum(["full", "slim"]).optional()
17245
17410
  });
17246
17411
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
17412
+ var RecentTracksQueryInput = object({
17413
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
17414
+ deviceIds: array(number()),
17415
+ /** Window lower bound on `lastSeen` (inclusive). */
17416
+ since: number().optional(),
17417
+ /** Window upper bound on `lastSeen` (inclusive). */
17418
+ until: number().optional(),
17419
+ /** Page size. Default 200, max 1000. */
17420
+ limit: number().int().min(1).max(1e3).default(200),
17421
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
17422
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
17423
+ cursor: string().optional(),
17424
+ /** See {@link TrackProjectionSchema}. Default `full`. */
17425
+ projection: TrackProjectionSchema.optional()
17426
+ });
17427
+ var RecentTracksPageSchema = object({
17428
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
17429
+ tracks: array(TrackSchema).readonly(),
17430
+ /** Cursor for the next page, or null when this page is the last. */
17431
+ nextCursor: string().nullable()
17432
+ });
17247
17433
  var KeyEventQueryInput = object({
17248
17434
  deviceId: number(),
17249
17435
  /** Window lower bound (track firstSeen ≥ since). */
@@ -17326,11 +17512,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17326
17512
  deviceId: number(),
17327
17513
  since: number().optional(),
17328
17514
  until: number().optional(),
17329
- limit: number().optional()
17330
- }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
17331
- kind: "mutation",
17332
- auth: "admin"
17333
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
17515
+ limit: number().optional(),
17516
+ /** Spatial filter only tracks whose trajectory intersects the zone
17517
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
17518
+ * envelope columns, then precisely tested per position. Tracks with
17519
+ * an unknown envelope (no frame dims at persist time) always match. */
17520
+ zone: TrackZoneFilterSchema.optional(),
17521
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
17522
+ * compatible — omitting the field keeps today's exact behaviour). */
17523
+ projection: TrackProjectionSchema.optional()
17524
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
17525
+ kind: "mutation",
17526
+ auth: "admin"
17527
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
17528
+ deviceId: number(),
17529
+ since: number().optional(),
17530
+ until: number().optional(),
17531
+ kinds: array(string()).optional(),
17532
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
17533
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
17334
17534
  deviceId: number(),
17335
17535
  since: number(),
17336
17536
  until: number(),
@@ -20626,7 +20826,12 @@ var RecordingStorageUsageSchema = object({
20626
20826
  /**
20627
20827
  * Result of locating footage at a wall-clock instant for one device/profile.
20628
20828
  * `segment` carries the covering segment's window; `gap` reports the forward
20629
- * nearest covered edge (`null` past the end of footage / when none exists).
20829
+ * nearest covered edge (`null` past the end of footage / when none exists)
20830
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
20831
+ * footage behind the epoch; `null` when none — optional so older providers
20832
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
20833
+ * small inter-segment cracks (durMs under-covers the span to the next
20834
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
20630
20835
  */
20631
20836
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
20632
20837
  kind: literal("segment"),
@@ -20635,7 +20840,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
20635
20840
  bytes: number()
20636
20841
  }), object({
20637
20842
  kind: literal("gap"),
20638
- nearestEdgeMs: number().nullable()
20843
+ nearestEdgeMs: number().nullable(),
20844
+ prevEndMs: number().nullable().optional()
20639
20845
  })]);
20640
20846
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
20641
20847
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -22237,6 +22443,12 @@ Object.freeze({
22237
22443
  addonId: null,
22238
22444
  access: "view"
22239
22445
  },
22446
+ "deviceManager.getLinkedDevices": {
22447
+ capName: "device-manager",
22448
+ capScope: "system",
22449
+ addonId: null,
22450
+ access: "view"
22451
+ },
22240
22452
  "deviceManager.getRoleDisplayDefaults": {
22241
22453
  capName: "device-manager",
22242
22454
  capScope: "system",
@@ -23791,6 +24003,12 @@ Object.freeze({
23791
24003
  addonId: null,
23792
24004
  access: "view"
23793
24005
  },
24006
+ "pipelineAnalytics.getSensorEvents": {
24007
+ capName: "pipeline-analytics",
24008
+ capScope: "device",
24009
+ addonId: null,
24010
+ access: "view"
24011
+ },
23794
24012
  "pipelineAnalytics.getTrack": {
23795
24013
  capName: "pipeline-analytics",
23796
24014
  capScope: "device",
@@ -23803,6 +24021,18 @@ Object.freeze({
23803
24021
  addonId: null,
23804
24022
  access: "view"
23805
24023
  },
24024
+ "pipelineAnalytics.listEventKinds": {
24025
+ capName: "pipeline-analytics",
24026
+ capScope: "device",
24027
+ addonId: null,
24028
+ access: "view"
24029
+ },
24030
+ "pipelineAnalytics.listRecentTracks": {
24031
+ capName: "pipeline-analytics",
24032
+ capScope: "device",
24033
+ addonId: null,
24034
+ access: "view"
24035
+ },
23806
24036
  "pipelineAnalytics.listTracks": {
23807
24037
  capName: "pipeline-analytics",
23808
24038
  capScope: "device",
@@ -25992,4 +26222,4 @@ function defaultDeviceFor(id) {
25992
26222
  return def(id).defaultDevice;
25993
26223
  }
25994
26224
  //#endregion
25995
- export { discriminatedUnion as $, recordingCapability as A, DeviceType as B, mapAudioLabelToMacro as C, nodePin as D, motionDetectionCapability as E, webrtcSessionCapability as F, makeSourceBrokerId as G, hydrateSchema as H, errMsg as I, selectAssignedProfileSlots as J, parseJsonUnknown as K, BaseAddon as L, storageEvictableCapability as M, streamBrokerCapability as N, pipelineExecutorCapability as O, supportedRuntimes as P, boolean as Q, CAM_PROFILE_ORDER as R, hfModelUrl as S, migrateConfigToBands as T, isEvent as U, createEvent as V, makeProfileBrokerId as W, _enum as X, sleep as Y, array as Z, customAction as _, COCO_TO_MACRO as a, string as at, detectionPipelineCapability as b, EncodeProfileSchema as c, RingBuffer as d, lazy as et, YAMNET_TO_MACRO as f, cameraStreamsCapability as g, audioAnalyzerCapability as h, COCO_80_LABELS as i, record as it, runtimeDevices as j, pipelineRunnerCapability as k, HF_BASE_URL as l, audioAnalysisCapability as m, AUDIO_BACKEND_CHOICES as n, number as nt, DEFAULT_AUDIO_ANALYZER_CONFIG as o, union as ot, addonWidgetsSourceCapability as p, parseProfileBrokerId as q, AUDIO_MACRO_LABELS as r, object as rt, EVENT_PAD_MS as s, EventCategory as st, APPLE_SA_TO_MACRO as t, literal as tt, RecordingConfigSchema as u, defaultDeviceFor as v, maskUrlCredentials as w, evaluateZoneRules as x, defineCustomActions as y, DeviceFeature as z };
26225
+ export { boolean as $, recordingCapability as A, DeviceFeature as B, mapAudioLabelToMacro as C, nodePin as D, motionDetectionCapability as E, supportedRuntimes as F, makeProfileBrokerId as G, createEvent as H, webrtcSessionCapability as I, parseProfileBrokerId as J, makeSourceBrokerId as K, errMsg as L, runtimeDevices as M, storageEvictableCapability as N, pipelineExecutorCapability as O, streamBrokerCapability as P, array as Q, BaseAddon as R, hfModelUrl as S, migrateConfigToBands as T, hydrateSchema as U, DeviceType as V, isEvent as W, sleep as X, selectAssignedProfileSlots as Y, _enum as Z, customAction as _, COCO_TO_MACRO as a, record as at, detectionPipelineCapability as b, EncodeProfileSchema as c, EventCategory as ct, RingBuffer as d, discriminatedUnion as et, YAMNET_TO_MACRO as f, cameraStreamsCapability as g, audioAnalyzerCapability as h, COCO_80_LABELS as i, object as it, resolveScrubThumbnailGeometry as j, pipelineRunnerCapability as k, HF_BASE_URL as l, audioAnalysisCapability as m, AUDIO_BACKEND_CHOICES as n, literal as nt, DEFAULT_AUDIO_ANALYZER_CONFIG as o, string as ot, addonWidgetsSourceCapability as p, parseJsonUnknown as q, AUDIO_MACRO_LABELS as r, number as rt, EVENT_PAD_MS as s, union as st, APPLE_SA_TO_MACRO as t, lazy as tt, RecordingConfigSchema as u, defaultDeviceFor as v, maskUrlCredentials as w, evaluateZoneRules as x, defineCustomActions as y, CAM_PROFILE_ORDER as z };