@camstack/addon-matter-broker 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
@@ -5374,7 +5374,7 @@ var ZodIssueCode = {
5374
5374
  var ZodFirstPartyTypeKind;
5375
5375
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5376
5376
  //#endregion
5377
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5377
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5378
5378
  /**
5379
5379
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5380
5380
  * window to float samples (D455).
@@ -11625,6 +11625,21 @@ var streamSignalsCapability = {
11625
11625
  mode: "singleton",
11626
11626
  deviceTypes: Object.values(DeviceType),
11627
11627
  runtimeState: StreamSignalsStatusSchema,
11628
+ /**
11629
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11630
+ *
11631
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11632
+ * not an operator choice: the provider re-declares it on every registration,
11633
+ * so losing it loses nothing and persisting it would freeze an answer the
11634
+ * camera is entitled to change. Measured the same day on the sibling case —
11635
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11636
+ * class the camera really detected stayed missing for the life of the row
11637
+ * because the fix could not reach it.
11638
+ *
11639
+ * See `RuntimeStateDurability`. Enforced by
11640
+ * `scripts/check-runtime-state-durability.ts`.
11641
+ */
11642
+ durability: "session",
11628
11643
  methods: {
11629
11644
  /**
11630
11645
  * What this device can emit. Empty is a valid and common answer — most
@@ -18256,6 +18271,48 @@ var NcAlarmConfigSchema = object({
18256
18271
  settings: NcAlarmSettingsSchema,
18257
18272
  coverage: array(NcAlarmModeCoverageSchema)
18258
18273
  });
18274
+ /**
18275
+ * ONE rule's demand on ONE camera's clip ring.
18276
+ *
18277
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18278
+ * camera, so the answer stays a faithful description of the rules and the
18279
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18280
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18281
+ * a different thing from never having been told, and only the envelope
18282
+ * (`rulesLoaded`) can tell those apart.
18283
+ */
18284
+ var NcClipRetentionAskSchema = object({
18285
+ /**
18286
+ * The camera this ask is about. **Absent = every camera**, which is what a
18287
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18288
+ * asking everywhere.
18289
+ */
18290
+ deviceId: number().int().nonnegative().optional(),
18291
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18292
+ * needs nothing produces no ask at all. */
18293
+ seconds: number().min(0).max(60),
18294
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18295
+ * assigned, which is what the cut defaults to. */
18296
+ profile: CamProfileSchema.optional(),
18297
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18298
+ ruleId: string$2(),
18299
+ ruleName: string$2(),
18300
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18301
+ reason: _enum(["window", "occupancy"])
18302
+ });
18303
+ /**
18304
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18305
+ *
18306
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18307
+ * once. A centre that is up but has not read its rules yet answers with an
18308
+ * empty ask list that means nothing at all — applying it would drop every
18309
+ * camera's ring to zero for the first events after a restart, which is the
18310
+ * footage this mechanism exists to keep.
18311
+ */
18312
+ var NcClipRetentionPlanSchema = object({
18313
+ rulesLoaded: boolean(),
18314
+ asks: array(NcClipRetentionAskSchema).readonly()
18315
+ });
18259
18316
  method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string$2() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
18260
18317
  kind: "mutation",
18261
18318
  auth: "admin",
@@ -18276,7 +18333,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18276
18333
  }), object({ success: literal(true) }), {
18277
18334
  kind: "mutation",
18278
18335
  auth: "admin"
18279
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18336
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18280
18337
  deviceId: number().int(),
18281
18338
  muted: boolean()
18282
18339
  }), object({ success: literal(true) }), {
@@ -19461,13 +19518,26 @@ var TrackAudioLabelSchema = object({
19461
19518
  * - `audio` — an audio event on the camera itself that was anomalous for
19462
19519
  * THAT camera, loud, and heard while nothing visual was happening (D62).
19463
19520
  *
19521
+ * - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
19522
+ * that frame's pixel space. A real root detector and a SPATIAL one: its
19523
+ * boxes are the same kind of fact `pipeline`'s are, produced by a different
19524
+ * detector.
19525
+ *
19526
+ * `onboard` was missing here while `DetectionSourceSchema` already had it, so
19527
+ * a persisted onboard track failed `safeParse` on read and came back with NO
19528
+ * source at all — which `isSpatialTrack` then admitted by accident, through the
19529
+ * `undefined` arm rather than by anybody's decision, and which `excludeSources`
19530
+ * could not name.
19531
+ *
19464
19532
  * The spatial subsystems (tracker association, occupancy count, re-id /
19465
19533
  * embedding, resurrection) MUST skip every synthetic source. Test for that
19466
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
19467
- * check silently readmits every source added after it was written.
19534
+ * with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
19535
+ * `!== 'sensor'` check silently readmits every source added after it was
19536
+ * written.
19468
19537
  */
19469
19538
  var TrackSourceSchema = _enum([
19470
19539
  "pipeline",
19540
+ "onboard",
19471
19541
  "sensor",
19472
19542
  "audio"
19473
19543
  ]);
@@ -20850,6 +20920,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20850
20920
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20851
20921
  framesMatched: number().int()
20852
20922
  })).readonly() });
