@camstack/addon-provider-tuya 0.2.87 → 0.2.89

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 CHANGED
@@ -8447,6 +8447,157 @@ var CameraSwitchGroupSchema = object({
8447
8447
  /** Unix ms when the group was composed server-side. */
8448
8448
  fetchedAt: number()
8449
8449
  });
8450
+ /**
8451
+ * What the gate decided about a birth, from the CALLER's point of view.
8452
+ *
8453
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
8454
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
8455
+ * The third member is the one the gate's own type cannot express, because
8456
+ * exhaustion is a property of how long the caller waited.
8457
+ */
8458
+ var BirthDecisionVerdictSchema = _enum([
8459
+ "confirmed",
8460
+ "suppressed",
8461
+ "exhausted-fallback"
8462
+ ]);
8463
+ /** One birth decision, as it is kept. */
8464
+ var BirthDecisionRecordSchema = object({
8465
+ id: string(),
8466
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
8467
+ at: number().int(),
8468
+ /** The camera. Required: every question here is asked per-camera. */
8469
+ deviceId: number().int(),
8470
+ /**
8471
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
8472
+ * birth has no track at all, and a confirmed one is expected to age out long
8473
+ * before this row does. Named `sourceTrackId` so the retention model's
8474
+ * ownership derivation (`collection-classification.ts`, which keys on a
8475
+ * column literally called `trackId`) cannot reach it.
8476
+ */
8477
+ sourceTrackId: string(),
8478
+ /** The candidate's claimed class. The miss rate is asked per class too. */
8479
+ className: string(),
8480
+ verdict: BirthDecisionVerdictSchema,
8481
+ /**
8482
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
8483
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
8484
+ * when the gate is DISABLED and every birth is waved through. `null` is not
8485
+ * "unknown": it says the gate took no measurement because it was off, which
8486
+ * is a different population and must never be averaged in with the rest.
8487
+ */
8488
+ reason: string().nullable(),
8489
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
8490
+ attempts: number().int(),
8491
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
8492
+ deferredForMs: number().int(),
8493
+ /**
8494
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
8495
+ *
8496
+ * `true` when the frame the verdict was taken on carried no matched
8497
+ * detection for this track — the tracker was coasting a frozen box and the
8498
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
8499
+ * straight out of `result.tracked` without checking, so this is reachable
8500
+ * today; the question is the RATE, per camera, and whether refusing those
8501
+ * frames would have cost real tracks (cross-read against `verdict` and
8502
+ * `decidedByBirthEvidence`).
8503
+ */
8504
+ decidedOnCoastedFrame: boolean(),
8505
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
8506
+ birthEvidenceAvailable: boolean(),
8507
+ /**
8508
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
8509
+ * deciding are different: the carried crop is confirm-only, so a candidate
8510
+ * can hold evidence, be found inconclusive on it, and be decided by a native
8511
+ * crop of a later instant. A coasted decision backed by carried evidence is
8512
+ * a real observation of the birth instant; one without it is not.
8513
+ */
8514
+ decidedByBirthEvidence: boolean(),
8515
+ /** Best class-compatible crop score, or `null` when nothing compatible was
8516
+ * found — deliberately not 0, which would be a measurement that never was. */
8517
+ bestScore: number().nullable(),
8518
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
8519
+ appliedMinConfidence: number().nullable(),
8520
+ /**
8521
+ * The track's own `firstSeen` — the candidate's first frame, which is where
8522
+ * the timeline starts. `null` for a suppressed birth, which has no track.
8523
+ */
8524
+ firstSeen: number().int().nullable(),
8525
+ /**
8526
+ * The device's most recent motion RISING EDGE at the moment of the decision,
8527
+ * or `null` when there is none, it is older than
8528
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
8529
+ */
8530
+ motionOnsetAt: number().int().nullable(),
8531
+ /**
8532
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
8533
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
8534
+ *
8535
+ * **Why motion onset and not something else.** Two other proxies were
8536
+ * considered and rejected:
8537
+ * - *the recording/pipeline session start*: for a camera on
8538
+ * `detectionMode: 'always'` the session opens at process start, hours
8539
+ * before any subject. It measures nothing.
8540
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
8541
+ * `firstSeen` IS the first detection of that object, so for the track that
8542
+ * OPENS a burst — the only one the operator is complaining about — the two
8543
+ * are the same instant and the latency is 0 by construction.
8544
+ * Motion onset is the only in-process signal produced by a DIFFERENT
8545
+ * mechanism from the object detector, so it is the only one that can precede
8546
+ * it. It is also already maintained per-device at frame rate on this very
8547
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
8548
+ * it free — and, decisively, the frame path and the motion path are gated to
8549
+ * the SAME designated post-processing node, so the mirror is never empty for
8550
+ * a camera whose births land here.
8551
+ *
8552
+ * **Error bars, all of them.**
8553
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
8554
+ * wall or a branch, and only later joined by the person, OVERSTATES the
8555
+ * latency without bound. Mitigated, never removed, by
8556
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
8557
+ * candidate for "this burst is this subject", and even then it is a
8558
+ * candidate, not a fact.
8559
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
8560
+ * intensity threshold. A subject entering slowly at the far edge of the
8561
+ * frame can clear the detector's confidence floor BEFORE it clears the
8562
+ * motion floor, making this negative. Negatives are stored as-is and
8563
+ * never clamped — clamping would fabricate the distribution's left tail,
8564
+ * which is the half that says the proxy is unreliable.
8565
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
8566
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
8567
+ * therefore comparable WITHIN a camera and not across cameras of
8568
+ * different motion sources. The motion source is deliberately not copied
8569
+ * here — it belongs to the addon that owns the device (D224) and this is
8570
+ * a write on the frame path — so group by `deviceId`, which is how the
8571
+ * question is always asked anyway.
8572
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
8573
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
8574
+ * past it this is `null`.
8575
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
8576
+ * reporting, or nothing since boot: `null`. Which is the truth about a
8577
+ * camera nobody has a reference instant for.
8578
+ *
8579
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
8580
+ * as such. It is not a per-track fact and must never be shown as one.
8581
+ */
8582
+ birthLatencyMs: number().int().nullable(),
8583
+ /**
8584
+ * How many births this device has already decided since that motion onset.
8585
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
8586
+ * this subject. `null` when there is no usable onset.
8587
+ */
8588
+ birthIndexInBurst: number().int().nullable()
8589
+ });
8590
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8591
+ var BirthDecisionQueryInputSchema = object({
8592
+ /** Restrict to a single camera; omit for every row. */
8593
+ deviceId: number().int().optional(),
8594
+ /** Only decisions at or after this epoch ms. */
8595
+ since: number().int().optional(),
8596
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8597
+ verdict: BirthDecisionVerdictSchema.optional(),
8598
+ /** Max rows returned, newest-first. */
8599
+ limit: number().int().min(1).max(5e3).optional()
8600
+ });
8450
8601
  /** One archived note — the operator's words plus enough context to find what
8451
8602
  * they were looking at, after the track itself is gone. */
