@camstack/types 1.2.171 → 1.2.172

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.
package/dist/addon.js CHANGED
@@ -149,6 +149,8 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
149
149
  "pipelineEnabled": true,
150
150
  "zones": [],
151
151
  "onboardMotionDrivesAnalyzer": true,
152
+ "preRollInferenceEnabled": true,
153
+ "preRollInferenceFrames": 12,
152
154
  "occupancyRecheckEnabled": true,
153
155
  "occupancyRecheckSec": 300,
154
156
  "occupancyRecheckFrames": 4,
package/dist/addon.mjs CHANGED
@@ -148,6 +148,8 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
148
148
  "pipelineEnabled": true,
149
149
  "zones": [],
150
150
  "onboardMotionDrivesAnalyzer": true,
151
+ "preRollInferenceEnabled": true,
152
+ "preRollInferenceFrames": 12,
151
153
  "occupancyRecheckEnabled": true,
152
154
  "occupancyRecheckSec": 300,
153
155
  "occupancyRecheckFrames": 4,
@@ -256,6 +256,8 @@ declare const RunnerCameraConfigSchema: z.ZodObject<{
256
256
  color: z.ZodDefault<z.ZodString>;
257
257
  }, z.core.$strip>>>>;
258
258
  onboardMotionDrivesAnalyzer: z.ZodDefault<z.ZodBoolean>;
259
+ preRollInferenceEnabled: z.ZodDefault<z.ZodBoolean>;
260
+ preRollInferenceFrames: z.ZodDefault<z.ZodNumber>;
259
261
  occupancyRecheckEnabled: z.ZodDefault<z.ZodBoolean>;
260
262
  occupancyRecheckSec: z.ZodDefault<z.ZodNumber>;
261
263
  occupancyRecheckFrames: z.ZodDefault<z.ZodNumber>;
@@ -516,6 +518,8 @@ export declare const pipelineRunnerCapability: {
516
518
  color: z.ZodDefault<z.ZodString>;
517
519
  }, z.core.$strip>>>>;
518
520
  onboardMotionDrivesAnalyzer: z.ZodDefault<z.ZodBoolean>;
521
+ preRollInferenceEnabled: z.ZodDefault<z.ZodBoolean>;
522
+ preRollInferenceFrames: z.ZodDefault<z.ZodNumber>;
519
523
  occupancyRecheckEnabled: z.ZodDefault<z.ZodBoolean>;
520
524
  occupancyRecheckSec: z.ZodDefault<z.ZodNumber>;
521
525
  occupancyRecheckFrames: z.ZodDefault<z.ZodNumber>;
package/dist/index.js CHANGED
@@ -21324,6 +21324,22 @@ var occupancyRecheckFramesField = {
21324
21324
  step: 1
21325
21325
  };
21326
21326
  /**
21327
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
21328
+ *
21329
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
21330
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
21331
+ * fleet measures — one-shot, and only ever taken while a permit would still be
21332
+ * spare for live. `0` turns the burst off entirely (the history is still
21333
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
21334
+ * discarded — the pre-D411 behaviour).
21335
+ */
21336
+ var preRollInferenceFramesField = {
21337
+ min: 0,
21338
+ max: 30,
21339
+ default: 12,
21340
+ step: 1
21341
+ };
21342
+ /**
21327
21343
  * Source enum for motion signals fed to the runner. Extensible — add
21328
21344
  * new variants here when new motion-trigger paths are wired in
21329
21345
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -21564,6 +21580,31 @@ var RunnerCameraConfigSchema = zod.z.object({
21564
21580
  * to every occupancy rule until something moved in front of it. The churn is
21565
21581
  * now paid on the interval instead — see `occupancyRecheckSecField`.
21566
21582
  */
