@camstack/addon-export-hap 1.2.114 → 1.2.115

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.
@@ -5445,7 +5445,7 @@ var ZodIssueCode = {
5445
5445
  var ZodFirstPartyTypeKind;
5446
5446
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5447
5447
  //#endregion
5448
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5448
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5449
5449
  /**
5450
5450
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5451
5451
  * window to float samples (D455).
@@ -18692,6 +18692,48 @@ var NcAlarmConfigSchema = object({
18692
18692
  settings: NcAlarmSettingsSchema,
18693
18693
  coverage: array(NcAlarmModeCoverageSchema)
18694
18694
  });
18695
+ /**
18696
+ * ONE rule's demand on ONE camera's clip ring.
18697
+ *
18698
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18699
+ * camera, so the answer stays a faithful description of the rules and the
18700
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18701
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18702
+ * a different thing from never having been told, and only the envelope
18703
+ * (`rulesLoaded`) can tell those apart.
18704
+ */
18705
+ var NcClipRetentionAskSchema = object({
18706
+ /**
18707
+ * The camera this ask is about. **Absent = every camera**, which is what a
18708
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18709
+ * asking everywhere.
18710
+ */
18711
+ deviceId: number().int().nonnegative().optional(),
18712
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18713
+ * needs nothing produces no ask at all. */
18714
+ seconds: number().min(0).max(60),
18715
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18716
+ * assigned, which is what the cut defaults to. */
18717
+ profile: CamProfileSchema.optional(),
18718
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18719
+ ruleId: string(),
18720
+ ruleName: string(),
18721
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18722
+ reason: _enum(["window", "occupancy"])
18723
+ });
18724
+ /**
18725
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18726
+ *
18727
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18728
+ * once. A centre that is up but has not read its rules yet answers with an
18729
+ * empty ask list that means nothing at all — applying it would drop every
18730
+ * camera's ring to zero for the first events after a restart, which is the
18731
+ * footage this mechanism exists to keep.
18732
+ */
18733
+ var NcClipRetentionPlanSchema = object({
18734
+ rulesLoaded: boolean(),
18735
+ asks: array(NcClipRetentionAskSchema).readonly()
18736
+ });
18695
18737
  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 }), {
18696
18738
  kind: "mutation",
18697
18739
  auth: "admin",
@@ -18712,7 +18754,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18712
18754
  }), object({ success: literal(true) }), {
18713
18755
  kind: "mutation",
18714
18756
  auth: "admin"
18715
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18757
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18716
18758
  deviceId: number().int(),
18717
18759
  muted: boolean()
18718
18760
  }), object({ success: literal(true) }), {
@@ -21246,6 +21288,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
21246
21288
  * solid is this track", cheaper than re-deriving it from a trajectory. */
21247
21289
  framesMatched: number().int()
21248
21290
  })).readonly() });
21291
+ /**
21292
+ * The long-term series a camera produces. A closed union so a typo cannot
21293
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21294
+ * is an alias of this, not a second list.
21295
+ */
21296
+ var AnalyticsLtsSeriesSchema = _enum([
21297
+ "motion",
21298
+ "audio-dbfs",
21299
+ "battery",
21300
+ "occupancy"
21301
+ ]);
21302
+ /**
21303
+ * One closed 5-minute bucket of a long-term series.
21304
+ *
21305
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21306
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21307
+ * that exists at all was measured; a bucket that is absent was not, which is a
21308
+ * different claim from zero and the reason this is a sparse series.
21309
+ */
21310
+ var LtsBucketSchema = object({
21311
+ scope: string(),
21312
+ bucketStart: number().int(),
21313
+ samples: number().int().nonnegative(),
21314
+ sum: number(),
21315
+ min: number(),
21316
+ max: number()
21317
+ });
21249
21318
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
21250
21319
  deviceId: number(),
21251
21320
  trackId: string()
@@ -21292,6 +21361,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21292
21361
  kinds: array(string()).optional(),