8452
8603
  var ArchivedDebugNoteSchema = object({
@@ -20956,7 +21107,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20956
21107
  deviceId: number(),
20957
21108
  trackId: string(),
20958
21109
  flags: TrackFlagsPatchSchema
20959
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
21110
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20960
21111
  kind: "query",
20961
21112
  auth: "admin"
20962
21113
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -21398,6 +21549,22 @@ var occupancyRecheckFramesField = {
21398
21549
  step: 1
21399
21550
  };
21400
21551
  /**
21552
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
21553
+ *
21554
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
21555
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
21556
+ * fleet measures — one-shot, and only ever taken while a permit would still be
21557
+ * spare for live. `0` turns the burst off entirely (the history is still
21558
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
21559
+ * discarded — the pre-D411 behaviour).
21560
+ */
21561
+ var preRollInferenceFramesField = {
21562
+ min: 0,
21563
+ max: 30,
21564
+ default: 12,
21565
+ step: 1
21566
+ };
21567
+ /**
21401
21568
  * Source enum for motion signals fed to the runner. Extensible — add
21402
21569
  * new variants here when new motion-trigger paths are wired in
21403
21570
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -21638,6 +21805,31 @@ var RunnerCameraConfigSchema = object({
21638
21805
  * to every occupancy rule until something moved in front of it. The churn is
21639
21806
  * now paid on the interval instead — see `occupancyRecheckSecField`.
21640
21807
  */
21808
+ /**
21809
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
21810
+ * at session open — instead of decoding it and throwing it away.
21811
+ *
21812
+ * DEFAULT `true`, and the default is the argument. This is not a new
21813
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
21814
+ * already served, already decoded and already paid for on every on-motion
21815
+ * detection session that asks for history. What shipped was a last-moment
21816
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
21817
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
21818
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
21819
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
21820
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
21821
+ * was decoded, and was freed.
21822
+ *
21823
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
21824
+ * setting whose absence looks exactly like a camera that noticed the cyclist
21825
+ * late. What makes ON safe is not a switch but the BOUND —
21826
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
21827
+ * the last inference permit — so the switch exists for the camera where the
21828
+ * history is worthless (a doorbell whose subject is always already at the
21829
+ * door), not as a hedge against the feature.
21830
+ */
21831
+ preRollInferenceEnabled: boolean().default(true),
21832
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
21641
21833
  occupancyRecheckEnabled: boolean().default(true),
21642
21834
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
21643
21835
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -21666,7 +21858,7 @@ var RunnerCameraConfigSchema = object({
21666
21858
  */
21667
21859
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
21668
21860
  });
21669
- motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
21861
+ motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, preRollInferenceFramesField.min, preRollInferenceFramesField.max, preRollInferenceFramesField.step, preRollInferenceFramesField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
21670
21862
  /**
21671
21863
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
21672
21864
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -38364,6 +38556,12 @@ Object.freeze({
38364
38556
  addonId: null,
38365
38557
  access: "view"
38366
38558
  },
38559
+ "pipelineAnalytics.listBirthDecisions": {
38560
+ capName: "pipeline-analytics",
38561
+ capScope: "device",
38562
+ addonId: null,
38563
+ access: "view"
38564
+ },
38367
38565
  "pipelineAnalytics.listEventKinds": {
38368
38566
  capName: "pipeline-analytics",
38369
38567
  capScope: "device",
@@ -42156,6 +42354,11 @@ Object.freeze({
42156
42354
  form: "single",
42157
42355
  optional: true
42158
42356
  }],
42357
+ "pipelineAnalytics.listBirthDecisions": [{
42358
+ name: "deviceId",
42359
+ form: "single",
42360
+ optional: true
42361
+ }],
42159
42362
  "pipelineAnalytics.listEventKinds": [{
42160
42363
  name: "deviceId",
42161
42364
  form: "single",
package/dist/addon.mjs CHANGED
@@ -8446,6 +8446,157 @@ var CameraSwitchGroupSchema = object({
8446
8446
  /** Unix ms when the group was composed server-side. */
8447
8447
  fetchedAt: number()
8448
8448
  });