21583
+ /**
21584
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
21585
+ * at session open — instead of decoding it and throwing it away.
21586
+ *
21587
+ * DEFAULT `true`, and the default is the argument. This is not a new
21588
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
21589
+ * already served, already decoded and already paid for on every on-motion
21590
+ * detection session that asks for history. What shipped was a last-moment
21591
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
21592
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
21593
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
21594
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
21595
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
21596
+ * was decoded, and was freed.
21597
+ *
21598
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
21599
+ * setting whose absence looks exactly like a camera that noticed the cyclist
21600
+ * late. What makes ON safe is not a switch but the BOUND —
21601
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
21602
+ * the last inference permit — so the switch exists for the camera where the
21603
+ * history is worthless (a doorbell whose subject is always already at the
21604
+ * door), not as a hedge against the feature.
21605
+ */
21606
+ preRollInferenceEnabled: zod.z.boolean().default(true),
21607
+ preRollInferenceFrames: zod.z.number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
21567
21608
  occupancyRecheckEnabled: zod.z.boolean().default(true),
21568
21609
  occupancyRecheckSec: zod.z.number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
21569
21610
  occupancyRecheckFrames: zod.z.number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -21718,6 +21759,29 @@ var RunnerCameraDeviceUIFields = [
21718
21759
  includes: "onboard"
21719
21760
  }
21720
21761
  },
21762
+ {
21763
+ key: "preRollInferenceEnabled",
21764
+ type: "boolean",
21765
+ style: "checkbox",
21766
+ label: "Detect in the pre-roll",
21767
+ description: "Run detection over the few seconds of footage the camera had already buffered when motion fired, so a subject that was in view before the trigger is found at the moment it appeared rather than seconds later. The burst is bounded and never delays live detection.",
21768
+ default: true
21769
+ },
21770
+ {
21771
+ key: "preRollInferenceFrames",
21772
+ type: "slider",
21773
+ label: "Pre-roll frames",
21774
+ description: "How many frames of buffered history may be detected on, per session. Higher samples the history more densely; 0 disables the pass.",
21775
+ min: preRollInferenceFramesField.min,
21776
+ max: preRollInferenceFramesField.max,
21777
+ step: preRollInferenceFramesField.step,
21778
+ default: preRollInferenceFramesField.default,
21779
+ showValue: true,
21780
+ showWhen: {
21781
+ field: "preRollInferenceEnabled",
21782
+ equals: true
21783
+ }
21784
+ },
21721
21785
  {
21722
21786
  key: "occupancyRecheckEnabled",
21723
21787
  type: "boolean",
package/dist/index.mjs CHANGED
@@ -21323,6 +21323,22 @@ var occupancyRecheckFramesField = {
21323
21323
  step: 1
21324
21324
  };
21325
21325
  /**
21326
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
21327
+ *
21328
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
21329
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
21330
+ * fleet measures — one-shot, and only ever taken while a permit would still be
21331
+ * spare for live. `0` turns the burst off entirely (the history is still
21332
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
21333
+ * discarded — the pre-D411 behaviour).
21334
+ */
21335
+ var preRollInferenceFramesField = {
21336
+ min: 0,
21337
+ max: 30,
21338
+ default: 12,
21339
+ step: 1
21340
+ };
21341
+ /**
21326
21342
  * Source enum for motion signals fed to the runner. Extensible — add
21327
21343
  * new variants here when new motion-trigger paths are wired in
21328
21344
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -21563,6 +21579,31 @@ var RunnerCameraConfigSchema = z.object({
21563
21579
  * to every occupancy rule until something moved in front of it. The churn is
21564
21580
  * now paid on the interval instead — see `occupancyRecheckSecField`.
21565
21581
  */
21582
+ /**
21583
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
21584
+ * at session open — instead of decoding it and throwing it away.
21585
+ *
21586
+ * DEFAULT `true`, and the default is the argument. This is not a new
21587
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
21588
+ * already served, already decoded and already paid for on every on-motion
21589
+ * detection session that asks for history. What shipped was a last-moment
21590
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
21591
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
21592
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
21593
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
21594
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
21595
+ * was decoded, and was freed.
21596
+ *
21597
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
21598
+ * setting whose absence looks exactly like a camera that noticed the cyclist
21599
+ * late. What makes ON safe is not a switch but the BOUND —
21600
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
21601
+ * the last inference permit — so the switch exists for the camera where the
21602
+ * history is worthless (a doorbell whose subject is always already at the
21603
+ * door), not as a hedge against the feature.
21604
+ */
21605
+ preRollInferenceEnabled: z.boolean().default(true),
21606
+ preRollInferenceFrames: z.number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
21566
21607
  occupancyRecheckEnabled: z.boolean().default(true),
21567
21608
  occupancyRecheckSec: z.number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
21568
21609
  occupancyRecheckFrames: z.number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -21717,6 +21758,29 @@ var RunnerCameraDeviceUIFields = [
21717
21758
  includes: "onboard"
21718
21759
  }
21719
21760
  },
