@camstack/addon-provider-velux 0.2.102 → 0.2.104

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
@@ -5360,7 +5360,7 @@ var ZodIssueCode = {
5360
5360
  var ZodFirstPartyTypeKind;
5361
5361
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5362
5362
  //#endregion
5363
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5363
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5364
5364
  /**
5365
5365
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5366
5366
  * window to float samples (D455).
@@ -11562,6 +11562,21 @@ var streamSignalsCapability = {
11562
11562
  mode: "singleton",
11563
11563
  deviceTypes: Object.values(DeviceType),
11564
11564
  runtimeState: StreamSignalsStatusSchema,
11565
+ /**
11566
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11567
+ *
11568
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11569
+ * not an operator choice: the provider re-declares it on every registration,
11570
+ * so losing it loses nothing and persisting it would freeze an answer the
11571
+ * camera is entitled to change. Measured the same day on the sibling case —
11572
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11573
+ * class the camera really detected stayed missing for the life of the row
11574
+ * because the fix could not reach it.
11575
+ *
11576
+ * See `RuntimeStateDurability`. Enforced by
11577
+ * `scripts/check-runtime-state-durability.ts`.
11578
+ */
11579
+ durability: "session",
11565
11580
  methods: {
11566
11581
  /**
11567
11582
  * What this device can emit. Empty is a valid and common answer — most
@@ -18176,6 +18191,48 @@ var NcAlarmConfigSchema = object({
18176
18191
  settings: NcAlarmSettingsSchema,
18177
18192
  coverage: array(NcAlarmModeCoverageSchema)
18178
18193
  });
18194
+ /**
18195
+ * ONE rule's demand on ONE camera's clip ring.
18196
+ *
18197
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18198
+ * camera, so the answer stays a faithful description of the rules and the
18199
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18200
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18201
+ * a different thing from never having been told, and only the envelope
18202
+ * (`rulesLoaded`) can tell those apart.
18203
+ */
18204
+ var NcClipRetentionAskSchema = object({
18205
+ /**
18206
+ * The camera this ask is about. **Absent = every camera**, which is what a
18207
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18208
+ * asking everywhere.
18209
+ */
18210
+ deviceId: number().int().nonnegative().optional(),
18211
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18212
+ * needs nothing produces no ask at all. */
18213
+ seconds: number().min(0).max(60),
18214
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18215
+ * assigned, which is what the cut defaults to. */
18216
+ profile: CamProfileSchema.optional(),
18217
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18218
+ ruleId: string(),
18219
+ ruleName: string(),
18220
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18221
+ reason: _enum(["window", "occupancy"])
18222
+ });
18223
+ /**
18224
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18225
+ *
18226
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18227
+ * once. A centre that is up but has not read its rules yet answers with an
18228
+ * empty ask list that means nothing at all — applying it would drop every
18229
+ * camera's ring to zero for the first events after a restart, which is the
18230
+ * footage this mechanism exists to keep.
18231
+ */
18232
+ var NcClipRetentionPlanSchema = object({
18233
+ rulesLoaded: boolean(),
18234
+ asks: array(NcClipRetentionAskSchema).readonly()
18235
+ });
18179
18236
  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 }), {
18180
18237
  kind: "mutation",
18181
18238
  auth: "admin",
@@ -18196,7 +18253,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18196
18253
  }), object({ success: literal(true) }), {
18197
18254
  kind: "mutation",
18198
18255
  auth: "admin"
18199
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18256
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18200
18257
  deviceId: number().int(),
18201
18258
  muted: boolean()
18202
18259
  }), object({ success: literal(true) }), {
@@ -19381,13 +19438,26 @@ var TrackAudioLabelSchema = object({
19381
19438
  * - `audio` — an audio event on the camera itself that was anomalous for
19382
19439
  * THAT camera, loud, and heard while nothing visual was happening (D62).
19383
19440
  *
19441
+ * - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
19442
+ * that frame's pixel space. A real root detector and a SPATIAL one: its
19443
+ * boxes are the same kind of fact `pipeline`'s are, produced by a different
19444
+ * detector.
19445
+ *
19446
+ * `onboard` was missing here while `DetectionSourceSchema` already had it, so
19447
+ * a persisted onboard track failed `safeParse` on read and came back with NO
19448
+ * source at all — which `isSpatialTrack` then admitted by accident, through the
19449
+ * `undefined` arm rather than by anybody's decision, and which `excludeSources`
19450
+ * could not name.
19451
+ *
19384
19452
  * The spatial subsystems (tracker association, occupancy count, re-id /
19385
19453
  * embedding, resurrection) MUST skip every synthetic source. Test for that
19386
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
19387
- * check silently readmits every source added after it was written.
19454
+ * with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
19455
+ * `!== 'sensor'` check silently readmits every source added after it was
19456
+ * written.
19388
19457
  */
19389
19458
  var TrackSourceSchema = _enum([
19390
19459
  "pipeline",
19460
+ "onboard",
19391
19461
  "sensor",
19392
19462
  "audio"
19393
19463
  ]);
@@ -20770,6 +20840,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20770
20840
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20771
20841
  framesMatched: number().int()
20772
20842
  })).readonly() });