21293
21362
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
21294
21363
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
21364
+ deviceId: number(),
21365
+ series: AnalyticsLtsSeriesSchema,
21366
+ /** Omit for EVERY scope of this series in the range. */
21367
+ scope: string().optional(),
21368
+ from: number(),
21369
+ to: number(),
21370
+ limit: number().int().positive().optional()
21371
+ }), array(LtsBucketSchema).readonly()), method(object({
21295
21372
  deviceId: number(),
21296
21373
  since: number(),
21297
21374
  until: number(),
@@ -21910,6 +21987,14 @@ var MotionSourceEnum = _enum([
21910
21987
  */
21911
21988
  var MotionSourcesSchema = array(MotionSourceEnum);
21912
21989
  /**
21990
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21991
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21992
+ * than a second spelling of the same two ideas — the value an operator picks
21993
+ * here is the value that comes back on the track, the overlay and the debug
21994
+ * row.
21995
+ */
21996
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21997
+ /**
21913
21998
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21914
21999
  * so cap-side consumers (the orchestrator forward, the runner addon's
21915
22000
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -22060,6 +22145,35 @@ var RunnerCameraConfigSchema = object({
22060
22145
  * events; the orchestrator forwards to `reportMotion`.
22061
22146
  */
22062
22147
  motionSources: MotionSourcesSchema.default(["analyzer"]),
22148
+ /**
22149
+ * WHICH root detector runs for this camera. The detection counterpart of
22150
+ * {@link motionSources}, same shape and same discipline: a per-camera list
22151
+ * of sources the system understands, vendor-agnostic, owned here.
22152
+ *
22153
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
22154
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
22155
+ * here. Its boxes reach post-analysis on the same
22156
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
22157
+ * track gets the same tracker, the same overlay and the same detail
22158
+ * subtree (face / plate / embedding).
22159
+ *
22160
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
22161
+ * run, and that is where a camera with a usable onboard detector buys back
22162
+ * its share of the accelerator. It saves the root inference, not the decode
22163
+ * — the detail subtree still needs pixels to cut crops from.
22164
+ *
22165
+ * A camera whose onboard detections carry no geometry cannot serve as a root
22166
+ * step at all (there is nothing to track), and the cap that knows this says
22167
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
22168
+ * every battery camera: the boxes ride a sub-stream a battery camera never
22169
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
22170
+ * worth exactly what it already is — a wake signal with a class.
22171
+ *
22172
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
22173
+ * vendor never turns a detector on for the operator, and neither does a
22174
+ * default.
22175
+ */
22176
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
22063
22177
  pipelineEnabled: boolean().default(true),
22064
22178
  /** Ordered tree of video steps. Absent → runner skips video detection. */
22065
22179
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -22241,7 +22355,47 @@ var RunnerLocalMetricsSchema = object({
22241
22355
  queueDepth: number(),
22242
22356
  frameLazy: FrameLazyMetricsSchema.optional()
22243
22357
  });
22358
+ /**
22359
+ * Pipeline Runner capability — runtime detection workhorse.
22360
+ *
22361
+ * One instance per node. Receives camera assignments from
22362
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22363
+ * decoded frames, drains motion + detection queues, calls the local
22364
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22365
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22366
+ * the bus.
22367
+ *
22368
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22369
+ * runner has zero knowledge of other agents, no global state, and never
22370
+ * makes assignment decisions itself.
22371
+ */
22372
+ /**
22373
+ * Why a runner declined to look at a camera out of band. Named rather than a
22374
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22375
+ * already mid-session and one already bursting are four different facts, and a
22376
+ * caller told only "no" cannot tell a protection from a bug.
22377
+ */
22378
+ var OccupancyBurstRefusalSchema = _enum([
22379
+ "not-attached",
22380
+ "battery-asleep",
22381
+ "not-watching",
22382
+ "already-bursting"
22383
+ ]);
22244
22384
  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({
22385
+ deviceId: number(),
22386
+ /** How many frames to collect. The caller sizes this against what its
22387
+ * own confirmation needs; the runner clamps it to the field's range. */
22388
+ frames: number().int().positive().optional(),
22389
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22390
+ * defend — the periodic one at least has a timer to point at. */
22391
+ reason: string()
22392
+ }), object({
22393
+ started: boolean(),
22394
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22395
+ }), {
22396
+ auth: "admin",
22397
+ kind: "mutation"
22398
+ }), method(object({
22245
22399
  handle: FrameHandleSchema,
22246
22400
  bbox: NativeCropBboxSchema,
22247
22401
  maxWidth: number().int().positive().optional(),
@@ -27746,7 +27900,7 @@ var NativeDetectionSchema = object({
27746
27900
  /** Firmware-provided confidence [0..1]. Reolink pushes don't carry it → undefined. */
27747
27901
  confidence: number().min(0).max(1).optional()
27748
27902
  });
27749
- object({
27903
+ var NativeObjectDetectionStatusSchema = object({
27750
27904
  /**
27751
27905
  * Last observed instance per class. Missing entries mean the class
27752
27906
  * is supported but nothing has been seen since the provider started.
@@ -27763,14 +27917,56 @@ object({
27763
27917
  supportedClasses: array(NativeObjectClassEnum).readonly(),
27764
27918
  /**
27765
27919
  * Whether forwarding of onboard AI detections is enabled for this device.
27766
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
27767
- * churn the tracker, so forwarding stays off until the operator enables it.
27920
+ *
27921
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
27922
+ * camera runs — that is the operator's choice, and it is made where every
27923
+ * other detection choice is made. `geometry` on
27924
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
27925
+ * choice would buy this particular camera.
27768
27926
  */
27769
27927
  enabled: boolean()
27770
- }).extend({
27928
+ });
27929
+ /**
27930
+ * WHEN a camera's onboard detections carry geometry.
27931
+ *
27932
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
27933
+ * a detection is a trackable subject whenever the camera sees one.
27934
+ * - `while-streaming` — only while some stream of this camera is already open.
27935
+ * The boxes ride the video's own side-channel rather than a feed of their
27936
+ * own, so they cost nothing and they exist only when something is pulling.
27937
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
27938
+ * radio drain, but a camera that is awake is awake precisely because
27939
+ * something is in front of it, and its stream is already being pulled.
27940
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
27941
+ * pipeline needs geometry to make a subject, so such a push reaches the
27942
+ * tracker as motion and no further.
27943
+ *
27944
+ * Reported and not inferred, because the operator's question in front of the
27945
+ * picker is "what do I get", and these are three different answers (D14: the
27946
+ * derived form is only as honest as `getOptions`).
27947
+ */
27948
+ var NativeObjectGeometryEnum = _enum([
27949
+ "boxed",
27950
+ "while-streaming",
27951
+ "flag-only"
27952
+ ]);
27953
+ var NativeObjectDetectionOptionsSchema = object({
27954
+ /** Classes this firmware can detect — the same list the status reports. */
27955
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
27956
+ /** What a detection from this camera carries. */
27957
+ geometry: NativeObjectGeometryEnum
27958
+ });
27959
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
27960
+ NativeObjectDetectionStatusSchema.extend({
27771
27961
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
27772
27962
  lastFetchedAt: number() });
27773
- DeviceType.Camera, method(object({
27963
+ DeviceType.Camera, method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema), method(object({
27964
+ deviceId: number(),
27965
+ settings: NativeObjectDetectionSettingsPatchSchema
27966
+ }), _void(), {
27967
+ kind: "mutation",
27968
+ auth: "admin"
27969
+ }), method(object({
27774
27970
  deviceId: number(),
27775
27971
  enabled: boolean()
27776
27972
  }), _void(), {
@@ -31594,7 +31790,28 @@ var PerScopeBreakdownSchema = object({
31594
31790
  /** Total tracked objects in this scope (frame / zone / unzoned). */
31595
31791
  totalObjects: number().int().nonnegative(),
31596
31792
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
31597
- byClass: record(string(), number().int().nonnegative())
31793
+ byClass: record(string(), number().int().nonnegative()),
31794
+ /**
31795
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
31796
+ * present but not going anywhere (a parked car, a bin, a statue).
31797
+ *
31798
+ * The operator's question about a scene has two halves and they answer
31799
+ * different things: "what is parked here" is stable for hours and must not
31800
+ * flap, while "who is walking through" is the thing an alert is about. One
31801
+ * number could only serve one of them, and `totalObjects` served the first
31802
+ * badly — a passer-by moved it and every occupancy rule saw a change.
31803
+ *
31804
+ * `standing + transient === totalObjects`, always. The total keeps its old
31805
+ * meaning exactly, so no rule written against it changes behaviour.
31806
+ *
31807
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
31808
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
31809
+ * parked objects here" about a camera whose lot is full.
31810
+ */
31811
+ standingObjects: number().int().nonnegative().optional(),
31812
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
31813
+ * same absence rule. */
31814
+ transientObjects: number().int().nonnegative().optional()
31598
31815
  });
31599
31816
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
31600
31817
  zoneId: string(),
@@ -34533,12 +34750,24 @@ Object.freeze({
34533
34750
  addonId: null,
34534
34751
  access: "create"
34535
34752
  },
34753
+ "nativeObjectDetection.getOptions": {
34754
+ capName: "native-object-detection",
34755
+ capScope: "device",
34756
+ addonId: null,
34757
+ access: "view"
34758
+ },
34536
34759
  "nativeObjectDetection.setEnabled": {
34537
34760
  capName: "native-object-detection",
34538
34761
  capScope: "device",
34539
34762
  addonId: null,
34540
34763
  access: "create"
34541
34764
  },
34765
+ "nativeObjectDetection.setSettings": {
34766
+ capName: "native-object-detection",
34767
+ capScope: "device",
34768
+ addonId: null,
34769
+ access: "create"
34770
+ },
34542
34771
  "navigation.getFeatures": {
34543
34772
  capName: "navigation",
34544
34773
  capScope: "device",
@@ -34803,6 +35032,12 @@ Object.freeze({
34803
35032
  addonId: null,
34804
35033
  access: "view"
34805
35034
  },
35035
+ "notificationRules.getClipRetentionAsks": {
35036
+ capName: "notification-rules",
35037
+ capScope: "system",
35038
+ addonId: null,
35039
+ access: "view"
35040
+ },
34806
35041
  "notificationRules.getConditionCatalog": {
34807
35042
  capName: "notification-rules",
34808
35043
  capScope: "system",
@@ -35313,6 +35548,12 @@ Object.freeze({
35313
35548
  addonId: null,
35314
35549
  access: "create"
35315
35550
  },
35551
+ "pipelineAnalytics.readLongTermSeries": {
35552
+ capName: "pipeline-analytics",
35553
+ capScope: "device",
35554
+ addonId: null,
35555
+ access: "view"
35556
+ },
35316
35557
  "pipelineAnalytics.rebuildObjectEmbeddings": {
35317
35558
  capName: "pipeline-analytics",
35318
35559
  capScope: "device",
@@ -35985,6 +36226,12 @@ Object.freeze({
35985
36226
  addonId: null,
35986
36227
  access: "create"
35987
36228
  },
36229
+ "pipelineRunner.requestOccupancyBurst": {
36230
+ capName: "pipeline-runner",
36231
+ capScope: "system",
36232
+ addonId: null,
36233
+ access: "create"
36234
+ },
35988
36235
  "pipelineRunner.runDetailSubtree": {
35989
36236
  capName: "pipeline-runner",
35990
36237
  capScope: "system",
@@ -38765,11 +39012,21 @@ Object.freeze({
38765
39012
  form: "single",
38766
39013
  optional: false
38767
39014
  }],
39015
+ "nativeObjectDetection.getOptions": [{
39016
+ name: "deviceId",
39017
+ form: "single",
39018
+ optional: false
39019
+ }],
38768
39020
  "nativeObjectDetection.setEnabled": [{
38769
39021
  name: "deviceId",
38770
39022
  form: "single",
38771
39023
  optional: false
38772
39024
  }],
39025
+ "nativeObjectDetection.setSettings": [{
39026
+ name: "deviceId",
39027
+ form: "single",
39028
+ optional: false
39029
+ }],
38773
39030
  "navigation.getFeatures": [{
38774
39031
  name: "deviceId",
38775
39032
  form: "single",
@@ -39119,6 +39376,11 @@ Object.freeze({
39119
39376
  form: "single",
39120
39377
  optional: false
39121
39378
  }],
39379
+ "pipelineAnalytics.readLongTermSeries": [{
39380
+ name: "deviceId",
39381
+ form: "single",
39382
+ optional: false
39383
+ }],
39122
39384
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
39123
39385
  name: "deviceId",
39124
39386
  form: "single",
@@ -39309,6 +39571,11 @@ Object.freeze({
39309
39571
  form: "single",
39310
39572
  optional: false
39311
39573
  }],
39574
+ "pipelineRunner.requestOccupancyBurst": [{
39575
+ name: "deviceId",
39576
+ form: "single",
39577
+ optional: false
39578
+ }],
39312
39579
  "pipelineRunner.runDetailSubtree": [{
39313
39580
  name: "deviceId",
39314
39581
  form: "single",
@@ -5433,7 +5433,7 @@ var ZodIssueCode = {
5433
5433
  var ZodFirstPartyTypeKind;
5434
5434
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5435
5435
  //#endregion
5436
- //#region ../types/dist/sleep-DEuj7E3j.mjs
5436
+ //#region ../types/dist/sleep-BDR76Ykr.mjs
5437
5437
  /**
5438
5438
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5439
5439
  * window to float samples (D455).
@@ -18680,6 +18680,48 @@ var NcAlarmConfigSchema = object({
18680
18680
  settings: NcAlarmSettingsSchema,
18681
18681
  coverage: array(NcAlarmModeCoverageSchema)
18682
18682
  });
18683
+ /**
18684
+ * ONE rule's demand on ONE camera's clip ring.
18685
+ *
18686
+ * A rule, not a camera: the broker takes the MAX over the asks that reach a
18687
+ * camera, so the answer stays a faithful description of the rules and the
18688
+ * bounding (the byte budget, the broker's own ceiling) stays where the cost
18689
+ * lives. A camera that appears in no ask is being told **nothing** — which is
18690
+ * a different thing from never having been told, and only the envelope
18691
+ * (`rulesLoaded`) can tell those apart.
18692
+ */
18693
+ var NcClipRetentionAskSchema = object({
18694
+ /**
18695
+ * The camera this ask is about. **Absent = every camera**, which is what a
18696
+ * rule with no `conditions.devices` means: it can fire anywhere, so it is
18697
+ * asking everywhere.
18698
+ */
18699
+ deviceId: number().int().nonnegative().optional(),
18700
+ /** Seconds of history the rule needs held for it. Never zero — a rule that
18701
+ * needs nothing produces no ask at all. */
18702
+ seconds: number().min(0).max(60),
18703
+ /** The profile the rule cuts from, when it named one. Absent = the cheapest
18704
+ * assigned, which is what the cut defaults to. */
18705
+ profile: CamProfileSchema.optional(),
18706
+ /** Who is asking — so a retention the operator did not expect names a rule. */
18707
+ ruleId: string(),
18708
+ ruleName: string(),
18709
+ /** Why this many seconds: the rule's own window, or the occupancy ceiling. */
18710
+ reason: _enum(["window", "occupancy"])
18711
+ });
18712
+ /**
18713
+ * The whole answer, with the one bit that keeps absence from reading as zero.
18714
+ *
18715
+ * `rulesLoaded` is false until the rule ledger has completed a load at least
18716
+ * once. A centre that is up but has not read its rules yet answers with an
18717
+ * empty ask list that means nothing at all — applying it would drop every
18718
+ * camera's ring to zero for the first events after a restart, which is the
18719
+ * footage this mechanism exists to keep.
18720
+ */
18721
+ var NcClipRetentionPlanSchema = object({
18722
+ rulesLoaded: boolean(),
18723
+ asks: array(NcClipRetentionAskSchema).readonly()
18724
+ });
18683
18725
  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 }), {
18684
18726
  kind: "mutation",
18685
18727
  auth: "admin",
@@ -18700,7 +18742,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
18700
18742
  }), object({ success: literal(true) }), {
18701
18743
  kind: "mutation",
18702
18744
  auth: "admin"
18703
- }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18745
+ }), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
18704
18746
  deviceId: number().int(),
18705
18747
  muted: boolean()
18706
18748
  }), object({ success: literal(true) }), {
@@ -21234,6 +21276,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
21234
21276
  * solid is this track", cheaper than re-deriving it from a trajectory. */
21235
21277
  framesMatched: number().int()
21236
21278
  })).readonly() });
21279
+ /**
21280
+ * The long-term series a camera produces. A closed union so a typo cannot
21281
+ * invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
21282
+ * is an alias of this, not a second list.
21283
+ */
21284
+ var AnalyticsLtsSeriesSchema = _enum([
21285
+ "motion",
21286
+ "audio-dbfs",
21287
+ "battery",
21288
+ "occupancy"
21289
+ ]);
21290
+ /**
21291
+ * One closed 5-minute bucket of a long-term series.
21292
+ *
21293
+ * `samples` is how many readings the bucket folded — it is the ACTIVITY for a
21294
+ * series like `motion`, and the confidence for one like `occupancy`. A bucket
21295
+ * that exists at all was measured; a bucket that is absent was not, which is a
21296
+ * different claim from zero and the reason this is a sparse series.
21297
+ */
21298
+ var LtsBucketSchema = object({
21299
+ scope: string(),
21300
+ bucketStart: number().int(),
21301
+ samples: number().int().nonnegative(),
21302
+ sum: number(),
21303
+ min: number(),
21304
+ max: number()
21305
+ });
21237
21306
  DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
21238
21307
  deviceId: number(),
21239
21308
  trackId: string()
@@ -21280,6 +21349,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21280
21349
  kinds: array(string()).optional(),
21281
21350
  limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
21282
21351
  }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
21352
+ deviceId: number(),
21353
+ series: AnalyticsLtsSeriesSchema,
21354
+ /** Omit for EVERY scope of this series in the range. */
21355
+ scope: string().optional(),
21356
+ from: number(),
21357
+ to: number(),
21358
+ limit: number().int().positive().optional()
21359
+ }), array(LtsBucketSchema).readonly()), method(object({
21283
21360
  deviceId: number(),
21284
21361
  since: number(),
21285
21362
  until: number(),
@@ -21898,6 +21975,14 @@ var MotionSourceEnum = _enum([
21898
21975
  */
21899
21976
  var MotionSourcesSchema = array(MotionSourceEnum);
21900
21977
  /**
21978
+ * Which root detectors a camera runs. Deliberately the SAME vocabulary
21979
+ * post-analysis already tags every detection with (`DetectionSource`) rather
21980
+ * than a second spelling of the same two ideas — the value an operator picks
21981
+ * here is the value that comes back on the track, the overlay and the debug
21982
+ * row.
21983
+ */
21984
+ var DetectionSourcesSchema = array(DetectionSourceSchema);
21985
+ /**
21901
21986
  * Input shape for `pipeline-runner.reportMotion` cap method. Exported
21902
21987
  * so cap-side consumers (the orchestrator forward, the runner addon's
21903
21988
  * cap implementation, tests) can reuse the type instead of redeclaring
@@ -22048,6 +22133,35 @@ var RunnerCameraConfigSchema = object({
22048
22133
  * events; the orchestrator forwards to `reportMotion`.
22049
22134
  */
22050
22135
  motionSources: MotionSourcesSchema.default(["analyzer"]),
22136
+ /**
22137
+ * WHICH root detector runs for this camera. The detection counterpart of
22138
+ * {@link motionSources}, same shape and same discipline: a per-camera list
22139
+ * of sources the system understands, vendor-agnostic, owned here.
22140
+ *
22141
+ * - `pipeline` — this runner's own root step on decoded pixels (`steps`).
22142
+ * - `onboard` — the CAMERA's own detector, admitted only when it is named
22143
+ * here. Its boxes reach post-analysis on the same
22144
+ * `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
22145
+ * track gets the same tracker, the same overlay and the same detail
22146
+ * subtree (face / plate / embedding).
22147
+ *
22148
+ * `['onboard']` alone is the REPLACEMENT: this runner's root step does not
22149
+ * run, and that is where a camera with a usable onboard detector buys back
22150
+ * its share of the accelerator. It saves the root inference, not the decode
22151
+ * — the detail subtree still needs pixels to cut crops from.
22152
+ *
22153
+ * A camera whose onboard detections carry no geometry cannot serve as a root
22154
+ * step at all (there is nothing to track), and the cap that knows this says
22155
+ * so on `native-object-detection.getOptions().geometry`. On Reolink that is
22156
+ * every battery camera: the boxes ride a sub-stream a battery camera never
22157
+ * attaches, so such a camera stays on `['pipeline']` and its onboard AI is
22158
+ * worth exactly what it already is — a wake signal with a class.
22159
+ *
22160
+ * Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
22161
+ * vendor never turns a detector on for the operator, and neither does a
22162
+ * default.
22163
+ */
22164
+ detectionSources: DetectionSourcesSchema.default(["pipeline"]),
22051
22165
  pipelineEnabled: boolean().default(true),
22052
22166
  /** Ordered tree of video steps. Absent → runner skips video detection. */
22053
22167
  steps: array(PipelineStepInputSchema).readonly().optional(),
@@ -22229,7 +22343,47 @@ var RunnerLocalMetricsSchema = object({
22229
22343
  queueDepth: number(),
22230
22344
  frameLazy: FrameLazyMetricsSchema.optional()
22231
22345
  });
22346
+ /**
22347
+ * Pipeline Runner capability — runtime detection workhorse.
22348
+ *
22349
+ * One instance per node. Receives camera assignments from
22350
+ * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
22351
+ * decoded frames, drains motion + detection queues, calls the local
22352
+ * `motion-detection` and `pipeline-executor` capabilities, and emits typed
22353
+ * `pipeline.inference-result` and `detection.motion-analysis` events on
22354
+ * the bus.
22355
+ *
22356
+ * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
22357
+ * runner has zero knowledge of other agents, no global state, and never
22358
+ * makes assignment decisions itself.
22359
+ */
22360
+ /**
22361
+ * Why a runner declined to look at a camera out of band. Named rather than a
22362
+ * bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
22363
+ * already mid-session and one already bursting are four different facts, and a
22364
+ * caller told only "no" cannot tell a protection from a bug.
22365
+ */
22366
+ var OccupancyBurstRefusalSchema = _enum([
22367
+ "not-attached",
22368
+ "battery-asleep",
22369
+ "not-watching",
22370
+ "already-bursting"
22371
+ ]);
22232
22372
  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({
22373
+ deviceId: number(),
22374
+ /** How many frames to collect. The caller sizes this against what its
22375
+ * own confirmation needs; the runner clamps it to the field's range. */
22376
+ frames: number().int().positive().optional(),
22377
+ /** Why, for the log. A burst nobody can attribute is a cost nobody can
22378
+ * defend — the periodic one at least has a timer to point at. */
22379
+ reason: string()
22380
+ }), object({
22381
+ started: boolean(),
22382
+ refusedBecause: OccupancyBurstRefusalSchema.optional()
22383
+ }), {
22384
+ auth: "admin",
22385
+ kind: "mutation"
22386
+ }), method(object({
22233
22387
  handle: FrameHandleSchema,
22234
22388
  bbox: NativeCropBboxSchema,
22235
22389
  maxWidth: number().int().positive().optional(),
@@ -27734,7 +27888,7 @@ var NativeDetectionSchema = object({
27734
27888
  /** Firmware-provided confidence [0..1]. Reolink pushes don't carry it → undefined. */
27735
27889
  confidence: number().min(0).max(1).optional()
27736
27890
  });
27737
- object({
27891
+ var NativeObjectDetectionStatusSchema = object({
27738
27892
  /**
27739
27893
  * Last observed instance per class. Missing entries mean the class
27740
27894
  * is supported but nothing has been seen since the provider started.
@@ -27751,14 +27905,56 @@ object({
27751
27905
  supportedClasses: array(NativeObjectClassEnum).readonly(),
27752
27906
  /**
27753
27907
  * Whether forwarding of onboard AI detections is enabled for this device.
27754
- * Default FALSE (opt-in, cold-start) — onboard AI pushes are noisy/sparse and
27755
- * churn the tracker, so forwarding stays off until the operator enables it.
27908
+ *
27909
+ * Cold-start OFF on every camera. A vendor does not decide which detector a
27910
+ * camera runs — that is the operator's choice, and it is made where every
27911
+ * other detection choice is made. `geometry` on
27912
+ * {@link NativeObjectDetectionOptionsSchema} is how the form says what the
27913
+ * choice would buy this particular camera.
27756
27914
  */
27757
27915
  enabled: boolean()
27758
- }).extend({
27916
+ });
27917
+ /**
27918
+ * WHEN a camera's onboard detections carry geometry.
27919
+ *
27920
+ * - `boxed` — always. The provider holds a standing channel for the boxes, so
27921
+ * a detection is a trackable subject whenever the camera sees one.
27922
+ * - `while-streaming` — only while some stream of this camera is already open.
27923
+ * The boxes ride the video's own side-channel rather than a feed of their
27924
+ * own, so they cost nothing and they exist only when something is pulling.
27925
+ * On Reolink this is every BATTERY camera: a persistent second feed is real
27926
+ * radio drain, but a camera that is awake is awake precisely because
27927
+ * something is in front of it, and its stream is already being pulled.
27928
+ * - `flag-only` — never. The firmware ships the class and nothing else; the
27929
+ * pipeline needs geometry to make a subject, so such a push reaches the
27930
+ * tracker as motion and no further.
27931
+ *
27932
+ * Reported and not inferred, because the operator's question in front of the
27933
+ * picker is "what do I get", and these are three different answers (D14: the
27934
+ * derived form is only as honest as `getOptions`).
27935
+ */
27936
+ var NativeObjectGeometryEnum = _enum([
27937
+ "boxed",
27938
+ "while-streaming",
27939
+ "flag-only"
27940
+ ]);
27941
+ var NativeObjectDetectionOptionsSchema = object({
27942
+ /** Classes this firmware can detect — the same list the status reports. */
27943
+ supportedClasses: array(NativeObjectClassEnum).readonly(),
27944
+ /** What a detection from this camera carries. */
27945
+ geometry: NativeObjectGeometryEnum
27946
+ });
27947
+ var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
27948
+ NativeObjectDetectionStatusSchema.extend({
27759
27949
  /** Required by createRuntimeStateBridge — epoch ms of last refresh. */
27760
27950
  lastFetchedAt: number() });
27761
- DeviceType.Camera, method(object({
27951
+ DeviceType.Camera, method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema), method(object({
27952
+ deviceId: number(),
27953
+ settings: NativeObjectDetectionSettingsPatchSchema
27954
+ }), _void(), {
27955
+ kind: "mutation",
27956
+ auth: "admin"
27957
+ }), method(object({
27762
27958
  deviceId: number(),
27763
27959
  enabled: boolean()
27764
27960
  }), _void(), {
@@ -31582,7 +31778,28 @@ var PerScopeBreakdownSchema = object({
31582
31778
  /** Total tracked objects in this scope (frame / zone / unzoned). */
31583
31779
  totalObjects: number().int().nonnegative(),
31584
31780
  /** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
31585
- byClass: record(string(), number().int().nonnegative())
31781
+ byClass: record(string(), number().int().nonnegative()),
31782
+ /**
31783
+ * Of `totalObjects`, how many are STANDING — objects the census holds,
31784
+ * present but not going anywhere (a parked car, a bin, a statue).
31785
+ *
31786
+ * The operator's question about a scene has two halves and they answer
31787
+ * different things: "what is parked here" is stable for hours and must not
31788
+ * flap, while "who is walking through" is the thing an alert is about. One
31789
+ * number could only serve one of them, and `totalObjects` served the first
31790
+ * badly — a passer-by moved it and every occupancy rule saw a change.
31791
+ *
31792
+ * `standing + transient === totalObjects`, always. The total keeps its old
31793
+ * meaning exactly, so no rule written against it changes behaviour.
31794
+ *
31795
+ * ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
31796
+ * this field cannot say, and a reader that folds absence in as 0 reports "no
31797
+ * parked objects here" about a camera whose lot is full.
31798
+ */
31799
+ standingObjects: number().int().nonnegative().optional(),
31800
+ /** Of `totalObjects`, how many are passing through. See `standingObjects` —
31801
+ * same absence rule. */
31802
+ transientObjects: number().int().nonnegative().optional()
31586
31803
  });
31587
31804
  var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
31588
31805
  zoneId: string(),
@@ -34521,12 +34738,24 @@ Object.freeze({
34521
34738
  addonId: null,
34522
34739
  access: "create"
34523
34740
  },
34741
+ "nativeObjectDetection.getOptions": {
34742
+ capName: "native-object-detection",
34743
+ capScope: "device",
34744
+ addonId: null,
34745
+ access: "view"
34746
+ },
34524
34747
  "nativeObjectDetection.setEnabled": {
34525
34748
  capName: "native-object-detection",
34526
34749
  capScope: "device",
34527
34750
  addonId: null,
34528
34751
  access: "create"
34529
34752
  },
34753
+ "nativeObjectDetection.setSettings": {
34754
+ capName: "native-object-detection",
34755
+ capScope: "device",
34756
+ addonId: null,
34757
+ access: "create"
34758
+ },
34530
34759
  "navigation.getFeatures": {
34531
34760
  capName: "navigation",
34532
34761
  capScope: "device",
@@ -34791,6 +35020,12 @@ Object.freeze({
34791
35020
  addonId: null,
34792
35021
  access: "view"
34793
35022
  },
35023
+ "notificationRules.getClipRetentionAsks": {
35024
+ capName: "notification-rules",
35025
+ capScope: "system",
35026
+ addonId: null,
35027
+ access: "view"
35028
+ },
34794
35029
  "notificationRules.getConditionCatalog": {
34795
35030
  capName: "notification-rules",
34796
35031
  capScope: "system",
@@ -35301,6 +35536,12 @@ Object.freeze({
35301
35536
  addonId: null,
35302
35537
  access: "create"
35303
35538
  },
35539
+ "pipelineAnalytics.readLongTermSeries": {
35540
+ capName: "pipeline-analytics",
35541
+ capScope: "device",
35542
+ addonId: null,
35543
+ access: "view"
35544
+ },
35304
35545
  "pipelineAnalytics.rebuildObjectEmbeddings": {
35305
35546
  capName: "pipeline-analytics",
35306
35547
  capScope: "device",
@@ -35973,6 +36214,12 @@ Object.freeze({
35973
36214
  addonId: null,
35974
36215
  access: "create"
35975
36216
  },
36217
+ "pipelineRunner.requestOccupancyBurst": {
36218
+ capName: "pipeline-runner",
36219
+ capScope: "system",
36220
+ addonId: null,
36221
+ access: "create"
36222
+ },
35976
36223
  "pipelineRunner.runDetailSubtree": {
35977
36224
  capName: "pipeline-runner",
35978
36225
  capScope: "system",
@@ -38753,11 +39000,21 @@ Object.freeze({
38753
39000
  form: "single",
38754
39001
  optional: false
38755
39002
  }],
39003
+ "nativeObjectDetection.getOptions": [{
39004
+ name: "deviceId",
39005
+ form: "single",
39006
+ optional: false
39007
+ }],
38756
39008
  "nativeObjectDetection.setEnabled": [{
38757
39009
  name: "deviceId",
38758
39010
  form: "single",
38759
39011
  optional: false
38760
39012
  }],
39013
+ "nativeObjectDetection.setSettings": [{
39014
+ name: "deviceId",
39015
+ form: "single",
39016
+ optional: false
39017
+ }],
38761
39018
  "navigation.getFeatures": [{
38762
39019
  name: "deviceId",
38763
39020
  form: "single",
@@ -39107,6 +39364,11 @@ Object.freeze({
39107
39364
  form: "single",
39108
39365
  optional: false
39109
39366
  }],
39367
+ "pipelineAnalytics.readLongTermSeries": [{
39368
+ name: "deviceId",
39369
+ form: "single",
39370
+ optional: false
39371
+ }],
39110
39372
  "pipelineAnalytics.rebuildObjectEmbeddings": [{
39111
39373
  name: "deviceId",
39112
39374
  form: "single",
@@ -39297,6 +39559,11 @@ Object.freeze({
39297
39559
  form: "single",
39298
39560
  optional: false
39299
39561
  }],
39562
+ "pipelineRunner.requestOccupancyBurst": [{
39563
+ name: "deviceId",
39564
+ form: "single",
39565
+ optional: false
39566
+ }],
39300
39567
  "pipelineRunner.runDetailSubtree": [{
39301
39568
  name: "deviceId",
39302
39569
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-hap",
3
- "version": "1.2.114",
3
+ "version": "1.2.115",
4
4
  "description": "HomeKit (HAP) exporter for CamStack devices. Publishes each exposed device as its own HomeKit accessory: cameras and doorbells with SRTP streaming, HomeKit Secure Video, motion, two-way audio, PTZ and battery; switches, lights, locks and sensors through a capability→service table.",
5
5
  "keywords": [
6
6
  "camstack",