@camstack/addon-provider-tuya 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
|
@@ -6180,7 +6180,7 @@ var ZodIssueCode = {
|
|
|
6180
6180
|
var ZodFirstPartyTypeKind;
|
|
6181
6181
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
6182
6182
|
//#endregion
|
|
6183
|
-
//#region ../types/dist/sleep-
|
|
6183
|
+
//#region ../types/dist/sleep-BDR76Ykr.mjs
|
|
6184
6184
|
/**
|
|
6185
6185
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
6186
6186
|
* window to float samples (D455).
|
|
@@ -12382,6 +12382,21 @@ var streamSignalsCapability = {
|
|
|
12382
12382
|
mode: "singleton",
|
|
12383
12383
|
deviceTypes: Object.values(DeviceType),
|
|
12384
12384
|
runtimeState: StreamSignalsStatusSchema,
|
|
12385
|
+
/**
|
|
12386
|
+
* Runtime-state durability: **session** — mirrored in RAM, never written.
|
|
12387
|
+
*
|
|
12388
|
+
* The slice holds what the DEVICE says it can emit. That is a probed fact,
|
|
12389
|
+
* not an operator choice: the provider re-declares it on every registration,
|
|
12390
|
+
* so losing it loses nothing and persisting it would freeze an answer the
|
|
12391
|
+
* camera is entitled to change. Measured the same day on the sibling case —
|
|
12392
|
+
* `native-object-detection.supportedClasses` was persisted, and a firmware
|
|
12393
|
+
* class the camera really detected stayed missing for the life of the row
|
|
12394
|
+
* because the fix could not reach it.
|
|
12395
|
+
*
|
|
12396
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
12397
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
12398
|
+
*/
|
|
12399
|
+
durability: "session",
|
|
12385
12400
|
methods: {
|
|
12386
12401
|
/**
|
|
12387
12402
|
* What this device can emit. Empty is a valid and common answer — most
|
|
@@ -19013,6 +19028,48 @@ var NcAlarmConfigSchema = object({
|
|
|
19013
19028
|
settings: NcAlarmSettingsSchema,
|
|
19014
19029
|
coverage: array(NcAlarmModeCoverageSchema)
|
|
19015
19030
|
});
|
|
19031
|
+
/**
|
|
19032
|
+
* ONE rule's demand on ONE camera's clip ring.
|
|
19033
|
+
*
|
|
19034
|
+
* A rule, not a camera: the broker takes the MAX over the asks that reach a
|
|
19035
|
+
* camera, so the answer stays a faithful description of the rules and the
|
|
19036
|
+
* bounding (the byte budget, the broker's own ceiling) stays where the cost
|
|
19037
|
+
* lives. A camera that appears in no ask is being told **nothing** — which is
|
|
19038
|
+
* a different thing from never having been told, and only the envelope
|
|
19039
|
+
* (`rulesLoaded`) can tell those apart.
|
|
19040
|
+
*/
|
|
19041
|
+
var NcClipRetentionAskSchema = object({
|
|
19042
|
+
/**
|
|
19043
|
+
* The camera this ask is about. **Absent = every camera**, which is what a
|
|
19044
|
+
* rule with no `conditions.devices` means: it can fire anywhere, so it is
|
|
19045
|
+
* asking everywhere.
|
|
19046
|
+
*/
|
|
19047
|
+
deviceId: number().int().nonnegative().optional(),
|
|
19048
|
+
/** Seconds of history the rule needs held for it. Never zero — a rule that
|
|
19049
|
+
* needs nothing produces no ask at all. */
|
|
19050
|
+
seconds: number().min(0).max(60),
|
|
19051
|
+
/** The profile the rule cuts from, when it named one. Absent = the cheapest
|
|
19052
|
+
* assigned, which is what the cut defaults to. */
|
|
19053
|
+
profile: CamProfileSchema.optional(),
|
|
19054
|
+
/** Who is asking — so a retention the operator did not expect names a rule. */
|
|
19055
|
+
ruleId: string(),
|
|
19056
|
+
ruleName: string(),
|
|
19057
|
+
/** Why this many seconds: the rule's own window, or the occupancy ceiling. */
|
|
19058
|
+
reason: _enum(["window", "occupancy"])
|
|
19059
|
+
});
|
|
19060
|
+
/**
|
|
19061
|
+
* The whole answer, with the one bit that keeps absence from reading as zero.
|
|
19062
|
+
*
|
|
19063
|
+
* `rulesLoaded` is false until the rule ledger has completed a load at least
|
|
19064
|
+
* once. A centre that is up but has not read its rules yet answers with an
|
|
19065
|
+
* empty ask list that means nothing at all — applying it would drop every
|
|
19066
|
+
* camera's ring to zero for the first events after a restart, which is the
|
|
19067
|
+
* footage this mechanism exists to keep.
|
|
19068
|
+
*/
|
|
19069
|
+
var NcClipRetentionPlanSchema = object({
|
|
19070
|
+
rulesLoaded: boolean(),
|
|
19071
|
+
asks: array(NcClipRetentionAskSchema).readonly()
|
|
19072
|
+
});
|
|
19016
19073
|
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 }), {
|
|
19017
19074
|
kind: "mutation",
|
|
19018
19075
|
auth: "admin",
|
|
@@ -19033,7 +19090,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
19033
19090
|
}), object({ success: literal(true) }), {
|
|
19034
19091
|
kind: "mutation",
|
|
19035
19092
|
auth: "admin"
|
|
19036
|
-
}), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
|
|
19093
|
+
}), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
|
|
19037
19094
|
deviceId: number().int(),
|
|
19038
19095
|
muted: boolean()
|
|
19039
19096
|
}), object({ success: literal(true) }), {
|
|
@@ -20218,13 +20275,26 @@ var TrackAudioLabelSchema = object({
|
|
|
20218
20275
|
* - `audio` — an audio event on the camera itself that was anomalous for
|
|
20219
20276
|
* THAT camera, loud, and heard while nothing visual was happening (D62).
|
|
20220
20277
|
*
|
|
20278
|
+
* - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
|
|
20279
|
+
* that frame's pixel space. A real root detector and a SPATIAL one: its
|
|
20280
|
+
* boxes are the same kind of fact `pipeline`'s are, produced by a different
|
|
20281
|
+
* detector.
|
|
20282
|
+
*
|
|
20283
|
+
* `onboard` was missing here while `DetectionSourceSchema` already had it, so
|
|
20284
|
+
* a persisted onboard track failed `safeParse` on read and came back with NO
|
|
20285
|
+
* source at all — which `isSpatialTrack` then admitted by accident, through the
|
|
20286
|
+
* `undefined` arm rather than by anybody's decision, and which `excludeSources`
|
|
20287
|
+
* could not name.
|
|
20288
|
+
*
|
|
20221
20289
|
* The spatial subsystems (tracker association, occupancy count, re-id /
|
|
20222
20290
|
* embedding, resurrection) MUST skip every synthetic source. Test for that
|
|
20223
|
-
* with `isSpatialTrack`, which allow-lists
|
|
20224
|
-
* check silently readmits every source added after it was
|
|
20291
|
+
* with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
|
|
20292
|
+
* `!== 'sensor'` check silently readmits every source added after it was
|
|
20293
|
+
* written.
|
|
20225
20294
|
*/
|
|
20226
20295
|
var TrackSourceSchema = _enum([
|
|
20227
20296
|
"pipeline",
|
|
20297
|
+
"onboard",
|
|
20228
20298
|
"sensor",
|
|
20229
20299
|
"audio"
|
|
20230
20300
|
]);
|
|
@@ -21607,6 +21677,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
|
21607
21677
|
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
21608
21678
|
framesMatched: number().int()
|
|
21609
21679
|
})).readonly() });
|
|
21680
|
+
/**
|
|
21681
|
+
* The long-term series a camera produces. A closed union so a typo cannot
|
|
21682
|
+
* invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
|
|
21683
|
+
* is an alias of this, not a second list.
|
|
21684
|
+
*/
|
|
21685
|
+
var AnalyticsLtsSeriesSchema = _enum([
|
|
21686
|
+
"motion",
|
|
21687
|
+
"audio-dbfs",
|
|
21688
|
+
"battery",
|
|
21689
|
+
"occupancy"
|
|
21690
|
+
]);
|
|
21691
|
+
/**
|
|
21692
|
+
* One closed 5-minute bucket of a long-term series.
|
|
21693
|
+
*
|
|
21694
|
+
* `samples` is how many readings the bucket folded — it is the ACTIVITY for a
|
|
21695
|
+
* series like `motion`, and the confidence for one like `occupancy`. A bucket
|
|
21696
|
+
* that exists at all was measured; a bucket that is absent was not, which is a
|
|
21697
|
+
* different claim from zero and the reason this is a sparse series.
|
|
21698
|
+
*/
|
|
21699
|
+
var LtsBucketSchema = object({
|
|
21700
|
+
scope: string(),
|
|
21701
|
+
bucketStart: number().int(),
|
|
21702
|
+
samples: number().int().nonnegative(),
|
|
21703
|
+
sum: number(),
|
|
21704
|
+
min: number(),
|
|
21705
|
+
max: number()
|
|
21706
|
+
});
|
|
21610
21707
|
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
21611
21708
|
deviceId: number(),
|
|
21612
21709
|
trackId: string()
|
|
@@ -21653,6 +21750,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21653
21750
|
kinds: array(string()).optional(),
|
|
21654
21751
|
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
21655
21752
|
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
|
|
21753
|
+
deviceId: number(),
|
|
21754
|
+
series: AnalyticsLtsSeriesSchema,
|
|
21755
|
+
/** Omit for EVERY scope of this series in the range. */
|
|
21756
|
+
scope: string().optional(),
|
|
21757
|
+
from: number(),
|
|
21758
|
+
to: number(),
|
|
21759
|
+
limit: number().int().positive().optional()
|
|
21760
|
+
}), array(LtsBucketSchema).readonly()), method(object({
|
|
21656
21761
|
deviceId: number(),
|
|
21657
21762
|
since: number(),
|
|
21658
21763
|
until: number(),
|
|
@@ -22271,6 +22376,40 @@ var MotionSourceEnum = _enum([
|
|
|
22271
22376
|
*/
|
|
22272
22377
|
var MotionSourcesSchema = array(MotionSourceEnum);
|
|
22273
22378
|
/**
|
|
22379
|
+
* Which root detector a camera runs — EXACTLY ONE.
|
|
22380
|
+
*
|
|
22381
|
+
* Deliberately the SAME vocabulary post-analysis already tags every detection
|
|
22382
|
+
* with (`DetectionSource`) rather than a second spelling of the same two
|
|
22383
|
+
* ideas: the value an operator picks here is the value that comes back on the
|
|
22384
|
+
* track, the overlay and the debug row.
|
|
22385
|
+
*
|
|
22386
|
+
* ## Why one, and why it is still an array
|
|
22387
|
+
*
|
|
22388
|
+
* Two roots on one camera is a capability nobody asked for and the operator has
|
|
22389
|
+
* since ruled out. It was never free: both planes feed the SAME per-device
|
|
22390
|
+
* stationary registry, both can promote the same parked object, and the two
|
|
22391
|
+
* detectors disagree about the same box by construction — which is the
|
|
22392
|
+
* disagreement D505 had to arbitrate. Removing the case removes the arbitration.
|
|
22393
|
+
*
|
|
22394
|
+
* The ARRAY shape survives because the stored settings and the attach payload
|
|
22395
|
+
* already speak it on every camera of every fleet, and a cap input that
|
|
22396
|
+
* suddenly refuses a stored value makes the camera un-attachable — a fail-closed
|
|
22397
|
+
* in the one direction that costs an operator their cameras. So the wire stays
|
|
22398
|
+
* tolerant and the TYPE is exact: a longer list is truncated to its first
|
|
22399
|
+
* element rather than refused, and `max(1)` is what every consumer can then
|
|
22400
|
+
* rely on.
|
|
22401
|
+
*
|
|
22402
|
+
* AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
|
|
22403
|
+
* a camera an operator left with no root detector — and `planDetectionSources`
|
|
22404
|
+
* has always said so: inventing a root for them is how a default acts without
|
|
22405
|
+
* anybody choosing it. Tightening this to `length(1)` broke that, and the
|
|
22406
|
+
* suite caught it.
|
|
22407
|
+
*
|
|
22408
|
+
* Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
|
|
22409
|
+
* `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
|
|
22410
|
+
*/
|
|
22411
|
+
var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
|
|
22412
|
+
/**
|
|
22274
22413
|
* Input shape for `pipeline-runner.reportMotion` cap method. Exported
|
|
22275
22414
|
* so cap-side consumers (the orchestrator forward, the runner addon's
|
|
22276
22415
|
* cap implementation, tests) can reuse the type instead of redeclaring
|
|
@@ -22421,6 +22560,35 @@ var RunnerCameraConfigSchema = object({
|
|
|
22421
22560
|
* events; the orchestrator forwards to `reportMotion`.
|
|
22422
22561
|
*/
|
|
22423
22562
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
22563
|
+
/**
|
|
22564
|
+
* WHICH root detector runs for this camera. The detection counterpart of
|
|
22565
|
+
* {@link motionSources}, same shape and same discipline: a per-camera list
|
|
22566
|
+
* of sources the system understands, vendor-agnostic, owned here.
|
|
22567
|
+
*
|
|
22568
|
+
* - `pipeline` — this runner's own root step on decoded pixels (`steps`).
|
|
22569
|
+
* - `onboard` — the CAMERA's own detector, admitted only when it is named
|
|
22570
|
+
* here. Its boxes reach post-analysis on the same
|
|
22571
|
+
* `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
|
|
22572
|
+
* track gets the same tracker, the same overlay and the same detail
|
|
22573
|
+
* subtree (face / plate / embedding).
|
|
22574
|
+
*
|
|
22575
|
+
* `['onboard']` alone is the REPLACEMENT: this runner's root step does not
|
|
22576
|
+
* run, and that is where a camera with a usable onboard detector buys back
|
|
22577
|
+
* its share of the accelerator. It saves the root inference, not the decode
|
|
22578
|
+
* — the detail subtree still needs pixels to cut crops from.
|
|
22579
|
+
*
|
|
22580
|
+
* A camera whose onboard detections carry no geometry cannot serve as a root
|
|
22581
|
+
* step at all (there is nothing to track), and the cap that knows this says
|
|
22582
|
+
* so on `native-object-detection.getOptions().geometry`. On Reolink that is
|
|
22583
|
+
* every battery camera: the boxes ride a sub-stream a battery camera never
|
|
22584
|
+
* attaches, so such a camera stays on `['pipeline']` and its onboard AI is
|
|
22585
|
+
* worth exactly what it already is — a wake signal with a class.
|
|
22586
|
+
*
|
|
22587
|
+
* Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
|
|
22588
|
+
* vendor never turns a detector on for the operator, and neither does a
|
|
22589
|
+
* default.
|
|
22590
|
+
*/
|
|
22591
|
+
detectionSources: DetectionSourcesSchema.default(["pipeline"]),
|
|
22424
22592
|
pipelineEnabled: boolean().default(true),
|
|
22425
22593
|
/** Ordered tree of video steps. Absent → runner skips video detection. */
|
|
22426
22594
|
steps: array(PipelineStepInputSchema).readonly().optional(),
|
|
@@ -22602,7 +22770,47 @@ var RunnerLocalMetricsSchema = object({
|
|
|
22602
22770
|
queueDepth: number(),
|
|
22603
22771
|
frameLazy: FrameLazyMetricsSchema.optional()
|
|
22604
22772
|
});
|
|
22773
|
+
/**
|
|
22774
|
+
* Pipeline Runner capability — runtime detection workhorse.
|
|
22775
|
+
*
|
|
22776
|
+
* One instance per node. Receives camera assignments from
|
|
22777
|
+
* `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
|
|
22778
|
+
* decoded frames, drains motion + detection queues, calls the local
|
|
22779
|
+
* `motion-detection` and `pipeline-executor` capabilities, and emits typed
|
|
22780
|
+
* `pipeline.inference-result` and `detection.motion-analysis` events on
|
|
22781
|
+
* the bus.
|
|
22782
|
+
*
|
|
22783
|
+
* Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
|
|
22784
|
+
* runner has zero knowledge of other agents, no global state, and never
|
|
22785
|
+
* makes assignment decisions itself.
|
|
22786
|
+
*/
|
|
22787
|
+
/**
|
|
22788
|
+
* Why a runner declined to look at a camera out of band. Named rather than a
|
|
22789
|
+
* bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
|
|
22790
|
+
* already mid-session and one already bursting are four different facts, and a
|
|
22791
|
+
* caller told only "no" cannot tell a protection from a bug.
|
|
22792
|
+
*/
|
|
22793
|
+
var OccupancyBurstRefusalSchema = _enum([
|
|
22794
|
+
"not-attached",
|
|
22795
|
+
"battery-asleep",
|
|
22796
|
+
"not-watching",
|
|
22797
|
+
"already-bursting"
|
|
22798
|
+
]);
|
|
22605
22799
|
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({
|
|
22800
|
+
deviceId: number(),
|
|
22801
|
+
/** How many frames to collect. The caller sizes this against what its
|
|
22802
|
+
* own confirmation needs; the runner clamps it to the field's range. */
|
|
22803
|
+
frames: number().int().positive().optional(),
|
|
22804
|
+
/** Why, for the log. A burst nobody can attribute is a cost nobody can
|
|
22805
|
+
* defend — the periodic one at least has a timer to point at. */
|
|
22806
|
+
reason: string()
|
|
22807
|
+
}), object({
|
|
22808
|
+
started: boolean(),
|
|
22809
|
+
refusedBecause: OccupancyBurstRefusalSchema.optional()
|
|
22810
|
+
}), {
|
|
22811
|
+
auth: "admin",
|
|
22812
|
+
kind: "mutation"
|
|
22813
|
+
}), method(object({
|
|
22606
22814
|
handle: FrameHandleSchema,
|
|
22607
22815
|
bbox: NativeCropBboxSchema,
|
|
22608
22816
|
maxWidth: number().int().positive().optional(),
|
|
@@ -29440,11 +29648,46 @@ var NativeObjectDetectionStatusSchema = object({
|
|
|
29440
29648
|
supportedClasses: array(NativeObjectClassEnum).readonly(),
|
|
29441
29649
|
/**
|
|
29442
29650
|
* Whether forwarding of onboard AI detections is enabled for this device.
|
|
29443
|
-
*
|
|
29444
|
-
*
|
|
29651
|
+
*
|
|
29652
|
+
* Cold-start OFF on every camera. A vendor does not decide which detector a
|
|
29653
|
+
* camera runs — that is the operator's choice, and it is made where every
|
|
29654
|
+
* other detection choice is made. `geometry` on
|
|
29655
|
+
* {@link NativeObjectDetectionOptionsSchema} is how the form says what the
|
|
29656
|
+
* choice would buy this particular camera.
|
|
29445
29657
|
*/
|
|
29446
29658
|
enabled: boolean()
|
|
29447
29659
|
});
|
|
29660
|
+
/**
|
|
29661
|
+
* WHEN a camera's onboard detections carry geometry.
|
|
29662
|
+
*
|
|
29663
|
+
* - `boxed` — always. The provider holds a standing channel for the boxes, so
|
|
29664
|
+
* a detection is a trackable subject whenever the camera sees one.
|
|
29665
|
+
* - `while-streaming` — only while some stream of this camera is already open.
|
|
29666
|
+
* The boxes ride the video's own side-channel rather than a feed of their
|
|
29667
|
+
* own, so they cost nothing and they exist only when something is pulling.
|
|
29668
|
+
* On Reolink this is every BATTERY camera: a persistent second feed is real
|
|
29669
|
+
* radio drain, but a camera that is awake is awake precisely because
|
|
29670
|
+
* something is in front of it, and its stream is already being pulled.
|
|
29671
|
+
* - `flag-only` — never. The firmware ships the class and nothing else; the
|
|
29672
|
+
* pipeline needs geometry to make a subject, so such a push reaches the
|
|
29673
|
+
* tracker as motion and no further.
|
|
29674
|
+
*
|
|
29675
|
+
* Reported and not inferred, because the operator's question in front of the
|
|
29676
|
+
* picker is "what do I get", and these are three different answers (D14: the
|
|
29677
|
+
* derived form is only as honest as `getOptions`).
|
|
29678
|
+
*/
|
|
29679
|
+
var NativeObjectGeometryEnum = _enum([
|
|
29680
|
+
"boxed",
|
|
29681
|
+
"while-streaming",
|
|
29682
|
+
"flag-only"
|
|
29683
|
+
]);
|
|
29684
|
+
var NativeObjectDetectionOptionsSchema = object({
|
|
29685
|
+
/** Classes this firmware can detect — the same list the status reports. */
|
|
29686
|
+
supportedClasses: array(NativeObjectClassEnum).readonly(),
|
|
29687
|
+
/** What a detection from this camera carries. */
|
|
29688
|
+
geometry: NativeObjectGeometryEnum
|
|
29689
|
+
});
|
|
29690
|
+
var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
|
|
29448
29691
|
var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
|
|
29449
29692
|
/** Required by createRuntimeStateBridge — epoch ms of last refresh. */
|
|
29450
29693
|
lastFetchedAt: number() });
|
|
@@ -29454,13 +29697,23 @@ var nativeObjectDetectionCapability = {
|
|
|
29454
29697
|
deviceNative: true,
|
|
29455
29698
|
mode: "singleton",
|
|
29456
29699
|
deviceTypes: [DeviceType.Camera],
|
|
29457
|
-
methods: {
|
|
29458
|
-
deviceId: number(),
|
|
29459
|
-
|
|
29460
|
-
|
|
29461
|
-
|
|
29462
|
-
|
|
29463
|
-
|
|
29700
|
+
methods: {
|
|
29701
|
+
getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
|
|
29702
|
+
setSettings: method(object({
|
|
29703
|
+
deviceId: number(),
|
|
29704
|
+
settings: NativeObjectDetectionSettingsPatchSchema
|
|
29705
|
+
}), _void(), {
|
|
29706
|
+
kind: "mutation",
|
|
29707
|
+
auth: "admin"
|
|
29708
|
+
}),
|
|
29709
|
+
setEnabled: method(object({
|
|
29710
|
+
deviceId: number(),
|
|
29711
|
+
enabled: boolean()
|
|
29712
|
+
}), _void(), {
|
|
29713
|
+
kind: "mutation",
|
|
29714
|
+
auth: "admin"
|
|
29715
|
+
})
|
|
29716
|
+
},
|
|
29464
29717
|
events: { onDetected: { data: object({
|
|
29465
29718
|
deviceId: number(),
|
|
29466
29719
|
detection: NativeDetectionSchema
|
|
@@ -34308,7 +34561,28 @@ var PerScopeBreakdownSchema = object({
|
|
|
34308
34561
|
/** Total tracked objects in this scope (frame / zone / unzoned). */
|
|
34309
34562
|
totalObjects: number().int().nonnegative(),
|
|
34310
34563
|
/** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
|
|
34311
|
-
byClass: record(string(), number().int().nonnegative())
|
|
34564
|
+
byClass: record(string(), number().int().nonnegative()),
|
|
34565
|
+
/**
|
|
34566
|
+
* Of `totalObjects`, how many are STANDING — objects the census holds,
|
|
34567
|
+
* present but not going anywhere (a parked car, a bin, a statue).
|
|
34568
|
+
*
|
|
34569
|
+
* The operator's question about a scene has two halves and they answer
|
|
34570
|
+
* different things: "what is parked here" is stable for hours and must not
|
|
34571
|
+
* flap, while "who is walking through" is the thing an alert is about. One
|
|
34572
|
+
* number could only serve one of them, and `totalObjects` served the first
|
|
34573
|
+
* badly — a passer-by moved it and every occupancy rule saw a change.
|
|
34574
|
+
*
|
|
34575
|
+
* `standing + transient === totalObjects`, always. The total keeps its old
|
|
34576
|
+
* meaning exactly, so no rule written against it changes behaviour.
|
|
34577
|
+
*
|
|
34578
|
+
* ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
|
|
34579
|
+
* this field cannot say, and a reader that folds absence in as 0 reports "no
|
|
34580
|
+
* parked objects here" about a camera whose lot is full.
|
|
34581
|
+
*/
|
|
34582
|
+
standingObjects: number().int().nonnegative().optional(),
|
|
34583
|
+
/** Of `totalObjects`, how many are passing through. See `standingObjects` —
|
|
34584
|
+
* same absence rule. */
|
|
34585
|
+
transientObjects: number().int().nonnegative().optional()
|
|
34312
34586
|
});
|
|
34313
34587
|
var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
|
|
34314
34588
|
zoneId: string(),
|
|
@@ -34431,6 +34705,23 @@ var HistoryPointSchema = object({
|
|
|
34431
34705
|
* triple covers the three spatial scopes (per-zone, frame-wide,
|
|
34432
34706
|
* outside-any-zone). Crossing them with `className?` gives the full
|
|
34433
34707
|
* combinatorial coverage the operator UI requested.
|
|
34708
|
+
*
|
|
34709
|
+
* ## ⚠️ The three history methods are DEPRECATED
|
|
34710
|
+
*
|
|
34711
|
+
* They are served from a 60-MINUTE in-memory ring. It dies with the process,
|
|
34712
|
+
* so after a restart they report nothing about a night that did happen, and any
|
|
34713
|
+
* window past an hour is silently clamped — a caller cannot tell a clamp from
|
|
34714
|
+
* an empty scene. The presets in the occupancy chart existed to hide that
|
|
34715
|
+
* horizon rather than to answer a question.
|
|
34716
|
+
*
|
|
34717
|
+
* Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
|
|
34718
|
+
* instead. Those rows are already written for every camera, ~60 bytes per
|
|
34719
|
+
* (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
|
|
34720
|
+
* Spell the scope with `occupancyScope(zoneId?, className?)` — the same
|
|
34721
|
+
* function the writer uses, so the two cannot drift.
|
|
34722
|
+
*
|
|
34723
|
+
* The ring stays until these three go, and it is the only thing left reading
|
|
34724
|
+
* it. Do not add a fourth caller.
|
|
34434
34725
|
*/
|
|
34435
34726
|
var zoneAnalyticsCapability = {
|
|
34436
34727
|
name: "zone-analytics",
|
|
@@ -38830,12 +39121,24 @@ Object.freeze({
|
|
|
38830
39121
|
addonId: null,
|
|
38831
39122
|
access: "create"
|
|
38832
39123
|
},
|
|
39124
|
+
"nativeObjectDetection.getOptions": {
|
|
39125
|
+
capName: "native-object-detection",
|
|
39126
|
+
capScope: "device",
|
|
39127
|
+
addonId: null,
|
|
39128
|
+
access: "view"
|
|
39129
|
+
},
|
|
38833
39130
|
"nativeObjectDetection.setEnabled": {
|
|
38834
39131
|
capName: "native-object-detection",
|
|
38835
39132
|
capScope: "device",
|
|
38836
39133
|
addonId: null,
|
|
38837
39134
|
access: "create"
|
|
38838
39135
|
},
|
|
39136
|
+
"nativeObjectDetection.setSettings": {
|
|
39137
|
+
capName: "native-object-detection",
|
|
39138
|
+
capScope: "device",
|
|
39139
|
+
addonId: null,
|
|
39140
|
+
access: "create"
|
|
39141
|
+
},
|
|
38839
39142
|
"navigation.getFeatures": {
|
|
38840
39143
|
capName: "navigation",
|
|
38841
39144
|
capScope: "device",
|
|
@@ -39100,6 +39403,12 @@ Object.freeze({
|
|
|
39100
39403
|
addonId: null,
|
|
39101
39404
|
access: "view"
|
|
39102
39405
|
},
|
|
39406
|
+
"notificationRules.getClipRetentionAsks": {
|
|
39407
|
+
capName: "notification-rules",
|
|
39408
|
+
capScope: "system",
|
|
39409
|
+
addonId: null,
|
|
39410
|
+
access: "view"
|
|
39411
|
+
},
|
|
39103
39412
|
"notificationRules.getConditionCatalog": {
|
|
39104
39413
|
capName: "notification-rules",
|
|
39105
39414
|
capScope: "system",
|
|
@@ -39610,6 +39919,12 @@ Object.freeze({
|
|
|
39610
39919
|
addonId: null,
|
|
39611
39920
|
access: "create"
|
|
39612
39921
|
},
|
|
39922
|
+
"pipelineAnalytics.readLongTermSeries": {
|
|
39923
|
+
capName: "pipeline-analytics",
|
|
39924
|
+
capScope: "device",
|
|
39925
|
+
addonId: null,
|
|
39926
|
+
access: "view"
|
|
39927
|
+
},
|
|
39613
39928
|
"pipelineAnalytics.rebuildObjectEmbeddings": {
|
|
39614
39929
|
capName: "pipeline-analytics",
|
|
39615
39930
|
capScope: "device",
|
|
@@ -40282,6 +40597,12 @@ Object.freeze({
|
|
|
40282
40597
|
addonId: null,
|
|
40283
40598
|
access: "create"
|
|
40284
40599
|
},
|
|
40600
|
+
"pipelineRunner.requestOccupancyBurst": {
|
|
40601
|
+
capName: "pipeline-runner",
|
|
40602
|
+
capScope: "system",
|
|
40603
|
+
addonId: null,
|
|
40604
|
+
access: "create"
|
|
40605
|
+
},
|
|
40285
40606
|
"pipelineRunner.runDetailSubtree": {
|
|
40286
40607
|
capName: "pipeline-runner",
|
|
40287
40608
|
capScope: "system",
|
|
@@ -43062,11 +43383,21 @@ Object.freeze({
|
|
|
43062
43383
|
form: "single",
|
|
43063
43384
|
optional: false
|
|
43064
43385
|
}],
|
|
43386
|
+
"nativeObjectDetection.getOptions": [{
|
|
43387
|
+
name: "deviceId",
|
|
43388
|
+
form: "single",
|
|
43389
|
+
optional: false
|
|
43390
|
+
}],
|
|
43065
43391
|
"nativeObjectDetection.setEnabled": [{
|
|
43066
43392
|
name: "deviceId",
|
|
43067
43393
|
form: "single",
|
|
43068
43394
|
optional: false
|
|
43069
43395
|
}],
|
|
43396
|
+
"nativeObjectDetection.setSettings": [{
|
|
43397
|
+
name: "deviceId",
|
|
43398
|
+
form: "single",
|
|
43399
|
+
optional: false
|
|
43400
|
+
}],
|
|
43070
43401
|
"navigation.getFeatures": [{
|
|
43071
43402
|
name: "deviceId",
|
|
43072
43403
|
form: "single",
|
|
@@ -43416,6 +43747,11 @@ Object.freeze({
|
|
|
43416
43747
|
form: "single",
|
|
43417
43748
|
optional: false
|
|
43418
43749
|
}],
|
|
43750
|
+
"pipelineAnalytics.readLongTermSeries": [{
|
|
43751
|
+
name: "deviceId",
|
|
43752
|
+
form: "single",
|
|
43753
|
+
optional: false
|
|
43754
|
+
}],
|
|
43419
43755
|
"pipelineAnalytics.rebuildObjectEmbeddings": [{
|
|
43420
43756
|
name: "deviceId",
|
|
43421
43757
|
form: "single",
|
|
@@ -43606,6 +43942,11 @@ Object.freeze({
|
|
|
43606
43942
|
form: "single",
|
|
43607
43943
|
optional: false
|
|
43608
43944
|
}],
|
|
43945
|
+
"pipelineRunner.requestOccupancyBurst": [{
|
|
43946
|
+
name: "deviceId",
|
|
43947
|
+
form: "single",
|
|
43948
|
+
optional: false
|
|
43949
|
+
}],
|
|
43609
43950
|
"pipelineRunner.runDetailSubtree": [{
|
|
43610
43951
|
name: "deviceId",
|
|
43611
43952
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -6179,7 +6179,7 @@ var ZodIssueCode = {
|
|
|
6179
6179
|
var ZodFirstPartyTypeKind;
|
|
6180
6180
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
6181
6181
|
//#endregion
|
|
6182
|
-
//#region ../types/dist/sleep-
|
|
6182
|
+
//#region ../types/dist/sleep-BDR76Ykr.mjs
|
|
6183
6183
|
/**
|
|
6184
6184
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
6185
6185
|
* window to float samples (D455).
|
|
@@ -12381,6 +12381,21 @@ var streamSignalsCapability = {
|
|
|
12381
12381
|
mode: "singleton",
|
|
12382
12382
|
deviceTypes: Object.values(DeviceType),
|
|
12383
12383
|
runtimeState: StreamSignalsStatusSchema,
|
|
12384
|
+
/**
|
|
12385
|
+
* Runtime-state durability: **session** — mirrored in RAM, never written.
|
|
12386
|
+
*
|
|
12387
|
+
* The slice holds what the DEVICE says it can emit. That is a probed fact,
|
|
12388
|
+
* not an operator choice: the provider re-declares it on every registration,
|
|
12389
|
+
* so losing it loses nothing and persisting it would freeze an answer the
|
|
12390
|
+
* camera is entitled to change. Measured the same day on the sibling case —
|
|
12391
|
+
* `native-object-detection.supportedClasses` was persisted, and a firmware
|
|
12392
|
+
* class the camera really detected stayed missing for the life of the row
|
|
12393
|
+
* because the fix could not reach it.
|
|
12394
|
+
*
|
|
12395
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
12396
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
12397
|
+
*/
|
|
12398
|
+
durability: "session",
|
|
12384
12399
|
methods: {
|
|
12385
12400
|
/**
|
|
12386
12401
|
* What this device can emit. Empty is a valid and common answer — most
|
|
@@ -19012,6 +19027,48 @@ var NcAlarmConfigSchema = object({
|
|
|
19012
19027
|
settings: NcAlarmSettingsSchema,
|
|
19013
19028
|
coverage: array(NcAlarmModeCoverageSchema)
|
|
19014
19029
|
});
|
|
19030
|
+
/**
|
|
19031
|
+
* ONE rule's demand on ONE camera's clip ring.
|
|
19032
|
+
*
|
|
19033
|
+
* A rule, not a camera: the broker takes the MAX over the asks that reach a
|
|
19034
|
+
* camera, so the answer stays a faithful description of the rules and the
|
|
19035
|
+
* bounding (the byte budget, the broker's own ceiling) stays where the cost
|
|
19036
|
+
* lives. A camera that appears in no ask is being told **nothing** — which is
|
|
19037
|
+
* a different thing from never having been told, and only the envelope
|
|
19038
|
+
* (`rulesLoaded`) can tell those apart.
|
|
19039
|
+
*/
|
|
19040
|
+
var NcClipRetentionAskSchema = object({
|
|
19041
|
+
/**
|
|
19042
|
+
* The camera this ask is about. **Absent = every camera**, which is what a
|
|
19043
|
+
* rule with no `conditions.devices` means: it can fire anywhere, so it is
|
|
19044
|
+
* asking everywhere.
|
|
19045
|
+
*/
|
|
19046
|
+
deviceId: number().int().nonnegative().optional(),
|
|
19047
|
+
/** Seconds of history the rule needs held for it. Never zero — a rule that
|
|
19048
|
+
* needs nothing produces no ask at all. */
|
|
19049
|
+
seconds: number().min(0).max(60),
|
|
19050
|
+
/** The profile the rule cuts from, when it named one. Absent = the cheapest
|
|
19051
|
+
* assigned, which is what the cut defaults to. */
|
|
19052
|
+
profile: CamProfileSchema.optional(),
|
|
19053
|
+
/** Who is asking — so a retention the operator did not expect names a rule. */
|
|
19054
|
+
ruleId: string(),
|
|
19055
|
+
ruleName: string(),
|
|
19056
|
+
/** Why this many seconds: the rule's own window, or the occupancy ceiling. */
|
|
19057
|
+
reason: _enum(["window", "occupancy"])
|
|
19058
|
+
});
|
|
19059
|
+
/**
|
|
19060
|
+
* The whole answer, with the one bit that keeps absence from reading as zero.
|
|
19061
|
+
*
|
|
19062
|
+
* `rulesLoaded` is false until the rule ledger has completed a load at least
|
|
19063
|
+
* once. A centre that is up but has not read its rules yet answers with an
|
|
19064
|
+
* empty ask list that means nothing at all — applying it would drop every
|
|
19065
|
+
* camera's ring to zero for the first events after a restart, which is the
|
|
19066
|
+
* footage this mechanism exists to keep.
|
|
19067
|
+
*/
|
|
19068
|
+
var NcClipRetentionPlanSchema = object({
|
|
19069
|
+
rulesLoaded: boolean(),
|
|
19070
|
+
asks: array(NcClipRetentionAskSchema).readonly()
|
|
19071
|
+
});
|
|
19015
19072
|
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 }), {
|
|
19016
19073
|
kind: "mutation",
|
|
19017
19074
|
auth: "admin",
|
|
@@ -19032,7 +19089,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
19032
19089
|
}), object({ success: literal(true) }), {
|
|
19033
19090
|
kind: "mutation",
|
|
19034
19091
|
auth: "admin"
|
|
19035
|
-
}), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
|
|
19092
|
+
}), method(object({}), NcClipRetentionPlanSchema, { auth: "admin" }), method(object({}), object({ mutedDeviceIds: array(number().int()).readonly() }), { auth: "admin" }), method(object({
|
|
19036
19093
|
deviceId: number().int(),
|
|
19037
19094
|
muted: boolean()
|
|
19038
19095
|
}), object({ success: literal(true) }), {
|
|
@@ -20217,13 +20274,26 @@ var TrackAudioLabelSchema = object({
|
|
|
20217
20274
|
* - `audio` — an audio event on the camera itself that was anomalous for
|
|
20218
20275
|
* THAT camera, loud, and heard while nothing visual was happening (D62).
|
|
20219
20276
|
*
|
|
20277
|
+
* - `onboard` — the CAMERA's own firmware, paired with a decoded frame in
|
|
20278
|
+
* that frame's pixel space. A real root detector and a SPATIAL one: its
|
|
20279
|
+
* boxes are the same kind of fact `pipeline`'s are, produced by a different
|
|
20280
|
+
* detector.
|
|
20281
|
+
*
|
|
20282
|
+
* `onboard` was missing here while `DetectionSourceSchema` already had it, so
|
|
20283
|
+
* a persisted onboard track failed `safeParse` on read and came back with NO
|
|
20284
|
+
* source at all — which `isSpatialTrack` then admitted by accident, through the
|
|
20285
|
+
* `undefined` arm rather than by anybody's decision, and which `excludeSources`
|
|
20286
|
+
* could not name.
|
|
20287
|
+
*
|
|
20220
20288
|
* The spatial subsystems (tracker association, occupancy count, re-id /
|
|
20221
20289
|
* embedding, resurrection) MUST skip every synthetic source. Test for that
|
|
20222
|
-
* with `isSpatialTrack`, which allow-lists
|
|
20223
|
-
* check silently readmits every source added after it was
|
|
20290
|
+
* with `isSpatialTrack`, which allow-lists the spatial sources explicitly — a
|
|
20291
|
+
* `!== 'sensor'` check silently readmits every source added after it was
|
|
20292
|
+
* written.
|
|
20224
20293
|
*/
|
|
20225
20294
|
var TrackSourceSchema = _enum([
|
|
20226
20295
|
"pipeline",
|
|
20296
|
+
"onboard",
|
|
20227
20297
|
"sensor",
|
|
20228
20298
|
"audio"
|
|
20229
20299
|
]);
|
|
@@ -21606,6 +21676,33 @@ var RunReplayFrameProcessorResultSchema = object({ tracks: array(object({
|
|
|
21606
21676
|
* solid is this track", cheaper than re-deriving it from a trajectory. */
|
|
21607
21677
|
framesMatched: number().int()
|
|
21608
21678
|
})).readonly() });
|
|
21679
|
+
/**
|
|
21680
|
+
* The long-term series a camera produces. A closed union so a typo cannot
|
|
21681
|
+
* invent one, and the ONE declaration of it — the addon's `AnalyticsLtsSeries`
|
|
21682
|
+
* is an alias of this, not a second list.
|
|
21683
|
+
*/
|
|
21684
|
+
var AnalyticsLtsSeriesSchema = _enum([
|
|
21685
|
+
"motion",
|
|
21686
|
+
"audio-dbfs",
|
|
21687
|
+
"battery",
|
|
21688
|
+
"occupancy"
|
|
21689
|
+
]);
|
|
21690
|
+
/**
|
|
21691
|
+
* One closed 5-minute bucket of a long-term series.
|
|
21692
|
+
*
|
|
21693
|
+
* `samples` is how many readings the bucket folded — it is the ACTIVITY for a
|
|
21694
|
+
* series like `motion`, and the confidence for one like `occupancy`. A bucket
|
|
21695
|
+
* that exists at all was measured; a bucket that is absent was not, which is a
|
|
21696
|
+
* different claim from zero and the reason this is a sparse series.
|
|
21697
|
+
*/
|
|
21698
|
+
var LtsBucketSchema = object({
|
|
21699
|
+
scope: string(),
|
|
21700
|
+
bucketStart: number().int(),
|
|
21701
|
+
samples: number().int().nonnegative(),
|
|
21702
|
+
sum: number(),
|
|
21703
|
+
min: number(),
|
|
21704
|
+
max: number()
|
|
21705
|
+
});
|
|
21609
21706
|
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
21610
21707
|
deviceId: number(),
|
|
21611
21708
|
trackId: string()
|
|
@@ -21652,6 +21749,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21652
21749
|
kinds: array(string()).optional(),
|
|
21653
21750
|
limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
|
|
21654
21751
|
}), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(KeyEventBatchQueryInput, array(KeyEventsForDeviceSchema).readonly()), method(object({
|
|
21752
|
+
deviceId: number(),
|
|
21753
|
+
series: AnalyticsLtsSeriesSchema,
|
|
21754
|
+
/** Omit for EVERY scope of this series in the range. */
|
|
21755
|
+
scope: string().optional(),
|
|
21756
|
+
from: number(),
|
|
21757
|
+
to: number(),
|
|
21758
|
+
limit: number().int().positive().optional()
|
|
21759
|
+
}), array(LtsBucketSchema).readonly()), method(object({
|
|
21655
21760
|
deviceId: number(),
|
|
21656
21761
|
since: number(),
|
|
21657
21762
|
until: number(),
|
|
@@ -22270,6 +22375,40 @@ var MotionSourceEnum = _enum([
|
|
|
22270
22375
|
*/
|
|
22271
22376
|
var MotionSourcesSchema = array(MotionSourceEnum);
|
|
22272
22377
|
/**
|
|
22378
|
+
* Which root detector a camera runs — EXACTLY ONE.
|
|
22379
|
+
*
|
|
22380
|
+
* Deliberately the SAME vocabulary post-analysis already tags every detection
|
|
22381
|
+
* with (`DetectionSource`) rather than a second spelling of the same two
|
|
22382
|
+
* ideas: the value an operator picks here is the value that comes back on the
|
|
22383
|
+
* track, the overlay and the debug row.
|
|
22384
|
+
*
|
|
22385
|
+
* ## Why one, and why it is still an array
|
|
22386
|
+
*
|
|
22387
|
+
* Two roots on one camera is a capability nobody asked for and the operator has
|
|
22388
|
+
* since ruled out. It was never free: both planes feed the SAME per-device
|
|
22389
|
+
* stationary registry, both can promote the same parked object, and the two
|
|
22390
|
+
* detectors disagree about the same box by construction — which is the
|
|
22391
|
+
* disagreement D505 had to arbitrate. Removing the case removes the arbitration.
|
|
22392
|
+
*
|
|
22393
|
+
* The ARRAY shape survives because the stored settings and the attach payload
|
|
22394
|
+
* already speak it on every camera of every fleet, and a cap input that
|
|
22395
|
+
* suddenly refuses a stored value makes the camera un-attachable — a fail-closed
|
|
22396
|
+
* in the one direction that costs an operator their cameras. So the wire stays
|
|
22397
|
+
* tolerant and the TYPE is exact: a longer list is truncated to its first
|
|
22398
|
+
* element rather than refused, and `max(1)` is what every consumer can then
|
|
22399
|
+
* rely on.
|
|
22400
|
+
*
|
|
22401
|
+
* AT MOST one, not exactly one. The EMPTY list is a legal, deliberate pick —
|
|
22402
|
+
* a camera an operator left with no root detector — and `planDetectionSources`
|
|
22403
|
+
* has always said so: inventing a root for them is how a default acts without
|
|
22404
|
+
* anybody choosing it. Tightening this to `length(1)` broke that, and the
|
|
22405
|
+
* suite caught it.
|
|
22406
|
+
*
|
|
22407
|
+
* Measured before tightening (2026-09-15, this fleet, 6 h of attaches): 3327
|
|
22408
|
+
* `["pipeline"]` and 2 `["onboard"]`. Not one camera had two.
|
|
22409
|
+
*/
|
|
22410
|
+
var DetectionSourcesSchema = preprocess((value) => Array.isArray(value) && value.length > 1 ? value.slice(0, 1) : value, array(DetectionSourceSchema).max(1));
|
|
22411
|
+
/**
|
|
22273
22412
|
* Input shape for `pipeline-runner.reportMotion` cap method. Exported
|
|
22274
22413
|
* so cap-side consumers (the orchestrator forward, the runner addon's
|
|
22275
22414
|
* cap implementation, tests) can reuse the type instead of redeclaring
|
|
@@ -22420,6 +22559,35 @@ var RunnerCameraConfigSchema = object({
|
|
|
22420
22559
|
* events; the orchestrator forwards to `reportMotion`.
|
|
22421
22560
|
*/
|
|
22422
22561
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
22562
|
+
/**
|
|
22563
|
+
* WHICH root detector runs for this camera. The detection counterpart of
|
|
22564
|
+
* {@link motionSources}, same shape and same discipline: a per-camera list
|
|
22565
|
+
* of sources the system understands, vendor-agnostic, owned here.
|
|
22566
|
+
*
|
|
22567
|
+
* - `pipeline` — this runner's own root step on decoded pixels (`steps`).
|
|
22568
|
+
* - `onboard` — the CAMERA's own detector, admitted only when it is named
|
|
22569
|
+
* here. Its boxes reach post-analysis on the same
|
|
22570
|
+
* `PipelineInferenceResult` payload as the pipeline's, so an onboard-born
|
|
22571
|
+
* track gets the same tracker, the same overlay and the same detail
|
|
22572
|
+
* subtree (face / plate / embedding).
|
|
22573
|
+
*
|
|
22574
|
+
* `['onboard']` alone is the REPLACEMENT: this runner's root step does not
|
|
22575
|
+
* run, and that is where a camera with a usable onboard detector buys back
|
|
22576
|
+
* its share of the accelerator. It saves the root inference, not the decode
|
|
22577
|
+
* — the detail subtree still needs pixels to cut crops from.
|
|
22578
|
+
*
|
|
22579
|
+
* A camera whose onboard detections carry no geometry cannot serve as a root
|
|
22580
|
+
* step at all (there is nothing to track), and the cap that knows this says
|
|
22581
|
+
* so on `native-object-detection.getOptions().geometry`. On Reolink that is
|
|
22582
|
+
* every battery camera: the boxes ride a sub-stream a battery camera never
|
|
22583
|
+
* attaches, so such a camera stays on `['pipeline']` and its onboard AI is
|
|
22584
|
+
* worth exactly what it already is — a wake signal with a class.
|
|
22585
|
+
*
|
|
22586
|
+
* Defaults to `['pipeline']`, which is byte-for-byte today's behaviour: a
|
|
22587
|
+
* vendor never turns a detector on for the operator, and neither does a
|
|
22588
|
+
* default.
|
|
22589
|
+
*/
|
|
22590
|
+
detectionSources: DetectionSourcesSchema.default(["pipeline"]),
|
|
22423
22591
|
pipelineEnabled: boolean().default(true),
|
|
22424
22592
|
/** Ordered tree of video steps. Absent → runner skips video detection. */
|
|
22425
22593
|
steps: array(PipelineStepInputSchema).readonly().optional(),
|
|
@@ -22601,7 +22769,47 @@ var RunnerLocalMetricsSchema = object({
|
|
|
22601
22769
|
queueDepth: number(),
|
|
22602
22770
|
frameLazy: FrameLazyMetricsSchema.optional()
|
|
22603
22771
|
});
|
|
22772
|
+
/**
|
|
22773
|
+
* Pipeline Runner capability — runtime detection workhorse.
|
|
22774
|
+
*
|
|
22775
|
+
* One instance per node. Receives camera assignments from
|
|
22776
|
+
* `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
|
|
22777
|
+
* decoded frames, drains motion + detection queues, calls the local
|
|
22778
|
+
* `motion-detection` and `pipeline-executor` capabilities, and emits typed
|
|
22779
|
+
* `pipeline.inference-result` and `detection.motion-analysis` events on
|
|
22780
|
+
* the bus.
|
|
22781
|
+
*
|
|
22782
|
+
* Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
|
|
22783
|
+
* runner has zero knowledge of other agents, no global state, and never
|
|
22784
|
+
* makes assignment decisions itself.
|
|
22785
|
+
*/
|
|
22786
|
+
/**
|
|
22787
|
+
* Why a runner declined to look at a camera out of band. Named rather than a
|
|
22788
|
+
* bare `false`: a camera asleep on battery (D173), one attached elsewhere, one
|
|
22789
|
+
* already mid-session and one already bursting are four different facts, and a
|
|
22790
|
+
* caller told only "no" cannot tell a protection from a bug.
|
|
22791
|
+
*/
|
|
22792
|
+
var OccupancyBurstRefusalSchema = _enum([
|
|
22793
|
+
"not-attached",
|
|
22794
|
+
"battery-asleep",
|
|
22795
|
+
"not-watching",
|
|
22796
|
+
"already-bursting"
|
|
22797
|
+
]);
|
|
22604
22798
|
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({
|
|
22799
|
+
deviceId: number(),
|
|
22800
|
+
/** How many frames to collect. The caller sizes this against what its
|
|
22801
|
+
* own confirmation needs; the runner clamps it to the field's range. */
|
|
22802
|
+
frames: number().int().positive().optional(),
|
|
22803
|
+
/** Why, for the log. A burst nobody can attribute is a cost nobody can
|
|
22804
|
+
* defend — the periodic one at least has a timer to point at. */
|
|
22805
|
+
reason: string()
|
|
22806
|
+
}), object({
|
|
22807
|
+
started: boolean(),
|
|
22808
|
+
refusedBecause: OccupancyBurstRefusalSchema.optional()
|
|
22809
|
+
}), {
|
|
22810
|
+
auth: "admin",
|
|
22811
|
+
kind: "mutation"
|
|
22812
|
+
}), method(object({
|
|
22605
22813
|
handle: FrameHandleSchema,
|
|
22606
22814
|
bbox: NativeCropBboxSchema,
|
|
22607
22815
|
maxWidth: number().int().positive().optional(),
|
|
@@ -29439,11 +29647,46 @@ var NativeObjectDetectionStatusSchema = object({
|
|
|
29439
29647
|
supportedClasses: array(NativeObjectClassEnum).readonly(),
|
|
29440
29648
|
/**
|
|
29441
29649
|
* Whether forwarding of onboard AI detections is enabled for this device.
|
|
29442
|
-
*
|
|
29443
|
-
*
|
|
29650
|
+
*
|
|
29651
|
+
* Cold-start OFF on every camera. A vendor does not decide which detector a
|
|
29652
|
+
* camera runs — that is the operator's choice, and it is made where every
|
|
29653
|
+
* other detection choice is made. `geometry` on
|
|
29654
|
+
* {@link NativeObjectDetectionOptionsSchema} is how the form says what the
|
|
29655
|
+
* choice would buy this particular camera.
|
|
29444
29656
|
*/
|
|
29445
29657
|
enabled: boolean()
|
|
29446
29658
|
});
|
|
29659
|
+
/**
|
|
29660
|
+
* WHEN a camera's onboard detections carry geometry.
|
|
29661
|
+
*
|
|
29662
|
+
* - `boxed` — always. The provider holds a standing channel for the boxes, so
|
|
29663
|
+
* a detection is a trackable subject whenever the camera sees one.
|
|
29664
|
+
* - `while-streaming` — only while some stream of this camera is already open.
|
|
29665
|
+
* The boxes ride the video's own side-channel rather than a feed of their
|
|
29666
|
+
* own, so they cost nothing and they exist only when something is pulling.
|
|
29667
|
+
* On Reolink this is every BATTERY camera: a persistent second feed is real
|
|
29668
|
+
* radio drain, but a camera that is awake is awake precisely because
|
|
29669
|
+
* something is in front of it, and its stream is already being pulled.
|
|
29670
|
+
* - `flag-only` — never. The firmware ships the class and nothing else; the
|
|
29671
|
+
* pipeline needs geometry to make a subject, so such a push reaches the
|
|
29672
|
+
* tracker as motion and no further.
|
|
29673
|
+
*
|
|
29674
|
+
* Reported and not inferred, because the operator's question in front of the
|
|
29675
|
+
* picker is "what do I get", and these are three different answers (D14: the
|
|
29676
|
+
* derived form is only as honest as `getOptions`).
|
|
29677
|
+
*/
|
|
29678
|
+
var NativeObjectGeometryEnum = _enum([
|
|
29679
|
+
"boxed",
|
|
29680
|
+
"while-streaming",
|
|
29681
|
+
"flag-only"
|
|
29682
|
+
]);
|
|
29683
|
+
var NativeObjectDetectionOptionsSchema = object({
|
|
29684
|
+
/** Classes this firmware can detect — the same list the status reports. */
|
|
29685
|
+
supportedClasses: array(NativeObjectClassEnum).readonly(),
|
|
29686
|
+
/** What a detection from this camera carries. */
|
|
29687
|
+
geometry: NativeObjectGeometryEnum
|
|
29688
|
+
});
|
|
29689
|
+
var NativeObjectDetectionSettingsPatchSchema = object({ enabled: boolean().optional() });
|
|
29447
29690
|
var NativeObjectDetectionRuntimeStateSchema = NativeObjectDetectionStatusSchema.extend({
|
|
29448
29691
|
/** Required by createRuntimeStateBridge — epoch ms of last refresh. */
|
|
29449
29692
|
lastFetchedAt: number() });
|
|
@@ -29453,13 +29696,23 @@ var nativeObjectDetectionCapability = {
|
|
|
29453
29696
|
deviceNative: true,
|
|
29454
29697
|
mode: "singleton",
|
|
29455
29698
|
deviceTypes: [DeviceType.Camera],
|
|
29456
|
-
methods: {
|
|
29457
|
-
deviceId: number(),
|
|
29458
|
-
|
|
29459
|
-
|
|
29460
|
-
|
|
29461
|
-
|
|
29462
|
-
|
|
29699
|
+
methods: {
|
|
29700
|
+
getOptions: method(object({ deviceId: number() }), NativeObjectDetectionOptionsSchema),
|
|
29701
|
+
setSettings: method(object({
|
|
29702
|
+
deviceId: number(),
|
|
29703
|
+
settings: NativeObjectDetectionSettingsPatchSchema
|
|
29704
|
+
}), _void(), {
|
|
29705
|
+
kind: "mutation",
|
|
29706
|
+
auth: "admin"
|
|
29707
|
+
}),
|
|
29708
|
+
setEnabled: method(object({
|
|
29709
|
+
deviceId: number(),
|
|
29710
|
+
enabled: boolean()
|
|
29711
|
+
}), _void(), {
|
|
29712
|
+
kind: "mutation",
|
|
29713
|
+
auth: "admin"
|
|
29714
|
+
})
|
|
29715
|
+
},
|
|
29463
29716
|
events: { onDetected: { data: object({
|
|
29464
29717
|
deviceId: number(),
|
|
29465
29718
|
detection: NativeDetectionSchema
|
|
@@ -34307,7 +34560,28 @@ var PerScopeBreakdownSchema = object({
|
|
|
34307
34560
|
/** Total tracked objects in this scope (frame / zone / unzoned). */
|
|
34308
34561
|
totalObjects: number().int().nonnegative(),
|
|
34309
34562
|
/** Per-class count. Keys are macro class names (e.g. `person`, `car`). */
|
|
34310
|
-
byClass: record(string(), number().int().nonnegative())
|
|
34563
|
+
byClass: record(string(), number().int().nonnegative()),
|
|
34564
|
+
/**
|
|
34565
|
+
* Of `totalObjects`, how many are STANDING — objects the census holds,
|
|
34566
|
+
* present but not going anywhere (a parked car, a bin, a statue).
|
|
34567
|
+
*
|
|
34568
|
+
* The operator's question about a scene has two halves and they answer
|
|
34569
|
+
* different things: "what is parked here" is stable for hours and must not
|
|
34570
|
+
* flap, while "who is walking through" is the thing an alert is about. One
|
|
34571
|
+
* number could only serve one of them, and `totalObjects` served the first
|
|
34572
|
+
* badly — a passer-by moved it and every occupancy rule saw a change.
|
|
34573
|
+
*
|
|
34574
|
+
* `standing + transient === totalObjects`, always. The total keeps its old
|
|
34575
|
+
* meaning exactly, so no rule written against it changes behaviour.
|
|
34576
|
+
*
|
|
34577
|
+
* ABSENT means UNKNOWN, never zero (D393): a snapshot from a node older than
|
|
34578
|
+
* this field cannot say, and a reader that folds absence in as 0 reports "no
|
|
34579
|
+
* parked objects here" about a camera whose lot is full.
|
|
34580
|
+
*/
|
|
34581
|
+
standingObjects: number().int().nonnegative().optional(),
|
|
34582
|
+
/** Of `totalObjects`, how many are passing through. See `standingObjects` —
|
|
34583
|
+
* same absence rule. */
|
|
34584
|
+
transientObjects: number().int().nonnegative().optional()
|
|
34311
34585
|
});
|
|
34312
34586
|
var ZoneScopeBreakdownSchema = PerScopeBreakdownSchema.extend({
|
|
34313
34587
|
zoneId: string(),
|
|
@@ -34430,6 +34704,23 @@ var HistoryPointSchema = object({
|
|
|
34430
34704
|
* triple covers the three spatial scopes (per-zone, frame-wide,
|
|
34431
34705
|
* outside-any-zone). Crossing them with `className?` gives the full
|
|
34432
34706
|
* combinatorial coverage the operator UI requested.
|
|
34707
|
+
*
|
|
34708
|
+
* ## ⚠️ The three history methods are DEPRECATED
|
|
34709
|
+
*
|
|
34710
|
+
* They are served from a 60-MINUTE in-memory ring. It dies with the process,
|
|
34711
|
+
* so after a restart they report nothing about a night that did happen, and any
|
|
34712
|
+
* window past an hour is silently clamped — a caller cannot tell a clamp from
|
|
34713
|
+
* an empty scene. The presets in the occupancy chart existed to hide that
|
|
34714
|
+
* horizon rather than to answer a question.
|
|
34715
|
+
*
|
|
34716
|
+
* Use `pipelineAnalytics.readLongTermSeries({ series: 'occupancy', scope })`
|
|
34717
|
+
* instead. Those rows are already written for every camera, ~60 bytes per
|
|
34718
|
+
* (camera, scope, 5-minute bucket), kept for a year, and survive a restart.
|
|
34719
|
+
* Spell the scope with `occupancyScope(zoneId?, className?)` — the same
|
|
34720
|
+
* function the writer uses, so the two cannot drift.
|
|
34721
|
+
*
|
|
34722
|
+
* The ring stays until these three go, and it is the only thing left reading
|
|
34723
|
+
* it. Do not add a fourth caller.
|
|
34433
34724
|
*/
|
|
34434
34725
|
var zoneAnalyticsCapability = {
|
|
34435
34726
|
name: "zone-analytics",
|
|
@@ -38829,12 +39120,24 @@ Object.freeze({
|
|
|
38829
39120
|
addonId: null,
|
|
38830
39121
|
access: "create"
|
|
38831
39122
|
},
|
|
39123
|
+
"nativeObjectDetection.getOptions": {
|
|
39124
|
+
capName: "native-object-detection",
|
|
39125
|
+
capScope: "device",
|
|
39126
|
+
addonId: null,
|
|
39127
|
+
access: "view"
|
|
39128
|
+
},
|
|
38832
39129
|
"nativeObjectDetection.setEnabled": {
|
|
38833
39130
|
capName: "native-object-detection",
|
|
38834
39131
|
capScope: "device",
|
|
38835
39132
|
addonId: null,
|
|
38836
39133
|
access: "create"
|
|
38837
39134
|
},
|
|
39135
|
+
"nativeObjectDetection.setSettings": {
|
|
39136
|
+
capName: "native-object-detection",
|
|
39137
|
+
capScope: "device",
|
|
39138
|
+
addonId: null,
|
|
39139
|
+
access: "create"
|
|
39140
|
+
},
|
|
38838
39141
|
"navigation.getFeatures": {
|
|
38839
39142
|
capName: "navigation",
|
|
38840
39143
|
capScope: "device",
|
|
@@ -39099,6 +39402,12 @@ Object.freeze({
|
|
|
39099
39402
|
addonId: null,
|
|
39100
39403
|
access: "view"
|
|
39101
39404
|
},
|
|
39405
|
+
"notificationRules.getClipRetentionAsks": {
|
|
39406
|
+
capName: "notification-rules",
|
|
39407
|
+
capScope: "system",
|
|
39408
|
+
addonId: null,
|
|
39409
|
+
access: "view"
|
|
39410
|
+
},
|
|
39102
39411
|
"notificationRules.getConditionCatalog": {
|
|
39103
39412
|
capName: "notification-rules",
|
|
39104
39413
|
capScope: "system",
|
|
@@ -39609,6 +39918,12 @@ Object.freeze({
|
|
|
39609
39918
|
addonId: null,
|
|
39610
39919
|
access: "create"
|
|
39611
39920
|
},
|
|
39921
|
+
"pipelineAnalytics.readLongTermSeries": {
|
|
39922
|
+
capName: "pipeline-analytics",
|
|
39923
|
+
capScope: "device",
|
|
39924
|
+
addonId: null,
|
|
39925
|
+
access: "view"
|
|
39926
|
+
},
|
|
39612
39927
|
"pipelineAnalytics.rebuildObjectEmbeddings": {
|
|
39613
39928
|
capName: "pipeline-analytics",
|
|
39614
39929
|
capScope: "device",
|
|
@@ -40281,6 +40596,12 @@ Object.freeze({
|
|
|
40281
40596
|
addonId: null,
|
|
40282
40597
|
access: "create"
|
|
40283
40598
|
},
|
|
40599
|
+
"pipelineRunner.requestOccupancyBurst": {
|
|
40600
|
+
capName: "pipeline-runner",
|
|
40601
|
+
capScope: "system",
|
|
40602
|
+
addonId: null,
|
|
40603
|
+
access: "create"
|
|
40604
|
+
},
|
|
40284
40605
|
"pipelineRunner.runDetailSubtree": {
|
|
40285
40606
|
capName: "pipeline-runner",
|
|
40286
40607
|
capScope: "system",
|
|
@@ -43061,11 +43382,21 @@ Object.freeze({
|
|
|
43061
43382
|
form: "single",
|
|
43062
43383
|
optional: false
|
|
43063
43384
|
}],
|
|
43385
|
+
"nativeObjectDetection.getOptions": [{
|
|
43386
|
+
name: "deviceId",
|
|
43387
|
+
form: "single",
|
|
43388
|
+
optional: false
|
|
43389
|
+
}],
|
|
43064
43390
|
"nativeObjectDetection.setEnabled": [{
|
|
43065
43391
|
name: "deviceId",
|
|
43066
43392
|
form: "single",
|
|
43067
43393
|
optional: false
|
|
43068
43394
|
}],
|
|
43395
|
+
"nativeObjectDetection.setSettings": [{
|
|
43396
|
+
name: "deviceId",
|
|
43397
|
+
form: "single",
|
|
43398
|
+
optional: false
|
|
43399
|
+
}],
|
|
43069
43400
|
"navigation.getFeatures": [{
|
|
43070
43401
|
name: "deviceId",
|
|
43071
43402
|
form: "single",
|
|
@@ -43415,6 +43746,11 @@ Object.freeze({
|
|
|
43415
43746
|
form: "single",
|
|
43416
43747
|
optional: false
|
|
43417
43748
|
}],
|
|
43749
|
+
"pipelineAnalytics.readLongTermSeries": [{
|
|
43750
|
+
name: "deviceId",
|
|
43751
|
+
form: "single",
|
|
43752
|
+
optional: false
|
|
43753
|
+
}],
|
|
43418
43754
|
"pipelineAnalytics.rebuildObjectEmbeddings": [{
|
|
43419
43755
|
name: "deviceId",
|
|
43420
43756
|
form: "single",
|
|
@@ -43605,6 +43941,11 @@ Object.freeze({
|
|
|
43605
43941
|
form: "single",
|
|
43606
43942
|
optional: false
|
|
43607
43943
|
}],
|
|
43944
|
+
"pipelineRunner.requestOccupancyBurst": [{
|
|
43945
|
+
name: "deviceId",
|
|
43946
|
+
form: "single",
|
|
43947
|
+
optional: false
|
|
43948
|
+
}],
|
|
43608
43949
|
"pipelineRunner.runDetailSubtree": [{
|
|
43609
43950
|
name: "deviceId",
|
|
43610
43951
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-tuya",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.104",
|
|
4
4
|
"description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"dev": "vite build --watch",
|
|
70
70
|
"typecheck": "tsc --noEmit",
|
|
71
71
|
"test": "vitest run",
|
|
72
|
-
"publish": "npm publish --access public"
|
|
72
|
+
"publish:npm": "npm publish --access public"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@apocaliss92/nodetuya": "file:./vendor/apocaliss92-nodetuya-0.2.1.tgz",
|