@camstack/addon-provider-rademacher 0.2.101 → 0.2.103

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 (3) hide show
  1. package/dist/addon.js +355 -14
  2. package/dist/addon.mjs +355 -14
  3. package/package.json +2 -2
package/dist/addon.js CHANGED
@@ -6345,7 +6345,7 @@ var ZodIssueCode = {
6345
6345
  var ZodFirstPartyTypeKind;
6346
6346
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6347
6347
  //#endregion
6348
- //#region ../types/dist/sleep-DEuj7E3j.mjs
6348
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
6349
6349
  /**
6350
6350
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6351
6351
  * window to float samples (D455).
@@ -12547,6 +12547,21 @@ var streamSignalsCapability = {
12547
12547
  mode: "singleton",
12548
12548
  deviceTypes: Object.values(DeviceType),
12549
12549
  runtimeState: StreamSignalsStatusSchema,
12550
+ /**
12551
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
12552
+ *
12553
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
12554
+ * not an operator choice: the provider re-declares it on every registration,
12555
+ * so losing it loses nothing and persisting it would freeze an answer the
12556
+ * camera is entitled to change. Measured the same day on the sibling case —
12557
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
12558
+ * class the camera really detected stayed missing for the life of the row
12559
+ * because the fix could not reach it.
12560
+ *
12561
+ * See `RuntimeStateDurability`. Enforced by
12562
+ * `scripts/check-runtime-state-durability.ts`.
12563
+ */
12564
+ durability: "session",
12550
12565
  methods: {
12551
12566
  /**
12552
12567
  * What this device can emit. Empty is a valid and common answer — most
@@ -19161,6 +19176,48 @@ var NcAlarmConfigSchema = object({
19161
19176
  settings: NcAlarmSettingsSchema,
19162
19177
  coverage: array(NcAlarmModeCoverageSchema)
19163
19178
  });
19179
+ /**
19180
+ * ONE rule's demand on ONE camera's clip ring.
19181
+ *
19182
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
19183
+ * camera, so the answer stays a faithful description of the rules and the
19184
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
19185
+ * lives. A camera that appears in no ask is being told **nothing** — which is
19186
+ * a different thing from never having been told, and only the envelope
19187
+ * (`rulesLoaded`) can tell those apart.
19188
+ */
19189
+ var NcClipRetentionAskSchema = object({
19190
+ /**
19191
+ * The camera this ask is about. **Absent = every camera**, which is what a
19192
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
19193
+ * asking everywhere.
19194
+ */
19195
+ deviceId: number().int().nonnegative().optional(),
19196
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
19197
+ * needs nothing produces no ask at all. */
19198
+ seconds: number().min(0).max(60),
19199
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
19200
+ * assigned, which is what the cut defaults to. */
19201
+ profile: CamProfileSchema.optional(),
19202
+ /** Who is asking — so a retention the operator did not expect names a rule. */
19203
+ ruleId: string(),
19204
+ ruleName: string(),
19205
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
19206
+ reason: _enum(["window", "occupancy"])
19207
+ });
19208
+ /**
19209
+ * The whole answer, with the one bit that keeps absence from reading as zero.
19210
+ *
19211
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
19212
+ * once. A centre that is up but has not read its rules yet answers with an
19213
+ * empty ask list that means nothing at all — applying it would drop every
19214
+ * camera's ring to zero for the first events after a restart, which is the
19215
+ * footage this mechanism exists to keep.
19216
+ */
19217
+ var NcClipRetentionPlanSchema = object({
19218
+ rulesLoaded: boolean(),
19219
+ asks: array(NcClipRetentionAskSchema).readonly()
19220
+ });
19164
19221
  method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
19165
19222
  kind: "mutation",
19166
19223
  auth: "admin",
@@ -19181,7 +19238,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
19181
19238
  }), object({ success: literal(true) }), {
19182
19239
  kind: "mutation",
19183
19240
  auth: "admin"
19184
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
19241
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
19185
19242
  deviceId: number().int(),
19186
19243
  muted: boolean()
19187
19244
  }), object({ success: literal(true) }), {
@@ -20366,13 +20423,26 @@ var TrackAudioLabelSchema = object({
20366
20423
  * - `audio` — an audio event on the camera itself that was anomalous for
20367
20424
  * THAT camera, loud, and heard while nothing visual was happening (D62).
20368
20425
  *
20426
+ * - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
20427
+ * that frame's pixel space. A real root detector and a SPATIAL one: its
20428
+ * boxes are the same kind of fact `pipeline`'s are, produced by a different
20429
+ * detector.
20430
+ *
20431
+ * `onboard` was missing here while `DetectionSourceSchema` already had it, so
20432
+ * a persisted onboard track failed `safeParse` on read and came back with NO
20433
+ * source at all — which `isSpatialTrack` then admitted by accident, through the
20434
+ * `undefined` arm rather than by anybody's decision, and which `excludeSources`
20435
+ * could not name.
20436
+ *
20369
20437
  * The spatial subsystems (tracker association, occupancy count, re-id /
20370
20438
  * embedding, resurrection) MUST skip every synthetic source. Test for that
20371
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
20372
- * check silently readmits every source added after it was written.
20439
+ * with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
20440
+ * `!== 'sensor'` check silently readmits every source added after it was
20441
+ * written.
20373
20442
  */
20374
20443
  var TrackSourceSchema = _enum([
20375
20444
  "pipeline",
20445
+ "onboard",
20376
20446
  "sensor",
20377
20447
  "audio"
20378
20448
  ]);
@@ -21755,6 +21825,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
21755
21825
  * solid is this track", cheaper than re-deriving it from a trajectory. */
21756
21826
  framesMatched: number().int()
21757
21827
  })).readonly() });
