@camstack/addon-provider-unifi 0.2.102 → 0.2.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +355 -14
- package/dist/addon.mjs +355 -14
- package/package.json +2 -2
package/dist/addon.js
CHANGED
|
@@ -5360,7 +5360,7 @@ var ZodIssueCode = {
|
|
|
5360
5360
|
var ZodFirstPartyTypeKind;
|
|
5361
5361
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5362
5362
|
//#endregion
|
|
5363
|
-
//#region ../types/dist/sleep-
|
|
5363
|
+
//#region ../types/dist/sleep-BDR76Ykr.mjs
|
|
5364
5364
|
/**
|
|
5365
5365
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5366
5366
|
* window to float samples (D455).
|
|
@@ -11562,6 +11562,21 @@ var streamSignalsCapability = {
|
|
|
11562
11562
|
mode: "singleton",
|
|
11563
11563
|
deviceTypes: Object.values(DeviceType),
|
|
11564
11564
|
runtimeState: StreamSignalsStatusSchema,
|
|
11565
|
+
/**
|
|
11566
|
+
* Runtime-state durability: **session** — mirrored in RAM, never written.
|
|
11567
|
+
*
|
|
11568
|
+
* The slice holds what the DEVICE says it can emit. That is a probed fact,
|
|
11569
|
+
* not an operator choice: the provider re-declares it on every registration,
|
|
11570
|
+
* so losing it loses nothing and persisting it would freeze an answer the
|
|
11571
|
+
* camera is entitled to change. Measured the same day on the sibling case —
|
|
11572
|
+
* `native-object-detection.supportedClasses` was persisted, and a firmware
|
|
11573
|
+
* class the camera really detected stayed missing for the life of the row
|
|
11574
|
+
* because the fix could not reach it.
|
|
11575
|
+
*
|
|
11576
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
11577
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
11578
|
+
*/
|
|
11579
|
+
durability: "session",
|
|
11565
11580
|
methods: {
|
|
11566
11581
|
/**
|
|
11567
11582
|
* What this device can emit. Empty is a valid and common answer — most
|
|
@@ -18176,6 +18191,48 @@ var NcAlarmConfigSchema = object({
|
|
|
18176
18191
|
settings: NcAlarmSettingsSchema,
|
|
18177
18192
|
coverage: array(NcAlarmModeCoverageSchema)
|
|
18178
18193
|
});
|
|
18194
|
+
/**
|
|
18195
|
+
* ONE rule's demand on ONE camera's clip ring.
|
|
18196
|
+
*
|
|
18197
|
+
* A rule, not a camera: the broker takes the MAX over the asks that reach a
|
|
18198
|
+
* camera, so the answer stays a faithful description of the rules and the
|
|
18199
|
+
* bounding (the byte budget, the broker's own ceiling) stays where the cost
|
|
18200
|
+
* lives. A camera that appears in no ask is being told **nothing** — which is
|
|
18201
|
+
* a different thing from never having been told, and only the envelope
|
|
18202
|
+
* (`rulesLoaded`) can tell those apart.
|
|
18203
|
+
*/
|
|
18204
|
+
var NcClipRetentionAskSchema = object({
|
|
18205
|
+
/**
|
|
18206
|
+
* The camera this ask is about. **Absent = every camera**, which is what a
|
|
18207
|
+
* rule with no `conditions.devices` means: it can fire anywhere, so it is
|
|
18208
|
+
* asking everywhere.
|
|
18209
|
+
*/
|
|
18210
|
+
deviceId: number().int().nonnegative().optional(),
|
|
18211
|
+
/** Seconds of history the rule needs held for it. Never zero — a rule that
|
|
18212
|
+
* needs nothing produces no ask at all. */
|
|
18213
|
+
seconds: number().min(0).max(60),
|
|
18214
|
+
/** The profile the rule cuts from, when it named one. Absent = the cheapest
|
|
18215
|
+
* assigned, which is what the cut defaults to. */
|
|
18216
|
+
profile: CamProfileSchema.optional(),
|
|
18217
|
+
/** Who is asking — so a retention the operator did not expect names a rule. */
|
|
18218
|
+
ruleId: string(),
|
|
18219
|
+
ruleName: string(),
|
|
18220
|
+
/** Why this many seconds: the rule's own window, or the occupancy ceiling. */
|
|
18221
|
+
reason: _enum(["window", "occupancy"])
|
|
18222
|
+
});
|
|
18223
|
+
/**
|
|
18224
|
+
* The whole answer, with the one bit that keeps absence from reading as zero.
|
|
18225
|
+
*
|
|
18226
|
+
* `rulesLoaded` is false until the rule ledger has completed a load at least
|
|
18227
|
+
* once. A centre that is up but has not read its rules yet answers with an
|
|
18228
|
+
* empty ask list that means nothing at all — applying it would drop every
|
|
18229
|
+
* camera's ring to zero for the first events after a restart, which is the
|
|
18230
|
+
* footage this mechanism exists to keep.
|
|
18231
|
+
*/
|
|
18232
|
+
var NcClipRetentionPlanSchema = object({
|
|
18233
|
+
rulesLoaded: boolean(),
|
|
18234
|
+
asks: array(NcClipRetentionAskSchema).readonly()
|
|
18235
|
+
});
|
|
18179
18236
|
method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
|
|
18180
18237
|
kind: "mutation",
|
|
18181
18238
|
auth: "admin",
|
|
@@ -18196,7 +18253,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
18196
18253
|
}), object({ success: literal(true) }), {
|
|
18197
18254
|
kind: "mutation",
|
|
18198
18255
|
auth: "admin"
|
|
18199
|
-
}), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
|
|
18256
|
+
}), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
|
|
18200
18257
|
deviceId: number().int(),
|
|
18201
18258
|
muted: boolean()
|
|
18202
18259
|
}), object({ success: literal(true) }), {
|
|
@@ -19381,13 +19438,26 @@ var TrackAudioLabelSchema = object({
|
|
|
19381
19438
|
* - `audio` — an audio event on the camera itself that was anomalous for
|
|
19382
19439
|
* THAT camera, loud, and heard while nothing visual was happening (D62).
|
|
19383
19440
|
*
|
|
19441
|
+
* - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
|
|
19442
|
+
* that frame's pixel space. A real root detector and a SPATIAL one: its
|
|
19443
|
+
* boxes are the same kind of fact `pipeline`'s are, produced by a different
|
|
19444
|
+
* detector.
|
|
19445
|
+
*
|
|
19446
|
+
* `onboard` was missing here while `DetectionSourceSchema` already had it, so
|
|
19447
|
+
* a persisted onboard track failed `safeParse` on read and came back with NO
|
|
19448
|
+
* source at all — which `isSpatialTrack` then admitted by accident, through the
|
|
19449
|
+
* `undefined` arm rather than by anybody's decision, and which `excludeSources`
|
|
19450
|
+
* could not name.
|
|
19451
|
+
*
|
|
19384
19452
|
* The spatial subsystems (tracker association, occupancy count, re-id /
|
|
19385
19453
|
* embedding, resurrection) MUST skip every synthetic source. Test for that
|
|
19386
|
-
* with `isSpatialTrack`, which allow-lists
|
|
19387
|
-
* check silently readmits every source added after it was
|
|
19454
|
+
* with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
|
|
19455
|
+
* `!== 'sensor'` check silently readmits every source added after it was
|
|
19456
|
+
* written.
|
|
19388
19457
|
*/
|
|
19389
19458
|
var TrackSourceSchema = _enum([
|
|
19390
19459
|
"pipeline",
|
|
19460
|
+
"onboard",
|
|
19391
19461
|
"sensor",
|
|
19392
19462
|
"audio"
|
|
19393
19463
|
]);
|
|
@@ -20770,6 +20840,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
|
20770
20840
|
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
20771
20841
|
framesMatched: number().int()
|
|
20772
20842
|
})).readonly() });
|
|
20843
|
+
/**
|
|
20844
|
+
* The long-term series a camera produces. A closed union so a typo cannot
|
|
20845
|
+
* invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
|
|
20846
|
+
* is an alias of this, not a second list.
|
|
20847
|
+
*/
|
|
20848
|
+
var AnalyticsLtsSeriesSchema = _enum([
|
|
20849
|
+
"motion",
|
|
20850
|
+
"audio-dbfs",
|
|
20851
|
+
"battery",
|
|
20852
|
+
"occupancy"
|
|
20853
|
+
]);
|
|
20854
|
+
/**
|
|
20855
|
+
* One closed 5-minute bucket of a long-term series.
|
|
20856
|
+
*
|
|
20857
|
+
* `samples` is how many readings the bucket folded — it is the ACTIVITY for a
|
|
20858
|
+
* series like `motion`, and the confidence for one like `occupancy`. A bucket
|
|
20859
|
+
* that exists at all was measured; a bucket that is absent was not, which is a
|
|
20860
|
+
* different claim from zero and the reason this is a sparse series.
|
|
20861
|
+
*/
|
|
20862
|
+
var LtsBucketSchema = object({
|
|
20863
|
+
scope: string(),
|
|
20864
|
+
bucketStart: number().int(),
|
|
20865
|
+
samples: number().int().nonnegative(),
|
|
20866
|
+
sum: number(),
|
|
20867
|
+
min: number(),
|
|
20868
|
+
max: number()
|
|
20869
|
+
});
|
|
20773
20870
|
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
20774
20871
|
deviceId: number(),
|
|
20775
20872
|
trackId: string()
|
|
@@ -20816,6 +20913,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
20816
20913
|
kinds: array(string()).optional(),
|
|
20817
20914
|
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
20818
20915
|
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
|
|
20916
|
+
deviceId: number(),
|
|
20917
|
+
series: AnalyticsLtsSeriesSchema,
|
|
20918
|
+
/** Omit for EVERY scope of this series in the range. */
|
|
20919
|
+
scope: string().optional(),
|
|
20920
|
+
from: number(),
|
|
20921
|
+
to: number(),
|
|
20922
|
+
limit: number().int().positive().optional()
|
|
20923
|
+
}), array(LtsBucketSchema).readonly()), method(object({
|
|
20819
20924
|
deviceId: number(),
|
|
20820
20925
|
since: number(),
|
|
20821
20926
|
until: number(),
|
|
@@ -21434,6 +21539,40 @@ var MotionSourceEnum = _enum([
|
|
|
21434
21539
|
*/
|
|
21435
21540
|
var MotionSourcesSchema = array(MotionSourceEnum);
|
|
21436
21541
|
/**
|
|
21542
|
+
* Which root detector a camera runs — EXACTLY ONE.
|
|
21543
|
+
*
|
|
21544
|
+
* Deliberately the SAME vocabulary post-analysis already tags every detection
|
|
21545
|
+
* with (`DetectionSource`) rather than a second spelling of the same two
|
|
21546
|
+
* ideas: the value an operator picks here is the value that comes back on the
|
|
21547
|
+
* track, the overlay and the debug row.
|
|
21548
|
+
*
|
|
21549
|
+
* ## Why one, and why it is still an array
|
|
21550
|
+
*
|
|
21551
|
+
* Two roots on one camera is a capability nobody asked for and the operator has
|
|
21552
|
+
* since ruled out. It was never free: both planes feed the SAME per-device
|
|
21553
|
+
* stationary registry, both can promote the same parked object, and the two
|
|
21554
|
+
* detectors disagree about the same box by construction — which is the
|
|
21555
|
+
* disagreement D505 had to arbitrate. Removing the case removes the arbitration.
|
|
21556
|
+
*
|
|
21557
|
+
* The ARRAY shape survives because the stored settings and the attach payload
|
|
21558
|
+
* already speak it on every camera of every fleet, and a cap input that
|
|
21559
|
+
* suddenly refuses a stored value makes the camera un-attachable — a fail-closed
|
|
21560
|
+
* in the one direction that costs an operator their cameras. So the wire stays
|
|
21561
|
+
* tolerant and the TYPE is exact: a longer list is truncated to its first
|
|
21562
|
+
* element rather than refused, and `max(1)` is what every consumer can then
|
|
21563
|
+
* rely on.
|
|
21564
|
+
*
|
|
21565
|
+
* AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
|
|
21566
|
+
* a camera an operator left with no root detector — and `planDetectionSources`
|
|
21567
|
+
* has always said so: inventing a root for them is how a default acts without
|
|
21568
|
+
* anybody choosing it. Tightening this to `length(1)` broke that, and the
|
|
21569
|
+
* suite caught it.
|
|
21570
|
+
*
|
|
21571
|
+
* Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
|
|
21572
|
+
* `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
|
|
21573
|
+
*/
|
|
21574
|
+
var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
|
|
21575
|
+
/**
|
|
21437
21576
|
* Input shape for `pipeline-runner.reportMotion` cap method. Exported
|
|
21438
21577
|
* so cap-side consumers (the orchestrator forward, the runner addon's
|
|
21439
21578
|
* cap implementation, tests) can reuse the type instead of redeclaring
|
|
@@ -21584,6 +21723,35 @@ var RunnerCameraConfigSchema = object({
|
|
|
21584
21723
|
* events; the orchestrator forwards to `reportMotion`.
|
|
21585
21724
|
*/
|
|
21586
21725
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
21726
|
+
/**
|
|
21727
|
+
* WHICH root detector runs for this camera. The detection counterpart of
|
|
21728
|
+
* {@link motionSources}, same shape and same discipline: a per-camera list
|
|
21729
|
+
* of sources the system understands, vendor-agnostic, owned here.
|
|
21730
|
+
*
|
|
21731
|
+
* - `pipeline` — this runner's own root step on decoded pixels (`steps`).
|
|
21732
|
+
* - `onboard` — the CAMERA's own detector, admitted only when it is named
|
|
21733
|
+
* here. Its boxes reach post-analysis on the same
|
|
21734
|
+
* `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
|
|
21735
|
+
* track gets the same tracker, the same overlay and the same detail
|
|
21736
|
+
* subtree (face / plate / embedding).
|
|
21737
|
+
*
|
|
21738
|
+
* `['onboard']` alone is the REPLACEMENT: this runner's root step does not
|
|
21739
|
+
* run, and that is where a camera with a usable onboard detector buys back
|
|
21740
|
+
* its share of the accelerator. It saves the root inference, not the decode
|
|
21741
|
+
* — the detail subtree still needs pixels to cut crops from.
|
|
21742
|
+
*
|
|
21743
|
+
* A camera whose onboard detections carry no geometry cannot serve as a root
|
|
21744
|
+
* step at all (there is nothing to track), and the cap that knows this says
|
|
21745
|
+
* so on `native-object-detection.getOptions().geometry`. On Reolink that is
|
|
21746
|
+
* every battery camera: the boxes ride a sub-stream a battery camera never
|
|
21747
|
+
* attaches, so such a camera stays on `['pipeline']` and its onboard AI is
|
|
21748
|
+
* worth exactly what it already is — a wake signal with a class.
|
|
21749
|
+
*
|
|
21750
|
+
* Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
|
|
21751
|
+
* vendor never turns a detector on for the operator, and neither does a
|
|
21752
|
+
* default.
|
|
21753
|
+
*/
|
|
21754
|
+
detectionSources: DetectionSourcesSchema.default(["pipeline"]),
|
|
21587
21755
|
pipelineEnabled: boolean().default(true),
|
|
21588
21756
|
/** Ordered tree of video steps. Absent → runner skips video detection. */
|
|
21589
21757
|
steps: array(PipelineStepInputSchema).readonly().optional(),
|
|
@@ -21765,7 +21933,47 @@ var RunnerLocalMetricsSchema = object({
|
|
|
21765
21933
|
queueDepth: number(),
|
|
21766
21934
|
frameLazy: FrameLazyMetricsSchema.optional()
|
|
21767
21935
|
});
|
|
21936
|
+
/**
|
|
21937
|
+
* Pipeline Runner capability — runtime detection workhorse.
|
|
21938
|
+
*
|
|
21939
|
+
* One instance per node. Receives camera assignments from
|
|
21940
|
+
* `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
|
|
21941
|
+
* decoded frames, drains motion + detection queues, calls the local
|
|
21942
|
+
* `motion-detection` and `pipeline-executor` capabilities, and emits typed
|
|
21943
|
+
* `pipeline.inference-result` and `detection.motion-analysis` events on
|
|
21944
|
+
* the bus.
|
|
21945
|
+
*
|
|
21946
|
+
* Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
|
|
21947
|
+
* runner has zero knowledge of other agents, no global state, and never
|
|
21948
|
+
* makes assignment decisions itself.
|
|
21949
|
+
*/
|
|
21950
|
+
/**
|
|
21951
|
+
* Why a runner declined to look at a camera out of band. Named rather than a
|
|
21952
|
+
* bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
|
|
21953
|
+
* already mid-session and one already bursting are four different facts, and a
|
|
21954
|
+
* caller told only "no" cannot tell a protection from a bug.
|
|
21955
|
+
*/
|
|
21956
|
+
var OccupancyBurstRefusalSchema = _enum([
|
|
21957
|
+
"not-attached",
|
|
21958
|
+
"battery-asleep",
|
|
21959
|
+
"not-watching",
|
|
21960
|
+
"already-bursting"
|
|
21961
|
+
]);
|
|
21768
21962
|
method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly()), method(object({
|
|
21963
|
+
deviceId: number(),
|
|
21964
|
+
/** How many frames to collect. The caller sizes this against what its
|
|
21965
|
+
* own confirmation needs; the runner clamps it to the field's range. */
|
|
21966
|
+
frames: number().int().positive().optional(),
|
|
21967
|
+
/** Why, for the log. A burst nobody can attribute is a cost nobody can
|
|
21968
|
+
* defend — the periodic one at least has a timer to point at. */
|
|
21969
|
+
reason: string()
|
|
21970
|
+
}), object({
|
|
21971
|
+
started: boolean(),
|
|
21972
|
+
refusedBecause: OccupancyBurstRefusalSchema.optional()
|
|
21973
|
+
}), {
|
|
21974
|
+
auth: "admin",
|
|
21975
|
+
kind: "mutation"
|
|
21976
|
+
}), method(object({
|
|
21769
21977
|
handle: FrameHandleSchema,
|
|
21770
21978
|
bbox: NativeCropBboxSchema,
|
|
21771
21979
|
maxWidth: number().int().positive().optional(),
|
|
@@ -28612,11 +28820,46 @@ var NativeObjectDetectionStatusSchema = object({
|
|
|
28612
28820
|
supportedClasses: array(NativeObjectClassEnum).readonly(),
|
|
28613
28821
|
/**
|
|
28614
28822
|
* Whether forwarding of onboard AI detections is enabled for this device.
|
|
28615
|
-
*
|
|
28616
|
-
*
|
|
28823
|
+
*
|
|
28824
|
+
* Cold-start OFF on every camera. A vendor does not decide which detector a
|
|
28825
|
+
* camera runs — that is the operator's choice, and it is made where every
|
|
28826
|
+
* other detection choice is made. `geometry` on
|
|
28827
|
+
* {@link NativeObjectDetectionOptionsSchema} is how the form says what the
|
|
28828
|
+
* choice would buy this particular camera.
|
|
28617
28829
|
*/
|
|
28618
28830
|
enabled: boolean()
|
|
28619
28831
|
});
|
|
28832
|
+
/**
|
|
28833
|
+
* WHEN a camera's onboard detections carry geometry.
|
|
28834
|
+
*
|
|
28835
|
+
* - `boxed` — always. The provider holds a standing channel for the boxes, so
|
|
28836
|
+
* a detection is a trackable subject whenever the camera sees one.
|
|
28837
|
+
* - `while-streaming` — only while some stream of this camera is already open.
|
|
28838
|
+
* The boxes ride the video's own side-channel rather than a feed of their
|
|
28839
|
+
* own, so they cost nothing and they exist only when something is pulling.
|
|
28840
|
+
* On Reolink this is every BATTERY camera: a persistent second feed is real
|
|
28841
|
+
* radio drain, but a camera that is awake is awake precisely because
|
|
28842
|
+
* something is in front of it, and its stream is already being pulled.
|
|
28843
|
+
* - `flag-only` — never. The firmware ships the class and nothing else; the
|
|
28844
|
+
* pipeline needs geometry to make a subject, so such a push reaches the
|
|
28845
|
+
* tracker as motion and no further.
|
|
28846
|
+
*
|
|
28847
|
+
* Reported and not inferred, because the operator's question in front of the
|
|
28848
|
+
* picker is "what do I get", and these are three different answers (D14: the
|
|
28849
|
+
* derived form is only as honest as `getOptions`).
|
|
28850
|
+
*/
|
|
28851
|
+
var NativeObjectGeometryEnum = _enum([
|
|
28852
|
+
"boxed",
|
|
28853
|
+
"while-streaming",
|
|
28854
|
+
"flag-only"
|
|
28855
|
+
]);
|
|
28856
|
+
var NativeObjectDetectionOptionsSchema = object({
|
|
28857
|
+
/** Classes this firmware can detect — the same list the status reports. */
|
|
28858
|
+
supportedClasses: array(NativeObjectClassEnum).readonly(),
|
|
28859
|
+
/** What a detection from this camera carries. */
|
|
28860
|
+
geometry: NativeObjectGeometryEnum
|
|
28861
|
+
});
|
|
28862
|
+
var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
|
|
28620
28863
|
var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
|
|
28621
28864
|
/** Required by createRuntimeStateBridge — epoch ms of last refresh. */
|
|
28622
28865
|
lastFetchedAt: number() });
|
|
@@ -28626,13 +28869,23 @@ var nativeObjectDetectionCapability = {
|
|
|
28626
28869
|
deviceNative: true,
|
|
28627
28870
|
mode: "singleton",
|
|
28628
28871
|
deviceTypes: [DeviceType.Camera],
|
|
28629
|
-
methods: {
|
|
28630
|
-
deviceId: number(),
|
|
28631
|
-
|
|
28632
|
-
|
|
28633
|
-
|
|
28634
|
-
|
|
28635
|
-
|
|
28872
|
+
methods: {
|
|
28873
|
+
getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
|
|
28874
|
+
setSettings: method(object({
|
|
28875
|
+
deviceId: number(),
|
|
28876
|
+
settings: NativeObjectDetectionSettingsPatchSchema
|
|
28877
|
+
}), _void(), {
|
|
28878
|
+
kind: "mutation",
|
|
28879
|
+
auth: "admin"
|
|
28880
|
+
}),
|
|
28881
|
+
setEnabled: method(object({
|
|
28882
|
+
deviceId: number(),
|
|
28883
|
+
enabled: boolean()
|
|
28884
|
+
}), _void(), {
|
|
28885
|
+
kind: "mutation",
|
|
28886
|
+
auth: "admin"
|
|
28887
|
+
})
|
|
28888
|
+
},
|
|
28636
28889
|
events: { onDetected: { data: object({
|
|
28637
28890
|
deviceId: number(),
|
|
28638
28891
|
detection: NativeDetectionSchema
|
|
@@ -33480,7 +33733,28 @@ var PerScopeBreakdownSchema = object({
|
|
|
33480
33733
|
/** Total tracked objects in this scope (frame / zone / unzoned). */
|
|
33481
33734
|
totalObjects: number().int().nonnegative(),
|
|
33482
33735
|
/** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
|
|
33483
|
-
byClass: record(string(), number().int().nonnegative())
|
|
33736
|
+
byClass: record(string(), number().int().nonnegative()),
|
|
33737
|
+
/**
|
|
33738
|
+
* Of `totalObjects`, how many are STANDING — objects the census holds,
|
|
33739
|
+
* present but not going anywhere (a parked car, a bin, a statue).
|
|
33740
|
+
*
|
|
33741
|
+
* The operator's question about a scene has two halves and they answer
|
|
33742
|
+
* different things: "what is parked here" is stable for hours and must not
|
|
33743
|
+
* flap, while "who is walking through" is the thing an alert is about. One
|
|
33744
|
+
* number could only serve one of them, and `totalObjects` served the first
|
|
33745
|
+
* badly — a passer-by moved it and every occupancy rule saw a change.
|
|
33746
|
+
*
|
|
33747
|
+
* `standing + transient === totalObjects`, always. The total keeps its old
|
|
33748
|
+
* meaning exactly, so no rule written against it changes behaviour.
|
|
33749
|
+
*
|
|
33750
|
+
* ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
|
|
33751
|
+
* this field cannot say, and a reader that folds absence in as 0 reports "no
|
|
33752
|
+
* parked objects here" about a camera whose lot is full.
|
|
33753
|
+
*/
|
|
33754
|
+
standingObjects: number().int().nonnegative().optional(),
|
|
33755
|
+
/** Of `totalObjects`, how many are passing through. See `standingObjects` —
|
|
33756
|
+
* same absence rule. */
|
|
33757
|
+
transientObjects: number().int().nonnegative().optional()
|
|
33484
33758
|
});
|
|
33485
33759
|
var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
|
|
33486
33760
|
zoneId: string(),
|
|
@@ -33603,6 +33877,23 @@ var HistoryPointSchema = object({
|
|
|
33603
33877
|
* triple covers the three spatial scopes (per-zone, frame-wide,
|
|
33604
33878
|
* outside-any-zone). Crossing them with `className?` gives the full
|
|
33605
33879
|
* combinatorial coverage the operator UI requested.
|
|
33880
|
+
*
|
|
33881
|
+
* ## ⚠️ The three history methods are DEPRECATED
|
|
33882
|
+
*
|
|
33883
|
+
* They are served from a 60-MINUTE in-memory ring. It dies with the process,
|
|
33884
|
+
* so after a restart they report nothing about a night that did happen, and any
|
|
33885
|
+
* window past an hour is silently clamped — a caller cannot tell a clamp from
|
|
33886
|
+
* an empty scene. The presets in the occupancy chart existed to hide that
|
|
33887
|
+
* horizon rather than to answer a question.
|
|
33888
|
+
*
|
|
33889
|
+
* Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
|
|
33890
|
+
* instead. Those rows are already written for every camera, ~60 bytes per
|
|
33891
|
+
* (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
|
|
33892
|
+
* Spell the scope with `occupancyScope(zoneId?, className?)` — the same
|
|
33893
|
+
* function the writer uses, so the two cannot drift.
|
|
33894
|
+
*
|
|
33895
|
+
* The ring stays until these three go, and it is the only thing left reading
|
|
33896
|
+
* it. Do not add a fourth caller.
|
|
33606
33897
|
*/
|
|
33607
33898
|
var zoneAnalyticsCapability = {
|
|
33608
33899
|
name: "zone-analytics",
|
|
@@ -38002,12 +38293,24 @@ Object.freeze({
|
|
|
38002
38293
|
addonId: null,
|
|
38003
38294
|
access: "create"
|
|
38004
38295
|
},
|
|
38296
|
+
"nativeObjectDetection.getOptions": {
|
|
38297
|
+
capName: "native-object-detection",
|
|
38298
|
+
capScope: "device",
|
|
38299
|
+
addonId: null,
|
|
38300
|
+
access: "view"
|
|
38301
|
+
},
|
|
38005
38302
|
"nativeObjectDetection.setEnabled": {
|
|
38006
38303
|
capName: "native-object-detection",
|
|
38007
38304
|
capScope: "device",
|
|
38008
38305
|
addonId: null,
|
|
38009
38306
|
access: "create"
|
|
38010
38307
|
},
|
|
38308
|
+
"nativeObjectDetection.setSettings": {
|
|
38309
|
+
capName: "native-object-detection",
|
|
38310
|
+
capScope: "device",
|
|
38311
|
+
addonId: null,
|
|
38312
|
+
access: "create"
|
|
38313
|
+
},
|
|
38011
38314
|
"navigation.getFeatures": {
|
|
38012
38315
|
capName: "navigation",
|
|
38013
38316
|
capScope: "device",
|
|
@@ -38272,6 +38575,12 @@ Object.freeze({
|
|
|
38272
38575
|
addonId: null,
|
|
38273
38576
|
access: "view"
|
|
38274
38577
|
},
|
|
38578
|
+
"notificationRules.getClipRetentionAsks": {
|
|
38579
|
+
capName: "notification-rules",
|
|
38580
|
+
capScope: "system",
|
|
38581
|
+
addonId: null,
|
|
38582
|
+
access: "view"
|
|
38583
|
+
},
|
|
38275
38584
|
"notificationRules.getConditionCatalog": {
|
|
38276
38585
|
capName: "notification-rules",
|
|
38277
38586
|
capScope: "system",
|
|
@@ -38782,6 +39091,12 @@ Object.freeze({
|
|
|
38782
39091
|
addonId: null,
|
|
38783
39092
|
access: "create"
|
|
38784
39093
|
},
|
|
39094
|
+
"pipelineAnalytics.readLongTermSeries": {
|
|
39095
|
+
capName: "pipeline-analytics",
|
|
39096
|
+
capScope: "device",
|
|
39097
|
+
addonId: null,
|
|
39098
|
+
access: "view"
|
|
39099
|
+
},
|
|
38785
39100
|
"pipelineAnalytics.rebuildObjectEmbeddings": {
|
|
38786
39101
|
capName: "pipeline-analytics",
|
|
38787
39102
|
capScope: "device",
|
|
@@ -39454,6 +39769,12 @@ Object.freeze({
|
|
|
39454
39769
|
addonId: null,
|
|
39455
39770
|
access: "create"
|
|
39456
39771
|
},
|
|
39772
|
+
"pipelineRunner.requestOccupancyBurst": {
|
|
39773
|
+
capName: "pipeline-runner",
|
|
39774
|
+
capScope: "system",
|
|
39775
|
+
addonId: null,
|
|
39776
|
+
access: "create"
|
|
39777
|
+
},
|
|
39457
39778
|
"pipelineRunner.runDetailSubtree": {
|
|
39458
39779
|
capName: "pipeline-runner",
|
|
39459
39780
|
capScope: "system",
|
|
@@ -42234,11 +42555,21 @@ Object.freeze({
|
|
|
42234
42555
|
form: "single",
|
|
42235
42556
|
optional: false
|
|
42236
42557
|
}],
|
|
42558
|
+
"nativeObjectDetection.getOptions": [{
|
|
42559
|
+
name: "deviceId",
|
|
42560
|
+
form: "single",
|
|
42561
|
+
optional: false
|
|
42562
|
+
}],
|
|
42237
42563
|
"nativeObjectDetection.setEnabled": [{
|
|
42238
42564
|
name: "deviceId",
|
|
42239
42565
|
form: "single",
|
|
42240
42566
|
optional: false
|
|
42241
42567
|
}],
|
|
42568
|
+
"nativeObjectDetection.setSettings": [{
|
|
42569
|
+
name: "deviceId",
|
|
42570
|
+
form: "single",
|
|
42571
|
+
optional: false
|
|
42572
|
+
}],
|
|
42242
42573
|
"navigation.getFeatures": [{
|
|
42243
42574
|
name: "deviceId",
|
|
42244
42575
|
form: "single",
|
|
@@ -42588,6 +42919,11 @@ Object.freeze({
|
|
|
42588
42919
|
form: "single",
|
|
42589
42920
|
optional: false
|
|
42590
42921
|
}],
|
|
42922
|
+
"pipelineAnalytics.readLongTermSeries": [{
|
|
42923
|
+
name: "deviceId",
|
|
42924
|
+
form: "single",
|
|
42925
|
+
optional: false
|
|
42926
|
+
}],
|
|
42591
42927
|
"pipelineAnalytics.rebuildObjectEmbeddings": [{
|
|
42592
42928
|
name: "deviceId",
|
|
42593
42929
|
form: "single",
|
|
@@ -42778,6 +43114,11 @@ Object.freeze({
|
|
|
42778
43114
|
form: "single",
|
|
42779
43115
|
optional: false
|
|
42780
43116
|
}],
|
|
43117
|
+
"pipelineRunner.requestOccupancyBurst": [{
|
|
43118
|
+
name: "deviceId",
|
|
43119
|
+
form: "single",
|
|
43120
|
+
optional: false
|
|
43121
|
+
}],
|
|
42781
43122
|
"pipelineRunner.runDetailSubtree": [{
|
|
42782
43123
|
name: "deviceId",
|
|
42783
43124
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -5359,7 +5359,7 @@ var ZodIssueCode = {
|
|
|
5359
5359
|
var ZodFirstPartyTypeKind;
|
|
5360
5360
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5361
5361
|
//#endregion
|
|
5362
|
-
//#region ../types/dist/sleep-
|
|
5362
|
+
//#region ../types/dist/sleep-BDR76Ykr.mjs
|
|
5363
5363
|
/**
|
|
5364
5364
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5365
5365
|
* window to float samples (D455).
|
|
@@ -11561,6 +11561,21 @@ var streamSignalsCapability = {
|
|
|
11561
11561
|
mode: "singleton",
|
|
11562
11562
|
deviceTypes: Object.values(DeviceType),
|
|
11563
11563
|
runtimeState: StreamSignalsStatusSchema,
|
|
11564
|
+
/**
|
|
11565
|
+
* Runtime-state durability: **session** — mirrored in RAM, never written.
|
|
11566
|
+
*
|
|
11567
|
+
* The slice holds what the DEVICE says it can emit. That is a probed fact,
|
|
11568
|
+
* not an operator choice: the provider re-declares it on every registration,
|
|
11569
|
+
* so losing it loses nothing and persisting it would freeze an answer the
|
|
11570
|
+
* camera is entitled to change. Measured the same day on the sibling case —
|
|
11571
|
+
* `native-object-detection.supportedClasses` was persisted, and a firmware
|
|
11572
|
+
* class the camera really detected stayed missing for the life of the row
|
|
11573
|
+
* because the fix could not reach it.
|
|
11574
|
+
*
|
|
11575
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
11576
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
11577
|
+
*/
|
|
11578
|
+
durability: "session",
|
|
11564
11579
|
methods: {
|
|
11565
11580
|
/**
|
|
11566
11581
|
* What this device can emit. Empty is a valid and common answer — most
|
|
@@ -18175,6 +18190,48 @@ var NcAlarmConfigSchema = object({
|
|
|
18175
18190
|
settings: NcAlarmSettingsSchema,
|
|
18176
18191
|
coverage: array(NcAlarmModeCoverageSchema)
|
|
18177
18192
|
});
|
|
18193
|
+
/**
|
|
18194
|
+
* ONE rule's demand on ONE camera's clip ring.
|
|
18195
|
+
*
|
|
18196
|
+
* A rule, not a camera: the broker takes the MAX over the asks that reach a
|
|
18197
|
+
* camera, so the answer stays a faithful description of the rules and the
|
|
18198
|
+
* bounding (the byte budget, the broker's own ceiling) stays where the cost
|
|
18199
|
+
* lives. A camera that appears in no ask is being told **nothing** — which is
|
|
18200
|
+
* a different thing from never having been told, and only the envelope
|
|
18201
|
+
* (`rulesLoaded`) can tell those apart.
|
|
18202
|
+
*/
|
|
18203
|
+
var NcClipRetentionAskSchema = object({
|
|
18204
|
+
/**
|
|
18205
|
+
* The camera this ask is about. **Absent = every camera**, which is what a
|
|
18206
|
+
* rule with no `conditions.devices` means: it can fire anywhere, so it is
|
|
18207
|
+
* asking everywhere.
|
|
18208
|
+
*/
|
|
18209
|
+
deviceId: number().int().nonnegative().optional(),
|
|
18210
|
+
/** Seconds of history the rule needs held for it. Never zero — a rule that
|
|
18211
|
+
* needs nothing produces no ask at all. */
|
|
18212
|
+
seconds: number().min(0).max(60),
|
|
18213
|
+
/** The profile the rule cuts from, when it named one. Absent = the cheapest
|
|
18214
|
+
* assigned, which is what the cut defaults to. */
|
|
18215
|
+
profile: CamProfileSchema.optional(),
|
|
18216
|
+
/** Who is asking — so a retention the operator did not expect names a rule. */
|
|
18217
|
+
ruleId: string(),
|
|
18218
|
+
ruleName: string(),
|
|
18219
|
+
/** Why this many seconds: the rule's own window, or the occupancy ceiling. */
|
|
18220
|
+
reason: _enum(["window", "occupancy"])
|
|
18221
|
+
});
|
|
18222
|
+
/**
|
|
18223
|
+
* The whole answer, with the one bit that keeps absence from reading as zero.
|
|
18224
|
+
*
|
|
18225
|
+
* `rulesLoaded` is false until the rule ledger has completed a load at least
|
|
18226
|
+
* once. A centre that is up but has not read its rules yet answers with an
|
|
18227
|
+
* empty ask list that means nothing at all — applying it would drop every
|
|
18228
|
+
* camera's ring to zero for the first events after a restart, which is the
|
|
18229
|
+
* footage this mechanism exists to keep.
|
|
18230
|
+
*/
|
|
18231
|
+
var NcClipRetentionPlanSchema = object({
|
|
18232
|
+
rulesLoaded: boolean(),
|
|
18233
|
+
asks: array(NcClipRetentionAskSchema).readonly()
|
|
18234
|
+
});
|
|
18178
18235
|
method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
|
|
18179
18236
|
kind: "mutation",
|
|
18180
18237
|
auth: "admin",
|
|
@@ -18195,7 +18252,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
18195
18252
|
}), object({ success: literal(true) }), {
|
|
18196
18253
|
kind: "mutation",
|
|
18197
18254
|
auth: "admin"
|
|
18198
|
-
}), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
|
|
18255
|
+
}), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
|
|
18199
18256
|
deviceId: number().int(),
|
|
18200
18257
|
muted: boolean()
|
|
18201
18258
|
}), object({ success: literal(true) }), {
|
|
@@ -19380,13 +19437,26 @@ var TrackAudioLabelSchema = object({
|
|
|
19380
19437
|
* - `audio` — an audio event on the camera itself that was anomalous for
|
|
19381
19438
|
* THAT camera, loud, and heard while nothing visual was happening (D62).
|
|
19382
19439
|
*
|
|
19440
|
+
* - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
|
|
19441
|
+
* that frame's pixel space. A real root detector and a SPATIAL one: its
|
|
19442
|
+
* boxes are the same kind of fact `pipeline`'s are, produced by a different
|
|
19443
|
+
* detector.
|
|
19444
|
+
*
|
|
19445
|
+
* `onboard` was missing here while `DetectionSourceSchema` already had it, so
|
|
19446
|
+
* a persisted onboard track failed `safeParse` on read and came back with NO
|
|
19447
|
+
* source at all — which `isSpatialTrack` then admitted by accident, through the
|
|
19448
|
+
* `undefined` arm rather than by anybody's decision, and which `excludeSources`
|
|
19449
|
+
* could not name.
|
|
19450
|
+
*
|
|
19383
19451
|
* The spatial subsystems (tracker association, occupancy count, re-id /
|
|
19384
19452
|
* embedding, resurrection) MUST skip every synthetic source. Test for that
|
|
19385
|
-
* with `isSpatialTrack`, which allow-lists
|
|
19386
|
-
* check silently readmits every source added after it was
|
|
19453
|
+
* with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
|
|
19454
|
+
* `!== 'sensor'` check silently readmits every source added after it was
|
|
19455
|
+
* written.
|
|
19387
19456
|
*/
|
|
19388
19457
|
var TrackSourceSchema = _enum([
|
|
19389
19458
|
"pipeline",
|
|
19459
|
+
"onboard",
|
|
19390
19460
|
"sensor",
|
|
19391
19461
|
"audio"
|
|
19392
19462
|
]);
|
|
@@ -20769,6 +20839,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
|
20769
20839
|
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
20770
20840
|
framesMatched: number().int()
|
|
20771
20841
|
})).readonly() });
|
|
20842
|
+
/**
|
|
20843
|
+
* The long-term series a camera produces. A closed union so a typo cannot
|
|
20844
|
+
* invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
|
|
20845
|
+
* is an alias of this, not a second list.
|
|
20846
|
+
*/
|
|
20847
|
+
var AnalyticsLtsSeriesSchema = _enum([
|
|
20848
|
+
"motion",
|
|
20849
|
+
"audio-dbfs",
|
|
20850
|
+
"battery",
|
|
20851
|
+
"occupancy"
|
|
20852
|
+
]);
|
|
20853
|
+
/**
|
|
20854
|
+
* One closed 5-minute bucket of a long-term series.
|
|
20855
|
+
*
|
|
20856
|
+
* `samples` is how many readings the bucket folded — it is the ACTIVITY for a
|
|
20857
|
+
* series like `motion`, and the confidence for one like `occupancy`. A bucket
|
|
20858
|
+
* that exists at all was measured; a bucket that is absent was not, which is a
|
|
20859
|
+
* different claim from zero and the reason this is a sparse series.
|
|
20860
|
+
*/
|
|
20861
|
+
var LtsBucketSchema = object({
|
|
20862
|
+
scope: string(),
|
|
20863
|
+
bucketStart: number().int(),
|
|
20864
|
+
samples: number().int().nonnegative(),
|
|
20865
|
+
sum: number(),
|
|
20866
|
+
min: number(),
|
|
20867
|
+
max: number()
|
|
20868
|
+
});
|
|
20772
20869
|
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
20773
20870
|
deviceId: number(),
|
|
20774
20871
|
trackId: string()
|
|
@@ -20815,6 +20912,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
20815
20912
|
kinds: array(string()).optional(),
|
|
20816
20913
|
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
20817
20914
|
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
|
|
20915
|
+
deviceId: number(),
|
|
20916
|
+
series: AnalyticsLtsSeriesSchema,
|
|
20917
|
+
/** Omit for EVERY scope of this series in the range. */
|
|
20918
|
+
scope: string().optional(),
|
|
20919
|
+
from: number(),
|
|
20920
|
+
to: number(),
|
|
20921
|
+
limit: number().int().positive().optional()
|
|
20922
|
+
}), array(LtsBucketSchema).readonly()), method(object({
|
|
20818
20923
|
deviceId: number(),
|
|
20819
20924
|
since: number(),
|
|
20820
20925
|
until: number(),
|
|
@@ -21433,6 +21538,40 @@ var MotionSourceEnum = _enum([
|
|
|
21433
21538
|
*/
|
|
21434
21539
|
var MotionSourcesSchema = array(MotionSourceEnum);
|
|
21435
21540
|
/**
|
|
21541
|
+
* Which root detector a camera runs — EXACTLY ONE.
|
|
21542
|
+
*
|
|
21543
|
+
* Deliberately the SAME vocabulary post-analysis already tags every detection
|
|
21544
|
+
* with (`DetectionSource`) rather than a second spelling of the same two
|
|
21545
|
+
* ideas: the value an operator picks here is the value that comes back on the
|
|
21546
|
+
* track, the overlay and the debug row.
|
|
21547
|
+
*
|
|
21548
|
+
* ## Why one, and why it is still an array
|
|
21549
|
+
*
|
|
21550
|
+
* Two roots on one camera is a capability nobody asked for and the operator has
|
|
21551
|
+
* since ruled out. It was never free: both planes feed the SAME per-device
|
|
21552
|
+
* stationary registry, both can promote the same parked object, and the two
|
|
21553
|
+
* detectors disagree about the same box by construction — which is the
|
|
21554
|
+
* disagreement D505 had to arbitrate. Removing the case removes the arbitration.
|
|
21555
|
+
*
|
|
21556
|
+
* The ARRAY shape survives because the stored settings and the attach payload
|
|
21557
|
+
* already speak it on every camera of every fleet, and a cap input that
|
|
21558
|
+
* suddenly refuses a stored value makes the camera un-attachable — a fail-closed
|
|
21559
|
+
* in the one direction that costs an operator their cameras. So the wire stays
|
|
21560
|
+
* tolerant and the TYPE is exact: a longer list is truncated to its first
|
|
21561
|
+
* element rather than refused, and `max(1)` is what every consumer can then
|
|
21562
|
+
* rely on.
|
|
21563
|
+
*
|
|
21564
|
+
* AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
|
|
21565
|
+
* a camera an operator left with no root detector — and `planDetectionSources`
|
|
21566
|
+
* has always said so: inventing a root for them is how a default acts without
|
|
21567
|
+
* anybody choosing it. Tightening this to `length(1)` broke that, and the
|
|
21568
|
+
* suite caught it.
|
|
21569
|
+
*
|
|
21570
|
+
* Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
|
|
21571
|
+
* `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
|
|
21572
|
+
*/
|
|
21573
|
+
var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
|
|
21574
|
+
/**
|
|
21436
21575
|
* Input shape for `pipeline-runner.reportMotion` cap method. Exported
|
|
21437
21576
|
* so cap-side consumers (the orchestrator forward, the runner addon's
|
|
21438
21577
|
* cap implementation, tests) can reuse the type instead of redeclaring
|
|
@@ -21583,6 +21722,35 @@ var RunnerCameraConfigSchema = object({
|
|
|
21583
21722
|
* events; the orchestrator forwards to `reportMotion`.
|
|
21584
21723
|
*/
|
|
21585
21724
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
21725
|
+
/**
|
|
21726
|
+
* WHICH root detector runs for this camera. The detection counterpart of
|
|
21727
|
+
* {@link motionSources}, same shape and same discipline: a per-camera list
|
|
21728
|
+
* of sources the system understands, vendor-agnostic, owned here.
|
|
21729
|
+
*
|
|
21730
|
+
* - `pipeline` — this runner's own root step on decoded pixels (`steps`).
|
|
21731
|
+
* - `onboard` — the CAMERA's own detector, admitted only when it is named
|
|
21732
|
+
* here. Its boxes reach post-analysis on the same
|
|
21733
|
+
* `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
|
|
21734
|
+
* track gets the same tracker, the same overlay and the same detail
|
|
21735
|
+
* subtree (face / plate / embedding).
|
|
21736
|
+
*
|
|
21737
|
+
* `['onboard']` alone is the REPLACEMENT: this runner's root step does not
|
|
21738
|
+
* run, and that is where a camera with a usable onboard detector buys back
|
|
21739
|
+
* its share of the accelerator. It saves the root inference, not the decode
|
|
21740
|
+
* — the detail subtree still needs pixels to cut crops from.
|
|
21741
|
+
*
|
|
21742
|
+
* A camera whose onboard detections carry no geometry cannot serve as a root
|
|
21743
|
+
* step at all (there is nothing to track), and the cap that knows this says
|
|
21744
|
+
* so on `native-object-detection.getOptions().geometry`. On Reolink that is
|
|
21745
|
+
* every battery camera: the boxes ride a sub-stream a battery camera never
|
|
21746
|
+
* attaches, so such a camera stays on `['pipeline']` and its onboard AI is
|
|
21747
|
+
* worth exactly what it already is — a wake signal with a class.
|
|
21748
|
+
*
|
|
21749
|
+
* Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
|
|
21750
|
+
* vendor never turns a detector on for the operator, and neither does a
|
|
21751
|
+
* default.
|
|
21752
|
+
*/
|
|
21753
|
+
detectionSources: DetectionSourcesSchema.default(["pipeline"]),
|
|
21586
21754
|
pipelineEnabled: boolean().default(true),
|
|
21587
21755
|
/** Ordered tree of video steps. Absent → runner skips video detection. */
|
|
21588
21756
|
steps: array(PipelineStepInputSchema).readonly().optional(),
|
|
@@ -21764,7 +21932,47 @@ var RunnerLocalMetricsSchema = object({
|
|
|
21764
21932
|
queueDepth: number(),
|
|
21765
21933
|
frameLazy: FrameLazyMetricsSchema.optional()
|
|
21766
21934
|
});
|
|
21935
|
+
/**
|
|
21936
|
+
* Pipeline Runner capability — runtime detection workhorse.
|
|
21937
|
+
*
|
|
21938
|
+
* One instance per node. Receives camera assignments from
|
|
21939
|
+
* `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
|
|
21940
|
+
* decoded frames, drains motion + detection queues, calls the local
|
|
21941
|
+
* `motion-detection` and `pipeline-executor` capabilities, and emits typed
|
|
21942
|
+
* `pipeline.inference-result` and `detection.motion-analysis` events on
|
|
21943
|
+
* the bus.
|
|
21944
|
+
*
|
|
21945
|
+
* Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
|
|
21946
|
+
* runner has zero knowledge of other agents, no global state, and never
|
|
21947
|
+
* makes assignment decisions itself.
|
|
21948
|
+
*/
|
|
21949
|
+
/**
|
|
21950
|
+
* Why a runner declined to look at a camera out of band. Named rather than a
|
|
21951
|
+
* bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
|
|
21952
|
+
* already mid-session and one already bursting are four different facts, and a
|
|
21953
|
+
* caller told only "no" cannot tell a protection from a bug.
|
|
21954
|
+
*/
|
|
21955
|
+
var OccupancyBurstRefusalSchema = _enum([
|
|
21956
|
+
"not-attached",
|
|
21957
|
+
"battery-asleep",
|
|
21958
|
+
"not-watching",
|
|
21959
|
+
"already-bursting"
|
|
21960
|
+
]);
|
|
21767
21961
|
method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mutation" }), method(object({ deviceId: number() }), object({ success: literal(true) }), { kind: "mutation" }), method(ReportMotionInputSchema, object({ success: literal(true) }), { kind: "mutation" }), method(_void(), RunnerLocalLoadSchema), method(_void(), RunnerLocalMetricsSchema), method(object({ deviceId: number() }), CameraMetricsSchema.nullable()), method(_void(), array(CameraMetricsWithDeviceIdSchema).readonly()), method(_void(), array(number()).readonly()), method(object({
|
|
21962
|
+
deviceId: number(),
|
|
21963
|
+
/** How many frames to collect. The caller sizes this against what its
|
|
21964
|
+
* own confirmation needs; the runner clamps it to the field's range. */
|
|
21965
|
+
frames: number().int().positive().optional(),
|
|
21966
|
+
/** Why, for the log. A burst nobody can attribute is a cost nobody can
|
|
21967
|
+
* defend — the periodic one at least has a timer to point at. */
|
|
21968
|
+
reason: string()
|
|
21969
|
+
}), object({
|
|
21970
|
+
started: boolean(),
|
|
21971
|
+
refusedBecause: OccupancyBurstRefusalSchema.optional()
|
|
21972
|
+
}), {
|
|
21973
|
+
auth: "admin",
|
|
21974
|
+
kind: "mutation"
|
|
21975
|
+
}), method(object({
|
|
21768
21976
|
handle: FrameHandleSchema,
|
|
21769
21977
|
bbox: NativeCropBboxSchema,
|
|
21770
21978
|
maxWidth: number().int().positive().optional(),
|
|
@@ -28611,11 +28819,46 @@ var NativeObjectDetectionStatusSchema = object({
|
|
|
28611
28819
|
supportedClasses: array(NativeObjectClassEnum).readonly(),
|
|
28612
28820
|
/**
|
|
28613
28821
|
* Whether forwarding of onboard AI detections is enabled for this device.
|
|
28614
|
-
*
|
|
28615
|
-
*
|
|
28822
|
+
*
|
|
28823
|
+
* Cold-start OFF on every camera. A vendor does not decide which detector a
|
|
28824
|
+
* camera runs — that is the operator's choice, and it is made where every
|
|
28825
|
+
* other detection choice is made. `geometry` on
|
|
28826
|
+
* {@link NativeObjectDetectionOptionsSchema} is how the form says what the
|
|
28827
|
+
* choice would buy this particular camera.
|
|
28616
28828
|
*/
|
|
28617
28829
|
enabled: boolean()
|
|
28618
28830
|
});
|
|
28831
|
+
/**
|
|
28832
|
+
* WHEN a camera's onboard detections carry geometry.
|
|
28833
|
+
*
|
|
28834
|
+
* - `boxed` — always. The provider holds a standing channel for the boxes, so
|
|
28835
|
+
* a detection is a trackable subject whenever the camera sees one.
|
|
28836
|
+
* - `while-streaming` — only while some stream of this camera is already open.
|
|
28837
|
+
* The boxes ride the video's own side-channel rather than a feed of their
|
|
28838
|
+
* own, so they cost nothing and they exist only when something is pulling.
|
|
28839
|
+
* On Reolink this is every BATTERY camera: a persistent second feed is real
|
|
28840
|
+
* radio drain, but a camera that is awake is awake precisely because
|
|
28841
|
+
* something is in front of it, and its stream is already being pulled.
|
|
28842
|
+
* - `flag-only` — never. The firmware ships the class and nothing else; the
|
|
28843
|
+
* pipeline needs geometry to make a subject, so such a push reaches the
|
|
28844
|
+
* tracker as motion and no further.
|
|
28845
|
+
*
|
|
28846
|
+
* Reported and not inferred, because the operator's question in front of the
|
|
28847
|
+
* picker is "what do I get", and these are three different answers (D14: the
|
|
28848
|
+
* derived form is only as honest as `getOptions`).
|
|
28849
|
+
*/
|
|
28850
|
+
var NativeObjectGeometryEnum = _enum([
|
|
28851
|
+
"boxed",
|
|
28852
|
+
"while-streaming",
|
|
28853
|
+
"flag-only"
|
|
28854
|
+
]);
|
|
28855
|
+
var NativeObjectDetectionOptionsSchema = object({
|
|
28856
|
+
/** Classes this firmware can detect — the same list the status reports. */
|
|
28857
|
+
supportedClasses: array(NativeObjectClassEnum).readonly(),
|
|
28858
|
+
/** What a detection from this camera carries. */
|
|
28859
|
+
geometry: NativeObjectGeometryEnum
|
|
28860
|
+
});
|
|
28861
|
+
var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
|
|
28619
28862
|
var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
|
|
28620
28863
|
/** Required by createRuntimeStateBridge — epoch ms of last refresh. */
|
|
28621
28864
|
lastFetchedAt: number() });
|
|
@@ -28625,13 +28868,23 @@ var nativeObjectDetectionCapability = {
|
|
|
28625
28868
|
deviceNative: true,
|
|
28626
28869
|
mode: "singleton",
|
|
28627
28870
|
deviceTypes: [DeviceType.Camera],
|
|
28628
|
-
methods: {
|
|
28629
|
-
deviceId: number(),
|
|
28630
|
-
|
|
28631
|
-
|
|
28632
|
-
|
|
28633
|
-
|
|
28634
|
-
|
|
28871
|
+
methods: {
|
|
28872
|
+
getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
|
|
28873
|
+
setSettings: method(object({
|
|
28874
|
+
deviceId: number(),
|
|
28875
|
+
settings: NativeObjectDetectionSettingsPatchSchema
|
|
28876
|
+
}), _void(), {
|
|
28877
|
+
kind: "mutation",
|
|
28878
|
+
auth: "admin"
|
|
28879
|
+
}),
|
|
28880
|
+
setEnabled: method(object({
|
|
28881
|
+
deviceId: number(),
|
|
28882
|
+
enabled: boolean()
|
|
28883
|
+
}), _void(), {
|
|
28884
|
+
kind: "mutation",
|
|
28885
|
+
auth: "admin"
|
|
28886
|
+
})
|
|
28887
|
+
},
|
|
28635
28888
|
events: { onDetected: { data: object({
|
|
28636
28889
|
deviceId: number(),
|
|
28637
28890
|
detection: NativeDetectionSchema
|
|
@@ -33479,7 +33732,28 @@ var PerScopeBreakdownSchema = object({
|
|
|
33479
33732
|
/** Total tracked objects in this scope (frame / zone / unzoned). */
|
|
33480
33733
|
totalObjects: number().int().nonnegative(),
|
|
33481
33734
|
/** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
|
|
33482
|
-
byClass: record(string(), number().int().nonnegative())
|
|
33735
|
+
byClass: record(string(), number().int().nonnegative()),
|
|
33736
|
+
/**
|
|
33737
|
+
* Of `totalObjects`, how many are STANDING — objects the census holds,
|
|
33738
|
+
* present but not going anywhere (a parked car, a bin, a statue).
|
|
33739
|
+
*
|
|
33740
|
+
* The operator's question about a scene has two halves and they answer
|
|
33741
|
+
* different things: "what is parked here" is stable for hours and must not
|
|
33742
|
+
* flap, while "who is walking through" is the thing an alert is about. One
|
|
33743
|
+
* number could only serve one of them, and `totalObjects` served the first
|
|
33744
|
+
* badly — a passer-by moved it and every occupancy rule saw a change.
|
|
33745
|
+
*
|
|
33746
|
+
* `standing + transient === totalObjects`, always. The total keeps its old
|
|
33747
|
+
* meaning exactly, so no rule written against it changes behaviour.
|
|
33748
|
+
*
|
|
33749
|
+
* ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
|
|
33750
|
+
* this field cannot say, and a reader that folds absence in as 0 reports "no
|
|
33751
|
+
* parked objects here" about a camera whose lot is full.
|
|
33752
|
+
*/
|
|
33753
|
+
standingObjects: number().int().nonnegative().optional(),
|
|
33754
|
+
/** Of `totalObjects`, how many are passing through. See `standingObjects` —
|
|
33755
|
+
* same absence rule. */
|
|
33756
|
+
transientObjects: number().int().nonnegative().optional()
|
|
33483
33757
|
});
|
|
33484
33758
|
var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
|
|
33485
33759
|
zoneId: string(),
|
|
@@ -33602,6 +33876,23 @@ var HistoryPointSchema = object({
|
|
|
33602
33876
|
* triple covers the three spatial scopes (per-zone, frame-wide,
|
|
33603
33877
|
* outside-any-zone). Crossing them with `className?` gives the full
|
|
33604
33878
|
* combinatorial coverage the operator UI requested.
|
|
33879
|
+
*
|
|
33880
|
+
* ## ⚠️ The three history methods are DEPRECATED
|
|
33881
|
+
*
|
|
33882
|
+
* They are served from a 60-MINUTE in-memory ring. It dies with the process,
|
|
33883
|
+
* so after a restart they report nothing about a night that did happen, and any
|
|
33884
|
+
* window past an hour is silently clamped — a caller cannot tell a clamp from
|
|
33885
|
+
* an empty scene. The presets in the occupancy chart existed to hide that
|
|
33886
|
+
* horizon rather than to answer a question.
|
|
33887
|
+
*
|
|
33888
|
+
* Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
|
|
33889
|
+
* instead. Those rows are already written for every camera, ~60 bytes per
|
|
33890
|
+
* (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
|
|
33891
|
+
* Spell the scope with `occupancyScope(zoneId?, className?)` — the same
|
|
33892
|
+
* function the writer uses, so the two cannot drift.
|
|
33893
|
+
*
|
|
33894
|
+
* The ring stays until these three go, and it is the only thing left reading
|
|
33895
|
+
* it. Do not add a fourth caller.
|
|
33605
33896
|
*/
|
|
33606
33897
|
var zoneAnalyticsCapability = {
|
|
33607
33898
|
name: "zone-analytics",
|
|
@@ -38001,12 +38292,24 @@ Object.freeze({
|
|
|
38001
38292
|
addonId: null,
|
|
38002
38293
|
access: "create"
|
|
38003
38294
|
},
|
|
38295
|
+
"nativeObjectDetection.getOptions": {
|
|
38296
|
+
capName: "native-object-detection",
|
|
38297
|
+
capScope: "device",
|
|
38298
|
+
addonId: null,
|
|
38299
|
+
access: "view"
|
|
38300
|
+
},
|
|
38004
38301
|
"nativeObjectDetection.setEnabled": {
|
|
38005
38302
|
capName: "native-object-detection",
|
|
38006
38303
|
capScope: "device",
|
|
38007
38304
|
addonId: null,
|
|
38008
38305
|
access: "create"
|
|
38009
38306
|
},
|
|
38307
|
+
"nativeObjectDetection.setSettings": {
|
|
38308
|
+
capName: "native-object-detection",
|
|
38309
|
+
capScope: "device",
|
|
38310
|
+
addonId: null,
|
|
38311
|
+
access: "create"
|
|
38312
|
+
},
|
|
38010
38313
|
"navigation.getFeatures": {
|
|
38011
38314
|
capName: "navigation",
|
|
38012
38315
|
capScope: "device",
|
|
@@ -38271,6 +38574,12 @@ Object.freeze({
|
|
|
38271
38574
|
addonId: null,
|
|
38272
38575
|
access: "view"
|
|
38273
38576
|
},
|
|
38577
|
+
"notificationRules.getClipRetentionAsks": {
|
|
38578
|
+
capName: "notification-rules",
|
|
38579
|
+
capScope: "system",
|
|
38580
|
+
addonId: null,
|
|
38581
|
+
access: "view"
|
|
38582
|
+
},
|
|
38274
38583
|
"notificationRules.getConditionCatalog": {
|
|
38275
38584
|
capName: "notification-rules",
|
|
38276
38585
|
capScope: "system",
|
|
@@ -38781,6 +39090,12 @@ Object.freeze({
|
|
|
38781
39090
|
addonId: null,
|
|
38782
39091
|
access: "create"
|
|
38783
39092
|
},
|
|
39093
|
+
"pipelineAnalytics.readLongTermSeries": {
|
|
39094
|
+
capName: "pipeline-analytics",
|
|
39095
|
+
capScope: "device",
|
|
39096
|
+
addonId: null,
|
|
39097
|
+
access: "view"
|
|
39098
|
+
},
|
|
38784
39099
|
"pipelineAnalytics.rebuildObjectEmbeddings": {
|
|
38785
39100
|
capName: "pipeline-analytics",
|
|
38786
39101
|
capScope: "device",
|
|
@@ -39453,6 +39768,12 @@ Object.freeze({
|
|
|
39453
39768
|
addonId: null,
|
|
39454
39769
|
access: "create"
|
|
39455
39770
|
},
|
|
39771
|
+
"pipelineRunner.requestOccupancyBurst": {
|
|
39772
|
+
capName: "pipeline-runner",
|
|
39773
|
+
capScope: "system",
|
|
39774
|
+
addonId: null,
|
|
39775
|
+
access: "create"
|
|
39776
|
+
},
|
|
39456
39777
|
"pipelineRunner.runDetailSubtree": {
|
|
39457
39778
|
capName: "pipeline-runner",
|
|
39458
39779
|
capScope: "system",
|
|
@@ -42233,11 +42554,21 @@ Object.freeze({
|
|
|
42233
42554
|
form: "single",
|
|
42234
42555
|
optional: false
|
|
42235
42556
|
}],
|
|
42557
|
+
"nativeObjectDetection.getOptions": [{
|
|
42558
|
+
name: "deviceId",
|
|
42559
|
+
form: "single",
|
|
42560
|
+
optional: false
|
|
42561
|
+
}],
|
|
42236
42562
|
"nativeObjectDetection.setEnabled": [{
|
|
42237
42563
|
name: "deviceId",
|
|
42238
42564
|
form: "single",
|
|
42239
42565
|
optional: false
|
|
42240
42566
|
}],
|
|
42567
|
+
"nativeObjectDetection.setSettings": [{
|
|
42568
|
+
name: "deviceId",
|
|
42569
|
+
form: "single",
|
|
42570
|
+
optional: false
|
|
42571
|
+
}],
|
|
42241
42572
|
"navigation.getFeatures": [{
|
|
42242
42573
|
name: "deviceId",
|
|
42243
42574
|
form: "single",
|
|
@@ -42587,6 +42918,11 @@ Object.freeze({
|
|
|
42587
42918
|
form: "single",
|
|
42588
42919
|
optional: false
|
|
42589
42920
|
}],
|
|
42921
|
+
"pipelineAnalytics.readLongTermSeries": [{
|
|
42922
|
+
name: "deviceId",
|
|
42923
|
+
form: "single",
|
|
42924
|
+
optional: false
|
|
42925
|
+
}],
|
|
42590
42926
|
"pipelineAnalytics.rebuildObjectEmbeddings": [{
|
|
42591
42927
|
name: "deviceId",
|
|
42592
42928
|
form: "single",
|
|
@@ -42777,6 +43113,11 @@ Object.freeze({
|
|
|
42777
43113
|
form: "single",
|
|
42778
43114
|
optional: false
|
|
42779
43115
|
}],
|
|
43116
|
+
"pipelineRunner.requestOccupancyBurst": [{
|
|
43117
|
+
name: "deviceId",
|
|
43118
|
+
form: "single",
|
|
43119
|
+
optional: false
|
|
43120
|
+
}],
|
|
42780
43121
|
"pipelineRunner.runDetailSubtree": [{
|
|
42781
43122
|
name: "deviceId",
|
|
42782
43123
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-unifi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.104",
|
|
4
4
|
"description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"dev": "vite build --watch",
|
|
63
63
|
"typecheck": "tsc --noEmit",
|
|
64
64
|
"test": "vitest run",
|
|
65
|
-
"publish": "npm publish --access public"
|
|
65
|
+
"publish:npm": "npm publish --access public"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@camstack/types": "*",
|