20923
+ /**
20924
+ * The long-term series a camera produces. A closed union so a typo cannot
20925
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20926
+ * is an alias of this, not a second list.
20927
+ */
20928
+ var AnalyticsLtsSeriesSchema = _enum([
20929
+ "motion",
20930
+ "audio-dbfs",
20931
+ "battery",
20932
+ "occupancy"
20933
+ ]);
20934
+ /**
20935
+ * One closed 5-minute bucket of a long-term series.
20936
+ *
20937
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20938
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20939
+ * that exists at all was measured; a bucket that is absent was not, which is a
20940
+ * different claim from zero and the reason this is a sparse series.
20941
+ */
20942
+ var LtsBucketSchema = object({
20943
+ scope: string$2(),
20944
+ bucketStart: number().int(),
20945
+ samples: number().int().nonnegative(),
20946
+ sum: number(),
20947
+ min: number(),
20948
+ max: number()
20949
+ });
20853
20950
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20854
20951
  deviceId: number(),
20855
20952
  trackId: string$2()
@@ -20896,6 +20993,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20896
20993
  kinds: array(string$2()).optional(),
20897
20994
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20898
20995
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20996
+ deviceId: number(),
20997
+ series: AnalyticsLtsSeriesSchema,
20998
+ /** Omit for EVERY scope of this series in the range. */
20999
+ scope: string$2().optional(),
21000
+ from: number(),
21001
+ to: number(),
21002
+ limit: number().int().positive().optional()
21003
+ }), array(LtsBucketSchema).readonly()), method(object({
20899
21004
  deviceId: number(),
20900
21005
  since: number(),
20901
21006
  until: number(),
@@ -21514,6 +21619,40 @@ var MotionSourceEnum = _enum([
21514
21619
  */
21515
21620
  var MotionSourcesSchema = array(MotionSourceEnum);
21516
21621
  /**
21622
+ * Which root detector a camera runs — EXACTLY ONE.
21623
+ *
21624
+ * Deliberately the SAME vocabulary post-analysis already tags every detection
21625
+ * with (`DetectionSource`) rather than a second spelling of the same two
21626
+ * ideas: the value an operator picks here is the value that comes back on the
21627
+ * track, the overlay and the debug row.
21628
+ *
21629
+ * ## Why one, and why it is still an array
21630
+ *
21631
+ * Two roots on one camera is a capability nobody asked for and the operator has
21632
+ * since ruled out. It was never free: both planes feed the SAME per-device
21633
+ * stationary registry, both can promote the same parked object, and the two
21634
+ * detectors disagree about the same box by construction — which is the
21635
+ * disagreement D505 had to arbitrate. Removing the case removes the arbitration.
21636
+ *
21637
+ * The ARRAY shape survives because the stored settings and the attach payload
21638
+ * already speak it on every camera of every fleet, and a cap input that
21639
+ * suddenly refuses a stored value makes the camera un-attachable — a fail-closed
21640
+ * in the one direction that costs an operator their cameras. So the wire stays
21641
+ * tolerant and the TYPE is exact: a longer list is truncated to its first
21642
+ * element rather than refused, and `max(1)` is what every consumer can then
21643
+ * rely on.
21644
+ *
21645
+ * AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
21646
+ * a camera an operator left with no root detector — and `planDetectionSources`
21647
+ * has always said so: inventing a root for them is how a default acts without
21648
+ * anybody choosing it. Tightening this to `length(1)` broke that, and the
21649
+ * suite caught it.
21650
+ *
21651
+ * Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
21652
+ * `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
21653
+ */
21654
+ var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
21655
+ /**
21517
21656
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21518
21657
  * so cap-side consumers (the orchestrator forward, the runner addon's
21519
21658
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21664,6 +21803,35 @@ var RunnerCameraConfigSchema = object({
21664
21803
  * events; the orchestrator forwards to `reportMotion`.
21665
21804
  */
21666
21805
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21806
+ /**
21807
+ * WHICH root detector runs for this camera. The detection counterpart of
21808
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21809
+ * of sources the system understands, vendor-agnostic, owned here.
21810
+ *
21811
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21812
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21813
+ * here. Its boxes reach post-analysis on the same
21814
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21815
+ * track gets the same tracker, the same overlay and the same detail
21816
+ * subtree (face / plate / embedding).
21817
+ *
21818
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21819
+ * run, and that is where a camera with a usable onboard detector buys back
21820
+ * its share of the accelerator. It saves the root inference, not the decode
21821
+ * — the detail subtree still needs pixels to cut crops from.
21822
+ *
21823
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21824
+ * step at all (there is nothing to track), and the cap that knows this says
21825
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21826
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21827
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21828
+ * worth exactly what it already is — a wake signal with a class.
21829
+ *
21830
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21831
+ * vendor never turns a detector on for the operator, and neither does a
21832
+ * default.
21833
+ */
21834
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21667
21835
  pipelineEnabled: boolean().default(true),
21668
21836
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21669
21837
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21845,7 +22013,47 @@ var RunnerLocalMetricsSchema = object({
21845
22013
  queueDepth: number(),
21846
22014
  frameLazy: FrameLazyMetricsSchema.optional()
21847
22015
  });
22016
+ /**
22017
+ * Pipeline Runner capability — runtime detection workhorse.
22018
+ *
22019
+ * One instance per node. Receives camera assignments from
22020
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22021
+ * decoded frames, drains motion + detection queues, calls the local
22022
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22023
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22024
+ * the bus.
22025
+ *
22026
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22027
+ * runner has zero knowledge of other agents, no global state, and never
22028
+ * makes assignment decisions itself.
22029
+ */
22030
+ /**
22031
+ * Why a runner declined to look at a camera out of band. Named rather than a
22032
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22033
+ * already mid-session and one already bursting are four different facts, and a
22034
+ * caller told only "no" cannot tell a protection from a bug.
22035
+ */
22036
+ var OccupancyBurstRefusalSchema = _enum([
22037
+ "not-attached",
22038
+ "battery-asleep",
22039
+ "not-watching",
22040
+ "already-bursting"
22041
+ ]);
21848
22042
  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({
22043
+ deviceId: number(),
22044
+ /** How many frames to collect. The caller sizes this against what its
22045
+ * own confirmation needs; the runner clamps it to the field's range. */
22046
+ frames: number().int().positive().optional(),
22047
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22048
+ * defend — the periodic one at least has a timer to point at. */
22049
+ reason: string$2()
22050
+ }), object({
22051
+ started: boolean(),
22052
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22053
+ }), {
22054
+ auth: "admin",
22055
+ kind: "mutation"
22056
+ }), method(object({
21849
22057
  handle: FrameHandleSchema,
21850
22058
  bbox: NativeCropBboxSchema,
21851
22059
  maxWidth: number().int().positive().optional(),
@@ -28692,11 +28900,46 @@ var NativeObjectDetectionStatusSchema = object({
28692
28900
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28693
28901
  /**
28694
28902
  * Whether forwarding of onboard AI detections is enabled for this device.
28695
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28696
- * churn the tracker, so forwarding stays off until the operator enables it.
28903
+ *
28904
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28905
+ * camera runs — that is the operator's choice, and it is made where every
28906
+ * other detection choice is made. `geometry` on
28907
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28908
+ * choice would buy this particular camera.
28697
28909
  */
28698
28910
  enabled: boolean()
28699
28911
  });
28912
+ /**
28913
+ * WHEN a camera's onboard detections carry geometry.
28914
+ *
28915
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28916
+ * a detection is a trackable subject whenever the camera sees one.
28917
+ * - `while-streaming` — only while some stream of this camera is already open.
28918
+ * The boxes ride the video's own side-channel rather than a feed of their
28919
+ * own, so they cost nothing and they exist only when something is pulling.
28920
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28921
+ * radio drain, but a camera that is awake is awake precisely because
28922
+ * something is in front of it, and its stream is already being pulled.
28923
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28924
+ * pipeline needs geometry to make a subject, so such a push reaches the
28925
+ * tracker as motion and no further.
28926
+ *
28927
+ * Reported and not inferred, because the operator's question in front of the
28928
+ * picker is "what do I get", and these are three different answers (D14: the
28929
+ * derived form is only as honest as `getOptions`).
28930
+ */
28931
+ var NativeObjectGeometryEnum = _enum([
28932
+ "boxed",
28933
+ "while-streaming",
28934
+ "flag-only"
28935
+ ]);
28936
+ var NativeObjectDetectionOptionsSchema = object({
28937
+ /** Classes this firmware can detect — the same list the status reports. */
28938
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28939
+ /** What a detection from this camera carries. */
28940
+ geometry: NativeObjectGeometryEnum
28941
+ });
28942
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28700
28943
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28701
28944
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28702
28945
  lastFetchedAt: number() });
@@ -28706,13 +28949,23 @@ var nativeObjectDetectionCapability = {
28706
28949
  deviceNative: true,
28707
28950
  mode: "singleton",
28708
28951
  deviceTypes: [DeviceType.Camera],
28709
- methods: { setEnabled: method(object({
28710
- deviceId: number(),
28711
- enabled: boolean()
28712
- }), _void(), {
28713
- kind: "mutation",
28714
- auth: "admin"
28715
- }) },
28952
+ methods: {
28953
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28954
+ setSettings: method(object({
28955
+ deviceId: number(),
28956
+ settings: NativeObjectDetectionSettingsPatchSchema
28957
+ }), _void(), {
28958
+ kind: "mutation",
28959
+ auth: "admin"
28960
+ }),
28961
+ setEnabled: method(object({
28962
+ deviceId: number(),
28963
+ enabled: boolean()
28964
+ }), _void(), {
28965
+ kind: "mutation",
28966
+ auth: "admin"
28967
+ })
28968
+ },
28716
28969
  events: { onDetected: { data: object({
28717
28970
  deviceId: number(),
28718
28971
  detection: NativeDetectionSchema
@@ -33560,7 +33813,28 @@ var PerScopeBreakdownSchema = object({
33560
33813
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33561
33814
  totalObjects: number().int().nonnegative(),
33562
33815
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33563
- byClass: record(string$2(), number().int().nonnegative())
33816
+ byClass: record(string$2(), number().int().nonnegative()),
33817
+ /**
33818
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33819
+ * present but not going anywhere (a parked car, a bin, a statue).
33820
+ *
33821
+ * The operator's question about a scene has two halves and they answer
33822
+ * different things: "what is parked here" is stable for hours and must not
33823
+ * flap, while "who is walking through" is the thing an alert is about. One
33824
+ * number could only serve one of them, and `totalObjects` served the first
33825
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33826
+ *
33827
+ * `standing + transient === totalObjects`, always. The total keeps its old
33828
+ * meaning exactly, so no rule written against it changes behaviour.
33829
+ *
33830
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33831
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33832
+ * parked objects here" about a camera whose lot is full.
33833
+ */
33834
+ standingObjects: number().int().nonnegative().optional(),
33835
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33836
+ * same absence rule. */
33837
+ transientObjects: number().int().nonnegative().optional()
33564
33838
  });
33565
33839
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33566
33840
  zoneId: string$2(),
@@ -33683,6 +33957,23 @@ var HistoryPointSchema = object({
33683
33957
  * triple covers the three spatial scopes (per-zone, frame-wide,
33684
33958
  * outside-any-zone). Crossing them with `className?` gives the full
33685
33959
  * combinatorial coverage the operator UI requested.
33960
+ *
33961
+ * ## ⚠️ The three history methods are DEPRECATED
33962
+ *
33963
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33964
+ * so after a restart they report nothing about a night that did happen, and any
33965
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33966
+ * an empty scene. The presets in the occupancy chart existed to hide that
33967
+ * horizon rather than to answer a question.
33968
+ *
33969
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33970
+ * instead. Those rows are already written for every camera, ~60 bytes per
33971
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33972
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33973
+ * function the writer uses, so the two cannot drift.
33974
+ *
33975
+ * The ring stays until these three go, and it is the only thing left reading
33976
+ * it. Do not add a fourth caller.
33686
33977
  */
33687
33978
  var zoneAnalyticsCapability = {
33688
33979
  name: "zone-analytics",
@@ -38082,12 +38373,24 @@ Object.freeze({
38082
38373
  addonId: null,
38083
38374
  access: "create"
38084
38375
  },
38376
+ "nativeObjectDetection.getOptions": {
38377
+ capName: "native-object-detection",
38378
+ capScope: "device",
38379
+ addonId: null,
38380
+ access: "view"
38381
+ },
38085
38382
  "nativeObjectDetection.setEnabled": {
38086
38383
  capName: "native-object-detection",
38087
38384
  capScope: "device",
38088
38385
  addonId: null,
38089
38386
  access: "create"
38090
38387
  },
38388
+ "nativeObjectDetection.setSettings": {
38389
+ capName: "native-object-detection",
38390
+ capScope: "device",
38391
+ addonId: null,
38392
+ access: "create"
38393
+ },
38091
38394
  "navigation.getFeatures": {
38092
38395
  capName: "navigation",
38093
38396
  capScope: "device",
@@ -38352,6 +38655,12 @@ Object.freeze({
38352
38655
  addonId: null,
38353
38656
  access: "view"
38354
38657
  },
38658
+ "notificationRules.getClipRetentionAsks": {
38659
+ capName: "notification-rules",
38660
+ capScope: "system",
38661
+ addonId: null,
38662
+ access: "view"
38663
+ },
38355
38664
  "notificationRules.getConditionCatalog": {
38356
38665
  capName: "notification-rules",
38357
38666
  capScope: "system",
@@ -38862,6 +39171,12 @@ Object.freeze({
38862
39171
  addonId: null,
38863
39172
  access: "create"
38864
39173
  },
39174
+ "pipelineAnalytics.readLongTermSeries": {
39175
+ capName: "pipeline-analytics",
39176
+ capScope: "device",
39177
+ addonId: null,
39178
+ access: "view"
39179
+ },
38865
39180
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38866
39181
  capName: "pipeline-analytics",
38867
39182
  capScope: "device",
@@ -39534,6 +39849,12 @@ Object.freeze({
39534
39849
  addonId: null,
39535
39850
  access: "create"
39536
39851
  },
39852
+ "pipelineRunner.requestOccupancyBurst": {
39853
+ capName: "pipeline-runner",
39854
+ capScope: "system",
39855
+ addonId: null,
39856
+ access: "create"
39857
+ },
39537
39858
  "pipelineRunner.runDetailSubtree": {
39538
39859
  capName: "pipeline-runner",
39539
39860
  capScope: "system",
@@ -42314,11 +42635,21 @@ Object.freeze({
42314
42635
  form: "single",
42315
42636
  optional: false
42316
42637
  }],
42638
+ "nativeObjectDetection.getOptions": [{
42639
+ name: "deviceId",
42640
+ form: "single",
42641
+ optional: false
42642
+ }],
42317
42643
  "nativeObjectDetection.setEnabled": [{
42318
42644
  name: "deviceId",
42319
42645
  form: "single",
42320
42646
  optional: false
42321
42647
  }],
42648
+ "nativeObjectDetection.setSettings": [{
42649
+ name: "deviceId",
42650
+ form: "single",
42651
+ optional: false
42652
+ }],
42322
42653
  "navigation.getFeatures": [{
42323
42654
  name: "deviceId",
42324
42655
  form: "single",
@@ -42668,6 +42999,11 @@ Object.freeze({
42668
42999
  form: "single",
42669
43000
  optional: false
42670
43001
  }],
43002
+ "pipelineAnalytics.readLongTermSeries": [{
43003
+ name: "deviceId",
43004
+ form: "single",
43005
+ optional: false
43006
+ }],
42671
43007
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42672
43008
  name: "deviceId",
42673
43009
  form: "single",
@@ -42858,6 +43194,11 @@ Object.freeze({
42858
43194
  form: "single",
42859
43195
  optional: false
42860
43196
  }],
43197
+ "pipelineRunner.requestOccupancyBurst": [{
43198
+ name: "deviceId",
43199
+ form: "single",
43200
+ optional: false
43201
+ }],
42861
43202
  "pipelineRunner.runDetailSubtree": [{
42862
43203
  name: "deviceId",
42863
43204
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5372,7 +5372,7 @@ var ZodIssueCode = {
5372
5372
  var ZodFirstPartyTypeKind;
5373
5373
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5374
5374
  //#endregion
5375
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5375
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5376
5376
  /**
5377
5377
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5378
5378
  * window to float samples (D455).
@@ -11623,6 +11623,21 @@ var streamSignalsCapability = {
11623
11623
  mode: "singleton",
11624
11624
  deviceTypes: Object.values(DeviceType),
11625
11625
  runtimeState: StreamSignalsStatusSchema,
11626
+ /**
11627
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
11628
+ *
11629
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
11630
+ * not an operator choice: the provider re-declares it on every registration,
11631
+ * so losing it loses nothing and persisting it would freeze an answer the
11632
+ * camera is entitled to change. Measured the same day on the sibling case —
11633
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
11634
+ * class the camera really detected stayed missing for the life of the row
11635
+ * because the fix could not reach it.
11636
+ *
11637
+ * See `RuntimeStateDurability`. Enforced by
11638
+ * `scripts/check-runtime-state-durability.ts`.
11639
+ */
11640
+ durability: "session",
11626
11641
  methods: {
11627
11642
  /**
11628
11643
  * What this device can emit. Empty is a valid and common answer — most
@@ -18254,6 +18269,48 @@ var NcAlarmConfigSchema = object({
18254
18269
  settings: NcAlarmSettingsSchema,
18255
18270
  coverage: array(NcAlarmModeCoverageSchema)
18256
18271
  });
18272
+ /**
18273
+ * ONE rule's demand on ONE camera's clip ring.
18274
+ *
18275
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18276
+ * camera, so the answer stays a faithful description of the rules and the
18277
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18278
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18279
+ * a different thing from never having been told, and only the envelope
18280
+ * (`rulesLoaded`) can tell those apart.
18281
+ */
18282
+ var NcClipRetentionAskSchema = object({
18283
+ /**
18284
+ * The camera this ask is about. **Absent = every camera**, which is what a
18285
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18286
+ * asking everywhere.
18287
+ */
18288
+ deviceId: number().int().nonnegative().optional(),
18289
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18290
+ * needs nothing produces no ask at all. */
18291
+ seconds: number().min(0).max(60),
18292
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18293
+ * assigned, which is what the cut defaults to. */
18294
+ profile: CamProfileSchema.optional(),
18295
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18296
+ ruleId: string$2(),
18297
+ ruleName: string$2(),
18298
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18299
+ reason: _enum(["window", "occupancy"])
18300
+ });
18301
+ /**
18302
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18303
+ *
18304
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18305
+ * once. A centre that is up but has not read its rules yet answers with an
18306
+ * empty ask list that means nothing at all — applying it would drop every
18307
+ * camera's ring to zero for the first events after a restart, which is the
18308
+ * footage this mechanism exists to keep.
18309
+ */
18310
+ var NcClipRetentionPlanSchema = object({
18311
+ rulesLoaded: boolean(),
18312
+ asks: array(NcClipRetentionAskSchema).readonly()
18313
+ });
18257
18314
  method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string$2() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
18258
18315
  kind: "mutation",
18259
18316
  auth: "admin",
@@ -18274,7 +18331,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18274
18331
  }), object({ success: literal(true) }), {
18275
18332
  kind: "mutation",
18276
18333
  auth: "admin"
18277
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18334
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18278
18335
  deviceId: number().int(),
18279
18336
  muted: boolean()
18280
18337
  }), object({ success: literal(true) }), {
@@ -19459,13 +19516,26 @@ var TrackAudioLabelSchema = object({
19459
19516
  * - `audio` — an audio event on the camera itself that was anomalous for
19460
19517
  * THAT camera, loud, and heard while nothing visual was happening (D62).
19461
19518
  *
19519
+ * - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
19520
+ * that frame's pixel space. A real root detector and a SPATIAL one: its
19521
+ * boxes are the same kind of fact `pipeline`'s are, produced by a different
19522
+ * detector.
19523
+ *
19524
+ * `onboard` was missing here while `DetectionSourceSchema` already had it, so
19525
+ * a persisted onboard track failed `safeParse` on read and came back with NO
19526
+ * source at all — which `isSpatialTrack` then admitted by accident, through the
19527
+ * `undefined` arm rather than by anybody's decision, and which `excludeSources`
19528
+ * could not name.
19529
+ *
19462
19530
  * The spatial subsystems (tracker association, occupancy count, re-id /
19463
19531
  * embedding, resurrection) MUST skip every synthetic source. Test for that
19464
- * with `isSpatialTrack`, which allow-lists `pipeline` — a `!== 'sensor'`
19465
- * check silently readmits every source added after it was written.
19532
+ * with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
19533
+ * `!== 'sensor'` check silently readmits every source added after it was
19534
+ * written.
19466
19535
  */
19467
19536
  var TrackSourceSchema = _enum([
19468
19537
  "pipeline",
19538
+ "onboard",
19469
19539
  "sensor",
19470
19540
  "audio"
19471
19541
  ]);
@@ -20848,6 +20918,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20848
20918
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20849
20919
  framesMatched: number().int()
20850
20920
  })).readonly() });
20921
+ /**
20922
+ * The long-term series a camera produces. A closed union so a typo cannot
20923
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20924
+ * is an alias of this, not a second list.
20925
+ */
20926
+ var AnalyticsLtsSeriesSchema = _enum([
20927
+ "motion",
20928
+ "audio-dbfs",
20929
+ "battery",
20930
+ "occupancy"
20931
+ ]);
20932
+ /**
20933
+ * One closed 5-minute bucket of a long-term series.
20934
+ *
20935
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20936
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20937
+ * that exists at all was measured; a bucket that is absent was not, which is a
20938
+ * different claim from zero and the reason this is a sparse series.
20939
+ */
20940
+ var LtsBucketSchema = object({
20941
+ scope: string$2(),
20942
+ bucketStart: number().int(),
20943
+ samples: number().int().nonnegative(),
20944
+ sum: number(),
20945
+ min: number(),
20946
+ max: number()
20947
+ });
20851
20948
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20852
20949
  deviceId: number(),
20853
20950
  trackId: string$2()
@@ -20894,6 +20991,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20894
20991
  kinds: array(string$2()).optional(),
20895
20992
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20896
20993
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20994
+ deviceId: number(),
20995
+ series: AnalyticsLtsSeriesSchema,
20996
+ /** Omit for EVERY scope of this series in the range. */
20997
+ scope: string$2().optional(),
20998
+ from: number(),
20999
+ to: number(),
21000
+ limit: number().int().positive().optional()
21001
+ }), array(LtsBucketSchema).readonly()), method(object({
20897
21002
  deviceId: number(),
20898
21003
  since: number(),
20899
21004
  until: number(),
@@ -21512,6 +21617,40 @@ var MotionSourceEnum = _enum([
21512
21617
  */
21513
21618
  var MotionSourcesSchema = array(MotionSourceEnum);
21514
21619
  /**
21620
+ * Which root detector a camera runs — EXACTLY ONE.
21621
+ *
21622
+ * Deliberately the SAME vocabulary post-analysis already tags every detection
21623
+ * with (`DetectionSource`) rather than a second spelling of the same two
21624
+ * ideas: the value an operator picks here is the value that comes back on the
21625
+ * track, the overlay and the debug row.
21626
+ *
21627
+ * ## Why one, and why it is still an array
21628
+ *
21629
+ * Two roots on one camera is a capability nobody asked for and the operator has
21630
+ * since ruled out. It was never free: both planes feed the SAME per-device
21631
+ * stationary registry, both can promote the same parked object, and the two
21632
+ * detectors disagree about the same box by construction — which is the
21633
+ * disagreement D505 had to arbitrate. Removing the case removes the arbitration.
21634
+ *
21635
+ * The ARRAY shape survives because the stored settings and the attach payload
21636
+ * already speak it on every camera of every fleet, and a cap input that
21637
+ * suddenly refuses a stored value makes the camera un-attachable — a fail-closed
21638
+ * in the one direction that costs an operator their cameras. So the wire stays
21639
+ * tolerant and the TYPE is exact: a longer list is truncated to its first
21640
+ * element rather than refused, and `max(1)` is what every consumer can then
21641
+ * rely on.
21642
+ *
21643
+ * AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
21644
+ * a camera an operator left with no root detector — and `planDetectionSources`
21645
+ * has always said so: inventing a root for them is how a default acts without
21646
+ * anybody choosing it. Tightening this to `length(1)` broke that, and the
21647
+ * suite caught it.
21648
+ *
21649
+ * Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
21650
+ * `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
21651
+ */
21652
+ var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
21653
+ /**
21515
21654
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21516
21655
  * so cap-side consumers (the orchestrator forward, the runner addon's
21517
21656
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21662,6 +21801,35 @@ var RunnerCameraConfigSchema = object({
21662
21801
  * events; the orchestrator forwards to `reportMotion`.
21663
21802
  */
21664
21803
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21804
+ /**
21805
+ * WHICH root detector runs for this camera. The detection counterpart of
21806
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21807
+ * of sources the system understands, vendor-agnostic, owned here.
21808
+ *
21809
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21810
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21811
+ * here. Its boxes reach post-analysis on the same
21812
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21813
+ * track gets the same tracker, the same overlay and the same detail
21814
+ * subtree (face / plate / embedding).
21815
+ *
21816
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21817
+ * run, and that is where a camera with a usable onboard detector buys back
21818
+ * its share of the accelerator. It saves the root inference, not the decode
21819
+ * — the detail subtree still needs pixels to cut crops from.
21820
+ *
21821
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21822
+ * step at all (there is nothing to track), and the cap that knows this says
21823
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21824
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21825
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21826
+ * worth exactly what it already is — a wake signal with a class.
21827
+ *
21828
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21829
+ * vendor never turns a detector on for the operator, and neither does a
21830
+ * default.
21831
+ */
21832
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21665
21833
  pipelineEnabled: boolean().default(true),
21666
21834
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21667
21835
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21843,7 +22011,47 @@ var RunnerLocalMetricsSchema = object({
21843
22011
  queueDepth: number(),
21844
22012
  frameLazy: FrameLazyMetricsSchema.optional()
21845
22013
  });
22014
+ /**
22015
+ * Pipeline Runner capability — runtime detection workhorse.
22016
+ *
22017
+ * One instance per node. Receives camera assignments from
22018
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22019
+ * decoded frames, drains motion + detection queues, calls the local
22020
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22021
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22022
+ * the bus.
22023
+ *
22024
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22025
+ * runner has zero knowledge of other agents, no global state, and never
22026
+ * makes assignment decisions itself.
22027
+ */
22028
+ /**
22029
+ * Why a runner declined to look at a camera out of band. Named rather than a
22030
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22031
+ * already mid-session and one already bursting are four different facts, and a
22032
+ * caller told only "no" cannot tell a protection from a bug.
22033
+ */
22034
+ var OccupancyBurstRefusalSchema = _enum([
22035
+ "not-attached",
22036
+ "battery-asleep",
22037
+ "not-watching",
22038
+ "already-bursting"
22039
+ ]);
21846
22040
  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({
22041
+ deviceId: number(),
22042
+ /** How many frames to collect. The caller sizes this against what its
22043
+ * own confirmation needs; the runner clamps it to the field's range. */
22044
+ frames: number().int().positive().optional(),
22045
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22046
+ * defend — the periodic one at least has a timer to point at. */
22047
+ reason: string$2()
22048
+ }), object({
22049
+ started: boolean(),
22050
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22051
+ }), {
22052
+ auth: "admin",
22053
+ kind: "mutation"
22054
+ }), method(object({
21847
22055
  handle: FrameHandleSchema,
21848
22056
  bbox: NativeCropBboxSchema,
21849
22057
  maxWidth: number().int().positive().optional(),
@@ -28690,11 +28898,46 @@ var NativeObjectDetectionStatusSchema = object({
28690
28898
  supportedClasses: array(NativeObjectClassEnum).readonly(),
28691
28899
  /**
28692
28900
  * Whether forwarding of onboard AI detections is enabled for this device.
28693
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
28694
- * churn the tracker, so forwarding stays off until the operator enables it.
28901
+ *
28902
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
28903
+ * camera runs — that is the operator's choice, and it is made where every
28904
+ * other detection choice is made. `geometry` on
28905
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
28906
+ * choice would buy this particular camera.
28695
28907
  */
28696
28908
  enabled: boolean()
28697
28909
  });
28910
+ /**
28911
+ * WHEN a camera's onboard detections carry geometry.
28912
+ *
28913
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
28914
+ * a detection is a trackable subject whenever the camera sees one.
28915
+ * - `while-streaming` — only while some stream of this camera is already open.
28916
+ * The boxes ride the video's own side-channel rather than a feed of their
28917
+ * own, so they cost nothing and they exist only when something is pulling.
28918
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
28919
+ * radio drain, but a camera that is awake is awake precisely because
28920
+ * something is in front of it, and its stream is already being pulled.
28921
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
28922
+ * pipeline needs geometry to make a subject, so such a push reaches the
28923
+ * tracker as motion and no further.
28924
+ *
28925
+ * Reported and not inferred, because the operator's question in front of the
28926
+ * picker is "what do I get", and these are three different answers (D14: the
28927
+ * derived form is only as honest as `getOptions`).
28928
+ */
28929
+ var NativeObjectGeometryEnum = _enum([
28930
+ "boxed",
28931
+ "while-streaming",
28932
+ "flag-only"
28933
+ ]);
28934
+ var NativeObjectDetectionOptionsSchema = object({
28935
+ /** Classes this firmware can detect — the same list the status reports. */
28936
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
28937
+ /** What a detection from this camera carries. */
28938
+ geometry: NativeObjectGeometryEnum
28939
+ });
28940
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
28698
28941
  var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
28699
28942
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
28700
28943
  lastFetchedAt: number() });
@@ -28704,13 +28947,23 @@ var nativeObjectDetectionCapability = {
28704
28947
  deviceNative: true,
28705
28948
  mode: "singleton",
28706
28949
  deviceTypes: [DeviceType.Camera],
28707
- methods: { setEnabled: method(object({
28708
- deviceId: number(),
28709
- enabled: boolean()
28710
- }), _void(), {
28711
- kind: "mutation",
28712
- auth: "admin"
28713
- }) },
28950
+ methods: {
28951
+ getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
28952
+ setSettings: method(object({
28953
+ deviceId: number(),
28954
+ settings: NativeObjectDetectionSettingsPatchSchema
28955
+ }), _void(), {
28956
+ kind: "mutation",
28957
+ auth: "admin"
28958
+ }),
28959
+ setEnabled: method(object({
28960
+ deviceId: number(),
28961
+ enabled: boolean()
28962
+ }), _void(), {
28963
+ kind: "mutation",
28964
+ auth: "admin"
28965
+ })
28966
+ },
28714
28967
  events: { onDetected: { data: object({
28715
28968
  deviceId: number(),
28716
28969
  detection: NativeDetectionSchema
@@ -33558,7 +33811,28 @@ var PerScopeBreakdownSchema = object({
33558
33811
  /** Total tracked objects in this scope (frame / zone / unzoned). */
33559
33812
  totalObjects: number().int().nonnegative(),
33560
33813
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
33561
- byClass: record(string$2(), number().int().nonnegative())
33814
+ byClass: record(string$2(), number().int().nonnegative()),
33815
+ /**
33816
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
33817
+ * present but not going anywhere (a parked car, a bin, a statue).
33818
+ *
33819
+ * The operator's question about a scene has two halves and they answer
33820
+ * different things: "what is parked here" is stable for hours and must not
33821
+ * flap, while "who is walking through" is the thing an alert is about. One
33822
+ * number could only serve one of them, and `totalObjects` served the first
33823
+ * badly — a passer-by moved it and every occupancy rule saw a change.
33824
+ *
33825
+ * `standing + transient === totalObjects`, always. The total keeps its old
33826
+ * meaning exactly, so no rule written against it changes behaviour.
33827
+ *
33828
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
33829
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
33830
+ * parked objects here" about a camera whose lot is full.
33831
+ */
33832
+ standingObjects: number().int().nonnegative().optional(),
33833
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
33834
+ * same absence rule. */
33835
+ transientObjects: number().int().nonnegative().optional()
33562
33836
  });
33563
33837
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
33564
33838
  zoneId: string$2(),
@@ -33681,6 +33955,23 @@ var HistoryPointSchema = object({
33681
33955
  * triple covers the three spatial scopes (per-zone, frame-wide,
33682
33956
  * outside-any-zone). Crossing them with `className?` gives the full
33683
33957
  * combinatorial coverage the operator UI requested.
33958
+ *
33959
+ * ## ⚠️ The three history methods are DEPRECATED
33960
+ *
33961
+ * They are served from a 60-MINUTE in-memory ring. It dies with the process,
33962
+ * so after a restart they report nothing about a night that did happen, and any
33963
+ * window past an hour is silently clamped — a caller cannot tell a clamp from
33964
+ * an empty scene. The presets in the occupancy chart existed to hide that
33965
+ * horizon rather than to answer a question.
33966
+ *
33967
+ * Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
33968
+ * instead. Those rows are already written for every camera, ~60 bytes per
33969
+ * (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
33970
+ * Spell the scope with `occupancyScope(zoneId?, className?)` — the same
33971
+ * function the writer uses, so the two cannot drift.
33972
+ *
33973
+ * The ring stays until these three go, and it is the only thing left reading
33974
+ * it. Do not add a fourth caller.
33684
33975
  */
33685
33976
  var zoneAnalyticsCapability = {
33686
33977
  name: "zone-analytics",
@@ -38080,12 +38371,24 @@ Object.freeze({
38080
38371
  addonId: null,
38081
38372
  access: "create"
38082
38373
  },
38374
+ "nativeObjectDetection.getOptions": {
38375
+ capName: "native-object-detection",
38376
+ capScope: "device",
38377
+ addonId: null,
38378
+ access: "view"
38379
+ },
38083
38380
  "nativeObjectDetection.setEnabled": {
38084
38381
  capName: "native-object-detection",
38085
38382
  capScope: "device",
38086
38383
  addonId: null,
38087
38384
  access: "create"
38088
38385
  },
38386
+ "nativeObjectDetection.setSettings": {
38387
+ capName: "native-object-detection",
38388
+ capScope: "device",
38389
+ addonId: null,
38390
+ access: "create"
38391
+ },
38089
38392
  "navigation.getFeatures": {
38090
38393
  capName: "navigation",
38091
38394
  capScope: "device",
@@ -38350,6 +38653,12 @@ Object.freeze({
38350
38653
  addonId: null,
38351
38654
  access: "view"
38352
38655
  },
38656
+ "notificationRules.getClipRetentionAsks": {
38657
+ capName: "notification-rules",
38658
+ capScope: "system",
38659
+ addonId: null,
38660
+ access: "view"
38661
+ },
38353
38662
  "notificationRules.getConditionCatalog": {
38354
38663
  capName: "notification-rules",
38355
38664
  capScope: "system",
@@ -38860,6 +39169,12 @@ Object.freeze({
38860
39169
  addonId: null,
38861
39170
  access: "create"
38862
39171
  },
39172
+ "pipelineAnalytics.readLongTermSeries": {
39173
+ capName: "pipeline-analytics",
39174
+ capScope: "device",
39175
+ addonId: null,
39176
+ access: "view"
39177
+ },
38863
39178
  "pipelineAnalytics.rebuildObjectEmbeddings": {
38864
39179
  capName: "pipeline-analytics",
38865
39180
  capScope: "device",
@@ -39532,6 +39847,12 @@ Object.freeze({
39532
39847
  addonId: null,
39533
39848
  access: "create"
39534
39849
  },
39850
+ "pipelineRunner.requestOccupancyBurst": {
39851
+ capName: "pipeline-runner",
39852
+ capScope: "system",
39853
+ addonId: null,
39854
+ access: "create"
39855
+ },
39535
39856
  "pipelineRunner.runDetailSubtree": {
39536
39857
  capName: "pipeline-runner",
39537
39858
  capScope: "system",
@@ -42312,11 +42633,21 @@ Object.freeze({
42312
42633
  form: "single",
42313
42634
  optional: false
42314
42635
  }],
42636
+ "nativeObjectDetection.getOptions": [{
42637
+ name: "deviceId",
42638
+ form: "single",
42639
+ optional: false
42640
+ }],
42315
42641
  "nativeObjectDetection.setEnabled": [{
42316
42642
  name: "deviceId",
42317
42643
  form: "single",
42318
42644
  optional: false
42319
42645
  }],
42646
+ "nativeObjectDetection.setSettings": [{
42647
+ name: "deviceId",
42648
+ form: "single",
42649
+ optional: false
42650
+ }],
42320
42651
  "navigation.getFeatures": [{
42321
42652
  name: "deviceId",
42322
42653
  form: "single",
@@ -42666,6 +42997,11 @@ Object.freeze({
42666
42997
  form: "single",
42667
42998
  optional: false
42668
42999
  }],
43000
+ "pipelineAnalytics.readLongTermSeries": [{
43001
+ name: "deviceId",
43002
+ form: "single",
43003
+ optional: false
43004
+ }],
42669
43005
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
42670
43006
  name: "deviceId",
42671
43007
  form: "single",
@@ -42856,6 +43192,11 @@ Object.freeze({
42856
43192
  form: "single",
42857
43193
  optional: false
42858
43194
  }],
43195
+ "pipelineRunner.requestOccupancyBurst": [{
43196
+ name: "deviceId",
43197
+ form: "single",
43198
+ optional: false
43199
+ }],
42859
43200
  "pipelineRunner.runDetailSubtree": [{
42860
43201
  name: "deviceId",
42861
43202
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-matter-broker",
3
- "version": "0.2.101",
3
+ "version": "0.2.103",
4
4
  "description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
5
5
  "keywords": [
6
6
  "camstack",
@@ -67,7 +67,7 @@
67
67
  "dev": "vite build --watch",
68
68
  "typecheck": "tsc --noEmit",
69
69
  "test": "vitest run",
70
- "publish": "npm publish --access public"
70
+ "publish:npm": "npm publish --access public"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@camstack/types": "*",