20843
+ /**
20844
+ * The long-term series a camera produces. A closed union so a typo cannot
20845
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20846
+ * is an alias of this, not a second list.
20847
+ */
20848
+ var AnalyticsLtsSeriesSchema = _enum([
20849
+ "motion",
20850
+ "audio-dbfs",
20851
+ "battery",
20852
+ "occupancy"
20853
+ ]);
20854
+ /**
20855
+ * One closed 5-minute bucket of a long-term series.
20856
+ *
20857
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20858
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20859
+ * that exists at all was measured; a bucket that is absent was not, which is a
20860
+ * different claim from zero and the reason this is a sparse series.
20861
+ */
20862
+ var LtsBucketSchema = object({
20863
+ scope: string(),
20864
+ bucketStart: number().int(),
20865
+ samples: number().int().nonnegative(),
20866
+ sum: number(),
20867
+ min: number(),
20868
+ max: number()
20869
+ });
20773
20870
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20774
20871
  deviceId: number(),
20775
20872
  trackId: string()
@@ -20816,6 +20913,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20816
20913
  kinds: array(string()).optional(),
20817
20914
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20818
20915
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20916
+ deviceId: number(),
20917
+ series: AnalyticsLtsSeriesSchema,
20918
+ /** Omit for EVERY scope of this series in the range. */
20919
+ scope: string().optional(),
20920
+ from: number(),
20921
+ to: number(),
20922
+ limit: number().int().positive().optional()
20923
+ }), array(LtsBucketSchema).readonly()), method(object({
20819
20924
  deviceId: number(),
20820
20925
  since: number(),
20821
20926
  until: number(),
@@ -21434,6 +21539,40 @@ var MotionSourceEnum = _enum([
21434
21539
  */
21435
21540
  var MotionSourcesSchema = array(MotionSourceEnum);
21436
21541
  /**
21542
+ * Which root detector a camera runs — EXACTLY ONE.
21543
+ *
21544
+ * Deliberately the SAME vocabulary post-analysis already tags every detection
21545
+ * with (`DetectionSource`) rather than a second spelling of the same two
21546
+ * ideas: the value an operator picks here is the value that comes back on the
21547
+ * track, the overlay and the debug row.
21548
+ *
21549
+ * ## Why one, and why it is still an array
21550
+ *
21551
+ * Two roots on one camera is a capability nobody asked for and the operator has
21552
+ * since ruled out. It was never free: both planes feed the SAME per-device
21553
+ * stationary registry, both can promote the same parked object, and the two
21554
+ * detectors disagree about the same box by construction — which is the
21555
+ * disagreement D505 had to arbitrate. Removing the case removes the arbitration.
21556
+ *
21557
+ * The ARRAY shape survives because the stored settings and the attach payload
21558
+ * already speak it on every camera of every fleet, and a cap input that
21559
+ * suddenly refuses a stored value makes the camera un-attachable — a fail-closed
21560
+ * in the one direction that costs an operator their cameras. So the wire stays
21561
+ * tolerant and the TYPE is exact: a longer list is truncated to its first
21562
+ * element rather than refused, and `max(1)` is what every consumer can then
21563
+ * rely on.
21564
+ *
21565
+ * AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
21566
+ * a camera an operator left with no root detector — and `planDetectionSources`
21567
+ * has always said so: inventing a root for them is how a default acts without
21568
+ * anybody choosing it. Tightening this to `length(1)` broke that, and the
21569
+ * suite caught it.
21570
+ *
21571
+ * Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
21572
+ * `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
21573
+ */
21574
+ var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
21575
+ /**
21437
21576
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21438
21577
  * so cap-side consumers (the orchestrator forward, the runner addon's
21439
21578
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21584,6 +21723,35 @@ var RunnerCameraConfigSchema = object({
21584
21723
  * events; the orchestrator forwards to `reportMotion`.
21585
21724
  */
21586
21725
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21726
+ /**
21727
+ * WHICH root detector runs for this camera. The detection counterpart of
21728
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21729
+ * of sources the system understands, vendor-agnostic, owned here.
21730
+ *
21731
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21732
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21733
+ * here. Its boxes reach post-analysis on the same
21734
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21735
+ * track gets the same tracker, the same overlay and the same detail
21736
+ * subtree (face / plate / embedding).
21737
+ *
21738
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21739
+ * run, and that is where a camera with a usable onboard detector buys back
21740
+ * its share of the accelerator. It saves the root inference, not the decode
21741
+ * — the detail subtree still needs pixels to cut crops from.
21742
+ *
21743
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21744
+ * step at all (there is nothing to track), and the cap that knows this says
21745
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21746
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21747
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21748
+ * worth exactly what it already is — a wake signal with a class.
21749
+ *
21750
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21751
+ * vendor never turns a detector on for the operator, and neither does a
21752
+ * default.
21753
+ */
21754
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21587
21755
  pipelineEnabled: boolean().default(true),
21588
21756
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21589
21757
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21765,7 +21933,47 @@ var RunnerLocalMetricsSchema = object({
21765
21933
  queueDepth: number(),
21766
21934
  frameLazy: FrameLazyMetricsSchema.optional()
21767
21935
  });
21936
+ /**
21937
+ * Pipeline Runner capability — runtime detection workhorse.
21938
+ *
21939
+ * One instance per node. Receives camera assignments from
21940
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21941
+ * decoded frames, drains motion + detection queues, calls the local
21942
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21943
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21944
+ * the bus.
21945
+ *
21946
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21947
+ * runner has zero knowledge of other agents, no global state, and never
21948
+ * makes assignment decisions itself.
21949
+ */
21950
+ /**
21951
+ * Why a runner declined to look at a camera out of band. Named rather than a
21952
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21953
+ * already mid-session and one already bursting are four different facts, and a
21954
+ * caller told only "no" cannot tell a protection from a bug.
21955
+ */
21956
+ var OccupancyBurstRefusalSchema = _enum([
21957
+ "not-attached",
21958
+ "battery-asleep",
21959
+ "not-watching",
21960
+ "already-bursting"
21961
+ ]);
21768
21962
  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({
21963
+ deviceId: number(),
21964
+ /** How many frames to collect. The caller sizes this against what its
21965
+ * own confirmation needs; the runner clamps it to the field's range. */
21966
+ frames: number().int().positive().optional(),
21967
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21968
+ * defend — the periodic one at least has a timer to point at. */
21969
+ reason: string()
21970
+ }), object({
21971
+ started: boolean(),
21972
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21973
+ }), {
21974
+ auth: "admin",
21975
+ kind: "mutation"
21976
+ }), method(object({
21769
21977
  handle: FrameHandleSchema,
21770
21978
  bbox: NativeCropBboxSchema,
21771
21979
  maxWidth: number().int().positive().optional(),
@@ -28595,11 +28803,46 @@ var NativeObjectDetectionStatusSchema = object({
28595
28803
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28596
28804
  /**
28597
28805
  * Whether forwarding of onboard AI detections is enabled for this device.
28598
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28599
- * churn the tracker, so forwarding stays off until the operator enables it.
28806
+ *
28807
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28808
+ * camera runs — that is the operator's choice, and it is made where every
28809
+ * other detection choice is made. `geometry` on
28810
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28811
+ * choice would buy this particular camera.
28600
28812
  */
28601
28813
  enabled: boolean()
28602
28814
  });
28815
+ /**
28816
+ * WHEN a camera's onboard detections carry geometry.
28817
+ *
28818
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28819
+ * a detection is a trackable subject whenever the camera sees one.
28820
+ * - `while-streaming` — only while some stream of this camera is already open.
28821
+ * The boxes ride the video's own side-channel rather than a feed of their
28822
+ * own, so they cost nothing and they exist only when something is pulling.
28823
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28824
+ * radio drain, but a camera that is awake is awake precisely because
28825
+ * something is in front of it, and its stream is already being pulled.
28826
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28827
+ * pipeline needs geometry to make a subject, so such a push reaches the
28828
+ * tracker as motion and no further.
28829
+ *
28830
+ * Reported and not inferred, because the operator's question in front of the
28831
+ * picker is "what do I get", and these are three different answers (D14: the
28832
+ * derived form is only as honest as `getOptions`).
28833
+ */
28834
+ var NativeObjectGeometryEnum = _enum([
28835
+ "boxed",
28836
+ "while-streaming",
28837
+ "flag-only"
28838
+ ]);
28839
+ var NativeObjectDetectionOptionsSchema = object({
28840
+ /** Classes this firmware can detect — the same list the status reports. */
28841
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28842
+ /** What a detection from this camera carries. */
28843
+ geometry: NativeObjectGeometryEnum
28844
+ });
28845
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28603
28846
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28604
28847
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28605
28848
  lastFetchedAt: number() });
@@ -28609,13 +28852,23 @@ var nativeObjectDetectionCapability = {
28609
28852
  deviceNative: true,
28610
28853
  mode: "singleton",
28611
28854
  deviceTypes: [DeviceType.Camera],
28612
- methods: { setEnabled: method(object({
28613
- deviceId: number(),
28614
- enabled: boolean()
28615
- }), _void(), {
28616
- kind: "mutation",
28617
- auth: "admin"
28618
- }) },
28855
+ methods: {
28856
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28857
+ setSettings: method(object({
28858
+ deviceId: number(),
28859
+ settings: NativeObjectDetectionSettingsPatchSchema
28860
+ }), _void(), {
28861
+ kind: "mutation",
28862
+ auth: "admin"
28863
+ }),
28864
+ setEnabled: method(object({
28865
+ deviceId: number(),
28866
+ enabled: boolean()
28867
+ }), _void(), {
28868
+ kind: "mutation",
28869
+ auth: "admin"
28870
+ })
28871
+ },
28619
28872
  events: { onDetected: { data: object({
28620
28873
  deviceId: number(),
28621
28874
  detection: NativeDetectionSchema
@@ -33463,7 +33716,28 @@ var PerScopeBreakdownSchema = object({
33463
33716
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33464
33717
  totalObjects: number().int().nonnegative(),
33465
33718
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33466
- byClass: record(string(), number().int().nonnegative())
33719
+ byClass: record(string(), number().int().nonnegative()),
33720
+ /**
33721
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33722
+ * present but not going anywhere (a parked car, a bin, a statue).
33723
+ *
33724
+ * The operator's question about a scene has two halves and they answer
33725
+ * different things: "what is parked here" is stable for hours and must not
33726
+ * flap, while "who is walking through" is the thing an alert is about. One
33727
+ * number could only serve one of them, and `totalObjects` served the first
33728
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33729
+ *
33730
+ * `standing + transient === totalObjects`, always. The total keeps its old
33731
+ * meaning exactly, so no rule written against it changes behaviour.
33732
+ *
33733
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33734
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33735
+ * parked objects here" about a camera whose lot is full.
33736
+ */
33737
+ standingObjects: number().int().nonnegative().optional(),
33738
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33739
+ * same absence rule. */
33740
+ transientObjects: number().int().nonnegative().optional()
33467
33741
  });
33468
33742
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33469
33743
  zoneId: string(),
@@ -33586,6 +33860,23 @@ var HistoryPointSchema = object({
33586
33860
  * triple covers the three spatial scopes (per-zone, frame-wide,
33587
33861
  * outside-any-zone). Crossing them with `className?` gives the full
33588
33862
  * combinatorial coverage the operator UI requested.
33863
+ *
33864
+ * ## ⚠️ The three history methods are DEPRECATED
33865
+ *
33866
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33867
+ * so after a restart they report nothing about a night that did happen, and any
33868
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33869
+ * an empty scene. The presets in the occupancy chart existed to hide that
33870
+ * horizon rather than to answer a question.
33871
+ *
33872
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33873
+ * instead. Those rows are already written for every camera, ~60 bytes per
33874
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33875
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33876
+ * function the writer uses, so the two cannot drift.
33877
+ *
33878
+ * The ring stays until these three go, and it is the only thing left reading
33879
+ * it. Do not add a fourth caller.
33589
33880
  */
33590
33881
  var zoneAnalyticsCapability = {
33591
33882
  name: "zone-analytics",
@@ -37985,12 +38276,24 @@ Object.freeze({
37985
38276
  addonId: null,
37986
38277
  access: "create"
37987
38278
  },
38279
+ "nativeObjectDetection.getOptions": {
38280
+ capName: "native-object-detection",
38281
+ capScope: "device",
38282
+ addonId: null,
38283
+ access: "view"
38284
+ },
37988
38285
  "nativeObjectDetection.setEnabled": {
37989
38286
  capName: "native-object-detection",
37990
38287
  capScope: "device",
37991
38288
  addonId: null,
37992
38289
  access: "create"
37993
38290
  },
38291
+ "nativeObjectDetection.setSettings": {
38292
+ capName: "native-object-detection",
38293
+ capScope: "device",
38294
+ addonId: null,
38295
+ access: "create"
38296
+ },
37994
38297
  "navigation.getFeatures": {
37995
38298
  capName: "navigation",
37996
38299
  capScope: "device",
@@ -38255,6 +38558,12 @@ Object.freeze({
38255
38558
  addonId: null,
38256
38559
  access: "view"
38257
38560
  },
38561
+ "notificationRules.getClipRetentionAsks": {
38562
+ capName: "notification-rules",
38563
+ capScope: "system",
38564
+ addonId: null,
38565
+ access: "view"
38566
+ },
38258
38567
  "notificationRules.getConditionCatalog": {
38259
38568
  capName: "notification-rules",
38260
38569
  capScope: "system",
@@ -38765,6 +39074,12 @@ Object.freeze({
38765
39074
  addonId: null,
38766
39075
  access: "create"
38767
39076
  },
39077
+ "pipelineAnalytics.readLongTermSeries": {
39078
+ capName: "pipeline-analytics",
39079
+ capScope: "device",
39080
+ addonId: null,
39081
+ access: "view"
39082
+ },
38768
39083
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38769
39084
  capName: "pipeline-analytics",
38770
39085
  capScope: "device",
@@ -39437,6 +39752,12 @@ Object.freeze({
39437
39752
  addonId: null,
39438
39753
  access: "create"
39439
39754
  },
39755
+ "pipelineRunner.requestOccupancyBurst": {
39756
+ capName: "pipeline-runner",
39757
+ capScope: "system",
39758
+ addonId: null,
39759
+ access: "create"
39760
+ },
39440
39761
  "pipelineRunner.runDetailSubtree": {
39441
39762
  capName: "pipeline-runner",
39442
39763
  capScope: "system",
@@ -42217,11 +42538,21 @@ Object.freeze({
42217
42538
  form: "single",
42218
42539
  optional: false
42219
42540
  }],
42541
+ "nativeObjectDetection.getOptions": [{
42542
+ name: "deviceId",
42543
+ form: "single",
42544
+ optional: false
42545
+ }],
42220
42546
  "nativeObjectDetection.setEnabled": [{
42221
42547
  name: "deviceId",
42222
42548
  form: "single",
42223
42549
  optional: false
42224
42550
  }],
42551
+ "nativeObjectDetection.setSettings": [{
42552
+ name: "deviceId",
42553
+ form: "single",
42554
+ optional: false
42555
+ }],
42225
42556
  "navigation.getFeatures": [{
42226
42557
  name: "deviceId",
42227
42558
  form: "single",
@@ -42571,6 +42902,11 @@ Object.freeze({
42571
42902
  form: "single",
42572
42903
  optional: false
42573
42904
  }],
42905
+ "pipelineAnalytics.readLongTermSeries": [{
42906
+ name: "deviceId",
42907
+ form: "single",
42908
+ optional: false
42909
+ }],
42574
42910
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42575
42911
  name: "deviceId",
42576
42912
  form: "single",
@@ -42761,6 +43097,11 @@ Object.freeze({
42761
43097
  form: "single",
42762
43098
  optional: false
42763
43099
  }],
43100
+ "pipelineRunner.requestOccupancyBurst": [{
43101
+ name: "deviceId",
43102
+ form: "single",
43103
+ optional: false
43104
+ }],
42764
43105
  "pipelineRunner.runDetailSubtree": [{
42765
43106
  name: "deviceId",
42766
43107
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5359,7 +5359,7 @@ var ZodIssueCode = {
5359
5359
  var ZodFirstPartyTypeKind;
5360
5360
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5361
5361
  //#endregion
5362
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5362
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5363
5363
  /**
5364
5364
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5365
5365
  * window to float samples (D455).
@@ -11561,6 +11561,21 @@ var streamSignalsCapability = {
11561
11561
  mode: "singleton",
11562
11562
  deviceTypes: Object.values(DeviceType),
11563
11563
  runtimeState: StreamSignalsStatusSchema,
11564
+ /**
11565
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11566
+ *
11567
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11568
+ * not an operator choice: the provider re-declares it on every registration,
11569
+ * so losing it loses nothing and persisting it would freeze an answer the
11570
+ * camera is entitled to change. Measured the same day on the sibling case —
11571
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11572
+ * class the camera really detected stayed missing for the life of the row
11573
+ * because the fix could not reach it.
11574
+ *
11575
+ * See `RuntimeStateDurability`. Enforced by
11576
+ * `scripts/check-runtime-state-durability.ts`.
11577
+ */
11578
+ durability: "session",
11564
11579
  methods: {
11565
11580
  /**
11566
11581
  * What this device can emit. Empty is a valid and common answer — most
@@ -18175,6 +18190,48 @@ var NcAlarmConfigSchema = object({
18175
18190
  settings: NcAlarmSettingsSchema,
18176
18191
  coverage: array(NcAlarmModeCoverageSchema)
18177
18192
  });
18193
+ /**
18194
+ * ONE rule's demand on ONE camera's clip ring.
18195
+ *
18196
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18197
+ * camera, so the answer stays a faithful description of the rules and the
18198
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18199
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18200
+ * a different thing from never having been told, and only the envelope
18201
+ * (`rulesLoaded`) can tell those apart.
18202
+ */
18203
+ var NcClipRetentionAskSchema = object({
18204
+ /**
18205
+ * The camera this ask is about. **Absent = every camera**, which is what a
18206
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18207
+ * asking everywhere.
18208
+ */
18209
+ deviceId: number().int().nonnegative().optional(),
18210
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18211
+ * needs nothing produces no ask at all. */
18212
+ seconds: number().min(0).max(60),
18213
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18214
+ * assigned, which is what the cut defaults to. */
18215
+ profile: CamProfileSchema.optional(),
18216
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18217
+ ruleId: string(),
18218
+ ruleName: string(),
18219
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18220
+ reason: _enum(["window", "occupancy"])
18221
+ });
18222
+ /**
18223
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18224
+ *
18225
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18226
+ * once. A centre that is up but has not read its rules yet answers with an
18227
+ * empty ask list that means nothing at all — applying it would drop every
18228
+ * camera's ring to zero for the first events after a restart, which is the
18229
+ * footage this mechanism exists to keep.
18230
+ */
18231
+ var NcClipRetentionPlanSchema = object({
18232
+ rulesLoaded: boolean(),
18233
+ asks: array(NcClipRetentionAskSchema).readonly()
18234
+ });
18178
18235
  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 }), {
18179
18236
  kind: "mutation",
18180
18237
  auth: "admin",
@@ -18195,7 +18252,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18195
18252
  }), object({ success: literal(true) }), {
18196
18253
  kind: "mutation",
18197
18254
  auth: "admin"
18198
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18255
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18199
18256
  deviceId: number().int(),
18200
18257
  muted: boolean()
18201
18258
  }), object({ success: literal(true) }), {
@@ -19380,13 +19437,26 @@ var TrackAudioLabelSchema = object({
19380
19437
  * - `audio` — an audio event on the camera itself that was anomalous for
19381
19438
  * THAT camera, loud, and heard while nothing visual was happening (D62).
19382
19439
  *
19440
+ * - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
19441
+ * that frame's pixel space. A real root detector and a SPATIAL one: its
19442
+ * boxes are the same kind of fact `pipeline`'s are, produced by a different
19443
+ * detector.
19444
+ *
19445
+ * `onboard` was missing here while `DetectionSourceSchema` already had it, so
19446
+ * a persisted onboard track failed `safeParse` on read and came back with NO
19447
+ * source at all — which `isSpatialTrack` then admitted by accident, through the
19448
+ * `undefined` arm rather than by anybody's decision, and which `excludeSources`
19449
+ * could not name.
19450
+ *
19383
19451
  * The spatial subsystems (tracker association, occupancy count, re-id /
19384
19452
  * embedding, resurrection) MUST skip every synthetic source. Test for that
19385
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
19386
- * check silently readmits every source added after it was written.
19453
+ * with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
19454
+ * `!== 'sensor'` check silently readmits every source added after it was
19455
+ * written.
19387
19456
  */
19388
19457
  var TrackSourceSchema = _enum([
19389
19458
  "pipeline",
19459
+ "onboard",
19390
19460
  "sensor",
19391
19461
  "audio"
19392
19462
  ]);
@@ -20769,6 +20839,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20769
20839
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20770
20840
  framesMatched: number().int()
20771
20841
  })).readonly() });
20842
+ /**
20843
+ * The long-term series a camera produces. A closed union so a typo cannot
20844
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20845
+ * is an alias of this, not a second list.
20846
+ */
20847
+ var AnalyticsLtsSeriesSchema = _enum([
20848
+ "motion",
20849
+ "audio-dbfs",
20850
+ "battery",
20851
+ "occupancy"
20852
+ ]);
20853
+ /**
20854
+ * One closed 5-minute bucket of a long-term series.
20855
+ *
20856
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20857
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20858
+ * that exists at all was measured; a bucket that is absent was not, which is a
20859
+ * different claim from zero and the reason this is a sparse series.
20860
+ */
20861
+ var LtsBucketSchema = object({
20862
+ scope: string(),
20863
+ bucketStart: number().int(),
20864
+ samples: number().int().nonnegative(),
20865
+ sum: number(),
20866
+ min: number(),
20867
+ max: number()
20868
+ });
20772
20869
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20773
20870
  deviceId: number(),
20774
20871
  trackId: string()
@@ -20815,6 +20912,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20815
20912
  kinds: array(string()).optional(),
20816
20913
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20817
20914
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20915
+ deviceId: number(),
20916
+ series: AnalyticsLtsSeriesSchema,
20917
+ /** Omit for EVERY scope of this series in the range. */
20918
+ scope: string().optional(),
20919
+ from: number(),
20920
+ to: number(),
20921
+ limit: number().int().positive().optional()
20922
+ }), array(LtsBucketSchema).readonly()), method(object({
20818
20923
  deviceId: number(),
20819
20924
  since: number(),
20820
20925
  until: number(),
@@ -21433,6 +21538,40 @@ var MotionSourceEnum = _enum([
21433
21538
  */
21434
21539
  var MotionSourcesSchema = array(MotionSourceEnum);
21435
21540
  /**
21541
+ * Which root detector a camera runs — EXACTLY ONE.
21542
+ *
21543
+ * Deliberately the SAME vocabulary post-analysis already tags every detection
21544
+ * with (`DetectionSource`) rather than a second spelling of the same two
21545
+ * ideas: the value an operator picks here is the value that comes back on the
21546
+ * track, the overlay and the debug row.
21547
+ *
21548
+ * ## Why one, and why it is still an array
21549
+ *
21550
+ * Two roots on one camera is a capability nobody asked for and the operator has
21551
+ * since ruled out. It was never free: both planes feed the SAME per-device
21552
+ * stationary registry, both can promote the same parked object, and the two
21553
+ * detectors disagree about the same box by construction — which is the
21554
+ * disagreement D505 had to arbitrate. Removing the case removes the arbitration.
21555
+ *
21556
+ * The ARRAY shape survives because the stored settings and the attach payload
21557
+ * already speak it on every camera of every fleet, and a cap input that
21558
+ * suddenly refuses a stored value makes the camera un-attachable — a fail-closed
21559
+ * in the one direction that costs an operator their cameras. So the wire stays
21560
+ * tolerant and the TYPE is exact: a longer list is truncated to its first
21561
+ * element rather than refused, and `max(1)` is what every consumer can then
21562
+ * rely on.
21563
+ *
21564
+ * AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
21565
+ * a camera an operator left with no root detector — and `planDetectionSources`
21566
+ * has always said so: inventing a root for them is how a default acts without
21567
+ * anybody choosing it. Tightening this to `length(1)` broke that, and the
21568
+ * suite caught it.
21569
+ *
21570
+ * Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
21571
+ * `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
21572
+ */
21573
+ var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
21574
+ /**
21436
21575
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21437
21576
  * so cap-side consumers (the orchestrator forward, the runner addon's
21438
21577
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21583,6 +21722,35 @@ var RunnerCameraConfigSchema = object({
21583
21722
  * events; the orchestrator forwards to `reportMotion`.
21584
21723
  */
21585
21724
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21725
+ /**
21726
+ * WHICH root detector runs for this camera. The detection counterpart of
21727
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21728
+ * of sources the system understands, vendor-agnostic, owned here.
21729
+ *
21730
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21731
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21732
+ * here. Its boxes reach post-analysis on the same
21733
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21734
+ * track gets the same tracker, the same overlay and the same detail
21735
+ * subtree (face / plate / embedding).
21736
+ *
21737
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21738
+ * run, and that is where a camera with a usable onboard detector buys back
21739
+ * its share of the accelerator. It saves the root inference, not the decode
21740
+ * — the detail subtree still needs pixels to cut crops from.
21741
+ *
21742
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21743
+ * step at all (there is nothing to track), and the cap that knows this says
21744
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21745
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21746
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21747
+ * worth exactly what it already is — a wake signal with a class.
21748
+ *
21749
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21750
+ * vendor never turns a detector on for the operator, and neither does a
21751
+ * default.
21752
+ */
21753
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21586
21754
  pipelineEnabled: boolean().default(true),
21587
21755
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21588
21756
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21764,7 +21932,47 @@ var RunnerLocalMetricsSchema = object({
21764
21932
  queueDepth: number(),
21765
21933
  frameLazy: FrameLazyMetricsSchema.optional()
21766
21934
  });
21935
+ /**
21936
+ * Pipeline Runner capability — runtime detection workhorse.
21937
+ *
21938
+ * One instance per node. Receives camera assignments from
21939
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21940
+ * decoded frames, drains motion + detection queues, calls the local
21941
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21942
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21943
+ * the bus.
21944
+ *
21945
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21946
+ * runner has zero knowledge of other agents, no global state, and never
21947
+ * makes assignment decisions itself.
21948
+ */
21949
+ /**
21950
+ * Why a runner declined to look at a camera out of band. Named rather than a
21951
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21952
+ * already mid-session and one already bursting are four different facts, and a
21953
+ * caller told only "no" cannot tell a protection from a bug.
21954
+ */
21955
+ var OccupancyBurstRefusalSchema = _enum([
21956
+ "not-attached",
21957
+ "battery-asleep",
21958
+ "not-watching",
21959
+ "already-bursting"
21960
+ ]);
21767
21961
  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({
21962
+ deviceId: number(),
21963
+ /** How many frames to collect. The caller sizes this against what its
21964
+ * own confirmation needs; the runner clamps it to the field's range. */
21965
+ frames: number().int().positive().optional(),
21966
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21967
+ * defend — the periodic one at least has a timer to point at. */
21968
+ reason: string()
21969
+ }), object({
21970
+ started: boolean(),
21971
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21972
+ }), {
21973
+ auth: "admin",
21974
+ kind: "mutation"
21975
+ }), method(object({
21768
21976
  handle: FrameHandleSchema,
21769
21977
  bbox: NativeCropBboxSchema,
21770
21978
  maxWidth: number().int().positive().optional(),
@@ -28594,11 +28802,46 @@ var NativeObjectDetectionStatusSchema = object({
28594
28802
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28595
28803
  /**
28596
28804
  * Whether forwarding of onboard AI detections is enabled for this device.
28597
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28598
- * churn the tracker, so forwarding stays off until the operator enables it.
28805
+ *
28806
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28807
+ * camera runs — that is the operator's choice, and it is made where every
28808
+ * other detection choice is made. `geometry` on
28809
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28810
+ * choice would buy this particular camera.
28599
28811
  */
28600
28812
  enabled: boolean()
28601
28813
  });
28814
+ /**
28815
+ * WHEN a camera's onboard detections carry geometry.
28816
+ *
28817
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28818
+ * a detection is a trackable subject whenever the camera sees one.
28819
+ * - `while-streaming` — only while some stream of this camera is already open.
28820
+ * The boxes ride the video's own side-channel rather than a feed of their
28821
+ * own, so they cost nothing and they exist only when something is pulling.
28822
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28823
+ * radio drain, but a camera that is awake is awake precisely because
28824
+ * something is in front of it, and its stream is already being pulled.
28825
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28826
+ * pipeline needs geometry to make a subject, so such a push reaches the
28827
+ * tracker as motion and no further.
28828
+ *
28829
+ * Reported and not inferred, because the operator's question in front of the
28830
+ * picker is "what do I get", and these are three different answers (D14: the
28831
+ * derived form is only as honest as `getOptions`).
28832
+ */
28833
+ var NativeObjectGeometryEnum = _enum([
28834
+ "boxed",
28835
+ "while-streaming",
28836
+ "flag-only"
28837
+ ]);
28838
+ var NativeObjectDetectionOptionsSchema = object({
28839
+ /** Classes this firmware can detect — the same list the status reports. */
28840
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28841
+ /** What a detection from this camera carries. */
28842
+ geometry: NativeObjectGeometryEnum
28843
+ });
28844
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28602
28845
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28603
28846
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28604
28847
  lastFetchedAt: number() });
@@ -28608,13 +28851,23 @@ var nativeObjectDetectionCapability = {
28608
28851
  deviceNative: true,
28609
28852
  mode: "singleton",
28610
28853
  deviceTypes: [DeviceType.Camera],
28611
- methods: { setEnabled: method(object({
28612
- deviceId: number(),
28613
- enabled: boolean()
28614
- }), _void(), {
28615
- kind: "mutation",
28616
- auth: "admin"
28617
- }) },
28854
+ methods: {
28855
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28856
+ setSettings: method(object({
28857
+ deviceId: number(),
28858
+ settings: NativeObjectDetectionSettingsPatchSchema
28859
+ }), _void(), {
28860
+ kind: "mutation",
28861
+ auth: "admin"
28862
+ }),
28863
+ setEnabled: method(object({
28864
+ deviceId: number(),
28865
+ enabled: boolean()
28866
+ }), _void(), {
28867
+ kind: "mutation",
28868
+ auth: "admin"
28869
+ })
28870
+ },
28618
28871
  events: { onDetected: { data: object({
28619
28872
  deviceId: number(),
28620
28873
  detection: NativeDetectionSchema
@@ -33462,7 +33715,28 @@ var PerScopeBreakdownSchema = object({
33462
33715
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33463
33716
  totalObjects: number().int().nonnegative(),
33464
33717
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33465
- byClass: record(string(), number().int().nonnegative())
33718
+ byClass: record(string(), number().int().nonnegative()),
33719
+ /**
33720
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33721
+ * present but not going anywhere (a parked car, a bin, a statue).
33722
+ *
33723
+ * The operator's question about a scene has two halves and they answer
33724
+ * different things: "what is parked here" is stable for hours and must not
33725
+ * flap, while "who is walking through" is the thing an alert is about. One
33726
+ * number could only serve one of them, and `totalObjects` served the first
33727
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33728
+ *
33729
+ * `standing + transient === totalObjects`, always. The total keeps its old
33730
+ * meaning exactly, so no rule written against it changes behaviour.
33731
+ *
33732
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33733
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33734
+ * parked objects here" about a camera whose lot is full.
33735
+ */
33736
+ standingObjects: number().int().nonnegative().optional(),
33737
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33738
+ * same absence rule. */
33739
+ transientObjects: number().int().nonnegative().optional()
33466
33740
  });
33467
33741
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33468
33742
  zoneId: string(),
@@ -33585,6 +33859,23 @@ var HistoryPointSchema = object({
33585
33859
  * triple covers the three spatial scopes (per-zone, frame-wide,
33586
33860
  * outside-any-zone). Crossing them with `className?` gives the full
33587
33861
  * combinatorial coverage the operator UI requested.
33862
+ *
33863
+ * ## ⚠️ The three history methods are DEPRECATED
33864
+ *
33865
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33866
+ * so after a restart they report nothing about a night that did happen, and any
33867
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33868
+ * an empty scene. The presets in the occupancy chart existed to hide that
33869
+ * horizon rather than to answer a question.
33870
+ *
33871
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33872
+ * instead. Those rows are already written for every camera, ~60 bytes per
33873
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33874
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33875
+ * function the writer uses, so the two cannot drift.
33876
+ *
33877
+ * The ring stays until these three go, and it is the only thing left reading
33878
+ * it. Do not add a fourth caller.
33588
33879
  */
33589
33880
  var zoneAnalyticsCapability = {
33590
33881
  name: "zone-analytics",
@@ -37984,12 +38275,24 @@ Object.freeze({
37984
38275
  addonId: null,
37985
38276
  access: "create"
37986
38277
  },
38278
+ "nativeObjectDetection.getOptions": {
38279
+ capName: "native-object-detection",
38280
+ capScope: "device",
38281
+ addonId: null,
38282
+ access: "view"
38283
+ },
37987
38284
  "nativeObjectDetection.setEnabled": {
37988
38285
  capName: "native-object-detection",
37989
38286
  capScope: "device",
37990
38287
  addonId: null,
37991
38288
  access: "create"
37992
38289
  },
38290
+ "nativeObjectDetection.setSettings": {
38291
+ capName: "native-object-detection",
38292
+ capScope: "device",
38293
+ addonId: null,
38294
+ access: "create"
38295
+ },
37993
38296
  "navigation.getFeatures": {
37994
38297
  capName: "navigation",
37995
38298
  capScope: "device",
@@ -38254,6 +38557,12 @@ Object.freeze({
38254
38557
  addonId: null,
38255
38558
  access: "view"
38256
38559
  },
38560
+ "notificationRules.getClipRetentionAsks": {
38561
+ capName: "notification-rules",
38562
+ capScope: "system",
38563
+ addonId: null,
38564
+ access: "view"
38565
+ },
38257
38566
  "notificationRules.getConditionCatalog": {
38258
38567
  capName: "notification-rules",
38259
38568
  capScope: "system",
@@ -38764,6 +39073,12 @@ Object.freeze({
38764
39073
  addonId: null,
38765
39074
  access: "create"
38766
39075
  },
39076
+ "pipelineAnalytics.readLongTermSeries": {
39077
+ capName: "pipeline-analytics",
39078
+ capScope: "device",
39079
+ addonId: null,
39080
+ access: "view"
39081
+ },
38767
39082
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38768
39083
  capName: "pipeline-analytics",
38769
39084
  capScope: "device",
@@ -39436,6 +39751,12 @@ Object.freeze({
39436
39751
  addonId: null,
39437
39752
  access: "create"
39438
39753
  },
39754
+ "pipelineRunner.requestOccupancyBurst": {
39755
+ capName: "pipeline-runner",
39756
+ capScope: "system",
39757
+ addonId: null,
39758
+ access: "create"
39759
+ },
39439
39760
  "pipelineRunner.runDetailSubtree": {
39440
39761
  capName: "pipeline-runner",
39441
39762
  capScope: "system",
@@ -42216,11 +42537,21 @@ Object.freeze({
42216
42537
  form: "single",
42217
42538
  optional: false
42218
42539
  }],
42540
+ "nativeObjectDetection.getOptions": [{
42541
+ name: "deviceId",
42542
+ form: "single",
42543
+ optional: false
42544
+ }],
42219
42545
  "nativeObjectDetection.setEnabled": [{
42220
42546
  name: "deviceId",
42221
42547
  form: "single",
42222
42548
  optional: false
42223
42549
  }],
42550
+ "nativeObjectDetection.setSettings": [{
42551
+ name: "deviceId",
42552
+ form: "single",
42553
+ optional: false
42554
+ }],
42224
42555
  "navigation.getFeatures": [{
42225
42556
  name: "deviceId",
42226
42557
  form: "single",
@@ -42570,6 +42901,11 @@ Object.freeze({
42570
42901
  form: "single",
42571
42902
  optional: false
42572
42903
  }],
42904
+ "pipelineAnalytics.readLongTermSeries": [{
42905
+ name: "deviceId",
42906
+ form: "single",
42907
+ optional: false
42908
+ }],
42573
42909
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42574
42910
  name: "deviceId",
42575
42911
  form: "single",
@@ -42760,6 +43096,11 @@ Object.freeze({
42760
43096
  form: "single",
42761
43097
  optional: false
42762
43098
  }],
43099
+ "pipelineRunner.requestOccupancyBurst": [{
43100
+ name: "deviceId",
43101
+ form: "single",
43102
+ optional: false
43103
+ }],
42763
43104
  "pipelineRunner.runDetailSubtree": [{
42764
43105
  name: "deviceId",
42765
43106
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-velux",
3
- "version": "0.2.102",
3
+ "version": "0.2.104",
4
4
  "description": "Velux KLF-200 device-provider addon for CamStack — local-gateway window + shutter covers (positional, no tilt)",
5
5
  "keywords": [
6
6
  "camstack",
@@ -62,7 +62,7 @@
62
62
  "dev": "vite build --watch",
63
63
  "typecheck": "tsc --noEmit",
64
64
  "test": "vitest run",
65
- "publish": "npm publish --access public"
65
+ "publish:npm": "npm publish --access public"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@camstack/types": "*",