8449
+ /**
8450
+ * What the gate decided about a birth, from the CALLER's point of view.
8451
+ *
8452
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
8453
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
8454
+ * The third member is the one the gate's own type cannot express, because
8455
+ * exhaustion is a property of how long the caller waited.
8456
+ */
8457
+ var BirthDecisionVerdictSchema = _enum([
8458
+ "confirmed",
8459
+ "suppressed",
8460
+ "exhausted-fallback"
8461
+ ]);
8462
+ /** One birth decision, as it is kept. */
8463
+ var BirthDecisionRecordSchema = object({
8464
+ id: string(),
8465
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
8466
+ at: number().int(),
8467
+ /** The camera. Required: every question here is asked per-camera. */
8468
+ deviceId: number().int(),
8469
+ /**
8470
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
8471
+ * birth has no track at all, and a confirmed one is expected to age out long
8472
+ * before this row does. Named `sourceTrackId` so the retention model's
8473
+ * ownership derivation (`collection-classification.ts`, which keys on a
8474
+ * column literally called `trackId`) cannot reach it.
8475
+ */
8476
+ sourceTrackId: string(),
8477
+ /** The candidate's claimed class. The miss rate is asked per class too. */
8478
+ className: string(),
8479
+ verdict: BirthDecisionVerdictSchema,
8480
+ /**
8481
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
8482
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
8483
+ * when the gate is DISABLED and every birth is waved through. `null` is not
8484
+ * "unknown": it says the gate took no measurement because it was off, which
8485
+ * is a different population and must never be averaged in with the rest.
8486
+ */
8487
+ reason: string().nullable(),
8488
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
8489
+ attempts: number().int(),
8490
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
8491
+ deferredForMs: number().int(),
8492
+ /**
8493
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
8494
+ *
8495
+ * `true` when the frame the verdict was taken on carried no matched
8496
+ * detection for this track — the tracker was coasting a frozen box and the
8497
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
8498
+ * straight out of `result.tracked` without checking, so this is reachable
8499
+ * today; the question is the RATE, per camera, and whether refusing those
8500
+ * frames would have cost real tracks (cross-read against `verdict` and
8501
+ * `decidedByBirthEvidence`).
8502
+ */
8503
+ decidedOnCoastedFrame: boolean(),
8504
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
8505
+ birthEvidenceAvailable: boolean(),
8506
+ /**
8507
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
8508
+ * deciding are different: the carried crop is confirm-only, so a candidate
8509
+ * can hold evidence, be found inconclusive on it, and be decided by a native
8510
+ * crop of a later instant. A coasted decision backed by carried evidence is
8511
+ * a real observation of the birth instant; one without it is not.
8512
+ */
8513
+ decidedByBirthEvidence: boolean(),
8514
+ /** Best class-compatible crop score, or `null` when nothing compatible was
8515
+ * found — deliberately not 0, which would be a measurement that never was. */
8516
+ bestScore: number().nullable(),
8517
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
8518
+ appliedMinConfidence: number().nullable(),
8519
+ /**
8520
+ * The track's own `firstSeen` — the candidate's first frame, which is where
8521
+ * the timeline starts. `null` for a suppressed birth, which has no track.
8522
+ */
8523
+ firstSeen: number().int().nullable(),
8524
+ /**
8525
+ * The device's most recent motion RISING EDGE at the moment of the decision,
8526
+ * or `null` when there is none, it is older than
8527
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
8528
+ */
8529
+ motionOnsetAt: number().int().nullable(),
8530
+ /**
8531
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
8532
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
8533
+ *
8534
+ * **Why motion onset and not something else.** Two other proxies were
8535
+ * considered and rejected:
8536
+ * - *the recording/pipeline session start*: for a camera on
8537
+ * `detectionMode: 'always'` the session opens at process start, hours
8538
+ * before any subject. It measures nothing.
8539
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
8540
+ * `firstSeen` IS the first detection of that object, so for the track that
8541
+ * OPENS a burst — the only one the operator is complaining about — the two
8542
+ * are the same instant and the latency is 0 by construction.
8543
+ * Motion onset is the only in-process signal produced by a DIFFERENT
8544
+ * mechanism from the object detector, so it is the only one that can precede
8545
+ * it. It is also already maintained per-device at frame rate on this very
8546
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
8547
+ * it free — and, decisively, the frame path and the motion path are gated to
8548
+ * the SAME designated post-processing node, so the mirror is never empty for
8549
+ * a camera whose births land here.
8550
+ *
8551
+ * **Error bars, all of them.**
8552
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
8553
+ * wall or a branch, and only later joined by the person, OVERSTATES the
8554
+ * latency without bound. Mitigated, never removed, by
8555
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
8556
+ * candidate for "this burst is this subject", and even then it is a
8557
+ * candidate, not a fact.
8558
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
8559
+ * intensity threshold. A subject entering slowly at the far edge of the
8560
+ * frame can clear the detector's confidence floor BEFORE it clears the
8561
+ * motion floor, making this negative. Negatives are stored as-is and
8562
+ * never clamped — clamping would fabricate the distribution's left tail,
8563
+ * which is the half that says the proxy is unreliable.
8564
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
8565
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
8566
+ * therefore comparable WITHIN a camera and not across cameras of
8567
+ * different motion sources. The motion source is deliberately not copied
8568
+ * here — it belongs to the addon that owns the device (D224) and this is
8569
+ * a write on the frame path — so group by `deviceId`, which is how the
8570
+ * question is always asked anyway.
8571
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
8572
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
8573
+ * past it this is `null`.
8574
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
8575
+ * reporting, or nothing since boot: `null`. Which is the truth about a
8576
+ * camera nobody has a reference instant for.
8577
+ *
8578
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
8579
+ * as such. It is not a per-track fact and must never be shown as one.
8580
+ */
8581
+ birthLatencyMs: number().int().nullable(),
8582
+ /**
8583
+ * How many births this device has already decided since that motion onset.
8584
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
8585
+ * this subject. `null` when there is no usable onset.
8586
+ */
8587
+ birthIndexInBurst: number().int().nullable()
8588
+ });
8589
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8590
+ var BirthDecisionQueryInputSchema = object({
8591
+ /** Restrict to a single camera; omit for every row. */
8592
+ deviceId: number().int().optional(),
8593
+ /** Only decisions at or after this epoch ms. */
8594
+ since: number().int().optional(),
8595
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8596
+ verdict: BirthDecisionVerdictSchema.optional(),
8597
+ /** Max rows returned, newest-first. */
8598
+ limit: number().int().min(1).max(5e3).optional()
8599
+ });
8449
8600
  /** One archived note — the operator's words plus enough context to find what
8450
8601
  * they were looking at, after the track itself is gone. */
