@camstack/addon-provider-onvif 1.2.95 → 1.2.97
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 +177 -11
- package/dist/addon.mjs +177 -11
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7302,6 +7302,23 @@ function errMsg(err) {
|
|
|
7302
7302
|
if (typeof err === "string") return err;
|
|
7303
7303
|
return String(err);
|
|
7304
7304
|
}
|
|
7305
|
+
new Set([
|
|
7306
|
+
"track",
|
|
7307
|
+
"summary",
|
|
7308
|
+
"face",
|
|
7309
|
+
"identity",
|
|
7310
|
+
"plate",
|
|
7311
|
+
"vehicle",
|
|
7312
|
+
"scene",
|
|
7313
|
+
"motion",
|
|
7314
|
+
"object",
|
|
7315
|
+
"audio"
|
|
7316
|
+
]);
|
|
7317
|
+
new Set([
|
|
7318
|
+
"motion",
|
|
7319
|
+
"object",
|
|
7320
|
+
"audio"
|
|
7321
|
+
]);
|
|
7305
7322
|
var EncodeProfileSchema = object({
|
|
7306
7323
|
video: object({
|
|
7307
7324
|
codec: _enum([
|
|
@@ -12400,8 +12417,17 @@ method(object({
|
|
|
12400
12417
|
}), array(SettingsRecordSchema).readonly()), method(object({
|
|
12401
12418
|
namespace: string().optional(),
|
|
12402
12419
|
collection: string(),
|
|
12403
|
-
record:
|
|
12404
|
-
|
|
12420
|
+
record: object({
|
|
12421
|
+
id: string().optional(),
|
|
12422
|
+
data: record(string(), unknown())
|
|
12423
|
+
})
|
|
12424
|
+
}), object({
|
|
12425
|
+
/**
|
|
12426
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
12427
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
12428
|
+
* primary key — which is the only place an auto key is knowable.
|
|
12429
|
+
*/
|
|
12430
|
+
id: union([string(), number()]) }), { kind: "mutation" }), method(object({
|
|
12405
12431
|
namespace: string().optional(),
|
|
12406
12432
|
collection: string(),
|
|
12407
12433
|
records: array(BulkRecordSchema).readonly()
|
|
@@ -12510,8 +12536,17 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
12510
12536
|
}), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
|
|
12511
12537
|
namespace: string().optional(),
|
|
12512
12538
|
collection: string(),
|
|
12513
|
-
record:
|
|
12514
|
-
|
|
12539
|
+
record: object({
|
|
12540
|
+
id: string().optional(),
|
|
12541
|
+
data: record(string(), unknown())
|
|
12542
|
+
})
|
|
12543
|
+
}), object({
|
|
12544
|
+
/**
|
|
12545
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
12546
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
12547
|
+
* primary key — which is the only place an auto key is knowable.
|
|
12548
|
+
*/
|
|
12549
|
+
id: union([string(), number()]) }), {
|
|
12515
12550
|
kind: "mutation",
|
|
12516
12551
|
auth: "admin"
|
|
12517
12552
|
}), method(object({
|
|
@@ -19234,7 +19269,20 @@ var TrackSchema = object({
|
|
|
19234
19269
|
...TrackRetrainFields
|
|
19235
19270
|
});
|
|
19236
19271
|
var BaseEventFields = {
|
|
19237
|
-
|
|
19272
|
+
/**
|
|
19273
|
+
* A SQLite ROWID, assigned by the database (D474).
|
|
19274
|
+
*
|
|
19275
|
+
* Was a 36-character UUID and cost 263 MB of a 1 117 MB database — paid
|
|
19276
|
+
* TWICE per row, in the row and in the primary-key index, across 2.1 million
|
|
19277
|
+
* motion, audio and object events. An `INTEGER PRIMARY KEY` in SQLite **is**
|
|
19278
|
+
* the rowid: the table itself is that B-tree, so the index stops existing
|
|
19279
|
+
* rather than getting smaller. No shorter string does that.
|
|
19280
|
+
*
|
|
19281
|
+
* Defined once here for all three event kinds, which is why they move
|
|
19282
|
+
* together: a per-table migration would have forked this and
|
|
19283
|
+
* `COMMON_BASE_COLUMNS` and reunited them two stages later.
|
|
19284
|
+
*/
|
|
19285
|
+
id: number().int(),
|
|
19238
19286
|
deviceId: number(),
|
|
19239
19287
|
timestamp: number()
|
|
19240
19288
|
};
|
|
@@ -19253,7 +19301,34 @@ var MotionEventSchema = object({
|
|
|
19253
19301
|
/** Omitted in slim projection. */
|
|
19254
19302
|
frameHeight: number().optional(),
|
|
19255
19303
|
/** Populated by B5 (recording playback URL for this event). */
|
|
19256
|
-
mediaUrl: string().optional()
|
|
19304
|
+
mediaUrl: string().optional(),
|
|
19305
|
+
/**
|
|
19306
|
+
* One row per motion EPISODE, not one per push (D475). `null` while the
|
|
19307
|
+
* episode is still open — a further rising edge extends it in place rather
|
|
19308
|
+
* than inserting a new row. Set once, at close, to `lastOnAt - startedAt`
|
|
19309
|
+
* (the span from the first rising edge to the LAST one, deliberately NOT
|
|
19310
|
+
* `closedAt - startedAt` — the close delay is a quiet CONFIRMATION, not
|
|
19311
|
+
* movement, and folding it in would report `MOTION_CLOSE_AFTER_MS` of
|
|
19312
|
+
* motion for an instantaneous trigger).
|
|
19313
|
+
*
|
|
19314
|
+
* **Absent** (not merely `null`) on a row written before D475 — that means
|
|
19315
|
+
* "closed the old way, before this column existed", never "still open".
|
|
19316
|
+
* Nothing in this codebase may read an absent `durationMs` as an open
|
|
19317
|
+
* episode; only `null` means open.
|
|
19318
|
+
*/
|
|
19319
|
+
durationMs: number().nullable().optional(),
|
|
19320
|
+
/**
|
|
19321
|
+
* Ms offsets from `timestamp` (the episode's own first rising edge, so the
|
|
19322
|
+
* first entry is always `0`) of every genuine off→on transition the
|
|
19323
|
+
* episode saw — "ogni evento on si deve salvare" (D475). NOT one entry per
|
|
19324
|
+
* push: a firmware source that keepalives at ~1 Hz for the whole burst
|
|
19325
|
+
* (Reolink, Hikvision) produces exactly one edge; a source that reports an
|
|
19326
|
+
* explicit `false` mid-episode and then resumes before the quiet window
|
|
19327
|
+
* elapses produces another. Stored compactly — see `motion-edge-codec.ts`
|
|
19328
|
+
* — and decoded back to this shape on read. Absent/empty on a legacy row,
|
|
19329
|
+
* which must never be read as "no episode happened here".
|
|
19330
|
+
*/
|
|
19331
|
+
edges: array(number()).readonly().optional()
|
|
19257
19332
|
});
|
|
19258
19333
|
/**
|
|
19259
19334
|
* Which detection SOURCE produced an object event. `pipeline` = the ML
|
|
@@ -19308,6 +19383,23 @@ var ObjectEventSchema = object({
|
|
|
19308
19383
|
* includes it (it is light). Absent on rows written before this field.
|
|
19309
19384
|
*/
|
|
19310
19385
|
frameId: string().optional(),
|
|
19386
|
+
/**
|
|
19387
|
+
* A PRODUCER-chosen key that makes a synthetic event's emission idempotent
|
|
19388
|
+
* (D474).
|
|
19389
|
+
*
|
|
19390
|
+
* Only the package detector writes it, and it exists because the event id
|
|
19391
|
+
* stopped being choosable: the delivery and pick-up rows used to BE their
|
|
19392
|
+
* dedupe key (`pa-pkg-<entryId>-delivered`), which is how "never emit a
|
|
19393
|
+
* second delivery for this entry" survived a restart. An `INTEGER` rowid is
|
|
19394
|
+
* assigned by SQLite, so that key had to move off the primary key rather
|
|
19395
|
+
* than be dropped — a detector that cannot recognise its own row re-delivers
|
|
19396
|
+
* every parcel on every boot.
|
|
19397
|
+
*
|
|
19398
|
+
* Absent on every other object event, and on every row written before this
|
|
19399
|
+
* field. Never a substitute for `id`: it is unique per (producer, occasion),
|
|
19400
|
+
* not per row, and nothing addresses a row by it.
|
|
19401
|
+
*/
|
|
19402
|
+
idempotencyKey: string().optional(),
|
|
19311
19403
|
/** Omitted in slim projection. */
|
|
19312
19404
|
trackId: string().optional(),
|
|
19313
19405
|
className: string(),
|
|
@@ -20410,6 +20502,14 @@ var NativeCropResultSchema = object({
|
|
|
20410
20502
|
* set `encodeJpeg: true`; `bytes` is then absent.
|
|
20411
20503
|
*/
|
|
20412
20504
|
jpeg: string().optional(),
|
|
20505
|
+
/**
|
|
20506
|
+
* The SAME compressed JPEG as `jpeg`, as bytes (D462). Present instead of
|
|
20507
|
+
* `jpeg` when the request set `acceptJpegBytes`; a request that did not gets
|
|
20508
|
+
* `jpeg` exactly as before. MsgPack and the mesh leg both carry binary —
|
|
20509
|
+
* `bytes` above has crossed this boundary as a `Uint8Array` all along — so
|
|
20510
|
+
* base64 was buying nothing but a multi-megabyte string in the relay's heap.
|
|
20511
|
+
*/
|
|
20512
|
+
jpegBytes: _instanceof(Uint8Array).optional(),
|
|
20413
20513
|
width: number().int().positive(),
|
|
20414
20514
|
height: number().int().positive(),
|
|
20415
20515
|
/**
|
|
@@ -20476,7 +20576,14 @@ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
|
|
|
20476
20576
|
})]);
|
|
20477
20577
|
/** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
|
|
20478
20578
|
var ParkedTrackFrameSchema = object({
|
|
20479
|
-
|
|
20579
|
+
/**
|
|
20580
|
+
* Base64 JPEG — the pre-D462 wire. OPTIONAL since D462: a request that set
|
|
20581
|
+
* `acceptJpegBytes` is answered in `jpegBytes` and this is then absent.
|
|
20582
|
+
* Exactly one of the two is present.
|
|
20583
|
+
*/
|
|
20584
|
+
jpeg: string().optional(),
|
|
20585
|
+
/** The same JPEG as bytes, for a caller that declared it reads them (D462). */
|
|
20586
|
+
jpegBytes: _instanceof(Uint8Array).optional(),
|
|
20480
20587
|
width: number().int().positive(),
|
|
20481
20588
|
height: number().int().positive(),
|
|
20482
20589
|
/** The frame instant the parcel shows (the caller's clock, echoed back). */
|
|
@@ -21063,6 +21170,13 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
21063
21170
|
bbox: NativeCropBboxSchema,
|
|
21064
21171
|
maxWidth: number().int().positive().optional(),
|
|
21065
21172
|
/**
|
|
21173
|
+
* The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
|
|
21174
|
+
* back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
|
|
21175
|
+
* wire — never assume consent: a pre-D462 caller parses the field as
|
|
21176
|
+
* base64 and bytes would decode to garbage rather than fail.
|
|
21177
|
+
*/
|
|
21178
|
+
acceptJpegBytes: boolean().optional(),
|
|
21179
|
+
/**
|
|
21066
21180
|
* When `true`, the runner encodes the resolved crop to JPEG ON THE
|
|
21067
21181
|
* OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
|
|
21068
21182
|
* Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
|
|
@@ -21130,7 +21244,14 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
21130
21244
|
}), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
|
|
21131
21245
|
deviceId: number(),
|
|
21132
21246
|
trackId: string(),
|
|
21133
|
-
kind: ParkedFrameKindSchema
|
|
21247
|
+
kind: ParkedFrameKindSchema,
|
|
21248
|
+
/**
|
|
21249
|
+
* The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
|
|
21250
|
+
* back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
|
|
21251
|
+
* wire — never assume consent: a pre-D462 caller parses the field as
|
|
21252
|
+
* base64 and bytes would decode to garbage rather than fail.
|
|
21253
|
+
*/
|
|
21254
|
+
acceptJpegBytes: boolean().optional()
|
|
21134
21255
|
}), ParkedTrackFrameSchema.nullable()), method(object({
|
|
21135
21256
|
deviceId: number(),
|
|
21136
21257
|
trackId: string()
|
|
@@ -26449,9 +26570,54 @@ object({
|
|
|
26449
26570
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
26450
26571
|
lastDetectedAt: number().nullable(),
|
|
26451
26572
|
/**
|
|
26452
|
-
*
|
|
26453
|
-
*
|
|
26454
|
-
*
|
|
26573
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
|
|
26574
|
+
* `null` while false and on every `Sensor` device (D475) — see that
|
|
26575
|
+
* constant's doc for the one-authority rule.
|
|
26576
|
+
*
|
|
26577
|
+
* ## Reading this field still arms nothing
|
|
26578
|
+
*
|
|
26579
|
+
* It reads like an instruction to the consumer ("revert after N ms if
|
|
26580
|
+
* no fresh push arrives") and it is not one: nothing in this repo reads
|
|
26581
|
+
* the LIVE cap value to drive a timer. `pipeline-analytics`'s motion-episode
|
|
26582
|
+
* close DOES now use the same number — `MOTION_CLOSE_AFTER_MS` — but as an
|
|
26583
|
+
* imported constant, not as a read of `device.state.motion.value`, so this
|
|
26584
|
+
* field stays what it always was: DESCRIPTIVE output, mirroring an answer
|
|
26585
|
+
* computed elsewhere. Building a self-clear timer out of a READ of this
|
|
26586
|
+
* field would add a second falling-edge authority beside whichever one
|
|
26587
|
+
* already owns the device, and two that can disagree are worse than one.
|
|
26588
|
+
* Consumers that need a falling edge SHAPED differently — held open across
|
|
26589
|
+
* a flapping source — debounce on their own side and say so, as
|
|
26590
|
+
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
26591
|
+
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
26592
|
+
*
|
|
26593
|
+
* ## Who writes it
|
|
26594
|
+
*
|
|
26595
|
+
* - **Cameras** — the runner's phase machine, `active → watching` on
|
|
26596
|
+
* `cooldown_expired`, which then writes this slice with
|
|
26597
|
+
* `detected: false` (`handlePhaseChanged` in
|
|
26598
|
+
* `pipeline-runner/index.ts`). It produces the FALLING edge, which
|
|
26599
|
+
* matters most for the sources that only ever push a rising one:
|
|
26600
|
+
* Reolink emits `MotionOnMotionChanged { detected: true }` and never
|
|
26601
|
+
* a false.
|
|
26602
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic) — the
|
|
26603
|
+
* provider pushes the false itself, from the upstream system's own
|
|
26604
|
+
* state change. No phase machine is involved.
|
|
26605
|
+
*
|
|
26606
|
+
* ### The phase machine is CANONICAL, not sole — and that is a defect
|
|
26607
|
+
*
|
|
26608
|
+
* An earlier revision of this docblock (mine, 2026-09-12) claimed the
|
|
26609
|
+
* phase machine is the sole writer for a camera. It is not.
|
|
26610
|
+
* `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
|
|
26611
|
+
* `setCapSlice(motionCapability, …)` on their own rising edge, and
|
|
26612
|
+
* Hikvision's comment says why: it read THIS docblock, agreed the
|
|
26613
|
+
* runner is canonical, and wrote anyway to avoid per-tick churn. So
|
|
26614
|
+
* two authorities can disagree about one slice, which this repo
|
|
26615
|
+
* forbids, and the doc said otherwise — which is worse than saying
|
|
26616
|
+
* nothing, because it reads as verification.
|
|
26617
|
+
*
|
|
26618
|
+
* This predates D475 and is not fixed there: the fix touches every
|
|
26619
|
+
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
26620
|
+
* "sole writer" wording without also removing the other writers.
|
|
26455
26621
|
*/
|
|
26456
26622
|
autoClearAfterMs: number().nullable()
|
|
26457
26623
|
});
|
package/dist/addon.mjs
CHANGED
|
@@ -7303,6 +7303,23 @@ function errMsg(err) {
|
|
|
7303
7303
|
if (typeof err === "string") return err;
|
|
7304
7304
|
return String(err);
|
|
7305
7305
|
}
|
|
7306
|
+
new Set([
|
|
7307
|
+
"track",
|
|
7308
|
+
"summary",
|
|
7309
|
+
"face",
|
|
7310
|
+
"identity",
|
|
7311
|
+
"plate",
|
|
7312
|
+
"vehicle",
|
|
7313
|
+
"scene",
|
|
7314
|
+
"motion",
|
|
7315
|
+
"object",
|
|
7316
|
+
"audio"
|
|
7317
|
+
]);
|
|
7318
|
+
new Set([
|
|
7319
|
+
"motion",
|
|
7320
|
+
"object",
|
|
7321
|
+
"audio"
|
|
7322
|
+
]);
|
|
7306
7323
|
var EncodeProfileSchema = object({
|
|
7307
7324
|
video: object({
|
|
7308
7325
|
codec: _enum([
|
|
@@ -12401,8 +12418,17 @@ method(object({
|
|
|
12401
12418
|
}), array(SettingsRecordSchema).readonly()), method(object({
|
|
12402
12419
|
namespace: string().optional(),
|
|
12403
12420
|
collection: string(),
|
|
12404
|
-
record:
|
|
12405
|
-
|
|
12421
|
+
record: object({
|
|
12422
|
+
id: string().optional(),
|
|
12423
|
+
data: record(string(), unknown())
|
|
12424
|
+
})
|
|
12425
|
+
}), object({
|
|
12426
|
+
/**
|
|
12427
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
12428
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
12429
|
+
* primary key — which is the only place an auto key is knowable.
|
|
12430
|
+
*/
|
|
12431
|
+
id: union([string(), number()]) }), { kind: "mutation" }), method(object({
|
|
12406
12432
|
namespace: string().optional(),
|
|
12407
12433
|
collection: string(),
|
|
12408
12434
|
records: array(BulkRecordSchema).readonly()
|
|
@@ -12511,8 +12537,17 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
12511
12537
|
}), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
|
|
12512
12538
|
namespace: string().optional(),
|
|
12513
12539
|
collection: string(),
|
|
12514
|
-
record:
|
|
12515
|
-
|
|
12540
|
+
record: object({
|
|
12541
|
+
id: string().optional(),
|
|
12542
|
+
data: record(string(), unknown())
|
|
12543
|
+
})
|
|
12544
|
+
}), object({
|
|
12545
|
+
/**
|
|
12546
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
12547
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
12548
|
+
* primary key — which is the only place an auto key is knowable.
|
|
12549
|
+
*/
|
|
12550
|
+
id: union([string(), number()]) }), {
|
|
12516
12551
|
kind: "mutation",
|
|
12517
12552
|
auth: "admin"
|
|
12518
12553
|
}), method(object({
|
|
@@ -19235,7 +19270,20 @@ var TrackSchema = object({
|
|
|
19235
19270
|
...TrackRetrainFields
|
|
19236
19271
|
});
|
|
19237
19272
|
var BaseEventFields = {
|
|
19238
|
-
|
|
19273
|
+
/**
|
|
19274
|
+
* A SQLite ROWID, assigned by the database (D474).
|
|
19275
|
+
*
|
|
19276
|
+
* Was a 36-character UUID and cost 263 MB of a 1 117 MB database — paid
|
|
19277
|
+
* TWICE per row, in the row and in the primary-key index, across 2.1 million
|
|
19278
|
+
* motion, audio and object events. An `INTEGER PRIMARY KEY` in SQLite **is**
|
|
19279
|
+
* the rowid: the table itself is that B-tree, so the index stops existing
|
|
19280
|
+
* rather than getting smaller. No shorter string does that.
|
|
19281
|
+
*
|
|
19282
|
+
* Defined once here for all three event kinds, which is why they move
|
|
19283
|
+
* together: a per-table migration would have forked this and
|
|
19284
|
+
* `COMMON_BASE_COLUMNS` and reunited them two stages later.
|
|
19285
|
+
*/
|
|
19286
|
+
id: number().int(),
|
|
19239
19287
|
deviceId: number(),
|
|
19240
19288
|
timestamp: number()
|
|
19241
19289
|
};
|
|
@@ -19254,7 +19302,34 @@ var MotionEventSchema = object({
|
|
|
19254
19302
|
/** Omitted in slim projection. */
|
|
19255
19303
|
frameHeight: number().optional(),
|
|
19256
19304
|
/** Populated by B5 (recording playback URL for this event). */
|
|
19257
|
-
mediaUrl: string().optional()
|
|
19305
|
+
mediaUrl: string().optional(),
|
|
19306
|
+
/**
|
|
19307
|
+
* One row per motion EPISODE, not one per push (D475). `null` while the
|
|
19308
|
+
* episode is still open — a further rising edge extends it in place rather
|
|
19309
|
+
* than inserting a new row. Set once, at close, to `lastOnAt - startedAt`
|
|
19310
|
+
* (the span from the first rising edge to the LAST one, deliberately NOT
|
|
19311
|
+
* `closedAt - startedAt` — the close delay is a quiet CONFIRMATION, not
|
|
19312
|
+
* movement, and folding it in would report `MOTION_CLOSE_AFTER_MS` of
|
|
19313
|
+
* motion for an instantaneous trigger).
|
|
19314
|
+
*
|
|
19315
|
+
* **Absent** (not merely `null`) on a row written before D475 — that means
|
|
19316
|
+
* "closed the old way, before this column existed", never "still open".
|
|
19317
|
+
* Nothing in this codebase may read an absent `durationMs` as an open
|
|
19318
|
+
* episode; only `null` means open.
|
|
19319
|
+
*/
|
|
19320
|
+
durationMs: number().nullable().optional(),
|
|
19321
|
+
/**
|
|
19322
|
+
* Ms offsets from `timestamp` (the episode's own first rising edge, so the
|
|
19323
|
+
* first entry is always `0`) of every genuine off→on transition the
|
|
19324
|
+
* episode saw — "ogni evento on si deve salvare" (D475). NOT one entry per
|
|
19325
|
+
* push: a firmware source that keepalives at ~1 Hz for the whole burst
|
|
19326
|
+
* (Reolink, Hikvision) produces exactly one edge; a source that reports an
|
|
19327
|
+
* explicit `false` mid-episode and then resumes before the quiet window
|
|
19328
|
+
* elapses produces another. Stored compactly — see `motion-edge-codec.ts`
|
|
19329
|
+
* — and decoded back to this shape on read. Absent/empty on a legacy row,
|
|
19330
|
+
* which must never be read as "no episode happened here".
|
|
19331
|
+
*/
|
|
19332
|
+
edges: array(number()).readonly().optional()
|
|
19258
19333
|
});
|
|
19259
19334
|
/**
|
|
19260
19335
|
* Which detection SOURCE produced an object event. `pipeline` = the ML
|
|
@@ -19309,6 +19384,23 @@ var ObjectEventSchema = object({
|
|
|
19309
19384
|
* includes it (it is light). Absent on rows written before this field.
|
|
19310
19385
|
*/
|
|
19311
19386
|
frameId: string().optional(),
|
|
19387
|
+
/**
|
|
19388
|
+
* A PRODUCER-chosen key that makes a synthetic event's emission idempotent
|
|
19389
|
+
* (D474).
|
|
19390
|
+
*
|
|
19391
|
+
* Only the package detector writes it, and it exists because the event id
|
|
19392
|
+
* stopped being choosable: the delivery and pick-up rows used to BE their
|
|
19393
|
+
* dedupe key (`pa-pkg-<entryId>-delivered`), which is how "never emit a
|
|
19394
|
+
* second delivery for this entry" survived a restart. An `INTEGER` rowid is
|
|
19395
|
+
* assigned by SQLite, so that key had to move off the primary key rather
|
|
19396
|
+
* than be dropped — a detector that cannot recognise its own row re-delivers
|
|
19397
|
+
* every parcel on every boot.
|
|
19398
|
+
*
|
|
19399
|
+
* Absent on every other object event, and on every row written before this
|
|
19400
|
+
* field. Never a substitute for `id`: it is unique per (producer, occasion),
|
|
19401
|
+
* not per row, and nothing addresses a row by it.
|
|
19402
|
+
*/
|
|
19403
|
+
idempotencyKey: string().optional(),
|
|
19312
19404
|
/** Omitted in slim projection. */
|
|
19313
19405
|
trackId: string().optional(),
|
|
19314
19406
|
className: string(),
|
|
@@ -20411,6 +20503,14 @@ var NativeCropResultSchema = object({
|
|
|
20411
20503
|
* set `encodeJpeg: true`; `bytes` is then absent.
|
|
20412
20504
|
*/
|
|
20413
20505
|
jpeg: string().optional(),
|
|
20506
|
+
/**
|
|
20507
|
+
* The SAME compressed JPEG as `jpeg`, as bytes (D462). Present instead of
|
|
20508
|
+
* `jpeg` when the request set `acceptJpegBytes`; a request that did not gets
|
|
20509
|
+
* `jpeg` exactly as before. MsgPack and the mesh leg both carry binary —
|
|
20510
|
+
* `bytes` above has crossed this boundary as a `Uint8Array` all along — so
|
|
20511
|
+
* base64 was buying nothing but a multi-megabyte string in the relay's heap.
|
|
20512
|
+
*/
|
|
20513
|
+
jpegBytes: _instanceof(Uint8Array).optional(),
|
|
20414
20514
|
width: number().int().positive(),
|
|
20415
20515
|
height: number().int().positive(),
|
|
20416
20516
|
/**
|
|
@@ -20477,7 +20577,14 @@ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
|
|
|
20477
20577
|
})]);
|
|
20478
20578
|
/** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
|
|
20479
20579
|
var ParkedTrackFrameSchema = object({
|
|
20480
|
-
|
|
20580
|
+
/**
|
|
20581
|
+
* Base64 JPEG — the pre-D462 wire. OPTIONAL since D462: a request that set
|
|
20582
|
+
* `acceptJpegBytes` is answered in `jpegBytes` and this is then absent.
|
|
20583
|
+
* Exactly one of the two is present.
|
|
20584
|
+
*/
|
|
20585
|
+
jpeg: string().optional(),
|
|
20586
|
+
/** The same JPEG as bytes, for a caller that declared it reads them (D462). */
|
|
20587
|
+
jpegBytes: _instanceof(Uint8Array).optional(),
|
|
20481
20588
|
width: number().int().positive(),
|
|
20482
20589
|
height: number().int().positive(),
|
|
20483
20590
|
/** The frame instant the parcel shows (the caller's clock, echoed back). */
|
|
@@ -21064,6 +21171,13 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
21064
21171
|
bbox: NativeCropBboxSchema,
|
|
21065
21172
|
maxWidth: number().int().positive().optional(),
|
|
21066
21173
|
/**
|
|
21174
|
+
* The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
|
|
21175
|
+
* back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
|
|
21176
|
+
* wire — never assume consent: a pre-D462 caller parses the field as
|
|
21177
|
+
* base64 and bytes would decode to garbage rather than fail.
|
|
21178
|
+
*/
|
|
21179
|
+
acceptJpegBytes: boolean().optional(),
|
|
21180
|
+
/**
|
|
21067
21181
|
* When `true`, the runner encodes the resolved crop to JPEG ON THE
|
|
21068
21182
|
* OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
|
|
21069
21183
|
* Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
|
|
@@ -21131,7 +21245,14 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
21131
21245
|
}), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
|
|
21132
21246
|
deviceId: number(),
|
|
21133
21247
|
trackId: string(),
|
|
21134
|
-
kind: ParkedFrameKindSchema
|
|
21248
|
+
kind: ParkedFrameKindSchema,
|
|
21249
|
+
/**
|
|
21250
|
+
* The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
|
|
21251
|
+
* back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
|
|
21252
|
+
* wire — never assume consent: a pre-D462 caller parses the field as
|
|
21253
|
+
* base64 and bytes would decode to garbage rather than fail.
|
|
21254
|
+
*/
|
|
21255
|
+
acceptJpegBytes: boolean().optional()
|
|
21135
21256
|
}), ParkedTrackFrameSchema.nullable()), method(object({
|
|
21136
21257
|
deviceId: number(),
|
|
21137
21258
|
trackId: string()
|
|
@@ -26450,9 +26571,54 @@ object({
|
|
|
26450
26571
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
26451
26572
|
lastDetectedAt: number().nullable(),
|
|
26452
26573
|
/**
|
|
26453
|
-
*
|
|
26454
|
-
*
|
|
26455
|
-
*
|
|
26574
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
|
|
26575
|
+
* `null` while false and on every `Sensor` device (D475) — see that
|
|
26576
|
+
* constant's doc for the one-authority rule.
|
|
26577
|
+
*
|
|
26578
|
+
* ## Reading this field still arms nothing
|
|
26579
|
+
*
|
|
26580
|
+
* It reads like an instruction to the consumer ("revert after N ms if
|
|
26581
|
+
* no fresh push arrives") and it is not one: nothing in this repo reads
|
|
26582
|
+
* the LIVE cap value to drive a timer. `pipeline-analytics`'s motion-episode
|
|
26583
|
+
* close DOES now use the same number — `MOTION_CLOSE_AFTER_MS` — but as an
|
|
26584
|
+
* imported constant, not as a read of `device.state.motion.value`, so this
|
|
26585
|
+
* field stays what it always was: DESCRIPTIVE output, mirroring an answer
|
|
26586
|
+
* computed elsewhere. Building a self-clear timer out of a READ of this
|
|
26587
|
+
* field would add a second falling-edge authority beside whichever one
|
|
26588
|
+
* already owns the device, and two that can disagree are worse than one.
|
|
26589
|
+
* Consumers that need a falling edge SHAPED differently — held open across
|
|
26590
|
+
* a flapping source — debounce on their own side and say so, as
|
|
26591
|
+
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
26592
|
+
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
26593
|
+
*
|
|
26594
|
+
* ## Who writes it
|
|
26595
|
+
*
|
|
26596
|
+
* - **Cameras** — the runner's phase machine, `active → watching` on
|
|
26597
|
+
* `cooldown_expired`, which then writes this slice with
|
|
26598
|
+
* `detected: false` (`handlePhaseChanged` in
|
|
26599
|
+
* `pipeline-runner/index.ts`). It produces the FALLING edge, which
|
|
26600
|
+
* matters most for the sources that only ever push a rising one:
|
|
26601
|
+
* Reolink emits `MotionOnMotionChanged { detected: true }` and never
|
|
26602
|
+
* a false.
|
|
26603
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic) — the
|
|
26604
|
+
* provider pushes the false itself, from the upstream system's own
|
|
26605
|
+
* state change. No phase machine is involved.
|
|
26606
|
+
*
|
|
26607
|
+
* ### The phase machine is CANONICAL, not sole — and that is a defect
|
|
26608
|
+
*
|
|
26609
|
+
* An earlier revision of this docblock (mine, 2026-09-12) claimed the
|
|
26610
|
+
* phase machine is the sole writer for a camera. It is not.
|
|
26611
|
+
* `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
|
|
26612
|
+
* `setCapSlice(motionCapability, …)` on their own rising edge, and
|
|
26613
|
+
* Hikvision's comment says why: it read THIS docblock, agreed the
|
|
26614
|
+
* runner is canonical, and wrote anyway to avoid per-tick churn. So
|
|
26615
|
+
* two authorities can disagree about one slice, which this repo
|
|
26616
|
+
* forbids, and the doc said otherwise — which is worse than saying
|
|
26617
|
+
* nothing, because it reads as verification.
|
|
26618
|
+
*
|
|
26619
|
+
* This predates D475 and is not fixed there: the fix touches every
|
|
26620
|
+
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
26621
|
+
* "sole writer" wording without also removing the other writers.
|
|
26456
26622
|
*/
|
|
26457
26623
|
autoClearAfterMs: number().nullable()
|
|
26458
26624
|
});
|