@camstack/addon-decoder-nodeav 1.2.102 → 1.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.
package/dist/index.js CHANGED
@@ -5364,7 +5364,7 @@ var ZodIssueCode = {
5364
5364
  var ZodFirstPartyTypeKind;
5365
5365
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5366
5366
  //#endregion
5367
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5367
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5368
5368
  /**
5369
5369
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5370
5370
  * window to float samples (D455).
@@ -17964,6 +17964,48 @@ var NcAlarmConfigSchema = object({
17964
17964
  settings: NcAlarmSettingsSchema,
17965
17965
  coverage: array(NcAlarmModeCoverageSchema)
17966
17966
  });
17967
+ /**
17968
+ * ONE rule's demand on ONE camera's clip ring.
17969
+ *
17970
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
17971
+ * camera, so the answer stays a faithful description of the rules and the
17972
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
17973
+ * lives. A camera that appears in no ask is being told **nothing** — which is
17974
+ * a different thing from never having been told, and only the envelope
17975
+ * (`rulesLoaded`) can tell those apart.
17976
+ */
17977
+ var NcClipRetentionAskSchema = object({
17978
+ /**
17979
+ * The camera this ask is about. **Absent = every camera**, which is what a
17980
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
17981
+ * asking everywhere.
17982
+ */
17983
+ deviceId: number().int().nonnegative().optional(),
17984
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
17985
+ * needs nothing produces no ask at all. */
17986
+ seconds: number().min(0).max(60),
17987
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
17988
+ * assigned, which is what the cut defaults to. */
17989
+ profile: CamProfileSchema.optional(),
17990
+ /** Who is asking — so a retention the operator did not expect names a rule. */
17991
+ ruleId: string(),
17992
+ ruleName: string(),
17993
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
17994
+ reason: _enum(["window", "occupancy"])
17995
+ });
17996
+ /**
17997
+ * The whole answer, with the one bit that keeps absence from reading as zero.
17998
+ *
17999
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18000
+ * once. A centre that is up but has not read its rules yet answers with an
18001
+ * empty ask list that means nothing at all — applying it would drop every
18002
+ * camera's ring to zero for the first events after a restart, which is the
18003
+ * footage this mechanism exists to keep.
18004
+ */
18005
+ var NcClipRetentionPlanSchema = object({
18006
+ rulesLoaded: boolean(),
18007
+ asks: array(NcClipRetentionAskSchema).readonly()
18008
+ });
17967
18009
  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 }), {
17968
18010
  kind: "mutation",
17969
18011
  auth: "admin",
@@ -17984,7 +18026,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
17984
18026
  }), object({ success: literal(true) }), {
17985
18027
  kind: "mutation",
17986
18028
  auth: "admin"
17987
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18029
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
17988
18030
  deviceId: number().int(),
17989
18031
  muted: boolean()
17990
18032
  }), object({ success: literal(true) }), {
@@ -20518,6 +20560,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20518
20560
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20519
20561
  framesMatched: number().int()
20520
20562
  })).readonly() });
20563
+ /**
20564
+ * The long-term series a camera produces. A closed union so a typo cannot
20565
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20566
+ * is an alias of this, not a second list.
20567
+ */
20568
+ var AnalyticsLtsSeriesSchema = _enum([
20569
+ "motion",
20570
+ "audio-dbfs",
20571
+ "battery",
20572
+ "occupancy"
20573
+ ]);
20574
+ /**
20575
+ * One closed 5-minute bucket of a long-term series.
20576
+ *
20577
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20578
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20579
+ * that exists at all was measured; a bucket that is absent was not, which is a
20580
+ * different claim from zero and the reason this is a sparse series.
20581
+ */
20582
+ var LtsBucketSchema = object({
20583
+ scope: string(),
20584
+ bucketStart: number().int(),
20585
+ samples: number().int().nonnegative(),
20586
+ sum: number(),
20587
+ min: number(),
20588
+ max: number()
20589
+ });
20521
20590
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20522
20591
  deviceId: number(),
20523
20592
  trackId: string()
@@ -20564,6 +20633,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20564
20633
  kinds: array(string()).optional(),