21761
+ {
21762
+ key: "preRollInferenceEnabled",
21763
+ type: "boolean",
21764
+ style: "checkbox",
21765
+ label: "Detect in the pre-roll",
21766
+ description: "Run detection over the few seconds of footage the camera had already buffered when motion fired, so a subject that was in view before the trigger is found at the moment it appeared rather than seconds later. The burst is bounded and never delays live detection.",
21767
+ default: true
21768
+ },
21769
+ {
21770
+ key: "preRollInferenceFrames",
21771
+ type: "slider",
21772
+ label: "Pre-roll frames",
21773
+ description: "How many frames of buffered history may be detected on, per session. Higher samples the history more densely; 0 disables the pass.",
21774
+ min: preRollInferenceFramesField.min,
21775
+ max: preRollInferenceFramesField.max,
21776
+ step: preRollInferenceFramesField.step,
21777
+ default: preRollInferenceFramesField.default,
21778
+ showValue: true,
21779
+ showWhen: {
21780
+ field: "preRollInferenceEnabled",
21781
+ equals: true
21782
+ }
21783
+ },
21720
21784
  {
21721
21785
  key: "occupancyRecheckEnabled",
21722
21786
  type: "boolean",
@@ -83,6 +83,15 @@ export interface RunnerCameraConfig {
83
83
  * to disable the dynamic analyzer for this camera.
84
84
  */
85
85
  readonly onboardMotionDrivesAnalyzer: boolean;
86
+ /**
87
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
88
+ * at session open — instead of decoding it and discarding it. Mirrors
89
+ * `RunnerCameraConfigSchema.preRollInferenceEnabled` (default true; see the
90
+ * schema for why the default is the argument).
91
+ */
92
+ readonly preRollInferenceEnabled: boolean;
93
+ /** Frames one pre-roll catch-up burst may send to inference. `0` disables it. */
94
+ readonly preRollInferenceFrames: number;
86
95
  /** Master toggle — when false the occupancy recheck never arms (default). */
87
96
  readonly occupancyRecheckEnabled: boolean;
88
97
  /** Seconds between occupancy re-check bursts in watching phase. */
@@ -149,6 +149,18 @@ export interface DecodedFrame {
149
149
  readonly capturedAt?: number;
150
150
  /** Process-local lazy source. Present with an empty `data` buffer on the co-located path. */
151
151
  readonly frameRef?: FrameRef;
152
+ /**
153
+ * True when this frame came out of a session's PRE-ROLL catch-up burst —
154
+ * retained history replayed at session open rather than live footage.
155
+ *
156
+ * It exists so a consumer can ROUTE the frame, not merely label it: history
157
+ * belongs in the runner's bounded pre-roll lane (FIFO, drained strictly
158
+ * behind live), never in the latest-only live detection queue, which would
159
+ * collapse a whole burst to its newest frame. A frame carrying this ALWAYS
160
+ * carries a `capturedAt` measured on the session media clock, not a fresh
161
+ * wall clock.
162
+ */
163
+ readonly preRoll?: boolean;
152
164
  }
153
165
  export interface DecodedAudioChunk {
154
166
  readonly data: Buffer;
@@ -446,4 +458,12 @@ export interface CameraDetectionConfig {
446
458
  readonly occupancyRecheckEnabled: boolean;
447
459
  readonly occupancyRecheckSec: number;
448
460
  readonly occupancyRecheckFrames: number;
461
+ /**
462
+ * Whether the session's already-decoded PRE-ROLL is inferred rather than
463
+ * dropped as stale, and how many of its frames the catch-up burst may spend
464
+ * (D411). Carried here because the orchestrator resolves it per camera and
465
+ * the runner is the one that spends it.
466
+ */
467
+ readonly preRollInferenceEnabled: boolean;
468
+ readonly preRollInferenceFrames: number;
449
469
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.171",
3
+ "version": "1.2.172",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",