21828
+ /**
21829
+ * The long-term series a camera produces. A closed union so a typo cannot
21830
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21831
+ * is an alias of this, not a second list.
21832
+ */
21833
+ var AnalyticsLtsSeriesSchema = _enum([
21834
+ "motion",
21835
+ "audio-dbfs",
21836
+ "battery",
21837
+ "occupancy"
21838
+ ]);
21839
+ /**
21840
+ * One closed 5-minute bucket of a long-term series.
21841
+ *
21842
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21843
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21844
+ * that exists at all was measured; a bucket that is absent was not, which is a
21845
+ * different claim from zero and the reason this is a sparse series.
21846
+ */
21847
+ var LtsBucketSchema = object({
21848
+ scope: string(),
21849
+ bucketStart: number().int(),
21850
+ samples: number().int().nonnegative(),
21851
+ sum: number(),
21852
+ min: number(),
21853
+ max: number()
21854
+ });
21758
21855
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
21759
21856
  deviceId: number(),
21760
21857
  trackId: string()
@@ -21801,6 +21898,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21801
21898
  kinds: array(string()).optional(),
21802
21899
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
21803
21900
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
21901
+ deviceId: number(),
21902
+ series: AnalyticsLtsSeriesSchema,
21903
+ /** Omit for EVERY scope of this series in the range. */
21904
+ scope: string().optional(),
21905
+ from: number(),
21906
+ to: number(),
21907
+ limit: number().int().positive().optional()
21908
+ }), array(LtsBucketSchema).readonly()), method(object({
21804
21909
  deviceId: number(),
21805
21910
  since: number(),
21806
21911
  until: number(),
@@ -22419,6 +22524,40 @@ var MotionSourceEnum = _enum([
22419
22524
  */
22420
22525
  var MotionSourcesSchema = array(MotionSourceEnum);
22421
22526
  /**
22527
+ * Which root detector a camera runs — EXACTLY ONE.
22528
+ *
22529
+ * Deliberately the SAME vocabulary post-analysis already tags every detection
22530
+ * with (`DetectionSource`) rather than a second spelling of the same two
22531
+ * ideas: the value an operator picks here is the value that comes back on the
22532
+ * track, the overlay and the debug row.
22533
+ *
22534
+ * ## Why one, and why it is still an array
22535
+ *
22536
+ * Two roots on one camera is a capability nobody asked for and the operator has
22537
+ * since ruled out. It was never free: both planes feed the SAME per-device
22538
+ * stationary registry, both can promote the same parked object, and the two
22539
+ * detectors disagree about the same box by construction — which is the
22540
+ * disagreement D505 had to arbitrate. Removing the case removes the arbitration.
22541
+ *
22542
+ * The ARRAY shape survives because the stored settings and the attach payload
22543
+ * already speak it on every camera of every fleet, and a cap input that
22544
+ * suddenly refuses a stored value makes the camera un-attachable — a fail-closed
22545
+ * in the one direction that costs an operator their cameras. So the wire stays
22546
+ * tolerant and the TYPE is exact: a longer list is truncated to its first
22547
+ * element rather than refused, and `max(1)` is what every consumer can then
22548
+ * rely on.
22549
+ *
22550
+ * AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
22551
+ * a camera an operator left with no root detector — and `planDetectionSources`
22552
+ * has always said so: inventing a root for them is how a default acts without
22553
+ * anybody choosing it. Tightening this to `length(1)` broke that, and the
22554
+ * suite caught it.
22555
+ *
22556
+ * Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
22557
+ * `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
22558
+ */
22559
+ var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
22560
+ /**
22422
22561
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
22423
22562
  * so cap-side consumers (the orchestrator forward, the runner addon's
22424
22563
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -22569,6 +22708,35 @@ var RunnerCameraConfigSchema = object({
22569
22708
  * events; the orchestrator forwards to `reportMotion`.
22570
22709
  */
22571
22710
  motionSources: MotionSourcesSchema.default(["analyzer"]),
22711
+ /**
22712
+ * WHICH root detector runs for this camera. The detection counterpart of
22713
+ * {@link motionSources}, same shape and same discipline: a per-camera list
22714
+ * of sources the system understands, vendor-agnostic, owned here.
22715
+ *
22716
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
22717
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
22718
+ * here. Its boxes reach post-analysis on the same
22719
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
22720
+ * track gets the same tracker, the same overlay and the same detail
22721
+ * subtree (face / plate / embedding).
22722
+ *
22723
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
22724
+ * run, and that is where a camera with a usable onboard detector buys back
22725
+ * its share of the accelerator. It saves the root inference, not the decode
22726
+ * — the detail subtree still needs pixels to cut crops from.
22727
+ *
22728
+ * A camera whose onboard detections carry no geometry cannot serve as a root
22729
+ * step at all (there is nothing to track), and the cap that knows this says
22730
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
22731
+ * every battery camera: the boxes ride a sub-stream a battery camera never
22732
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
22733
+ * worth exactly what it already is — a wake signal with a class.
22734
+ *
22735
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
22736
+ * vendor never turns a detector on for the operator, and neither does a
22737
+ * default.
22738
+ */
22739
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
22572
22740
  pipelineEnabled: boolean().default(true),
22573
22741
  /** Ordered tree of video steps. Absent → runner skips video detection. */
22574
22742
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -22750,7 +22918,47 @@ var RunnerLocalMetricsSchema = object({
22750
22918
  queueDepth: number(),
22751
22919
  frameLazy: FrameLazyMetricsSchema.optional()
22752
22920
  });
22921
+ /**
22922
+ * Pipeline Runner capability — runtime detection workhorse.
22923
+ *
22924
+ * One instance per node. Receives camera assignments from
22925
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22926
+ * decoded frames, drains motion + detection queues, calls the local
22927
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22928
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22929
+ * the bus.
22930
+ *
22931
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22932
+ * runner has zero knowledge of other agents, no global state, and never
22933
+ * makes assignment decisions itself.
22934
+ */
22935
+ /**
22936
+ * Why a runner declined to look at a camera out of band. Named rather than a
22937
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22938
+ * already mid-session and one already bursting are four different facts, and a
22939
+ * caller told only "no" cannot tell a protection from a bug.
22940
+ */
22941
+ var OccupancyBurstRefusalSchema = _enum([
22942
+ "not-attached",
22943
+ "battery-asleep",
22944
+ "not-watching",
22945
+ "already-bursting"
22946
+ ]);
22753
22947
  method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly()), method(object({
22948
+ deviceId: number(),
22949
+ /** How many frames to collect. The caller sizes this against what its
22950
+ * own confirmation needs; the runner clamps it to the field's range. */
22951
+ frames: number().int().positive().optional(),
22952
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22953
+ * defend — the periodic one at least has a timer to point at. */
22954
+ reason: string()
22955
+ }), object({
22956
+ started: boolean(),
22957
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22958
+ }), {
22959
+ auth: "admin",
22960
+ kind: "mutation"
22961
+ }), method(object({
22754
22962
  handle: FrameHandleSchema,
22755
22963
  bbox: NativeCropBboxSchema,
22756
22964
  maxWidth: number().int().positive().optional(),
@@ -29580,11 +29788,46 @@ var NativeObjectDetectionStatusSchema = object({
29580
29788
  supportedClasses: array(NativeObjectClassEnum).readonly(),
29581
29789
  /**
29582
29790
  * Whether forwarding of onboard AI detections is enabled for this device.
29583
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
29584
- * churn the tracker, so forwarding stays off until the operator enables it.
29791
+ *
29792
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
29793
+ * camera runs — that is the operator's choice, and it is made where every
29794
+ * other detection choice is made. `geometry` on
29795
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
29796
+ * choice would buy this particular camera.
29585
29797
  */
29586
29798
  enabled: boolean()
29587
29799
  });
29800
+ /**
29801
+ * WHEN a camera's onboard detections carry geometry.
29802
+ *
29803
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
29804
+ * a detection is a trackable subject whenever the camera sees one.
29805
+ * - `while-streaming` — only while some stream of this camera is already open.
29806
+ * The boxes ride the video's own side-channel rather than a feed of their
29807
+ * own, so they cost nothing and they exist only when something is pulling.
29808
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
29809
+ * radio drain, but a camera that is awake is awake precisely because
29810
+ * something is in front of it, and its stream is already being pulled.
29811
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
29812
+ * pipeline needs geometry to make a subject, so such a push reaches the
29813
+ * tracker as motion and no further.
29814
+ *
29815
+ * Reported and not inferred, because the operator's question in front of the
29816
+ * picker is "what do I get", and these are three different answers (D14: the
29817
+ * derived form is only as honest as `getOptions`).
29818
+ */
29819
+ var NativeObjectGeometryEnum = _enum([
29820
+ "boxed",
29821
+ "while-streaming",
29822
+ "flag-only"
29823
+ ]);
29824
+ var NativeObjectDetectionOptionsSchema = object({
29825
+ /** Classes this firmware can detect — the same list the status reports. */
29826
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
29827
+ /** What a detection from this camera carries. */
29828
+ geometry: NativeObjectGeometryEnum
29829
+ });
29830
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
29588
29831
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
29589
29832
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
29590
29833
  lastFetchedAt: number() });
@@ -29594,13 +29837,23 @@ var nativeObjectDetectionCapability = {
29594
29837
  deviceNative: true,
29595
29838
  mode: "singleton",
29596
29839
  deviceTypes: [DeviceType.Camera],
29597
- methods: { setEnabled: method(object({
29598
- deviceId: number(),
29599
- enabled: boolean()
29600
- }), _void(), {
29601
- kind: "mutation",
29602
- auth: "admin"
29603
- }) },
29840
+ methods: {
29841
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29842
+ setSettings: method(object({
29843
+ deviceId: number(),
29844
+ settings: NativeObjectDetectionSettingsPatchSchema
29845
+ }), _void(), {
29846
+ kind: "mutation",
29847
+ auth: "admin"
29848
+ }),
29849
+ setEnabled: method(object({
29850
+ deviceId: number(),
29851
+ enabled: boolean()
29852
+ }), _void(), {
29853
+ kind: "mutation",
29854
+ auth: "admin"
29855
+ })
29856
+ },
29604
29857
  events: { onDetected: { data: object({
29605
29858
  deviceId: number(),
29606
29859
  detection: NativeDetectionSchema
@@ -34448,7 +34701,28 @@ var PerScopeBreakdownSchema = object({
34448
34701
  /** Total tracked objects in this scope (frame / zone / unzoned). */
34449
34702
  totalObjects: number().int().nonnegative(),
34450
34703
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
34451
- byClass: record(string(), number().int().nonnegative())
34704
+ byClass: record(string(), number().int().nonnegative()),
34705
+ /**
34706
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
34707
+ * present but not going anywhere (a parked car, a bin, a statue).
34708
+ *
34709
+ * The operator's question about a scene has two halves and they answer
34710
+ * different things: "what is parked here" is stable for hours and must not
34711
+ * flap, while "who is walking through" is the thing an alert is about. One
34712
+ * number could only serve one of them, and `totalObjects` served the first
34713
+ * badly — a passer-by moved it and every occupancy rule saw a change.
34714
+ *
34715
+ * `standing + transient === totalObjects`, always. The total keeps its old
34716
+ * meaning exactly, so no rule written against it changes behaviour.
34717
+ *
34718
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
34719
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
34720
+ * parked objects here" about a camera whose lot is full.
34721
+ */
34722
+ standingObjects: number().int().nonnegative().optional(),
34723
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
34724
+ * same absence rule. */
34725
+ transientObjects: number().int().nonnegative().optional()
34452
34726
  });
34453
34727
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
34454
34728
  zoneId: string(),
@@ -34571,6 +34845,23 @@ var HistoryPointSchema = object({
34571
34845
  * triple covers the three spatial scopes (per-zone, frame-wide,
34572
34846
  * outside-any-zone). Crossing them with `className?` gives the full
34573
34847
  * combinatorial coverage the operator UI requested.
34848
+ *
34849
+ * ## ⚠️ The three history methods are DEPRECATED
34850
+ *
34851
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34852
+ * so after a restart they report nothing about a night that did happen, and any
34853
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34854
+ * an empty scene. The presets in the occupancy chart existed to hide that
34855
+ * horizon rather than to answer a question.
34856
+ *
34857
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34858
+ * instead. Those rows are already written for every camera, ~60 bytes per
34859
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34860
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34861
+ * function the writer uses, so the two cannot drift.
34862
+ *
34863
+ * The ring stays until these three go, and it is the only thing left reading
34864
+ * it. Do not add a fourth caller.
34574
34865
  */
34575
34866
  var zoneAnalyticsCapability = {
34576
34867
  name: "zone-analytics",
@@ -38970,12 +39261,24 @@ Object.freeze({
38970
39261
  addonId: null,
38971
39262
  access: "create"
38972
39263
  },
39264
+ "nativeObjectDetection.getOptions": {
39265
+ capName: "native-object-detection",
39266
+ capScope: "device",
39267
+ addonId: null,
39268
+ access: "view"
39269
+ },
38973
39270
  "nativeObjectDetection.setEnabled": {
38974
39271
  capName: "native-object-detection",
38975
39272
  capScope: "device",
38976
39273
  addonId: null,
38977
39274
  access: "create"
38978
39275
  },
39276
+ "nativeObjectDetection.setSettings": {
39277
+ capName: "native-object-detection",
39278
+ capScope: "device",
39279
+ addonId: null,
39280
+ access: "create"
39281
+ },
38979
39282
  "navigation.getFeatures": {
38980
39283
  capName: "navigation",
38981
39284
  capScope: "device",
@@ -39240,6 +39543,12 @@ Object.freeze({
39240
39543
  addonId: null,
39241
39544
  access: "view"
39242
39545
  },
39546
+ "notificationRules.getClipRetentionAsks": {
39547
+ capName: "notification-rules",
39548
+ capScope: "system",
39549
+ addonId: null,
39550
+ access: "view"
39551
+ },
39243
39552
  "notificationRules.getConditionCatalog": {
39244
39553
  capName: "notification-rules",
39245
39554
  capScope: "system",
@@ -39750,6 +40059,12 @@ Object.freeze({
39750
40059
  addonId: null,
39751
40060
  access: "create"
39752
40061
  },
40062
+ "pipelineAnalytics.readLongTermSeries": {
40063
+ capName: "pipeline-analytics",
40064
+ capScope: "device",
40065
+ addonId: null,
40066
+ access: "view"
40067
+ },
39753
40068
  "pipelineAnalytics.rebuildObjectEmbeddings": {
39754
40069
  capName: "pipeline-analytics",
39755
40070
  capScope: "device",
@@ -40422,6 +40737,12 @@ Object.freeze({
40422
40737
  addonId: null,
40423
40738
  access: "create"
40424
40739
  },
40740
+ "pipelineRunner.requestOccupancyBurst": {
40741
+ capName: "pipeline-runner",
40742
+ capScope: "system",
40743
+ addonId: null,
40744
+ access: "create"
40745
+ },
40425
40746
  "pipelineRunner.runDetailSubtree": {
40426
40747
  capName: "pipeline-runner",
40427
40748
  capScope: "system",
@@ -43202,11 +43523,21 @@ Object.freeze({
43202
43523
  form: "single",
43203
43524
  optional: false
43204
43525
  }],
43526
+ "nativeObjectDetection.getOptions": [{
43527
+ name: "deviceId",
43528
+ form: "single",
43529
+ optional: false
43530
+ }],
43205
43531
  "nativeObjectDetection.setEnabled": [{
43206
43532
  name: "deviceId",
43207
43533
  form: "single",
43208
43534
  optional: false
43209
43535
  }],
43536
+ "nativeObjectDetection.setSettings": [{
43537
+ name: "deviceId",
43538
+ form: "single",
43539
+ optional: false
43540
+ }],
43210
43541
  "navigation.getFeatures": [{
43211
43542
  name: "deviceId",
43212
43543
  form: "single",
@@ -43556,6 +43887,11 @@ Object.freeze({
43556
43887
  form: "single",
43557
43888
  optional: false
43558
43889
  }],
43890
+ "pipelineAnalytics.readLongTermSeries": [{
43891
+ name: "deviceId",
43892
+ form: "single",
43893
+ optional: false
43894
+ }],
43559
43895
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
43560
43896
  name: "deviceId",
43561
43897
  form: "single",
@@ -43746,6 +44082,11 @@ Object.freeze({
43746
44082
  form: "single",
43747
44083
  optional: false
43748
44084
  }],
44085
+ "pipelineRunner.requestOccupancyBurst": [{
44086
+ name: "deviceId",
44087
+ form: "single",
44088
+ optional: false
44089
+ }],
43749
44090
  "pipelineRunner.runDetailSubtree": [{
43750
44091
  name: "deviceId",
43751
44092
  form: "single",
package/dist/addon.mjs CHANGED
@@ -6344,7 +6344,7 @@ var ZodIssueCode = {
6344
6344
  var ZodFirstPartyTypeKind;
6345
6345
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6346
6346
  //#endregion
6347
- //#region ../types/dist/sleep-DEuj7E3j.mjs
6347
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
6348
6348
  /**
6349
6349
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6350
6350
  * window to float samples (D455).
@@ -12546,6 +12546,21 @@ var streamSignalsCapability = {
12546
12546
  mode: "singleton",
12547
12547
  deviceTypes: Object.values(DeviceType),
12548
12548
  runtimeState: StreamSignalsStatusSchema,
12549
+ /**
12550
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
12551
+ *
12552
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
12553
+ * not an operator choice: the provider re-declares it on every registration,
12554
+ * so losing it loses nothing and persisting it would freeze an answer the
12555
+ * camera is entitled to change. Measured the same day on the sibling case —
12556
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
12557
+ * class the camera really detected stayed missing for the life of the row
12558
+ * because the fix could not reach it.
12559
+ *
12560
+ * See `RuntimeStateDurability`. Enforced by
12561
+ * `scripts/check-runtime-state-durability.ts`.
12562
+ */
12563
+ durability: "session",
12549
12564
  methods: {
12550
12565
  /**
12551
12566
  * What this device can emit. Empty is a valid and common answer — most
@@ -19160,6 +19175,48 @@ var NcAlarmConfigSchema = object({
19160
19175
  settings: NcAlarmSettingsSchema,
19161
19176
  coverage: array(NcAlarmModeCoverageSchema)
19162
19177
  });
19178
+ /**
19179
+ * ONE rule's demand on ONE camera's clip ring.
19180
+ *
19181
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
19182
+ * camera, so the answer stays a faithful description of the rules and the
19183
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
19184
+ * lives. A camera that appears in no ask is being told **nothing** — which is
19185
+ * a different thing from never having been told, and only the envelope
19186
+ * (`rulesLoaded`) can tell those apart.
19187
+ */
19188
+ var NcClipRetentionAskSchema = object({
19189
+ /**
19190
+ * The camera this ask is about. **Absent = every camera**, which is what a
19191
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
19192
+ * asking everywhere.
19193
+ */
19194
+ deviceId: number().int().nonnegative().optional(),
19195
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
19196
+ * needs nothing produces no ask at all. */
19197
+ seconds: number().min(0).max(60),
19198
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
19199
+ * assigned, which is what the cut defaults to. */
19200
+ profile: CamProfileSchema.optional(),
19201
+ /** Who is asking — so a retention the operator did not expect names a rule. */
19202
+ ruleId: string(),
19203
+ ruleName: string(),
19204
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
19205
+ reason: _enum(["window", "occupancy"])
19206
+ });
19207
+ /**
19208
+ * The whole answer, with the one bit that keeps absence from reading as zero.
19209
+ *
19210
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
19211
+ * once. A centre that is up but has not read its rules yet answers with an
19212
+ * empty ask list that means nothing at all — applying it would drop every
19213
+ * camera's ring to zero for the first events after a restart, which is the
19214
+ * footage this mechanism exists to keep.
19215
+ */
19216
+ var NcClipRetentionPlanSchema = object({
19217
+ rulesLoaded: boolean(),
19218
+ asks: array(NcClipRetentionAskSchema).readonly()
19219
+ });
19163
19220
  method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
19164
19221
  kind: "mutation",
19165
19222
  auth: "admin",
@@ -19180,7 +19237,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
19180
19237
  }), object({ success: literal(true) }), {
19181
19238
  kind: "mutation",
19182
19239
  auth: "admin"
19183
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
19240
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
19184
19241
  deviceId: number().int(),
19185
19242
  muted: boolean()
19186
19243
  }), object({ success: literal(true) }), {
@@ -20365,13 +20422,26 @@ var TrackAudioLabelSchema = object({
20365
20422
  * - `audio` — an audio event on the camera itself that was anomalous for
20366
20423
  * THAT camera, loud, and heard while nothing visual was happening (D62).
20367
20424
  *
20425
+ * - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
20426
+ * that frame's pixel space. A real root detector and a SPATIAL one: its
20427
+ * boxes are the same kind of fact `pipeline`'s are, produced by a different
20428
+ * detector.
20429
+ *
20430
+ * `onboard` was missing here while `DetectionSourceSchema` already had it, so
20431
+ * a persisted onboard track failed `safeParse` on read and came back with NO
20432
+ * source at all — which `isSpatialTrack` then admitted by accident, through the
20433
+ * `undefined` arm rather than by anybody's decision, and which `excludeSources`
20434
+ * could not name.
20435
+ *
20368
20436
  * The spatial subsystems (tracker association, occupancy count, re-id /
20369
20437
  * embedding, resurrection) MUST skip every synthetic source. Test for that
20370
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
20371
- * check silently readmits every source added after it was written.
20438
+ * with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
20439
+ * `!== 'sensor'` check silently readmits every source added after it was
20440
+ * written.
20372
20441
  */
20373
20442
  var TrackSourceSchema = _enum([
20374
20443
  "pipeline",
20444
+ "onboard",
20375
20445
  "sensor",
20376
20446
  "audio"
20377
20447
  ]);
@@ -21754,6 +21824,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
21754
21824
  * solid is this track", cheaper than re-deriving it from a trajectory. */
21755
21825
  framesMatched: number().int()
21756
21826
  })).readonly() });
21827
+ /**
21828
+ * The long-term series a camera produces. A closed union so a typo cannot
21829
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21830
+ * is an alias of this, not a second list.
21831
+ */
21832
+ var AnalyticsLtsSeriesSchema = _enum([
21833
+ "motion",
21834
+ "audio-dbfs",
21835
+ "battery",
21836
+ "occupancy"
21837
+ ]);
21838
+ /**
21839
+ * One closed 5-minute bucket of a long-term series.
21840
+ *
21841
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21842
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21843
+ * that exists at all was measured; a bucket that is absent was not, which is a
21844
+ * different claim from zero and the reason this is a sparse series.
21845
+ */
21846
+ var LtsBucketSchema = object({
21847
+ scope: string(),
21848
+ bucketStart: number().int(),
21849
+ samples: number().int().nonnegative(),
21850
+ sum: number(),
21851
+ min: number(),
21852
+ max: number()
21853
+ });
21757
21854
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
21758
21855
  deviceId: number(),
21759
21856
  trackId: string()
@@ -21800,6 +21897,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21800
21897
  kinds: array(string()).optional(),
21801
21898
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
21802
21899
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
21900
+ deviceId: number(),
21901
+ series: AnalyticsLtsSeriesSchema,
21902
+ /** Omit for EVERY scope of this series in the range. */
21903
+ scope: string().optional(),
21904
+ from: number(),
21905
+ to: number(),
21906
+ limit: number().int().positive().optional()
21907
+ }), array(LtsBucketSchema).readonly()), method(object({
21803
21908
  deviceId: number(),
21804
21909
  since: number(),
21805
21910
  until: number(),
@@ -22418,6 +22523,40 @@ var MotionSourceEnum = _enum([
22418
22523
  */
22419
22524
  var MotionSourcesSchema = array(MotionSourceEnum);
22420
22525
  /**
22526
+ * Which root detector a camera runs — EXACTLY ONE.
22527
+ *
22528
+ * Deliberately the SAME vocabulary post-analysis already tags every detection
22529
+ * with (`DetectionSource`) rather than a second spelling of the same two
22530
+ * ideas: the value an operator picks here is the value that comes back on the
22531
+ * track, the overlay and the debug row.
22532
+ *
22533
+ * ## Why one, and why it is still an array
22534
+ *
22535
+ * Two roots on one camera is a capability nobody asked for and the operator has
22536
+ * since ruled out. It was never free: both planes feed the SAME per-device
22537
+ * stationary registry, both can promote the same parked object, and the two
22538
+ * detectors disagree about the same box by construction — which is the
22539
+ * disagreement D505 had to arbitrate. Removing the case removes the arbitration.
22540
+ *
22541
+ * The ARRAY shape survives because the stored settings and the attach payload
22542
+ * already speak it on every camera of every fleet, and a cap input that
22543
+ * suddenly refuses a stored value makes the camera un-attachable — a fail-closed
22544
+ * in the one direction that costs an operator their cameras. So the wire stays
22545
+ * tolerant and the TYPE is exact: a longer list is truncated to its first
22546
+ * element rather than refused, and `max(1)` is what every consumer can then
22547
+ * rely on.
22548
+ *
22549
+ * AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
22550
+ * a camera an operator left with no root detector — and `planDetectionSources`
22551
+ * has always said so: inventing a root for them is how a default acts without
22552
+ * anybody choosing it. Tightening this to `length(1)` broke that, and the
22553
+ * suite caught it.
22554
+ *
22555
+ * Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
22556
+ * `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
22557
+ */
22558
+ var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
22559
+ /**
22421
22560
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
22422
22561
  * so cap-side consumers (the orchestrator forward, the runner addon's
22423
22562
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -22568,6 +22707,35 @@ var RunnerCameraConfigSchema = object({
22568
22707
  * events; the orchestrator forwards to `reportMotion`.
22569
22708
  */
22570
22709
  motionSources: MotionSourcesSchema.default(["analyzer"]),
22710
+ /**
22711
+ * WHICH root detector runs for this camera. The detection counterpart of
22712
+ * {@link motionSources}, same shape and same discipline: a per-camera list
22713
+ * of sources the system understands, vendor-agnostic, owned here.
22714
+ *
22715
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
22716
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
22717
+ * here. Its boxes reach post-analysis on the same
22718
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
22719
+ * track gets the same tracker, the same overlay and the same detail
22720
+ * subtree (face / plate / embedding).
22721
+ *
22722
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
22723
+ * run, and that is where a camera with a usable onboard detector buys back
22724
+ * its share of the accelerator. It saves the root inference, not the decode
22725
+ * — the detail subtree still needs pixels to cut crops from.
22726
+ *
22727
+ * A camera whose onboard detections carry no geometry cannot serve as a root
22728
+ * step at all (there is nothing to track), and the cap that knows this says
22729
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
22730
+ * every battery camera: the boxes ride a sub-stream a battery camera never
22731
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
22732
+ * worth exactly what it already is — a wake signal with a class.
22733
+ *
22734
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
22735
+ * vendor never turns a detector on for the operator, and neither does a
22736
+ * default.
22737
+ */
22738
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
22571
22739
  pipelineEnabled: boolean().default(true),
22572
22740
  /** Ordered tree of video steps. Absent → runner skips video detection. */
22573
22741
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -22749,7 +22917,47 @@ var RunnerLocalMetricsSchema = object({
22749
22917
  queueDepth: number(),
22750
22918
  frameLazy: FrameLazyMetricsSchema.optional()
22751
22919
  });
22920
+ /**
22921
+ * Pipeline Runner capability — runtime detection workhorse.
22922
+ *
22923
+ * One instance per node. Receives camera assignments from
22924
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22925
+ * decoded frames, drains motion + detection queues, calls the local
22926
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22927
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22928
+ * the bus.
22929
+ *
22930
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22931
+ * runner has zero knowledge of other agents, no global state, and never
22932
+ * makes assignment decisions itself.
22933
+ */
22934
+ /**
22935
+ * Why a runner declined to look at a camera out of band. Named rather than a
22936
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22937
+ * already mid-session and one already bursting are four different facts, and a
22938
+ * caller told only "no" cannot tell a protection from a bug.
22939
+ */
22940
+ var OccupancyBurstRefusalSchema = _enum([
22941
+ "not-attached",
22942
+ "battery-asleep",
22943
+ "not-watching",
22944
+ "already-bursting"
22945
+ ]);
22752
22946
  method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly()), method(object({
22947
+ deviceId: number(),
22948
+ /** How many frames to collect. The caller sizes this against what its
22949
+ * own confirmation needs; the runner clamps it to the field's range. */
22950
+ frames: number().int().positive().optional(),
22951
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22952
+ * defend — the periodic one at least has a timer to point at. */
22953
+ reason: string()
22954
+ }), object({
22955
+ started: boolean(),
22956
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22957
+ }), {
22958
+ auth: "admin",
22959
+ kind: "mutation"
22960
+ }), method(object({
22753
22961
  handle: FrameHandleSchema,
22754
22962
  bbox: NativeCropBboxSchema,
22755
22963
  maxWidth: number().int().positive().optional(),
@@ -29579,11 +29787,46 @@ var NativeObjectDetectionStatusSchema = object({
29579
29787
  supportedClasses: array(NativeObjectClassEnum).readonly(),
29580
29788
  /**
29581
29789
  * Whether forwarding of onboard AI detections is enabled for this device.
29582
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
29583
- * churn the tracker, so forwarding stays off until the operator enables it.
29790
+ *
29791
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
29792
+ * camera runs — that is the operator's choice, and it is made where every
29793
+ * other detection choice is made. `geometry` on
29794
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
29795
+ * choice would buy this particular camera.
29584
29796
  */
29585
29797
  enabled: boolean()
29586
29798
  });
29799
+ /**
29800
+ * WHEN a camera's onboard detections carry geometry.
29801
+ *
29802
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
29803
+ * a detection is a trackable subject whenever the camera sees one.
29804
+ * - `while-streaming` — only while some stream of this camera is already open.
29805
+ * The boxes ride the video's own side-channel rather than a feed of their
29806
+ * own, so they cost nothing and they exist only when something is pulling.
29807
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
29808
+ * radio drain, but a camera that is awake is awake precisely because
29809
+ * something is in front of it, and its stream is already being pulled.
29810
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
29811
+ * pipeline needs geometry to make a subject, so such a push reaches the
29812
+ * tracker as motion and no further.
29813
+ *
29814
+ * Reported and not inferred, because the operator's question in front of the
29815
+ * picker is "what do I get", and these are three different answers (D14: the
29816
+ * derived form is only as honest as `getOptions`).
29817
+ */
29818
+ var NativeObjectGeometryEnum = _enum([
29819
+ "boxed",
29820
+ "while-streaming",
29821
+ "flag-only"
29822
+ ]);
29823
+ var NativeObjectDetectionOptionsSchema = object({
29824
+ /** Classes this firmware can detect — the same list the status reports. */
29825
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
29826
+ /** What a detection from this camera carries. */
29827
+ geometry: NativeObjectGeometryEnum
29828
+ });
29829
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
29587
29830
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
29588
29831
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
29589
29832
  lastFetchedAt: number() });
@@ -29593,13 +29836,23 @@ var nativeObjectDetectionCapability = {
29593
29836
  deviceNative: true,
29594
29837
  mode: "singleton",
29595
29838
  deviceTypes: [DeviceType.Camera],
29596
- methods: { setEnabled: method(object({
29597
- deviceId: number(),
29598
- enabled: boolean()
29599
- }), _void(), {
29600
- kind: "mutation",
29601
- auth: "admin"
29602
- }) },
29839
+ methods: {
29840
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
29841
+ setSettings: method(object({
29842
+ deviceId: number(),
29843
+ settings: NativeObjectDetectionSettingsPatchSchema
29844
+ }), _void(), {
29845
+ kind: "mutation",
29846
+ auth: "admin"
29847
+ }),
29848
+ setEnabled: method(object({
29849
+ deviceId: number(),
29850
+ enabled: boolean()
29851
+ }), _void(), {
29852
+ kind: "mutation",
29853
+ auth: "admin"
29854
+ })
29855
+ },
29603
29856
  events: { onDetected: { data: object({
29604
29857
  deviceId: number(),
29605
29858
  detection: NativeDetectionSchema
@@ -34447,7 +34700,28 @@ var PerScopeBreakdownSchema = object({
34447
34700
  /** Total tracked objects in this scope (frame / zone / unzoned). */
34448
34701
  totalObjects: number().int().nonnegative(),
34449
34702
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
34450
- byClass: record(string(), number().int().nonnegative())
34703
+ byClass: record(string(), number().int().nonnegative()),
34704
+ /**
34705
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
34706
+ * present but not going anywhere (a parked car, a bin, a statue).
34707
+ *
34708
+ * The operator's question about a scene has two halves and they answer
34709
+ * different things: "what is parked here" is stable for hours and must not
34710
+ * flap, while "who is walking through" is the thing an alert is about. One
34711
+ * number could only serve one of them, and `totalObjects` served the first
34712
+ * badly — a passer-by moved it and every occupancy rule saw a change.
34713
+ *
34714
+ * `standing + transient === totalObjects`, always. The total keeps its old
34715
+ * meaning exactly, so no rule written against it changes behaviour.
34716
+ *
34717
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
34718
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
34719
+ * parked objects here" about a camera whose lot is full.
34720
+ */
34721
+ standingObjects: number().int().nonnegative().optional(),
34722
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
34723
+ * same absence rule. */
34724
+ transientObjects: number().int().nonnegative().optional()
34451
34725
  });
34452
34726
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
34453
34727
  zoneId: string(),
@@ -34570,6 +34844,23 @@ var HistoryPointSchema = object({
34570
34844
  * triple covers the three spatial scopes (per-zone, frame-wide,
34571
34845
  * outside-any-zone). Crossing them with `className?` gives the full
34572
34846
  * combinatorial coverage the operator UI requested.
34847
+ *
34848
+ * ## ⚠️ The three history methods are DEPRECATED
34849
+ *
34850
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
34851
+ * so after a restart they report nothing about a night that did happen, and any
34852
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
34853
+ * an empty scene. The presets in the occupancy chart existed to hide that
34854
+ * horizon rather than to answer a question.
34855
+ *
34856
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
34857
+ * instead. Those rows are already written for every camera, ~60 bytes per
34858
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
34859
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
34860
+ * function the writer uses, so the two cannot drift.
34861
+ *
34862
+ * The ring stays until these three go, and it is the only thing left reading
34863
+ * it. Do not add a fourth caller.
34573
34864
  */
34574
34865
  var zoneAnalyticsCapability = {
34575
34866
  name: "zone-analytics",
@@ -38969,12 +39260,24 @@ Object.freeze({
38969
39260
  addonId: null,
38970
39261
  access: "create"
38971
39262
  },
39263
+ "nativeObjectDetection.getOptions": {
39264
+ capName: "native-object-detection",
39265
+ capScope: "device",
39266
+ addonId: null,
39267
+ access: "view"
39268
+ },
38972
39269
  "nativeObjectDetection.setEnabled": {
38973
39270
  capName: "native-object-detection",
38974
39271
  capScope: "device",
38975
39272
  addonId: null,
38976
39273
  access: "create"
38977
39274
  },
39275
+ "nativeObjectDetection.setSettings": {
39276
+ capName: "native-object-detection",
39277
+ capScope: "device",
39278
+ addonId: null,
39279
+ access: "create"
39280
+ },
38978
39281
  "navigation.getFeatures": {
38979
39282
  capName: "navigation",
38980
39283
  capScope: "device",
@@ -39239,6 +39542,12 @@ Object.freeze({
39239
39542
  addonId: null,
39240
39543
  access: "view"
39241
39544
  },
39545
+ "notificationRules.getClipRetentionAsks": {
39546
+ capName: "notification-rules",
39547
+ capScope: "system",
39548
+ addonId: null,
39549
+ access: "view"
39550
+ },
39242
39551
  "notificationRules.getConditionCatalog": {
39243
39552
  capName: "notification-rules",
39244
39553
  capScope: "system",
@@ -39749,6 +40058,12 @@ Object.freeze({
39749
40058
  addonId: null,
39750
40059
  access: "create"
39751
40060
  },
40061
+ "pipelineAnalytics.readLongTermSeries": {
40062
+ capName: "pipeline-analytics",
40063
+ capScope: "device",
40064
+ addonId: null,
40065
+ access: "view"
40066
+ },
39752
40067
  "pipelineAnalytics.rebuildObjectEmbeddings": {
39753
40068
  capName: "pipeline-analytics",
39754
40069
  capScope: "device",
@@ -40421,6 +40736,12 @@ Object.freeze({
40421
40736
  addonId: null,
40422
40737
  access: "create"
40423
40738
  },
40739
+ "pipelineRunner.requestOccupancyBurst": {
40740
+ capName: "pipeline-runner",
40741
+ capScope: "system",
40742
+ addonId: null,
40743
+ access: "create"
40744
+ },
40424
40745
  "pipelineRunner.runDetailSubtree": {
40425
40746
  capName: "pipeline-runner",
40426
40747
  capScope: "system",
@@ -43201,11 +43522,21 @@ Object.freeze({
43201
43522
  form: "single",
43202
43523
  optional: false
43203
43524
  }],
43525
+ "nativeObjectDetection.getOptions": [{
43526
+ name: "deviceId",
43527
+ form: "single",
43528
+ optional: false
43529
+ }],
43204
43530
  "nativeObjectDetection.setEnabled": [{
43205
43531
  name: "deviceId",
43206
43532
  form: "single",
43207
43533
  optional: false
43208
43534
  }],
43535
+ "nativeObjectDetection.setSettings": [{
43536
+ name: "deviceId",
43537
+ form: "single",
43538
+ optional: false
43539
+ }],
43209
43540
  "navigation.getFeatures": [{
43210
43541
  name: "deviceId",
43211
43542
  form: "single",
@@ -43555,6 +43886,11 @@ Object.freeze({
43555
43886
  form: "single",
43556
43887
  optional: false
43557
43888
  }],
43889
+ "pipelineAnalytics.readLongTermSeries": [{
43890
+ name: "deviceId",
43891
+ form: "single",
43892
+ optional: false
43893
+ }],
43558
43894
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
43559
43895
  name: "deviceId",
43560
43896
  form: "single",
@@ -43745,6 +44081,11 @@ Object.freeze({
43745
44081
  form: "single",
43746
44082
  optional: false
43747
44083
  }],
44084
+ "pipelineRunner.requestOccupancyBurst": [{
44085
+ name: "deviceId",
44086
+ form: "single",
44087
+ optional: false
44088
+ }],
43748
44089
  "pipelineRunner.runDetailSubtree": [{
43749
44090
  name: "deviceId",
43750
44091
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-rademacher",
3
- "version": "0.2.101",
3
+ "version": "0.2.103",
4
4
  "description": "Rademacher HomePilot device-provider addon for CamStack — wraps the @apocaliss92/noderademacher local-hub client (roller shutters over the cover cap)",
5
5
  "keywords": [
6
6
  "camstack",
@@ -63,7 +63,7 @@
63
63
  "dev": "vite build --watch",
64
64
  "typecheck": "tsc --noEmit",
65
65
  "test": "vitest run",
66
- "publish": "npm publish --access public"
66
+ "publish:npm": "npm publish --access public"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@apocaliss92/noderademacher": "0.1.0",