20565
20634
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20566
20635
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20636
+ deviceId: number(),
20637
+ series: AnalyticsLtsSeriesSchema,
20638
+ /** Omit for EVERY scope of this series in the range. */
20639
+ scope: string().optional(),
20640
+ from: number(),
20641
+ to: number(),
20642
+ limit: number().int().positive().optional()
20643
+ }), array(LtsBucketSchema).readonly()), method(object({
20567
20644
  deviceId: number(),
20568
20645
  since: number(),
20569
20646
  until: number(),
@@ -21182,6 +21259,14 @@ var MotionSourceEnum = _enum([
21182
21259
  */
21183
21260
  var MotionSourcesSchema = array(MotionSourceEnum);
21184
21261
  /**
21262
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21263
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21264
+ * than a second spelling of the same two ideas — the value an operator picks
21265
+ * here is the value that comes back on the track, the overlay and the debug
21266
+ * row.
21267
+ */
21268
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21269
+ /**
21185
21270
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21186
21271
  * so cap-side consumers (the orchestrator forward, the runner addon's
21187
21272
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21332,6 +21417,35 @@ var RunnerCameraConfigSchema = object({
21332
21417
  * events; the orchestrator forwards to `reportMotion`.
21333
21418
  */
21334
21419
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21420
+ /**
21421
+ * WHICH root detector runs for this camera. The detection counterpart of
21422
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21423
+ * of sources the system understands, vendor-agnostic, owned here.
21424
+ *
21425
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21426
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21427
+ * here. Its boxes reach post-analysis on the same
21428
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21429
+ * track gets the same tracker, the same overlay and the same detail
21430
+ * subtree (face / plate / embedding).
21431
+ *
21432
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21433
+ * run, and that is where a camera with a usable onboard detector buys back
21434
+ * its share of the accelerator. It saves the root inference, not the decode
21435
+ * — the detail subtree still needs pixels to cut crops from.
21436
+ *
21437
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21438
+ * step at all (there is nothing to track), and the cap that knows this says
21439
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21440
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21441
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21442
+ * worth exactly what it already is — a wake signal with a class.
21443
+ *
21444
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21445
+ * vendor never turns a detector on for the operator, and neither does a
21446
+ * default.
21447
+ */
21448
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21335
21449
  pipelineEnabled: boolean().default(true),
21336
21450
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21337
21451
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21513,7 +21627,47 @@ var RunnerLocalMetricsSchema = object({
21513
21627
  queueDepth: number(),
21514
21628
  frameLazy: FrameLazyMetricsSchema.optional()
21515
21629
  });
21630
+ /**
21631
+ * Pipeline Runner capability — runtime detection workhorse.
21632
+ *
21633
+ * One instance per node. Receives camera assignments from
21634
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21635
+ * decoded frames, drains motion + detection queues, calls the local
21636
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21637
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21638
+ * the bus.
21639
+ *
21640
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21641
+ * runner has zero knowledge of other agents, no global state, and never
21642
+ * makes assignment decisions itself.
21643
+ */
21644
+ /**
21645
+ * Why a runner declined to look at a camera out of band. Named rather than a
21646
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21647
+ * already mid-session and one already bursting are four different facts, and a
21648
+ * caller told only "no" cannot tell a protection from a bug.
21649
+ */
21650
+ var OccupancyBurstRefusalSchema = _enum([
21651
+ "not-attached",
21652
+ "battery-asleep",
21653
+ "not-watching",
21654
+ "already-bursting"
21655
+ ]);
21516
21656
  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({
21657
+ deviceId: number(),
21658
+ /** How many frames to collect. The caller sizes this against what its
21659
+ * own confirmation needs; the runner clamps it to the field's range. */
21660
+ frames: number().int().positive().optional(),
21661
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21662
+ * defend — the periodic one at least has a timer to point at. */
21663
+ reason: string()
21664
+ }), object({
21665
+ started: boolean(),
21666
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21667
+ }), {
21668
+ auth: "admin",
21669
+ kind: "mutation"
21670
+ }), method(object({
21517
21671
  handle: FrameHandleSchema,
21518
21672
  bbox: NativeCropBboxSchema,
21519
21673
  maxWidth: number().int().positive().optional(),
@@ -26982,7 +27136,7 @@ var NativeDetectionSchema = object({
26982
27136
  /** Firmware-provided confidence [0..1]. Reolink pushes don't carry it → undefined. */
26983
27137
  confidence: number().min(0).max(1).optional()
26984
27138
  });
26985
- object({
27139
+ var NativeObjectDetectionStatusSchema = object({
26986
27140
  /**
26987
27141
  * Last observed instance per class. Missing entries mean the class
26988
27142
  * is supported but nothing has been seen since the provider started.
@@ -26999,14 +27153,56 @@ object({
26999
27153
  supportedClasses: array(NativeObjectClassEnum).readonly(),
27000
27154
  /**
27001
27155
  * Whether forwarding of onboard AI detections is enabled for this device.
27002
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
27003
- * churn the tracker, so forwarding stays off until the operator enables it.
27156
+ *
27157
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
27158
+ * camera runs — that is the operator's choice, and it is made where every
27159
+ * other detection choice is made. `geometry` on
27160
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
27161
+ * choice would buy this particular camera.
27004
27162
  */
27005
27163
  enabled: boolean()
27006
- }).extend({
27164
+ });
27165
+ /**
27166
+ * WHEN a camera's onboard detections carry geometry.
27167
+ *
27168
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
27169
+ * a detection is a trackable subject whenever the camera sees one.
27170
+ * - `while-streaming` — only while some stream of this camera is already open.
27171
+ * The boxes ride the video's own side-channel rather than a feed of their
27172
+ * own, so they cost nothing and they exist only when something is pulling.
27173
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
27174
+ * radio drain, but a camera that is awake is awake precisely because
27175
+ * something is in front of it, and its stream is already being pulled.
27176
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
27177
+ * pipeline needs geometry to make a subject, so such a push reaches the
27178
+ * tracker as motion and no further.
27179
+ *
27180
+ * Reported and not inferred, because the operator's question in front of the
27181
+ * picker is "what do I get", and these are three different answers (D14: the
27182
+ * derived form is only as honest as `getOptions`).
27183
+ */
27184
+ var NativeObjectGeometryEnum = _enum([
27185
+ "boxed",
27186
+ "while-streaming",
27187
+ "flag-only"
27188
+ ]);
27189
+ var NativeObjectDetectionOptionsSchema = object({
27190
+ /** Classes this firmware can detect — the same list the status reports. */
27191
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
27192
+ /** What a detection from this camera carries. */
27193
+ geometry: NativeObjectGeometryEnum
27194
+ });
27195
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
27196
+ NativeObjectDetectionStatusSchema.extend({
27007
27197
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
27008
27198
  lastFetchedAt: number() });
27009
- DeviceType.Camera, method(object({
27199
+ DeviceType.Camera, method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema), method(object({
27200
+ deviceId: number(),
27201
+ settings: NativeObjectDetectionSettingsPatchSchema
27202
+ }), _void(), {
27203
+ kind: "mutation",
27204
+ auth: "admin"
27205
+ }), method(object({
27010
27206
  deviceId: number(),
27011
27207
  enabled: boolean()
27012
27208
  }), _void(), {
@@ -30805,7 +31001,28 @@ var PerScopeBreakdownSchema = object({
30805
31001
  /** Total tracked objects in this scope (frame / zone / unzoned). */
30806
31002
  totalObjects: number().int().nonnegative(),
30807
31003
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
30808
- byClass: record(string(), number().int().nonnegative())
31004
+ byClass: record(string(), number().int().nonnegative()),
31005
+ /**
31006
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
31007
+ * present but not going anywhere (a parked car, a bin, a statue).
31008
+ *
31009
+ * The operator's question about a scene has two halves and they answer
31010
+ * different things: "what is parked here" is stable for hours and must not
31011
+ * flap, while "who is walking through" is the thing an alert is about. One
31012
+ * number could only serve one of them, and `totalObjects` served the first
31013
+ * badly — a passer-by moved it and every occupancy rule saw a change.
31014
+ *
31015
+ * `standing + transient === totalObjects`, always. The total keeps its old
31016
+ * meaning exactly, so no rule written against it changes behaviour.
31017
+ *
31018
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
31019
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
31020
+ * parked objects here" about a camera whose lot is full.
31021
+ */
31022
+ standingObjects: number().int().nonnegative().optional(),
31023
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
31024
+ * same absence rule. */
31025
+ transientObjects: number().int().nonnegative().optional()
30809
31026
  });
30810
31027
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
30811
31028
  zoneId: string(),
@@ -33744,12 +33961,24 @@ Object.freeze({
33744
33961
  addonId: null,
33745
33962
  access: "create"
33746
33963
  },
33964
+ "nativeObjectDetection.getOptions": {
33965
+ capName: "native-object-detection",
33966
+ capScope: "device",
33967
+ addonId: null,
33968
+ access: "view"
33969
+ },
33747
33970
  "nativeObjectDetection.setEnabled": {
33748
33971
  capName: "native-object-detection",
33749
33972
  capScope: "device",
33750
33973
  addonId: null,
33751
33974
  access: "create"
33752
33975
  },
33976
+ "nativeObjectDetection.setSettings": {
33977
+ capName: "native-object-detection",
33978
+ capScope: "device",
33979
+ addonId: null,
33980
+ access: "create"
33981
+ },
33753
33982
  "navigation.getFeatures": {
33754
33983
  capName: "navigation",
33755
33984
  capScope: "device",
@@ -34014,6 +34243,12 @@ Object.freeze({
34014
34243
  addonId: null,
34015
34244
  access: "view"
34016
34245
  },
34246
+ "notificationRules.getClipRetentionAsks": {
34247
+ capName: "notification-rules",
34248
+ capScope: "system",
34249
+ addonId: null,
34250
+ access: "view"
34251
+ },
34017
34252
  "notificationRules.getConditionCatalog": {
34018
34253
  capName: "notification-rules",
34019
34254
  capScope: "system",
@@ -34524,6 +34759,12 @@ Object.freeze({
34524
34759
  addonId: null,
34525
34760
  access: "create"
34526
34761
  },
34762
+ "pipelineAnalytics.readLongTermSeries": {
34763
+ capName: "pipeline-analytics",
34764
+ capScope: "device",
34765
+ addonId: null,
34766
+ access: "view"
34767
+ },
34527
34768
  "pipelineAnalytics.rebuildObjectEmbeddings": {
34528
34769
  capName: "pipeline-analytics",
34529
34770
  capScope: "device",
@@ -35196,6 +35437,12 @@ Object.freeze({
35196
35437
  addonId: null,
35197
35438
  access: "create"
35198
35439
  },
35440
+ "pipelineRunner.requestOccupancyBurst": {
35441
+ capName: "pipeline-runner",
35442
+ capScope: "system",
35443
+ addonId: null,
35444
+ access: "create"
35445
+ },
35199
35446
  "pipelineRunner.runDetailSubtree": {
35200
35447
  capName: "pipeline-runner",
35201
35448
  capScope: "system",
@@ -37976,11 +38223,21 @@ Object.freeze({
37976
38223
  form: "single",
37977
38224
  optional: false
37978
38225
  }],
38226
+ "nativeObjectDetection.getOptions": [{
38227
+ name: "deviceId",
38228
+ form: "single",
38229
+ optional: false
38230
+ }],
37979
38231
  "nativeObjectDetection.setEnabled": [{
37980
38232
  name: "deviceId",
37981
38233
  form: "single",
37982
38234
  optional: false
37983
38235
  }],
38236
+ "nativeObjectDetection.setSettings": [{
38237
+ name: "deviceId",
38238
+ form: "single",
38239
+ optional: false
38240
+ }],
37984
38241
  "navigation.getFeatures": [{
37985
38242
  name: "deviceId",
37986
38243
  form: "single",
@@ -38330,6 +38587,11 @@ Object.freeze({
38330
38587
  form: "single",
38331
38588
  optional: false
38332
38589
  }],
38590
+ "pipelineAnalytics.readLongTermSeries": [{
38591
+ name: "deviceId",
38592
+ form: "single",
38593
+ optional: false
38594
+ }],
38333
38595
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
38334
38596
  name: "deviceId",
38335
38597
  form: "single",
@@ -38520,6 +38782,11 @@ Object.freeze({
38520
38782
  form: "single",
38521
38783
  optional: false
38522
38784
  }],
38785
+ "pipelineRunner.requestOccupancyBurst": [{
38786
+ name: "deviceId",
38787
+ form: "single",
38788
+ optional: false
38789
+ }],
38523
38790
  "pipelineRunner.runDetailSubtree": [{
38524
38791
  name: "deviceId",
38525
38792
  form: "single",
package/dist/index.mjs 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).
@@ -17960,6 +17960,48 @@ var NcAlarmConfigSchema = object({
17960
17960
  settings: NcAlarmSettingsSchema,
17961
17961
  coverage: array(NcAlarmModeCoverageSchema)
17962
17962
  });
17963
+ /**
17964
+ * ONE rule's demand on ONE camera's clip ring.
17965
+ *
17966
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
17967
+ * camera, so the answer stays a faithful description of the rules and the
17968
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
17969
+ * lives. A camera that appears in no ask is being told **nothing** — which is
17970
+ * a different thing from never having been told, and only the envelope
17971
+ * (`rulesLoaded`) can tell those apart.
17972
+ */
17973
+ var NcClipRetentionAskSchema = object({
17974
+ /**
17975
+ * The camera this ask is about. **Absent = every camera**, which is what a
17976
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
17977
+ * asking everywhere.
17978
+ */
17979
+ deviceId: number().int().nonnegative().optional(),
17980
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
17981
+ * needs nothing produces no ask at all. */
17982
+ seconds: number().min(0).max(60),
17983
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
17984
+ * assigned, which is what the cut defaults to. */
17985
+ profile: CamProfileSchema.optional(),
17986
+ /** Who is asking — so a retention the operator did not expect names a rule. */
17987
+ ruleId: string(),
17988
+ ruleName: string(),
17989
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
17990
+ reason: _enum(["window", "occupancy"])
17991
+ });
17992
+ /**
17993
+ * The whole answer, with the one bit that keeps absence from reading as zero.
17994
+ *
17995
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
17996
+ * once. A centre that is up but has not read its rules yet answers with an
17997
+ * empty ask list that means nothing at all — applying it would drop every
17998
+ * camera's ring to zero for the first events after a restart, which is the
17999
+ * footage this mechanism exists to keep.
18000
+ */
18001
+ var NcClipRetentionPlanSchema = object({
18002
+ rulesLoaded: boolean(),
18003
+ asks: array(NcClipRetentionAskSchema).readonly()
18004
+ });
17963
18005
  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 }), {
17964
18006
  kind: "mutation",
17965
18007
  auth: "admin",
@@ -17980,7 +18022,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
17980
18022
  }), object({ success: literal(true) }), {
17981
18023
  kind: "mutation",
17982
18024
  auth: "admin"
17983
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18025
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
17984
18026
  deviceId: number().int(),
17985
18027
  muted: boolean()
17986
18028
  }), object({ success: literal(true) }), {
@@ -20514,6 +20556,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
20514
20556
  * solid is this track", cheaper than re-deriving it from a trajectory. */
20515
20557
  framesMatched: number().int()
20516
20558
  })).readonly() });
20559
+ /**
20560
+ * The long-term series a camera produces. A closed union so a typo cannot
20561
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
20562
+ * is an alias of this, not a second list.
20563
+ */
20564
+ var AnalyticsLtsSeriesSchema = _enum([
20565
+ "motion",
20566
+ "audio-dbfs",
20567
+ "battery",
20568
+ "occupancy"
20569
+ ]);
20570
+ /**
20571
+ * One closed 5-minute bucket of a long-term series.
20572
+ *
20573
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
20574
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
20575
+ * that exists at all was measured; a bucket that is absent was not, which is a
20576
+ * different claim from zero and the reason this is a sparse series.
20577
+ */
20578
+ var LtsBucketSchema = object({
20579
+ scope: string(),
20580
+ bucketStart: number().int(),
20581
+ samples: number().int().nonnegative(),
20582
+ sum: number(),
20583
+ min: number(),
20584
+ max: number()
20585
+ });
20517
20586
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
20518
20587
  deviceId: number(),
20519
20588
  trackId: string()
@@ -20560,6 +20629,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20560
20629
  kinds: array(string()).optional(),
20561
20630
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
20562
20631
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
20632
+ deviceId: number(),
20633
+ series: AnalyticsLtsSeriesSchema,
20634
+ /** Omit for EVERY scope of this series in the range. */
20635
+ scope: string().optional(),
20636
+ from: number(),
20637
+ to: number(),
20638
+ limit: number().int().positive().optional()
20639
+ }), array(LtsBucketSchema).readonly()), method(object({
20563
20640
  deviceId: number(),
20564
20641
  since: number(),
20565
20642
  until: number(),
@@ -21178,6 +21255,14 @@ var MotionSourceEnum = _enum([
21178
21255
  */
21179
21256
  var MotionSourcesSchema = array(MotionSourceEnum);
21180
21257
  /**
21258
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21259
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21260
+ * than a second spelling of the same two ideas — the value an operator picks
21261
+ * here is the value that comes back on the track, the overlay and the debug
21262
+ * row.
21263
+ */
21264
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21265
+ /**
21181
21266
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21182
21267
  * so cap-side consumers (the orchestrator forward, the runner addon's
21183
21268
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -21328,6 +21413,35 @@ var RunnerCameraConfigSchema = object({
21328
21413
  * events; the orchestrator forwards to `reportMotion`.
21329
21414
  */
21330
21415
  motionSources: MotionSourcesSchema.default(["analyzer"]),
21416
+ /**
21417
+ * WHICH root detector runs for this camera. The detection counterpart of
21418
+ * {@link motionSources}, same shape and same discipline: a per-camera list
21419
+ * of sources the system understands, vendor-agnostic, owned here.
21420
+ *
21421
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
21422
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
21423
+ * here. Its boxes reach post-analysis on the same
21424
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
21425
+ * track gets the same tracker, the same overlay and the same detail
21426
+ * subtree (face / plate / embedding).
21427
+ *
21428
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
21429
+ * run, and that is where a camera with a usable onboard detector buys back
21430
+ * its share of the accelerator. It saves the root inference, not the decode
21431
+ * — the detail subtree still needs pixels to cut crops from.
21432
+ *
21433
+ * A camera whose onboard detections carry no geometry cannot serve as a root
21434
+ * step at all (there is nothing to track), and the cap that knows this says
21435
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
21436
+ * every battery camera: the boxes ride a sub-stream a battery camera never
21437
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
21438
+ * worth exactly what it already is — a wake signal with a class.
21439
+ *
21440
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
21441
+ * vendor never turns a detector on for the operator, and neither does a
21442
+ * default.
21443
+ */
21444
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
21331
21445
  pipelineEnabled: boolean().default(true),
21332
21446
  /** Ordered tree of video steps. Absent → runner skips video detection. */
21333
21447
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -21509,7 +21623,47 @@ var RunnerLocalMetricsSchema = object({
21509
21623
  queueDepth: number(),
21510
21624
  frameLazy: FrameLazyMetricsSchema.optional()
21511
21625
  });
21626
+ /**
21627
+ * Pipeline Runner capability — runtime detection workhorse.
21628
+ *
21629
+ * One instance per node. Receives camera assignments from
21630
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
21631
+ * decoded frames, drains motion + detection queues, calls the local
21632
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
21633
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
21634
+ * the bus.
21635
+ *
21636
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
21637
+ * runner has zero knowledge of other agents, no global state, and never
21638
+ * makes assignment decisions itself.
21639
+ */
21640
+ /**
21641
+ * Why a runner declined to look at a camera out of band. Named rather than a
21642
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
21643
+ * already mid-session and one already bursting are four different facts, and a
21644
+ * caller told only "no" cannot tell a protection from a bug.
21645
+ */
21646
+ var OccupancyBurstRefusalSchema = _enum([
21647
+ "not-attached",
21648
+ "battery-asleep",
21649
+ "not-watching",
21650
+ "already-bursting"
21651
+ ]);
21512
21652
  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({
21653
+ deviceId: number(),
21654
+ /** How many frames to collect. The caller sizes this against what its
21655
+ * own confirmation needs; the runner clamps it to the field's range. */
21656
+ frames: number().int().positive().optional(),
21657
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
21658
+ * defend — the periodic one at least has a timer to point at. */
21659
+ reason: string()
21660
+ }), object({
21661
+ started: boolean(),
21662
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
21663
+ }), {
21664
+ auth: "admin",
21665
+ kind: "mutation"
21666
+ }), method(object({
21513
21667
  handle: FrameHandleSchema,
21514
21668
  bbox: NativeCropBboxSchema,
21515
21669
  maxWidth: number().int().positive().optional(),
@@ -26978,7 +27132,7 @@ var NativeDetectionSchema = object({
26978
27132
  /** Firmware-provided confidence [0..1]. Reolink pushes don't carry it → undefined. */
26979
27133
  confidence: number().min(0).max(1).optional()
26980
27134
  });
26981
- object({
27135
+ var NativeObjectDetectionStatusSchema = object({
26982
27136
  /**
26983
27137
  * Last observed instance per class. Missing entries mean the class
26984
27138
  * is supported but nothing has been seen since the provider started.
@@ -26995,14 +27149,56 @@ object({
26995
27149
  supportedClasses: array(NativeObjectClassEnum).readonly(),
26996
27150
  /**
26997
27151
  * Whether forwarding of onboard AI detections is enabled for this device.
26998
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
26999
- * churn the tracker, so forwarding stays off until the operator enables it.
27152
+ *
27153
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
27154
+ * camera runs — that is the operator's choice, and it is made where every
27155
+ * other detection choice is made. `geometry` on
27156
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
27157
+ * choice would buy this particular camera.
27000
27158
  */
27001
27159
  enabled: boolean()
27002
- }).extend({
27160
+ });
27161
+ /**
27162
+ * WHEN a camera's onboard detections carry geometry.
27163
+ *
27164
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
27165
+ * a detection is a trackable subject whenever the camera sees one.
27166
+ * - `while-streaming` — only while some stream of this camera is already open.
27167
+ * The boxes ride the video's own side-channel rather than a feed of their
27168
+ * own, so they cost nothing and they exist only when something is pulling.
27169
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
27170
+ * radio drain, but a camera that is awake is awake precisely because
27171
+ * something is in front of it, and its stream is already being pulled.
27172
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
27173
+ * pipeline needs geometry to make a subject, so such a push reaches the
27174
+ * tracker as motion and no further.
27175
+ *
27176
+ * Reported and not inferred, because the operator's question in front of the
27177
+ * picker is "what do I get", and these are three different answers (D14: the
27178
+ * derived form is only as honest as `getOptions`).
27179
+ */
27180
+ var NativeObjectGeometryEnum = _enum([
27181
+ "boxed",
27182
+ "while-streaming",
27183
+ "flag-only"
27184
+ ]);
27185
+ var NativeObjectDetectionOptionsSchema = object({
27186
+ /** Classes this firmware can detect — the same list the status reports. */
27187
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
27188
+ /** What a detection from this camera carries. */
27189
+ geometry: NativeObjectGeometryEnum
27190
+ });
27191
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
27192
+ NativeObjectDetectionStatusSchema.extend({
27003
27193
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
27004
27194
  lastFetchedAt: number() });
27005
- DeviceType.Camera, method(object({
27195
+ DeviceType.Camera, method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema), method(object({
27196
+ deviceId: number(),
27197
+ settings: NativeObjectDetectionSettingsPatchSchema
27198
+ }), _void(), {
27199
+ kind: "mutation",
27200
+ auth: "admin"
27201
+ }), method(object({
27006
27202
  deviceId: number(),
27007
27203
  enabled: boolean()
27008
27204
  }), _void(), {
@@ -30801,7 +30997,28 @@ var PerScopeBreakdownSchema = object({
30801
30997
  /** Total tracked objects in this scope (frame / zone / unzoned). */
30802
30998
  totalObjects: number().int().nonnegative(),
30803
30999
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
30804
- byClass: record(string(), number().int().nonnegative())
31000
+ byClass: record(string(), number().int().nonnegative()),
31001
+ /**
31002
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
31003
+ * present but not going anywhere (a parked car, a bin, a statue).
31004
+ *
31005
+ * The operator's question about a scene has two halves and they answer
31006
+ * different things: "what is parked here" is stable for hours and must not
31007
+ * flap, while "who is walking through" is the thing an alert is about. One
31008
+ * number could only serve one of them, and `totalObjects` served the first
31009
+ * badly — a passer-by moved it and every occupancy rule saw a change.
31010
+ *
31011
+ * `standing + transient === totalObjects`, always. The total keeps its old
31012
+ * meaning exactly, so no rule written against it changes behaviour.
31013
+ *
31014
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
31015
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
31016
+ * parked objects here" about a camera whose lot is full.
31017
+ */
31018
+ standingObjects: number().int().nonnegative().optional(),
31019
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
31020
+ * same absence rule. */
31021
+ transientObjects: number().int().nonnegative().optional()
30805
31022
  });
30806
31023
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
30807
31024
  zoneId: string(),
@@ -33740,12 +33957,24 @@ Object.freeze({
33740
33957
  addonId: null,
33741
33958
  access: "create"
33742
33959
  },
33960
+ "nativeObjectDetection.getOptions": {
33961
+ capName: "native-object-detection",
33962
+ capScope: "device",
33963
+ addonId: null,
33964
+ access: "view"
33965
+ },
33743
33966
  "nativeObjectDetection.setEnabled": {
33744
33967
  capName: "native-object-detection",
33745
33968
  capScope: "device",
33746
33969
  addonId: null,
33747
33970
  access: "create"
33748
33971
  },
33972
+ "nativeObjectDetection.setSettings": {
33973
+ capName: "native-object-detection",
33974
+ capScope: "device",
33975
+ addonId: null,
33976
+ access: "create"
33977
+ },
33749
33978
  "navigation.getFeatures": {
33750
33979
  capName: "navigation",
33751
33980
  capScope: "device",
@@ -34010,6 +34239,12 @@ Object.freeze({
34010
34239
  addonId: null,
34011
34240
  access: "view"
34012
34241
  },
34242
+ "notificationRules.getClipRetentionAsks": {
34243
+ capName: "notification-rules",
34244
+ capScope: "system",
34245
+ addonId: null,
34246
+ access: "view"
34247
+ },
34013
34248
  "notificationRules.getConditionCatalog": {
34014
34249
  capName: "notification-rules",
34015
34250
  capScope: "system",
@@ -34520,6 +34755,12 @@ Object.freeze({
34520
34755
  addonId: null,
34521
34756
  access: "create"
34522
34757
  },
34758
+ "pipelineAnalytics.readLongTermSeries": {
34759
+ capName: "pipeline-analytics",
34760
+ capScope: "device",
34761
+ addonId: null,
34762
+ access: "view"
34763
+ },
34523
34764
  "pipelineAnalytics.rebuildObjectEmbeddings": {
34524
34765
  capName: "pipeline-analytics",
34525
34766
  capScope: "device",
@@ -35192,6 +35433,12 @@ Object.freeze({
35192
35433
  addonId: null,
35193
35434
  access: "create"
35194
35435
  },
35436
+ "pipelineRunner.requestOccupancyBurst": {
35437
+ capName: "pipeline-runner",
35438
+ capScope: "system",
35439
+ addonId: null,
35440
+ access: "create"
35441
+ },
35195
35442
  "pipelineRunner.runDetailSubtree": {
35196
35443
  capName: "pipeline-runner",
35197
35444
  capScope: "system",
@@ -37972,11 +38219,21 @@ Object.freeze({
37972
38219
  form: "single",
37973
38220
  optional: false
37974
38221
  }],
38222
+ "nativeObjectDetection.getOptions": [{
38223
+ name: "deviceId",
38224
+ form: "single",
38225
+ optional: false
38226
+ }],
37975
38227
  "nativeObjectDetection.setEnabled": [{
37976
38228
  name: "deviceId",
37977
38229
  form: "single",
37978
38230
  optional: false
37979
38231
  }],
38232
+ "nativeObjectDetection.setSettings": [{
38233
+ name: "deviceId",
38234
+ form: "single",
38235
+ optional: false
38236
+ }],
37980
38237
  "navigation.getFeatures": [{
37981
38238
  name: "deviceId",
37982
38239
  form: "single",
@@ -38326,6 +38583,11 @@ Object.freeze({
38326
38583
  form: "single",
38327
38584
  optional: false
38328
38585
  }],
38586
+ "pipelineAnalytics.readLongTermSeries": [{
38587
+ name: "deviceId",
38588
+ form: "single",
38589
+ optional: false
38590
+ }],
38329
38591
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
38330
38592
  name: "deviceId",
38331
38593
  form: "single",
@@ -38516,6 +38778,11 @@ Object.freeze({
38516
38778
  form: "single",
38517
38779
  optional: false
38518
38780
  }],
38781
+ "pipelineRunner.requestOccupancyBurst": [{
38782
+ name: "deviceId",
38783
+ form: "single",
38784
+ optional: false
38785
+ }],
38519
38786
  "pipelineRunner.runDetailSubtree": [{
38520
38787
  name: "deviceId",
38521
38788
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-decoder-nodeav",
3
- "version": "1.2.102",
3
+ "version": "1.2.103",
4
4
  "description": "Standalone in-process node-av decoder addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",
@@ -68,7 +68,7 @@
68
68
  "dev": "vite build --watch",
69
69
  "typecheck": "tsc --noEmit",
70
70
  "test": "vitest run",
71
- "publish": "npm publish --access public"
71
+ "publish:npm": "npm publish --access public"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "@camstack/types": "*"