8451
8602
  var ArchivedDebugNoteSchema = object({
@@ -20955,7 +21106,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20955
21106
  deviceId: number(),
20956
21107
  trackId: string(),
20957
21108
  flags: TrackFlagsPatchSchema
20958
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
21109
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20959
21110
  kind: "query",
20960
21111
  auth: "admin"
20961
21112
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -21397,6 +21548,22 @@ var occupancyRecheckFramesField = {
21397
21548
  step: 1
21398
21549
  };
21399
21550
  /**
21551
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
21552
+ *
21553
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
21554
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
21555
+ * fleet measures — one-shot, and only ever taken while a permit would still be
21556
+ * spare for live. `0` turns the burst off entirely (the history is still
21557
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
21558
+ * discarded — the pre-D411 behaviour).
21559
+ */
21560
+ var preRollInferenceFramesField = {
21561
+ min: 0,
21562
+ max: 30,
21563
+ default: 12,
21564
+ step: 1
21565
+ };
21566
+ /**
21400
21567
  * Source enum for motion signals fed to the runner. Extensible — add
21401
21568
  * new variants here when new motion-trigger paths are wired in
21402
21569
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -21637,6 +21804,31 @@ var RunnerCameraConfigSchema = object({
21637
21804
  * to every occupancy rule until something moved in front of it. The churn is
21638
21805
  * now paid on the interval instead — see `occupancyRecheckSecField`.
21639
21806
  */
21807
+ /**
21808
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
21809
+ * at session open — instead of decoding it and throwing it away.
21810
+ *
21811
+ * DEFAULT `true`, and the default is the argument. This is not a new
21812
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
21813
+ * already served, already decoded and already paid for on every on-motion
21814
+ * detection session that asks for history. What shipped was a last-moment
21815
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
21816
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
21817
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
21818
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
21819
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
21820
+ * was decoded, and was freed.
21821
+ *
21822
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
21823
+ * setting whose absence looks exactly like a camera that noticed the cyclist
21824
+ * late. What makes ON safe is not a switch but the BOUND —
21825
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
21826
+ * the last inference permit — so the switch exists for the camera where the
21827
+ * history is worthless (a doorbell whose subject is always already at the
21828
+ * door), not as a hedge against the feature.
21829
+ */
21830
+ preRollInferenceEnabled: boolean().default(true),
21831
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
21640
21832
  occupancyRecheckEnabled: boolean().default(true),
21641
21833
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
21642
21834
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -21665,7 +21857,7 @@ var RunnerCameraConfigSchema = object({
21665
21857
  */
21666
21858
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
21667
21859
  });
21668
- motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
21860
+ motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, preRollInferenceFramesField.min, preRollInferenceFramesField.max, preRollInferenceFramesField.step, preRollInferenceFramesField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
21669
21861
  /**
21670
21862
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
21671
21863
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -38363,6 +38555,12 @@ Object.freeze({
38363
38555
  addonId: null,
38364
38556
  access: "view"
38365
38557
  },
38558
+ "pipelineAnalytics.listBirthDecisions": {
38559
+ capName: "pipeline-analytics",
38560
+ capScope: "device",
38561
+ addonId: null,
38562
+ access: "view"
38563
+ },
38366
38564
  "pipelineAnalytics.listEventKinds": {
38367
38565
  capName: "pipeline-analytics",
38368
38566
  capScope: "device",
@@ -42155,6 +42353,11 @@ Object.freeze({
42155
42353
  form: "single",
42156
42354
  optional: true
42157
42355
  }],
42356
+ "pipelineAnalytics.listBirthDecisions": [{
42357
+ name: "deviceId",
42358
+ form: "single",
42359
+ optional: true
42360
+ }],
42158
42361
  "pipelineAnalytics.listEventKinds": [{
42159
42362
  name: "deviceId",
42160
42363
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.87",
3
+ "version": "0.2.89",
4
4
  "description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
5
5
  "keywords": [
6
6
  "camstack",