@camstack/addon-auth 1.2.103 → 1.2.105

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.
@@ -7298,8 +7298,23 @@ function errMsg(err) {
7298
7298
  if (typeof err === "string") return err;
7299
7299
  return String(err);
7300
7300
  }
7301
- //#endregion
7302
- //#region ../types/dist/index.mjs
7301
+ new Set([
7302
+ "track",
7303
+ "summary",
7304
+ "face",
7305
+ "identity",
7306
+ "plate",
7307
+ "vehicle",
7308
+ "scene",
7309
+ "motion",
7310
+ "object",
7311
+ "audio"
7312
+ ]);
7313
+ new Set([
7314
+ "motion",
7315
+ "object",
7316
+ "audio"
7317
+ ]);
7303
7318
  /**
7304
7319
  * Build an `IAddonRouteProvider` from a list of routes. Implements
7305
7320
  * both the operator-facing `getRoutes` (returning route descriptors
@@ -12566,8 +12581,17 @@ method(object({
12566
12581
  }), array(SettingsRecordSchema).readonly()), method(object({
12567
12582
  namespace: string().optional(),
12568
12583
  collection: string(),
12569
- record: SettingsRecordSchema
12570
- }), _void(), { kind: "mutation" }), method(object({
12584
+ record: object({
12585
+ id: string().optional(),
12586
+ data: record(string(), unknown())
12587
+ })
12588
+ }), object({
12589
+ /**
12590
+ * The id the row ACTUALLY got (D473): the one supplied, the UUID minted
12591
+ * for an absent one, or the ROWID SQLite assigned on an `INTEGER`
12592
+ * primary key — which is the only place an auto key is knowable.
12593
+ */
12594
+ id: union([string(), number()]) }), { kind: "mutation" }), method(object({
12571
12595
  namespace: string().optional(),
12572
12596
  collection: string(),
12573
12597
  records: array(BulkRecordSchema).readonly()
@@ -12676,8 +12700,17 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
12676
12700
  }), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
12677
12701
  namespace: string().optional(),
12678
12702
  collection: string(),
12679
- record: SettingsRecordSchema
12680
- }), _void(), {
12703
+ record: object({
12704
+ id: string().optional(),
12705
+ data: record(string(), unknown())
12706
+ })
12707
+ }), object({
12708
+ /**
12709
+ * The id the row ACTUALLY got (D473): the one supplied, the UUID minted
12710
+ * for an absent one, or the ROWID SQLite assigned on an `INTEGER`
12711
+ * primary key — which is the only place an auto key is knowable.
12712
+ */
12713
+ id: union([string(), number()]) }), {
12681
12714
  kind: "mutation",
12682
12715
  auth: "admin"
12683
12716
  }), method(object({
@@ -19327,7 +19360,20 @@ var TrackSchema = object({
19327
19360
  ...TrackRetrainFields
19328
19361
  });
19329
19362
  var BaseEventFields = {
19330
- id: string(),
19363
+ /**
19364
+ * A SQLite ROWID, assigned by the database (D474).
19365
+ *
19366
+ * Was a 36-character UUID and cost 263 MB of a 1 117 MB database — paid
19367
+ * TWICE per row, in the row and in the primary-key index, across 2.1 million
19368
+ * motion, audio and object events. An `INTEGER PRIMARY KEY` in SQLite **is**
19369
+ * the rowid: the table itself is that B-tree, so the index stops existing
19370
+ * rather than getting smaller. No shorter string does that.
19371
+ *
19372
+ * Defined once here for all three event kinds, which is why they move
19373
+ * together: a per-table migration would have forked this and
19374
+ * `COMMON_BASE_COLUMNS` and reunited them two stages later.
19375
+ */
19376
+ id: number().int(),
19331
19377
  deviceId: number(),
19332
19378
  timestamp: number()
19333
19379
  };
@@ -19346,7 +19392,34 @@ var MotionEventSchema = object({
19346
19392
  /** Omitted in slim projection. */
19347
19393
  frameHeight: number().optional(),
19348
19394
  /** Populated by B5 (recording playback URL for this event). */
19349
- mediaUrl: string().optional()
19395
+ mediaUrl: string().optional(),
19396
+ /**
19397
+ * One row per motion EPISODE, not one per push (D475). `null` while the
19398
+ * episode is still open — a further rising edge extends it in place rather
19399
+ * than inserting a new row. Set once, at close, to `lastOnAt - startedAt`
19400
+ * (the span from the first rising edge to the LAST one, deliberately NOT
19401
+ * `closedAt - startedAt` — the close delay is a quiet CONFIRMATION, not
19402
+ * movement, and folding it in would report `MOTION_CLOSE_AFTER_MS` of
19403
+ * motion for an instantaneous trigger).
19404
+ *
19405
+ * **Absent** (not merely `null`) on a row written before D475 — that means
19406
+ * "closed the old way, before this column existed", never "still open".
19407
+ * Nothing in this codebase may read an absent `durationMs` as an open
19408
+ * episode; only `null` means open.
19409
+ */
19410
+ durationMs: number().nullable().optional(),
19411
+ /**
19412
+ * Ms offsets from `timestamp` (the episode's own first rising edge, so the
19413
+ * first entry is always `0`) of every genuine off→on transition the
19414
+ * episode saw — "ogni evento on si deve salvare" (D475). NOT one entry per
19415
+ * push: a firmware source that keepalives at ~1 Hz for the whole burst
19416
+ * (Reolink, Hikvision) produces exactly one edge; a source that reports an
19417
+ * explicit `false` mid-episode and then resumes before the quiet window
19418
+ * elapses produces another. Stored compactly — see `motion-edge-codec.ts`
19419
+ * — and decoded back to this shape on read. Absent/empty on a legacy row,
19420
+ * which must never be read as "no episode happened here".
19421
+ */
19422
+ edges: array(number()).readonly().optional()
19350
19423
  });
19351
19424
  /**
19352
19425
  * Which detection SOURCE produced an object event. `pipeline` = the ML
@@ -19401,6 +19474,23 @@ var ObjectEventSchema = object({
19401
19474
  * includes it (it is light). Absent on rows written before this field.
19402
19475
  */
19403
19476
  frameId: string().optional(),
19477
+ /**
19478
+ * A PRODUCER-chosen key that makes a synthetic event's emission idempotent
19479
+ * (D474).
19480
+ *
19481
+ * Only the package detector writes it, and it exists because the event id
19482
+ * stopped being choosable: the delivery and pick-up rows used to BE their
19483
+ * dedupe key (`pa-pkg-<entryId>-delivered`), which is how "never emit a
19484
+ * second delivery for this entry" survived a restart. An `INTEGER` rowid is
19485
+ * assigned by SQLite, so that key had to move off the primary key rather
19486
+ * than be dropped — a detector that cannot recognise its own row re-delivers
19487
+ * every parcel on every boot.
19488
+ *
19489
+ * Absent on every other object event, and on every row written before this
19490
+ * field. Never a substitute for `id`: it is unique per (producer, occasion),
19491
+ * not per row, and nothing addresses a row by it.
19492
+ */
19493
+ idempotencyKey: string().optional(),
19404
19494
  /** Omitted in slim projection. */
19405
19495
  trackId: string().optional(),
19406
19496
  className: string(),
@@ -20503,6 +20593,14 @@ var NativeCropResultSchema = object({
20503
20593
  * set `encodeJpeg: true`; `bytes` is then absent.
20504
20594
  */
20505
20595
  jpeg: string().optional(),
20596
+ /**
20597
+ * The SAME compressed JPEG as `jpeg`, as bytes (D462). Present instead of
20598
+ * `jpeg` when the request set `acceptJpegBytes`; a request that did not gets
20599
+ * `jpeg` exactly as before. MsgPack and the mesh leg both carry binary —
20600
+ * `bytes` above has crossed this boundary as a `Uint8Array` all along — so
20601
+ * base64 was buying nothing but a multi-megabyte string in the relay's heap.
20602
+ */
20603
+ jpegBytes: _instanceof(Uint8Array).optional(),
20506
20604
  width: number().int().positive(),
20507
20605
  height: number().int().positive(),
20508
20606
  /**
@@ -20569,7 +20667,14 @@ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20569
20667
  })]);
20570
20668
  /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20571
20669
  var ParkedTrackFrameSchema = object({
20572
- jpeg: string(),
20670
+ /**
20671
+ * Base64 JPEG — the pre-D462 wire. OPTIONAL since D462: a request that set
20672
+ * `acceptJpegBytes` is answered in `jpegBytes` and this is then absent.
20673
+ * Exactly one of the two is present.
20674
+ */
20675
+ jpeg: string().optional(),
20676
+ /** The same JPEG as bytes, for a caller that declared it reads them (D462). */
20677
+ jpegBytes: _instanceof(Uint8Array).optional(),
20573
20678
  width: number().int().positive(),
20574
20679
  height: number().int().positive(),
20575
20680
  /** The frame instant the parcel shows (the caller's clock, echoed back). */
@@ -21156,6 +21261,13 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21156
21261
  bbox: NativeCropBboxSchema,
21157
21262
  maxWidth: number().int().positive().optional(),
21158
21263
  /**
21264
+ * The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
21265
+ * back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
21266
+ * wire — never assume consent: a pre-D462 caller parses the field as
21267
+ * base64 and bytes would decode to garbage rather than fail.
21268
+ */
21269
+ acceptJpegBytes: boolean().optional(),
21270
+ /**
21159
21271
  * When `true`, the runner encodes the resolved crop to JPEG ON THE
21160
21272
  * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
21161
21273
  * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
@@ -21223,7 +21335,14 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21223
21335
  }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21224
21336
  deviceId: number(),
21225
21337
  trackId: string(),
21226
- kind: ParkedFrameKindSchema
21338
+ kind: ParkedFrameKindSchema,
21339
+ /**
21340
+ * The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
21341
+ * back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
21342
+ * wire — never assume consent: a pre-D462 caller parses the field as
21343
+ * base64 and bytes would decode to garbage rather than fail.
21344
+ */
21345
+ acceptJpegBytes: boolean().optional()
21227
21346
  }), ParkedTrackFrameSchema.nullable()), method(object({
21228
21347
  deviceId: number(),
21229
21348
  trackId: string()
@@ -26473,9 +26592,54 @@ object({
26473
26592
  /** Ms epoch of the last detected-true observation. Null if never detected. */
26474
26593
  lastDetectedAt: number().nullable(),
26475
26594
  /**
26476
- * Ms after which `detected` auto-reverts to false if no fresh push
26477
- * arrives. Null means the provider leaves detected state until a
26478
- * native "clear" event.
26595
+ * `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
26596
+ * `null` while false and on every `Sensor` device (D475) — see that
26597
+ * constant's doc for the one-authority rule.
26598
+ *
26599
+ * ## Reading this field still arms nothing
26600
+ *
26601
+ * It reads like an instruction to the consumer ("revert after N ms if
26602
+ * no fresh push arrives") and it is not one: nothing in this repo reads
26603
+ * the LIVE cap value to drive a timer. `pipeline-analytics`'s motion-episode
26604
+ * close DOES now use the same number — `MOTION_CLOSE_AFTER_MS` — but as an
26605
+ * imported constant, not as a read of `device.state.motion.value`, so this
26606
+ * field stays what it always was: DESCRIPTIVE output, mirroring an answer
26607
+ * computed elsewhere. Building a self-clear timer out of a READ of this
26608
+ * field would add a second falling-edge authority beside whichever one
26609
+ * already owns the device, and two that can disagree are worse than one.
26610
+ * Consumers that need a falling edge SHAPED differently — held open across
26611
+ * a flapping source — debounce on their own side and say so, as
26612
+ * `addon-export-alexa/src/motion-clear-hold.ts` and
26613
+ * `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
26614
+ *
26615
+ * ## Who writes it
26616
+ *
26617
+ * - **Cameras** — the runner's phase machine, `active → watching` on
26618
+ * `cooldown_expired`, which then writes this slice with
26619
+ * `detected: false` (`handlePhaseChanged` in
26620
+ * `pipeline-runner/index.ts`). It produces the FALLING edge, which
26621
+ * matters most for the sources that only ever push a rising one:
26622
+ * Reolink emits `MotionOnMotionChanged { detected: true }` and never
26623
+ * a false.
26624
+ * - **Sensors** (Home Assistant binary sensors, Homematic) — the
26625
+ * provider pushes the false itself, from the upstream system's own
26626
+ * state change. No phase machine is involved.
26627
+ *
26628
+ * ### The phase machine is CANONICAL, not sole — and that is a defect
26629
+ *
26630
+ * An earlier revision of this docblock (mine, 2026-09-12) claimed the
26631
+ * phase machine is the sole writer for a camera. It is not.
26632
+ * `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
26633
+ * `setCapSlice(motionCapability, …)` on their own rising edge, and
26634
+ * Hikvision's comment says why: it read THIS docblock, agreed the
26635
+ * runner is canonical, and wrote anyway to avoid per-tick churn. So
26636
+ * two authorities can disagree about one slice, which this repo
26637
+ * forbids, and the doc said otherwise — which is worse than saying
26638
+ * nothing, because it reads as verification.
26639
+ *
26640
+ * This predates D475 and is not fixed there: the fix touches every
26641
+ * camera provider. Recorded in D475's Consequences. Do not restore the
26642
+ * "sole writer" wording without also removing the other writers.
26479
26643
  */
26480
26644
  autoClearAfterMs: number().nullable()
26481
26645
  });
@@ -7298,8 +7298,23 @@ function errMsg(err) {
7298
7298
  if (typeof err === "string") return err;
7299
7299
  return String(err);
7300
7300
  }
7301
- //#endregion
7302
- //#region ../types/dist/index.mjs
7301
+ new Set([
7302
+ "track",
7303
+ "summary",
7304
+ "face",
7305
+ "identity",
7306
+ "plate",
7307
+ "vehicle",
7308
+ "scene",
7309
+ "motion",
7310
+ "object",
7311
+ "audio"
7312
+ ]);
7313
+ new Set([
7314
+ "motion",
7315
+ "object",
7316
+ "audio"
7317
+ ]);
7303
7318
  /**
7304
7319
  * Build an `IAddonRouteProvider` from a list of routes. Implements
7305
7320
  * both the operator-facing `getRoutes` (returning route descriptors
@@ -12566,8 +12581,17 @@ method(object({
12566
12581
  }), array(SettingsRecordSchema).readonly()), method(object({
12567
12582
  namespace: string().optional(),
12568
12583
  collection: string(),
12569
- record: SettingsRecordSchema
12570
- }), _void(), { kind: "mutation" }), method(object({
12584
+ record: object({
12585
+ id: string().optional(),
12586
+ data: record(string(), unknown())
12587
+ })
12588
+ }), object({
12589
+ /**
12590
+ * The id the row ACTUALLY got (D473): the one supplied, the UUID minted
12591
+ * for an absent one, or the ROWID SQLite assigned on an `INTEGER`
12592
+ * primary key — which is the only place an auto key is knowable.
12593
+ */
12594
+ id: union([string(), number()]) }), { kind: "mutation" }), method(object({
12571
12595
  namespace: string().optional(),
12572
12596
  collection: string(),
12573
12597
  records: array(BulkRecordSchema).readonly()
@@ -12676,8 +12700,17 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
12676
12700
  }), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
12677
12701
  namespace: string().optional(),
12678
12702
  collection: string(),
12679
- record: SettingsRecordSchema
12680
- }), _void(), {
12703
+ record: object({
12704
+ id: string().optional(),
12705
+ data: record(string(), unknown())
12706
+ })
12707
+ }), object({
12708
+ /**
12709
+ * The id the row ACTUALLY got (D473): the one supplied, the UUID minted
12710
+ * for an absent one, or the ROWID SQLite assigned on an `INTEGER`
12711
+ * primary key — which is the only place an auto key is knowable.
12712
+ */
12713
+ id: union([string(), number()]) }), {
12681
12714
  kind: "mutation",
12682
12715
  auth: "admin"
12683
12716
  }), method(object({
@@ -19327,7 +19360,20 @@ var TrackSchema = object({
19327
19360
  ...TrackRetrainFields
19328
19361
  });
19329
19362
  var BaseEventFields = {
19330
- id: string(),
19363
+ /**
19364
+ * A SQLite ROWID, assigned by the database (D474).
19365
+ *
19366
+ * Was a 36-character UUID and cost 263 MB of a 1 117 MB database — paid
19367
+ * TWICE per row, in the row and in the primary-key index, across 2.1 million
19368
+ * motion, audio and object events. An `INTEGER PRIMARY KEY` in SQLite **is**
19369
+ * the rowid: the table itself is that B-tree, so the index stops existing
19370
+ * rather than getting smaller. No shorter string does that.
19371
+ *
19372
+ * Defined once here for all three event kinds, which is why they move
19373
+ * together: a per-table migration would have forked this and
19374
+ * `COMMON_BASE_COLUMNS` and reunited them two stages later.
19375
+ */
19376
+ id: number().int(),
19331
19377
  deviceId: number(),
19332
19378
  timestamp: number()
19333
19379
  };
@@ -19346,7 +19392,34 @@ var MotionEventSchema = object({
19346
19392
  /** Omitted in slim projection. */
19347
19393
  frameHeight: number().optional(),
19348
19394
  /** Populated by B5 (recording playback URL for this event). */
19349
- mediaUrl: string().optional()
19395
+ mediaUrl: string().optional(),
19396
+ /**
19397
+ * One row per motion EPISODE, not one per push (D475). `null` while the
19398
+ * episode is still open — a further rising edge extends it in place rather
19399
+ * than inserting a new row. Set once, at close, to `lastOnAt - startedAt`
19400
+ * (the span from the first rising edge to the LAST one, deliberately NOT
19401
+ * `closedAt - startedAt` — the close delay is a quiet CONFIRMATION, not
19402
+ * movement, and folding it in would report `MOTION_CLOSE_AFTER_MS` of
19403
+ * motion for an instantaneous trigger).
19404
+ *
19405
+ * **Absent** (not merely `null`) on a row written before D475 — that means
19406
+ * "closed the old way, before this column existed", never "still open".
19407
+ * Nothing in this codebase may read an absent `durationMs` as an open
19408
+ * episode; only `null` means open.
19409
+ */
19410
+ durationMs: number().nullable().optional(),
19411
+ /**
19412
+ * Ms offsets from `timestamp` (the episode's own first rising edge, so the
19413
+ * first entry is always `0`) of every genuine off→on transition the
19414
+ * episode saw — "ogni evento on si deve salvare" (D475). NOT one entry per
19415
+ * push: a firmware source that keepalives at ~1 Hz for the whole burst
19416
+ * (Reolink, Hikvision) produces exactly one edge; a source that reports an
19417
+ * explicit `false` mid-episode and then resumes before the quiet window
19418
+ * elapses produces another. Stored compactly — see `motion-edge-codec.ts`
19419
+ * — and decoded back to this shape on read. Absent/empty on a legacy row,
19420
+ * which must never be read as "no episode happened here".
19421
+ */
19422
+ edges: array(number()).readonly().optional()
19350
19423
  });
19351
19424
  /**
19352
19425
  * Which detection SOURCE produced an object event. `pipeline` = the ML
@@ -19401,6 +19474,23 @@ var ObjectEventSchema = object({
19401
19474
  * includes it (it is light). Absent on rows written before this field.
19402
19475
  */
19403
19476
  frameId: string().optional(),
19477
+ /**
19478
+ * A PRODUCER-chosen key that makes a synthetic event's emission idempotent
19479
+ * (D474).
19480
+ *
19481
+ * Only the package detector writes it, and it exists because the event id
19482
+ * stopped being choosable: the delivery and pick-up rows used to BE their
19483
+ * dedupe key (`pa-pkg-<entryId>-delivered`), which is how "never emit a
19484
+ * second delivery for this entry" survived a restart. An `INTEGER` rowid is
19485
+ * assigned by SQLite, so that key had to move off the primary key rather
19486
+ * than be dropped — a detector that cannot recognise its own row re-delivers
19487
+ * every parcel on every boot.
19488
+ *
19489
+ * Absent on every other object event, and on every row written before this
19490
+ * field. Never a substitute for `id`: it is unique per (producer, occasion),
19491
+ * not per row, and nothing addresses a row by it.
19492
+ */
19493
+ idempotencyKey: string().optional(),
19404
19494
  /** Omitted in slim projection. */
19405
19495
  trackId: string().optional(),
19406
19496
  className: string(),
@@ -20503,6 +20593,14 @@ var NativeCropResultSchema = object({
20503
20593
  * set `encodeJpeg: true`; `bytes` is then absent.
20504
20594
  */
20505
20595
  jpeg: string().optional(),
20596
+ /**
20597
+ * The SAME compressed JPEG as `jpeg`, as bytes (D462). Present instead of
20598
+ * `jpeg` when the request set `acceptJpegBytes`; a request that did not gets
20599
+ * `jpeg` exactly as before. MsgPack and the mesh leg both carry binary —
20600
+ * `bytes` above has crossed this boundary as a `Uint8Array` all along — so
20601
+ * base64 was buying nothing but a multi-megabyte string in the relay's heap.
20602
+ */
20603
+ jpegBytes: _instanceof(Uint8Array).optional(),
20506
20604
  width: number().int().positive(),
20507
20605
  height: number().int().positive(),
20508
20606
  /**
@@ -20569,7 +20667,14 @@ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20569
20667
  })]);
20570
20668
  /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20571
20669
  var ParkedTrackFrameSchema = object({
20572
- jpeg: string(),
20670
+ /**
20671
+ * Base64 JPEG — the pre-D462 wire. OPTIONAL since D462: a request that set
20672
+ * `acceptJpegBytes` is answered in `jpegBytes` and this is then absent.
20673
+ * Exactly one of the two is present.
20674
+ */
20675
+ jpeg: string().optional(),
20676
+ /** The same JPEG as bytes, for a caller that declared it reads them (D462). */
20677
+ jpegBytes: _instanceof(Uint8Array).optional(),
20573
20678
  width: number().int().positive(),
20574
20679
  height: number().int().positive(),
20575
20680
  /** The frame instant the parcel shows (the caller's clock, echoed back). */
@@ -21156,6 +21261,13 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21156
21261
  bbox: NativeCropBboxSchema,
21157
21262
  maxWidth: number().int().positive().optional(),
21158
21263
  /**
21264
+ * The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
21265
+ * back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
21266
+ * wire — never assume consent: a pre-D462 caller parses the field as
21267
+ * base64 and bytes would decode to garbage rather than fail.
21268
+ */
21269
+ acceptJpegBytes: boolean().optional(),
21270
+ /**
21159
21271
  * When `true`, the runner encodes the resolved crop to JPEG ON THE
21160
21272
  * OWNING NODE and returns it in `jpeg` (base64) INSTEAD of raw `bytes`.
21161
21273
  * Callers set this for CROSS-NODE fetches (`handle.nodeId` is a remote
@@ -21223,7 +21335,14 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21223
21335
  }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21224
21336
  deviceId: number(),
21225
21337
  trackId: string(),
21226
- kind: ParkedFrameKindSchema
21338
+ kind: ParkedFrameKindSchema,
21339
+ /**
21340
+ * The caller reads a `Uint8Array` (D462). When set, a JPEG answer comes
21341
+ * back in `jpegBytes` instead of base64 `jpeg`. Absent means the old
21342
+ * wire — never assume consent: a pre-D462 caller parses the field as
21343
+ * base64 and bytes would decode to garbage rather than fail.
21344
+ */
21345
+ acceptJpegBytes: boolean().optional()
21227
21346
  }), ParkedTrackFrameSchema.nullable()), method(object({
21228
21347
  deviceId: number(),
21229
21348
  trackId: string()
@@ -26473,9 +26592,54 @@ object({
26473
26592
  /** Ms epoch of the last detected-true observation. Null if never detected. */
26474
26593
  lastDetectedAt: number().nullable(),
26475
26594
  /**
26476
- * Ms after which `detected` auto-reverts to false if no fresh push
26477
- * arrives. Null means the provider leaves detected state until a
26478
- * native "clear" event.
26595
+ * `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
26596
+ * `null` while false and on every `Sensor` device (D475) — see that
26597
+ * constant's doc for the one-authority rule.
26598
+ *
26599
+ * ## Reading this field still arms nothing
26600
+ *
26601
+ * It reads like an instruction to the consumer ("revert after N ms if
26602
+ * no fresh push arrives") and it is not one: nothing in this repo reads
26603
+ * the LIVE cap value to drive a timer. `pipeline-analytics`'s motion-episode
26604
+ * close DOES now use the same number — `MOTION_CLOSE_AFTER_MS` — but as an
26605
+ * imported constant, not as a read of `device.state.motion.value`, so this
26606
+ * field stays what it always was: DESCRIPTIVE output, mirroring an answer
26607
+ * computed elsewhere. Building a self-clear timer out of a READ of this
26608
+ * field would add a second falling-edge authority beside whichever one
26609
+ * already owns the device, and two that can disagree are worse than one.
26610
+ * Consumers that need a falling edge SHAPED differently — held open across
26611
+ * a flapping source — debounce on their own side and say so, as
26612
+ * `addon-export-alexa/src/motion-clear-hold.ts` and
26613
+ * `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
26614
+ *
26615
+ * ## Who writes it
26616
+ *
26617
+ * - **Cameras** — the runner's phase machine, `active → watching` on
26618
+ * `cooldown_expired`, which then writes this slice with
26619
+ * `detected: false` (`handlePhaseChanged` in
26620
+ * `pipeline-runner/index.ts`). It produces the FALLING edge, which
26621
+ * matters most for the sources that only ever push a rising one:
26622
+ * Reolink emits `MotionOnMotionChanged { detected: true }` and never
26623
+ * a false.
26624
+ * - **Sensors** (Home Assistant binary sensors, Homematic) — the
26625
+ * provider pushes the false itself, from the upstream system's own
26626
+ * state change. No phase machine is involved.
26627
+ *
26628
+ * ### The phase machine is CANONICAL, not sole — and that is a defect
26629
+ *
26630
+ * An earlier revision of this docblock (mine, 2026-09-12) claimed the
26631
+ * phase machine is the sole writer for a camera. It is not.
26632
+ * `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
26633
+ * `setCapSlice(motionCapability, …)` on their own rising edge, and
26634
+ * Hikvision's comment says why: it read THIS docblock, agreed the
26635
+ * runner is canonical, and wrote anyway to avoid per-tick churn. So
26636
+ * two authorities can disagree about one slice, which this repo
26637
+ * forbids, and the doc said otherwise — which is worse than saying
26638
+ * nothing, because it reads as verification.
26639
+ *
26640
+ * This predates D475 and is not fixed there: the fix touches every
26641
+ * camera provider. Recorded in D475's Consequences. Do not restore the
26642
+ * "sole writer" wording without also removing the other writers.
26479
26643
  */
26480
26644
  autoClearAfterMs: number().nullable()
26481
26645
  });
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../chunk-Cek0wNdY.js");
6
- const require_dist = require("../dist-C7Wygqtf.js");
6
+ const require_dist = require("../dist-DpNmygFK.js");
7
7
  //#region src/magic-link/auth-magic-link.addon.ts
8
8
  /**
9
9
  * Magic-link authentication addon.
@@ -1,4 +1,4 @@
1
- import { a as loginMethodCapability, c as BaseAddon, i as buildAddonRouteProvider, r as authProviderCapability, s as errMsg, t as addonRoutesCapability } from "../dist-CeTETBzP.mjs";
1
+ import { a as loginMethodCapability, c as BaseAddon, i as buildAddonRouteProvider, r as authProviderCapability, s as errMsg, t as addonRoutesCapability } from "../dist-CvKyAjie.mjs";
2
2
  //#region src/magic-link/auth-magic-link.addon.ts
3
3
  /**
4
4
  * Magic-link authentication addon.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-Cek0wNdY.js");
6
- const require_dist = require("../dist-C7Wygqtf.js");
6
+ const require_dist = require("../dist-DpNmygFK.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  node_crypto = require_chunk.__toESM(node_crypto);
9
9
  //#region node_modules/jose/dist/webapi/lib/buffer_utils.js
@@ -1,4 +1,4 @@
1
- import { a as loginMethodCapability, c as BaseAddon, i as buildAddonRouteProvider, r as authProviderCapability, s as errMsg, t as addonRoutesCapability } from "../dist-CeTETBzP.mjs";
1
+ import { a as loginMethodCapability, c as BaseAddon, i as buildAddonRouteProvider, r as authProviderCapability, s as errMsg, t as addonRoutesCapability } from "../dist-CvKyAjie.mjs";
2
2
  import * as crypto$1 from "node:crypto";
3
3
  //#region node_modules/jose/dist/webapi/lib/buffer_utils.js
4
4
  var encoder = new TextEncoder();
@@ -3,7 +3,7 @@ import "./dist-CYZr2fwk.mjs";
3
3
  var e = {
4
4
  "@camstack/sdk": {
5
5
  name: "@camstack/sdk",
6
- version: "1.2.99",
6
+ version: "1.2.101",
7
7
  scope: ["default"],
8
8
  loaded: !1,
9
9
  from: "addon_auth_webauthn_widgets",
@@ -18,7 +18,7 @@ var e = {
18
18
  },
19
19
  "@camstack/types": {
20
20
  name: "@camstack/types",
21
- version: "1.2.179",
21
+ version: "1.2.181",
22
22
  scope: ["default"],
23
23
  loaded: !1,
24
24
  from: "addon_auth_webauthn_widgets",
@@ -33,7 +33,7 @@ var e = {
33
33
  },
34
34
  "@camstack/ui-library": {
35
35
  name: "@camstack/ui-library",
36
- version: "1.2.147",
36
+ version: "1.2.149",
37
37
  scope: ["default"],
38
38
  loaded: !1,
39
39
  from: "addon_auth_webauthn_widgets",
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-Cek0wNdY.js");
6
- const require_dist = require("../dist-C7Wygqtf.js");
6
+ const require_dist = require("../dist-DpNmygFK.js");
7
7
  let stream = require("stream");
8
8
  stream = require_chunk.__toESM(stream, 1);
9
9
  let http = require("http");
@@ -1,4 +1,4 @@
1
- import { a as loginMethodCapability, c as BaseAddon, d as number, f as object, l as array, n as addonWidgetsSourceCapability, o as userPasskeysCapability, p as string, u as boolean } from "../dist-CeTETBzP.mjs";
1
+ import { a as loginMethodCapability, c as BaseAddon, d as number, f as object, l as array, n as addonWidgetsSourceCapability, o as userPasskeysCapability, p as string, u as boolean } from "../dist-CvKyAjie.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import Stream from "stream";
4
4
  import http from "http";
@@ -36,7 +36,7 @@ async function r() {
36
36
  }
37
37
  },
38
38
  "@camstack/types": {
39
- version: "1.2.179",
39
+ version: "1.2.181",
40
40
  scope: "default",
41
41
  shareConfig: {
42
42
  singleton: !0,
@@ -45,7 +45,7 @@ async function r() {
45
45
  }
46
46
  },
47
47
  "@camstack/sdk": {
48
- version: "1.2.99",
48
+ version: "1.2.101",
49
49
  scope: "default",
50
50
  shareConfig: {
51
51
  singleton: !0,
@@ -81,7 +81,7 @@ async function r() {
81
81
  }
82
82
  },
83
83
  "@camstack/ui-library": {
84
- version: "1.2.147",
84
+ version: "1.2.149",
85
85
  scope: "default",
86
86
  shareConfig: {
87
87
  singleton: !0,
@@ -30,7 +30,7 @@ async function d(e) {
30
30
  }
31
31
  }
32
32
  async function f() {
33
- return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_auth_webauthn_widgets-MhcWorg1.mjs")).catch((e) => {
33
+ return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_auth_webauthn_widgets-DIxLwIUs.mjs")).catch((e) => {
34
34
  throw l = void 0, e;
35
35
  }), l;
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-auth",
3
- "version": "1.2.103",
3
+ "version": "1.2.105",
4
4
  "description": "Authentication bundle — magic-link, OIDC, and WebAuthn/passkey. Multi-entry npm package shipping 3 addons under a single bundle; each addon keeps its own id, capabilities, and runner.",
5
5
  "keywords": [
6
6
  "camstack",