@camstack/addon-provider-wyze 0.2.100 → 0.2.102
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 +182 -24
- package/dist/addon.mjs +182 -24
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7335,6 +7335,23 @@ function errMsg(err) {
|
|
|
7335
7335
|
if (typeof err === "string") return err;
|
|
7336
7336
|
return String(err);
|
|
7337
7337
|
}
|
|
7338
|
+
new Set([
|
|
7339
|
+
"track",
|
|
7340
|
+
"summary",
|
|
7341
|
+
"face",
|
|
7342
|
+
"identity",
|
|
7343
|
+
"plate",
|
|
7344
|
+
"vehicle",
|
|
7345
|
+
"scene",
|
|
7346
|
+
"motion",
|
|
7347
|
+
"object",
|
|
7348
|
+
"audio"
|
|
7349
|
+
]);
|
|
7350
|
+
new Set([
|
|
7351
|
+
"motion",
|
|
7352
|
+
"object",
|
|
7353
|
+
"audio"
|
|
7354
|
+
]);
|
|
7338
7355
|
var EncodeProfileSchema = object({
|
|
7339
7356
|
video: object({
|
|
7340
7357
|
codec: _enum([
|
|
@@ -12535,8 +12552,17 @@ method(object({
|
|
|
12535
12552
|
}), array(SettingsRecordSchema).readonly()), method(object({
|
|
12536
12553
|
namespace: string().optional(),
|
|
12537
12554
|
collection: string(),
|
|
12538
|
-
record:
|
|
12539
|
-
|
|
12555
|
+
record: object({
|
|
12556
|
+
id: string().optional(),
|
|
12557
|
+
data: record(string(), unknown())
|
|
12558
|
+
})
|
|
12559
|
+
}), object({
|
|
12560
|
+
/**
|
|
12561
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
12562
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
12563
|
+
* primary key — which is the only place an auto key is knowable.
|
|
12564
|
+
*/
|
|
12565
|
+
id: union([string(), number()]) }), { kind: "mutation" }), method(object({
|
|
12540
12566
|
namespace: string().optional(),
|
|
12541
12567
|
collection: string(),
|
|
12542
12568
|
records: array(BulkRecordSchema).readonly()
|
|
@@ -12645,8 +12671,17 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
12645
12671
|
}), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
|
|
12646
12672
|
namespace: string().optional(),
|
|
12647
12673
|
collection: string(),
|
|
12648
|
-
record:
|
|
12649
|
-
|
|
12674
|
+
record: object({
|
|
12675
|
+
id: string().optional(),
|
|
12676
|
+
data: record(string(), unknown())
|
|
12677
|
+
})
|
|
12678
|
+
}), object({
|
|
12679
|
+
/**
|
|
12680
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
12681
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
12682
|
+
* primary key — which is the only place an auto key is knowable.
|
|
12683
|
+
*/
|
|
12684
|
+
id: union([string(), number()]) }), {
|
|
12650
12685
|
kind: "mutation",
|
|
12651
12686
|
auth: "admin"
|
|
12652
12687
|
}), method(object({
|
|
@@ -19571,7 +19606,20 @@ var TrackSchema = object({
|
|
|
19571
19606
|
...TrackRetrainFields
|
|
19572
19607
|
});
|
|
19573
19608
|
var BaseEventFields = {
|
|
19574
|
-
|
|
19609
|
+
/**
|
|
19610
|
+
* A SQLite ROWID, assigned by the database (D474).
|
|
19611
|
+
*
|
|
19612
|
+
* Was a 36-character UUID and cost 263 MB of a 1 117 MB database — paid
|
|
19613
|
+
* TWICE per row, in the row and in the primary-key index, across 2.1 million
|
|
19614
|
+
* motion, audio and object events. An `INTEGER PRIMARY KEY` in SQLite **is**
|
|
19615
|
+
* the rowid: the table itself is that B-tree, so the index stops existing
|
|
19616
|
+
* rather than getting smaller. No shorter string does that.
|
|
19617
|
+
*
|
|
19618
|
+
* Defined once here for all three event kinds, which is why they move
|
|
19619
|
+
* together: a per-table migration would have forked this and
|
|
19620
|
+
* `COMMON_BASE_COLUMNS` and reunited them two stages later.
|
|
19621
|
+
*/
|
|
19622
|
+
id: number().int(),
|
|
19575
19623
|
deviceId: number(),
|
|
19576
19624
|
timestamp: number()
|
|
19577
19625
|
};
|
|
@@ -19590,7 +19638,34 @@ var MotionEventSchema = object({
|
|
|
19590
19638
|
/** Omitted in slim projection. */
|
|
19591
19639
|
frameHeight: number().optional(),
|
|
19592
19640
|
/** Populated by B5 (recording playback URL for this event). */
|
|
19593
|
-
mediaUrl: string().optional()
|
|
19641
|
+
mediaUrl: string().optional(),
|
|
19642
|
+
/**
|
|
19643
|
+
* One row per motion EPISODE, not one per push (D475). `null` while the
|
|
19644
|
+
* episode is still open — a further rising edge extends it in place rather
|
|
19645
|
+
* than inserting a new row. Set once, at close, to `lastOnAt - startedAt`
|
|
19646
|
+
* (the span from the first rising edge to the LAST one, deliberately NOT
|
|
19647
|
+
* `closedAt - startedAt` — the close delay is a quiet CONFIRMATION, not
|
|
19648
|
+
* movement, and folding it in would report `MOTION_CLOSE_AFTER_MS` of
|
|
19649
|
+
* motion for an instantaneous trigger).
|
|
19650
|
+
*
|
|
19651
|
+
* **Absent** (not merely `null`) on a row written before D475 — that means
|
|
19652
|
+
* "closed the old way, before this column existed", never "still open".
|
|
19653
|
+
* Nothing in this codebase may read an absent `durationMs` as an open
|
|
19654
|
+
* episode; only `null` means open.
|
|
19655
|
+
*/
|
|
19656
|
+
durationMs: number().nullable().optional(),
|
|
19657
|
+
/**
|
|
19658
|
+
* Ms offsets from `timestamp` (the episode's own first rising edge, so the
|
|
19659
|
+
* first entry is always `0`) of every genuine off→on transition the
|
|
19660
|
+
* episode saw — "ogni evento on si deve salvare" (D475). NOT one entry per
|
|
19661
|
+
* push: a firmware source that keepalives at ~1 Hz for the whole burst
|
|
19662
|
+
* (Reolink, Hikvision) produces exactly one edge; a source that reports an
|
|
19663
|
+
* explicit `false` mid-episode and then resumes before the quiet window
|
|
19664
|
+
* elapses produces another. Stored compactly — see `motion-edge-codec.ts`
|
|
19665
|
+
* — and decoded back to this shape on read. Absent/empty on a legacy row,
|
|
19666
|
+
* which must never be read as "no episode happened here".
|
|
19667
|
+
*/
|
|
19668
|
+
edges: array(number()).readonly().optional()
|
|
19594
19669
|
});
|
|
19595
19670
|
/**
|
|
19596
19671
|
* Which detection SOURCE produced an object event. `pipeline` = the ML
|
|
@@ -19645,6 +19720,23 @@ var ObjectEventSchema = object({
|
|
|
19645
19720
|
* includes it (it is light). Absent on rows written before this field.
|
|
19646
19721
|
*/
|
|
19647
19722
|
frameId: string().optional(),
|
|
19723
|
+
/**
|
|
19724
|
+
* A PRODUCER-chosen key that makes a synthetic event's emission idempotent
|
|
19725
|
+
* (D474).
|
|
19726
|
+
*
|
|
19727
|
+
* Only the package detector writes it, and it exists because the event id
|
|
19728
|
+
* stopped being choosable: the delivery and pick-up rows used to BE their
|
|
19729
|
+
* dedupe key (`pa-pkg-<entryId>-delivered`), which is how "never emit a
|
|
19730
|
+
* second delivery for this entry" survived a restart. An `INTEGER` rowid is
|
|
19731
|
+
* assigned by SQLite, so that key had to move off the primary key rather
|
|
19732
|
+
* than be dropped — a detector that cannot recognise its own row re-delivers
|
|
19733
|
+
* every parcel on every boot.
|
|
19734
|
+
*
|
|
19735
|
+
* Absent on every other object event, and on every row written before this
|
|
19736
|
+
* field. Never a substitute for `id`: it is unique per (producer, occasion),
|
|
19737
|
+
* not per row, and nothing addresses a row by it.
|
|
19738
|
+
*/
|
|
19739
|
+
idempotencyKey: string().optional(),
|
|
19648
19740
|
/** Omitted in slim projection. */
|
|
19649
19741
|
trackId: string().optional(),
|
|
19650
19742
|
className: string(),
|
|
@@ -20747,6 +20839,14 @@ var NativeCropResultSchema = object({
|
|
|
20747
20839
|
* set `encodeJpeg: true`; `bytes` is then absent.
|
|
20748
20840
|
*/
|
|
20749
20841
|
jpeg: string().optional(),
|
|
20842
|
+
/**
|
|
20843
|
+
* The SAME compressed JPEG as `jpeg`, as bytes (D462). Present instead of
|
|
20844
|
+
* `jpeg` when the request set `acceptJpegBytes`; a request that did not gets
|
|
20845
|
+
* `jpeg` exactly as before. MsgPack and the mesh leg both carry binary —
|
|
20846
|
+
* `bytes` above has crossed this boundary as a `Uint8Array` all along — so
|
|
20847
|
+
* base64 was buying nothing but a multi-megabyte string in the relay's heap.
|
|
20848
|
+
*/
|
|
20849
|
+
jpegBytes: _instanceof(Uint8Array).optional(),
|
|
20750
20850
|
width: number().int().positive(),
|
|
20751
20851
|
height: number().int().positive(),
|
|
20752
20852
|
/**
|
|
@@ -20813,7 +20913,14 @@ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
|
|
|
20813
20913
|
})]);
|
|
20814
20914
|
/** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
|
|
20815
20915
|
var ParkedTrackFrameSchema = object({
|
|
20816
|
-
|
|
20916
|
+
/**
|
|
20917
|
+
* Base64 JPEG — the pre-D462 wire. OPTIONAL since D462: a request that set
|
|
20918
|
+
* `acceptJpegBytes` is answered in `jpegBytes` and this is then absent.
|
|
20919
|
+
* Exactly one of the two is present.
|
|
20920
|
+
*/
|
|
20921
|
+
jpeg: string().optional(),
|
|
20922
|
+
/** The same JPEG as bytes, for a caller that declared it reads them (D462). */
|
|
20923
|
+
jpegBytes: _instanceof(Uint8Array).optional(),
|
|
20817
20924
|
width: number().int().positive(),
|
|
20818
20925
|
height: number().int().positive(),
|
|
20819
20926
|
/** The frame instant the parcel shows (the caller's clock, echoed back). */
|
|
@@ -21400,6 +21507,13 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
21400
21507
|
bbox: NativeCropBboxSchema,
|
|
21401
21508
|
maxWidth: number().int().positive().optional(),
|
|
21402
21509
|
/**
|
|
21510
|
+
* The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
|
|
21511
|
+
* back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
|
|
21512
|
+
* wire — never assume consent: a pre-D462 caller parses the field as
|
|
21513
|
+
* base64 and bytes would decode to garbage rather than fail.
|
|
21514
|
+
*/
|
|
21515
|
+
acceptJpegBytes: boolean().optional(),
|
|
21516
|
+
/**
|
|
21403
21517
|
* When `true`, the runner encodes the resolved crop to JPEG ON THE
|
|
21404
21518
|
* OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
|
|
21405
21519
|
* Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
|
|
@@ -21467,7 +21581,14 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
21467
21581
|
}), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
|
|
21468
21582
|
deviceId: number(),
|
|
21469
21583
|
trackId: string(),
|
|
21470
|
-
kind: ParkedFrameKindSchema
|
|
21584
|
+
kind: ParkedFrameKindSchema,
|
|
21585
|
+
/**
|
|
21586
|
+
* The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
|
|
21587
|
+
* back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
|
|
21588
|
+
* wire — never assume consent: a pre-D462 caller parses the field as
|
|
21589
|
+
* base64 and bytes would decode to garbage rather than fail.
|
|
21590
|
+
*/
|
|
21591
|
+
acceptJpegBytes: boolean().optional()
|
|
21471
21592
|
}), ParkedTrackFrameSchema.nullable()), method(object({
|
|
21472
21593
|
deviceId: number(),
|
|
21473
21594
|
trackId: string()
|
|
@@ -27977,26 +28098,59 @@ authKey: string().optional() }), object({
|
|
|
27977
28098
|
/** Human-readable error when `ok: false`. */
|
|
27978
28099
|
error: string().optional()
|
|
27979
28100
|
}), { kind: "mutation" });
|
|
27980
|
-
/**
|
|
27981
|
-
* Hardware / firmware motion sensor cap — binary detected state plus
|
|
27982
|
-
* a timestamp of the last observation. Distinct from
|
|
27983
|
-
* `motion-detection.cap.ts` which owns the LOCAL ML motion pipeline;
|
|
27984
|
-
* `motion` is the lightweight readout from on-camera motion (Reolink
|
|
27985
|
-
* `GetMdState`, Baichuan push `type: motion`, ONVIF analytics).
|
|
27986
|
-
*
|
|
27987
|
-
* Native-motion providers also fan out to `detection.camera-native`
|
|
27988
|
-
* with `source: 'onboard'` so cross-cutting system services
|
|
27989
|
-
* (alert-center, advanced-notifier) can subscribe once and receive
|
|
27990
|
-
* motion from every camera.
|
|
27991
|
-
*/
|
|
27992
28101
|
var MotionStatusSchema = object({
|
|
27993
28102
|
detected: boolean(),
|
|
27994
28103
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
27995
28104
|
lastDetectedAt: number().nullable(),
|
|
27996
28105
|
/**
|
|
27997
|
-
*
|
|
27998
|
-
*
|
|
27999
|
-
*
|
|
28106
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
|
|
28107
|
+
* `null` while false and on every `Sensor` device (D475) — see that
|
|
28108
|
+
* constant's doc for the one-authority rule.
|
|
28109
|
+
*
|
|
28110
|
+
* ## Reading this field still arms nothing
|
|
28111
|
+
*
|
|
28112
|
+
* It reads like an instruction to the consumer ("revert after N ms if
|
|
28113
|
+
* no fresh push arrives") and it is not one: nothing in this repo reads
|
|
28114
|
+
* the LIVE cap value to drive a timer. `pipeline-analytics`'s motion-episode
|
|
28115
|
+
* close DOES now use the same number — `MOTION_CLOSE_AFTER_MS` — but as an
|
|
28116
|
+
* imported constant, not as a read of `device.state.motion.value`, so this
|
|
28117
|
+
* field stays what it always was: DESCRIPTIVE output, mirroring an answer
|
|
28118
|
+
* computed elsewhere. Building a self-clear timer out of a READ of this
|
|
28119
|
+
* field would add a second falling-edge authority beside whichever one
|
|
28120
|
+
* already owns the device, and two that can disagree are worse than one.
|
|
28121
|
+
* Consumers that need a falling edge SHAPED differently — held open across
|
|
28122
|
+
* a flapping source — debounce on their own side and say so, as
|
|
28123
|
+
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
28124
|
+
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
28125
|
+
*
|
|
28126
|
+
* ## Who writes it
|
|
28127
|
+
*
|
|
28128
|
+
* - **Cameras** — the runner's phase machine, `active → watching` on
|
|
28129
|
+
* `cooldown_expired`, which then writes this slice with
|
|
28130
|
+
* `detected: false` (`handlePhaseChanged` in
|
|
28131
|
+
* `pipeline-runner/index.ts`). It produces the FALLING edge, which
|
|
28132
|
+
* matters most for the sources that only ever push a rising one:
|
|
28133
|
+
* Reolink emits `MotionOnMotionChanged { detected: true }` and never
|
|
28134
|
+
* a false.
|
|
28135
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic) — the
|
|
28136
|
+
* provider pushes the false itself, from the upstream system's own
|
|
28137
|
+
* state change. No phase machine is involved.
|
|
28138
|
+
*
|
|
28139
|
+
* ### The phase machine is CANONICAL, not sole — and that is a defect
|
|
28140
|
+
*
|
|
28141
|
+
* An earlier revision of this docblock (mine, 2026-09-12) claimed the
|
|
28142
|
+
* phase machine is the sole writer for a camera. It is not.
|
|
28143
|
+
* `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
|
|
28144
|
+
* `setCapSlice(motionCapability, …)` on their own rising edge, and
|
|
28145
|
+
* Hikvision's comment says why: it read THIS docblock, agreed the
|
|
28146
|
+
* runner is canonical, and wrote anyway to avoid per-tick churn. So
|
|
28147
|
+
* two authorities can disagree about one slice, which this repo
|
|
28148
|
+
* forbids, and the doc said otherwise — which is worse than saying
|
|
28149
|
+
* nothing, because it reads as verification.
|
|
28150
|
+
*
|
|
28151
|
+
* This predates D475 and is not fixed there: the fix touches every
|
|
28152
|
+
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
28153
|
+
* "sole writer" wording without also removing the other writers.
|
|
28000
28154
|
*/
|
|
28001
28155
|
autoClearAfterMs: number().nullable()
|
|
28002
28156
|
});
|
|
@@ -28066,7 +28220,11 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
|
|
|
28066
28220
|
*/
|
|
28067
28221
|
runtimeState: MotionStatusSchema,
|
|
28068
28222
|
/**
|
|
28069
|
-
* Runtime-state durability: **session** —
|
|
28223
|
+
* Runtime-state durability: **session** — every writer of this slice
|
|
28224
|
+
* writes only on an EDGE, so a restored `detected: true` would stay
|
|
28225
|
+
* frozen until the next one instead of being corrected. The next edge
|
|
28226
|
+
* re-publishes the real state. (On who the writers are, and why there
|
|
28227
|
+
* is more than one, see `autoClearAfterMs` above.)
|
|
28070
28228
|
*
|
|
28071
28229
|
* See `RuntimeStateDurability`. Enforced by
|
|
28072
28230
|
* `scripts/check-runtime-state-durability.ts`.
|
package/dist/addon.mjs
CHANGED
|
@@ -7314,6 +7314,23 @@ function errMsg(err) {
|
|
|
7314
7314
|
if (typeof err === "string") return err;
|
|
7315
7315
|
return String(err);
|
|
7316
7316
|
}
|
|
7317
|
+
new Set([
|
|
7318
|
+
"track",
|
|
7319
|
+
"summary",
|
|
7320
|
+
"face",
|
|
7321
|
+
"identity",
|
|
7322
|
+
"plate",
|
|
7323
|
+
"vehicle",
|
|
7324
|
+
"scene",
|
|
7325
|
+
"motion",
|
|
7326
|
+
"object",
|
|
7327
|
+
"audio"
|
|
7328
|
+
]);
|
|
7329
|
+
new Set([
|
|
7330
|
+
"motion",
|
|
7331
|
+
"object",
|
|
7332
|
+
"audio"
|
|
7333
|
+
]);
|
|
7317
7334
|
var EncodeProfileSchema = object({
|
|
7318
7335
|
video: object({
|
|
7319
7336
|
codec: _enum([
|
|
@@ -12514,8 +12531,17 @@ method(object({
|
|
|
12514
12531
|
}), array(SettingsRecordSchema).readonly()), method(object({
|
|
12515
12532
|
namespace: string().optional(),
|
|
12516
12533
|
collection: string(),
|
|
12517
|
-
record:
|
|
12518
|
-
|
|
12534
|
+
record: object({
|
|
12535
|
+
id: string().optional(),
|
|
12536
|
+
data: record(string(), unknown())
|
|
12537
|
+
})
|
|
12538
|
+
}), object({
|
|
12539
|
+
/**
|
|
12540
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
12541
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
12542
|
+
* primary key — which is the only place an auto key is knowable.
|
|
12543
|
+
*/
|
|
12544
|
+
id: union([string(), number()]) }), { kind: "mutation" }), method(object({
|
|
12519
12545
|
namespace: string().optional(),
|
|
12520
12546
|
collection: string(),
|
|
12521
12547
|
records: array(BulkRecordSchema).readonly()
|
|
@@ -12624,8 +12650,17 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
12624
12650
|
}), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
|
|
12625
12651
|
namespace: string().optional(),
|
|
12626
12652
|
collection: string(),
|
|
12627
|
-
record:
|
|
12628
|
-
|
|
12653
|
+
record: object({
|
|
12654
|
+
id: string().optional(),
|
|
12655
|
+
data: record(string(), unknown())
|
|
12656
|
+
})
|
|
12657
|
+
}), object({
|
|
12658
|
+
/**
|
|
12659
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
12660
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
12661
|
+
* primary key — which is the only place an auto key is knowable.
|
|
12662
|
+
*/
|
|
12663
|
+
id: union([string(), number()]) }), {
|
|
12629
12664
|
kind: "mutation",
|
|
12630
12665
|
auth: "admin"
|
|
12631
12666
|
}), method(object({
|
|
@@ -19550,7 +19585,20 @@ var TrackSchema = object({
|
|
|
19550
19585
|
...TrackRetrainFields
|
|
19551
19586
|
});
|
|
19552
19587
|
var BaseEventFields = {
|
|
19553
|
-
|
|
19588
|
+
/**
|
|
19589
|
+
* A SQLite ROWID, assigned by the database (D474).
|
|
19590
|
+
*
|
|
19591
|
+
* Was a 36-character UUID and cost 263 MB of a 1 117 MB database — paid
|
|
19592
|
+
* TWICE per row, in the row and in the primary-key index, across 2.1 million
|
|
19593
|
+
* motion, audio and object events. An `INTEGER PRIMARY KEY` in SQLite **is**
|
|
19594
|
+
* the rowid: the table itself is that B-tree, so the index stops existing
|
|
19595
|
+
* rather than getting smaller. No shorter string does that.
|
|
19596
|
+
*
|
|
19597
|
+
* Defined once here for all three event kinds, which is why they move
|
|
19598
|
+
* together: a per-table migration would have forked this and
|
|
19599
|
+
* `COMMON_BASE_COLUMNS` and reunited them two stages later.
|
|
19600
|
+
*/
|
|
19601
|
+
id: number().int(),
|
|
19554
19602
|
deviceId: number(),
|
|
19555
19603
|
timestamp: number()
|
|
19556
19604
|
};
|
|
@@ -19569,7 +19617,34 @@ var MotionEventSchema = object({
|
|
|
19569
19617
|
/** Omitted in slim projection. */
|
|
19570
19618
|
frameHeight: number().optional(),
|
|
19571
19619
|
/** Populated by B5 (recording playback URL for this event). */
|
|
19572
|
-
mediaUrl: string().optional()
|
|
19620
|
+
mediaUrl: string().optional(),
|
|
19621
|
+
/**
|
|
19622
|
+
* One row per motion EPISODE, not one per push (D475). `null` while the
|
|
19623
|
+
* episode is still open — a further rising edge extends it in place rather
|
|
19624
|
+
* than inserting a new row. Set once, at close, to `lastOnAt - startedAt`
|
|
19625
|
+
* (the span from the first rising edge to the LAST one, deliberately NOT
|
|
19626
|
+
* `closedAt - startedAt` — the close delay is a quiet CONFIRMATION, not
|
|
19627
|
+
* movement, and folding it in would report `MOTION_CLOSE_AFTER_MS` of
|
|
19628
|
+
* motion for an instantaneous trigger).
|
|
19629
|
+
*
|
|
19630
|
+
* **Absent** (not merely `null`) on a row written before D475 — that means
|
|
19631
|
+
* "closed the old way, before this column existed", never "still open".
|
|
19632
|
+
* Nothing in this codebase may read an absent `durationMs` as an open
|
|
19633
|
+
* episode; only `null` means open.
|
|
19634
|
+
*/
|
|
19635
|
+
durationMs: number().nullable().optional(),
|
|
19636
|
+
/**
|
|
19637
|
+
* Ms offsets from `timestamp` (the episode's own first rising edge, so the
|
|
19638
|
+
* first entry is always `0`) of every genuine off→on transition the
|
|
19639
|
+
* episode saw — "ogni evento on si deve salvare" (D475). NOT one entry per
|
|
19640
|
+
* push: a firmware source that keepalives at ~1 Hz for the whole burst
|
|
19641
|
+
* (Reolink, Hikvision) produces exactly one edge; a source that reports an
|
|
19642
|
+
* explicit `false` mid-episode and then resumes before the quiet window
|
|
19643
|
+
* elapses produces another. Stored compactly — see `motion-edge-codec.ts`
|
|
19644
|
+
* — and decoded back to this shape on read. Absent/empty on a legacy row,
|
|
19645
|
+
* which must never be read as "no episode happened here".
|
|
19646
|
+
*/
|
|
19647
|
+
edges: array(number()).readonly().optional()
|
|
19573
19648
|
});
|
|
19574
19649
|
/**
|
|
19575
19650
|
* Which detection SOURCE produced an object event. `pipeline` = the ML
|
|
@@ -19624,6 +19699,23 @@ var ObjectEventSchema = object({
|
|
|
19624
19699
|
* includes it (it is light). Absent on rows written before this field.
|
|
19625
19700
|
*/
|
|
19626
19701
|
frameId: string().optional(),
|
|
19702
|
+
/**
|
|
19703
|
+
* A PRODUCER-chosen key that makes a synthetic event's emission idempotent
|
|
19704
|
+
* (D474).
|
|
19705
|
+
*
|
|
19706
|
+
* Only the package detector writes it, and it exists because the event id
|
|
19707
|
+
* stopped being choosable: the delivery and pick-up rows used to BE their
|
|
19708
|
+
* dedupe key (`pa-pkg-<entryId>-delivered`), which is how "never emit a
|
|
19709
|
+
* second delivery for this entry" survived a restart. An `INTEGER` rowid is
|
|
19710
|
+
* assigned by SQLite, so that key had to move off the primary key rather
|
|
19711
|
+
* than be dropped — a detector that cannot recognise its own row re-delivers
|
|
19712
|
+
* every parcel on every boot.
|
|
19713
|
+
*
|
|
19714
|
+
* Absent on every other object event, and on every row written before this
|
|
19715
|
+
* field. Never a substitute for `id`: it is unique per (producer, occasion),
|
|
19716
|
+
* not per row, and nothing addresses a row by it.
|
|
19717
|
+
*/
|
|
19718
|
+
idempotencyKey: string().optional(),
|
|
19627
19719
|
/** Omitted in slim projection. */
|
|
19628
19720
|
trackId: string().optional(),
|
|
19629
19721
|
className: string(),
|
|
@@ -20726,6 +20818,14 @@ var NativeCropResultSchema = object({
|
|
|
20726
20818
|
* set `encodeJpeg: true`; `bytes` is then absent.
|
|
20727
20819
|
*/
|
|
20728
20820
|
jpeg: string().optional(),
|
|
20821
|
+
/**
|
|
20822
|
+
* The SAME compressed JPEG as `jpeg`, as bytes (D462). Present instead of
|
|
20823
|
+
* `jpeg` when the request set `acceptJpegBytes`; a request that did not gets
|
|
20824
|
+
* `jpeg` exactly as before. MsgPack and the mesh leg both carry binary —
|
|
20825
|
+
* `bytes` above has crossed this boundary as a `Uint8Array` all along — so
|
|
20826
|
+
* base64 was buying nothing but a multi-megabyte string in the relay's heap.
|
|
20827
|
+
*/
|
|
20828
|
+
jpegBytes: _instanceof(Uint8Array).optional(),
|
|
20729
20829
|
width: number().int().positive(),
|
|
20730
20830
|
height: number().int().positive(),
|
|
20731
20831
|
/**
|
|
@@ -20792,7 +20892,14 @@ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
|
|
|
20792
20892
|
})]);
|
|
20793
20893
|
/** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
|
|
20794
20894
|
var ParkedTrackFrameSchema = object({
|
|
20795
|
-
|
|
20895
|
+
/**
|
|
20896
|
+
* Base64 JPEG — the pre-D462 wire. OPTIONAL since D462: a request that set
|
|
20897
|
+
* `acceptJpegBytes` is answered in `jpegBytes` and this is then absent.
|
|
20898
|
+
* Exactly one of the two is present.
|
|
20899
|
+
*/
|
|
20900
|
+
jpeg: string().optional(),
|
|
20901
|
+
/** The same JPEG as bytes, for a caller that declared it reads them (D462). */
|
|
20902
|
+
jpegBytes: _instanceof(Uint8Array).optional(),
|
|
20796
20903
|
width: number().int().positive(),
|
|
20797
20904
|
height: number().int().positive(),
|
|
20798
20905
|
/** The frame instant the parcel shows (the caller's clock, echoed back). */
|
|
@@ -21379,6 +21486,13 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
21379
21486
|
bbox: NativeCropBboxSchema,
|
|
21380
21487
|
maxWidth: number().int().positive().optional(),
|
|
21381
21488
|
/**
|
|
21489
|
+
* The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
|
|
21490
|
+
* back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
|
|
21491
|
+
* wire — never assume consent: a pre-D462 caller parses the field as
|
|
21492
|
+
* base64 and bytes would decode to garbage rather than fail.
|
|
21493
|
+
*/
|
|
21494
|
+
acceptJpegBytes: boolean().optional(),
|
|
21495
|
+
/**
|
|
21382
21496
|
* When `true`, the runner encodes the resolved crop to JPEG ON THE
|
|
21383
21497
|
* OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
|
|
21384
21498
|
* Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
|
|
@@ -21446,7 +21560,14 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
21446
21560
|
}), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
|
|
21447
21561
|
deviceId: number(),
|
|
21448
21562
|
trackId: string(),
|
|
21449
|
-
kind: ParkedFrameKindSchema
|
|
21563
|
+
kind: ParkedFrameKindSchema,
|
|
21564
|
+
/**
|
|
21565
|
+
* The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
|
|
21566
|
+
* back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
|
|
21567
|
+
* wire — never assume consent: a pre-D462 caller parses the field as
|
|
21568
|
+
* base64 and bytes would decode to garbage rather than fail.
|
|
21569
|
+
*/
|
|
21570
|
+
acceptJpegBytes: boolean().optional()
|
|
21450
21571
|
}), ParkedTrackFrameSchema.nullable()), method(object({
|
|
21451
21572
|
deviceId: number(),
|
|
21452
21573
|
trackId: string()
|
|
@@ -27956,26 +28077,59 @@ authKey: string().optional() }), object({
|
|
|
27956
28077
|
/** Human-readable error when `ok: false`. */
|
|
27957
28078
|
error: string().optional()
|
|
27958
28079
|
}), { kind: "mutation" });
|
|
27959
|
-
/**
|
|
27960
|
-
* Hardware / firmware motion sensor cap — binary detected state plus
|
|
27961
|
-
* a timestamp of the last observation. Distinct from
|
|
27962
|
-
* `motion-detection.cap.ts` which owns the LOCAL ML motion pipeline;
|
|
27963
|
-
* `motion` is the lightweight readout from on-camera motion (Reolink
|
|
27964
|
-
* `GetMdState`, Baichuan push `type: motion`, ONVIF analytics).
|
|
27965
|
-
*
|
|
27966
|
-
* Native-motion providers also fan out to `detection.camera-native`
|
|
27967
|
-
* with `source: 'onboard'` so cross-cutting system services
|
|
27968
|
-
* (alert-center, advanced-notifier) can subscribe once and receive
|
|
27969
|
-
* motion from every camera.
|
|
27970
|
-
*/
|
|
27971
28080
|
var MotionStatusSchema = object({
|
|
27972
28081
|
detected: boolean(),
|
|
27973
28082
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
27974
28083
|
lastDetectedAt: number().nullable(),
|
|
27975
28084
|
/**
|
|
27976
|
-
*
|
|
27977
|
-
*
|
|
27978
|
-
*
|
|
28085
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
|
|
28086
|
+
* `null` while false and on every `Sensor` device (D475) — see that
|
|
28087
|
+
* constant's doc for the one-authority rule.
|
|
28088
|
+
*
|
|
28089
|
+
* ## Reading this field still arms nothing
|
|
28090
|
+
*
|
|
28091
|
+
* It reads like an instruction to the consumer ("revert after N ms if
|
|
28092
|
+
* no fresh push arrives") and it is not one: nothing in this repo reads
|
|
28093
|
+
* the LIVE cap value to drive a timer. `pipeline-analytics`'s motion-episode
|
|
28094
|
+
* close DOES now use the same number — `MOTION_CLOSE_AFTER_MS` — but as an
|
|
28095
|
+
* imported constant, not as a read of `device.state.motion.value`, so this
|
|
28096
|
+
* field stays what it always was: DESCRIPTIVE output, mirroring an answer
|
|
28097
|
+
* computed elsewhere. Building a self-clear timer out of a READ of this
|
|
28098
|
+
* field would add a second falling-edge authority beside whichever one
|
|
28099
|
+
* already owns the device, and two that can disagree are worse than one.
|
|
28100
|
+
* Consumers that need a falling edge SHAPED differently — held open across
|
|
28101
|
+
* a flapping source — debounce on their own side and say so, as
|
|
28102
|
+
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
28103
|
+
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
28104
|
+
*
|
|
28105
|
+
* ## Who writes it
|
|
28106
|
+
*
|
|
28107
|
+
* - **Cameras** — the runner's phase machine, `active → watching` on
|
|
28108
|
+
* `cooldown_expired`, which then writes this slice with
|
|
28109
|
+
* `detected: false` (`handlePhaseChanged` in
|
|
28110
|
+
* `pipeline-runner/index.ts`). It produces the FALLING edge, which
|
|
28111
|
+
* matters most for the sources that only ever push a rising one:
|
|
28112
|
+
* Reolink emits `MotionOnMotionChanged { detected: true }` and never
|
|
28113
|
+
* a false.
|
|
28114
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic) — the
|
|
28115
|
+
* provider pushes the false itself, from the upstream system's own
|
|
28116
|
+
* state change. No phase machine is involved.
|
|
28117
|
+
*
|
|
28118
|
+
* ### The phase machine is CANONICAL, not sole — and that is a defect
|
|
28119
|
+
*
|
|
28120
|
+
* An earlier revision of this docblock (mine, 2026-09-12) claimed the
|
|
28121
|
+
* phase machine is the sole writer for a camera. It is not.
|
|
28122
|
+
* `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
|
|
28123
|
+
* `setCapSlice(motionCapability, …)` on their own rising edge, and
|
|
28124
|
+
* Hikvision's comment says why: it read THIS docblock, agreed the
|
|
28125
|
+
* runner is canonical, and wrote anyway to avoid per-tick churn. So
|
|
28126
|
+
* two authorities can disagree about one slice, which this repo
|
|
28127
|
+
* forbids, and the doc said otherwise — which is worse than saying
|
|
28128
|
+
* nothing, because it reads as verification.
|
|
28129
|
+
*
|
|
28130
|
+
* This predates D475 and is not fixed there: the fix touches every
|
|
28131
|
+
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
28132
|
+
* "sole writer" wording without also removing the other writers.
|
|
27979
28133
|
*/
|
|
27980
28134
|
autoClearAfterMs: number().nullable()
|
|
27981
28135
|
});
|
|
@@ -28045,7 +28199,11 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
|
|
|
28045
28199
|
*/
|
|
28046
28200
|
runtimeState: MotionStatusSchema,
|
|
28047
28201
|
/**
|
|
28048
|
-
* Runtime-state durability: **session** —
|
|
28202
|
+
* Runtime-state durability: **session** — every writer of this slice
|
|
28203
|
+
* writes only on an EDGE, so a restored `detected: true` would stay
|
|
28204
|
+
* frozen until the next one instead of being corrected. The next edge
|
|
28205
|
+
* re-publishes the real state. (On who the writers are, and why there
|
|
28206
|
+
* is more than one, see `autoClearAfterMs` above.)
|
|
28049
28207
|
*
|
|
28050
28208
|
* See `RuntimeStateDurability`. Enforced by
|
|
28051
28209
|
* `scripts/check-runtime-state-durability.ts`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-wyze",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.102",
|
|
4
4
|
"description": "Wyze camera device-provider addon for CamStack — wraps the @apocaliss92/wyze-bridge-js P2P/DTLS client, feeding the stream-broker via the pull-rfc4571 lazy-publish path (a structural twin of addon-provider-reolink)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|