@camstack/addon-provider-unifi 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
@@ -7627,6 +7627,157 @@ var CameraSwitchGroupSchema = object({
7627
7627
  /** Unix ms when the group was composed server-side. */
7628
7628
  fetchedAt: number()
7629
7629
  });
7630
+ /**
7631
+ * What the gate decided about a birth, from the CALLER's point of view.
7632
+ *
7633
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7634
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7635
+ * The third member is the one the gate's own type cannot express, because
7636
+ * exhaustion is a property of how long the caller waited.
7637
+ */
7638
+ var BirthDecisionVerdictSchema = _enum([
7639
+ "confirmed",
7640
+ "suppressed",
7641
+ "exhausted-fallback"
7642
+ ]);
7643
+ /** One birth decision, as it is kept. */
7644
+ var BirthDecisionRecordSchema = object({
7645
+ id: string(),
7646
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7647
+ at: number().int(),
7648
+ /** The camera. Required: every question here is asked per-camera. */
7649
+ deviceId: number().int(),
7650
+ /**
7651
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7652
+ * birth has no track at all, and a confirmed one is expected to age out long
7653
+ * before this row does. Named `sourceTrackId` so the retention model's
7654
+ * ownership derivation (`collection-classification.ts`, which keys on a
7655
+ * column literally called `trackId`) cannot reach it.
7656
+ */
7657
+ sourceTrackId: string(),
7658
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7659
+ className: string(),
7660
+ verdict: BirthDecisionVerdictSchema,
7661
+ /**
7662
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7663
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7664
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7665
+ * "unknown": it says the gate took no measurement because it was off, which
7666
+ * is a different population and must never be averaged in with the rest.
7667
+ */
7668
+ reason: string().nullable(),
7669
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7670
+ attempts: number().int(),
7671
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7672
+ deferredForMs: number().int(),
7673
+ /**
7674
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7675
+ *
7676
+ * `true` when the frame the verdict was taken on carried no matched
7677
+ * detection for this track — the tracker was coasting a frozen box and the
7678
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7679
+ * straight out of `result.tracked` without checking, so this is reachable
7680
+ * today; the question is the RATE, per camera, and whether refusing those
7681
+ * frames would have cost real tracks (cross-read against `verdict` and
7682
+ * `decidedByBirthEvidence`).
7683
+ */
7684
+ decidedOnCoastedFrame: boolean(),
7685
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7686
+ birthEvidenceAvailable: boolean(),
7687
+ /**
7688
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7689
+ * deciding are different: the carried crop is confirm-only, so a candidate
7690
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7691
+ * crop of a later instant. A coasted decision backed by carried evidence is
7692
+ * a real observation of the birth instant; one without it is not.
7693
+ */
7694
+ decidedByBirthEvidence: boolean(),
7695
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7696
+ * found — deliberately not 0, which would be a measurement that never was. */
7697
+ bestScore: number().nullable(),
7698
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7699
+ appliedMinConfidence: number().nullable(),
7700
+ /**
7701
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7702
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7703
+ */
7704
+ firstSeen: number().int().nullable(),
7705
+ /**
7706
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7707
+ * or `null` when there is none, it is older than
7708
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7709
+ */
7710
+ motionOnsetAt: number().int().nullable(),
7711
+ /**
7712
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7713
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7714
+ *
7715
+ * **Why motion onset and not something else.** Two other proxies were
7716
+ * considered and rejected:
7717
+ * - *the recording/pipeline session start*: for a camera on
7718
+ * `detectionMode: 'always'` the session opens at process start, hours
7719
+ * before any subject. It measures nothing.
7720
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7721
+ * `firstSeen` IS the first detection of that object, so for the track that
7722
+ * OPENS a burst — the only one the operator is complaining about — the two
7723
+ * are the same instant and the latency is 0 by construction.
7724
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7725
+ * mechanism from the object detector, so it is the only one that can precede
7726
+ * it. It is also already maintained per-device at frame rate on this very
7727
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7728
+ * it free — and, decisively, the frame path and the motion path are gated to
7729
+ * the SAME designated post-processing node, so the mirror is never empty for
7730
+ * a camera whose births land here.
7731
+ *
7732
+ * **Error bars, all of them.**
7733
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7734
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7735
+ * latency without bound. Mitigated, never removed, by
7736
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7737
+ * candidate for "this burst is this subject", and even then it is a
7738
+ * candidate, not a fact.
7739
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7740
+ * intensity threshold. A subject entering slowly at the far edge of the
7741
+ * frame can clear the detector's confidence floor BEFORE it clears the
7742
+ * motion floor, making this negative. Negatives are stored as-is and
7743
+ * never clamped — clamping would fabricate the distribution's left tail,
7744
+ * which is the half that says the proxy is unreliable.
7745
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7746
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7747
+ * therefore comparable WITHIN a camera and not across cameras of
7748
+ * different motion sources. The motion source is deliberately not copied
7749
+ * here — it belongs to the addon that owns the device (D224) and this is
7750
+ * a write on the frame path — so group by `deviceId`, which is how the
7751
+ * question is always asked anyway.
7752
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7753
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7754
+ * past it this is `null`.
7755
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7756
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7757
+ * camera nobody has a reference instant for.
7758
+ *
7759
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7760
+ * as such. It is not a per-track fact and must never be shown as one.
7761
+ */
7762
+ birthLatencyMs: number().int().nullable(),
7763
+ /**
7764
+ * How many births this device has already decided since that motion onset.
7765
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7766
+ * this subject. `null` when there is no usable onset.
7767
+ */
7768
+ birthIndexInBurst: number().int().nullable()
7769
+ });
7770
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
7771
+ var BirthDecisionQueryInputSchema = object({
7772
+ /** Restrict to a single camera; omit for every row. */
7773
+ deviceId: number().int().optional(),
7774
+ /** Only decisions at or after this epoch ms. */
7775
+ since: number().int().optional(),
7776
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
7777
+ verdict: BirthDecisionVerdictSchema.optional(),
7778
+ /** Max rows returned, newest-first. */
7779
+ limit: number().int().min(1).max(5e3).optional()
7780
+ });
7630
7781
  /** One archived note — the operator's words plus enough context to find what
7631
7782
  * they were looking at, after the track itself is gone. */
7632
7783
  var ArchivedDebugNoteSchema = object({
@@ -20119,7 +20270,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20119
20270
  deviceId: number(),
20120
20271
  trackId: string(),
20121
20272
  flags: TrackFlagsPatchSchema
20122
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20273
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20123
20274
  kind: "query",
20124
20275
  auth: "admin"
20125
20276
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -20561,6 +20712,22 @@ var occupancyRecheckFramesField = {
20561
20712
  step: 1
20562
20713
  };
20563
20714
  /**
20715
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
20716
+ *
20717
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
20718
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
20719
+ * fleet measures — one-shot, and only ever taken while a permit would still be
20720
+ * spare for live. `0` turns the burst off entirely (the history is still
20721
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
20722
+ * discarded — the pre-D411 behaviour).
20723
+ */
20724
+ var preRollInferenceFramesField = {
20725
+ min: 0,
20726
+ max: 30,
20727
+ default: 12,
20728
+ step: 1
20729
+ };
20730
+ /**
20564
20731
  * Source enum for motion signals fed to the runner. Extensible — add
20565
20732
  * new variants here when new motion-trigger paths are wired in
20566
20733
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -20801,6 +20968,31 @@ var RunnerCameraConfigSchema = object({
20801
20968
  * to every occupancy rule until something moved in front of it. The churn is
20802
20969
  * now paid on the interval instead — see `occupancyRecheckSecField`.
20803
20970
  */
20971
+ /**
20972
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
20973
+ * at session open — instead of decoding it and throwing it away.
20974
+ *
20975
+ * DEFAULT `true`, and the default is the argument. This is not a new
20976
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
20977
+ * already served, already decoded and already paid for on every on-motion
20978
+ * detection session that asks for history. What shipped was a last-moment
20979
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
20980
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
20981
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
20982
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
20983
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
20984
+ * was decoded, and was freed.
20985
+ *
20986
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
20987
+ * setting whose absence looks exactly like a camera that noticed the cyclist
20988
+ * late. What makes ON safe is not a switch but the BOUND —
20989
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
20990
+ * the last inference permit — so the switch exists for the camera where the
20991
+ * history is worthless (a doorbell whose subject is always already at the
20992
+ * door), not as a hedge against the feature.
20993
+ */
20994
+ preRollInferenceEnabled: boolean().default(true),
20995
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
20804
20996
  occupancyRecheckEnabled: boolean().default(true),
20805
20997
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
20806
20998
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -20829,7 +21021,7 @@ var RunnerCameraConfigSchema = object({
20829
21021
  */
20830
21022
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
20831
21023
  });
20832
- 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;
21024
+ 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;
20833
21025
  /**
20834
21026
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
20835
21027
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -37536,6 +37728,12 @@ Object.freeze({
37536
37728
  addonId: null,
37537
37729
  access: "view"
37538
37730
  },
37731
+ "pipelineAnalytics.listBirthDecisions": {
37732
+ capName: "pipeline-analytics",
37733
+ capScope: "device",
37734
+ addonId: null,
37735
+ access: "view"
37736
+ },
37539
37737
  "pipelineAnalytics.listEventKinds": {
37540
37738
  capName: "pipeline-analytics",
37541
37739
  capScope: "device",
@@ -41328,6 +41526,11 @@ Object.freeze({
41328
41526
  form: "single",
41329
41527
  optional: true
41330
41528
  }],
41529
+ "pipelineAnalytics.listBirthDecisions": [{
41530
+ name: "deviceId",
41531
+ form: "single",
41532
+ optional: true
41533
+ }],
41331
41534
  "pipelineAnalytics.listEventKinds": [{
41332
41535
  name: "deviceId",
41333
41536
  form: "single",
package/dist/addon.mjs CHANGED
@@ -7626,6 +7626,157 @@ var CameraSwitchGroupSchema = object({
7626
7626
  /** Unix ms when the group was composed server-side. */
7627
7627
  fetchedAt: number()
7628
7628
  });
7629
+ /**
7630
+ * What the gate decided about a birth, from the CALLER's point of view.
7631
+ *
7632
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7633
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7634
+ * The third member is the one the gate's own type cannot express, because
7635
+ * exhaustion is a property of how long the caller waited.
7636
+ */
7637
+ var BirthDecisionVerdictSchema = _enum([
7638
+ "confirmed",
7639
+ "suppressed",
7640
+ "exhausted-fallback"
7641
+ ]);
7642
+ /** One birth decision, as it is kept. */
7643
+ var BirthDecisionRecordSchema = object({
7644
+ id: string(),
7645
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7646
+ at: number().int(),
7647
+ /** The camera. Required: every question here is asked per-camera. */
7648
+ deviceId: number().int(),
7649
+ /**
7650
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7651
+ * birth has no track at all, and a confirmed one is expected to age out long
7652
+ * before this row does. Named `sourceTrackId` so the retention model's
7653
+ * ownership derivation (`collection-classification.ts`, which keys on a
7654
+ * column literally called `trackId`) cannot reach it.
7655
+ */
7656
+ sourceTrackId: string(),
7657
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7658
+ className: string(),
7659
+ verdict: BirthDecisionVerdictSchema,
7660
+ /**
7661
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7662
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7663
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7664
+ * "unknown": it says the gate took no measurement because it was off, which
7665
+ * is a different population and must never be averaged in with the rest.
7666
+ */
7667
+ reason: string().nullable(),
7668
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7669
+ attempts: number().int(),
7670
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7671
+ deferredForMs: number().int(),
7672
+ /**
7673
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7674
+ *
7675
+ * `true` when the frame the verdict was taken on carried no matched
7676
+ * detection for this track — the tracker was coasting a frozen box and the
7677
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7678
+ * straight out of `result.tracked` without checking, so this is reachable
7679
+ * today; the question is the RATE, per camera, and whether refusing those
7680
+ * frames would have cost real tracks (cross-read against `verdict` and
7681
+ * `decidedByBirthEvidence`).
7682
+ */
7683
+ decidedOnCoastedFrame: boolean(),
7684
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7685
+ birthEvidenceAvailable: boolean(),
7686
+ /**
7687
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7688
+ * deciding are different: the carried crop is confirm-only, so a candidate
7689
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7690
+ * crop of a later instant. A coasted decision backed by carried evidence is
7691
+ * a real observation of the birth instant; one without it is not.
7692
+ */
7693
+ decidedByBirthEvidence: boolean(),
7694
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7695
+ * found — deliberately not 0, which would be a measurement that never was. */
7696
+ bestScore: number().nullable(),
7697
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7698
+ appliedMinConfidence: number().nullable(),
7699
+ /**
7700
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7701
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7702
+ */
7703
+ firstSeen: number().int().nullable(),
7704
+ /**
7705
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7706
+ * or `null` when there is none, it is older than
7707
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7708
+ */
7709
+ motionOnsetAt: number().int().nullable(),
7710
+ /**
7711
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7712
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7713
+ *
7714
+ * **Why motion onset and not something else.** Two other proxies were
7715
+ * considered and rejected:
7716
+ * - *the recording/pipeline session start*: for a camera on
7717
+ * `detectionMode: 'always'` the session opens at process start, hours
7718
+ * before any subject. It measures nothing.
7719
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7720
+ * `firstSeen` IS the first detection of that object, so for the track that
7721
+ * OPENS a burst — the only one the operator is complaining about — the two
7722
+ * are the same instant and the latency is 0 by construction.
7723
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7724
+ * mechanism from the object detector, so it is the only one that can precede
7725
+ * it. It is also already maintained per-device at frame rate on this very
7726
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7727
+ * it free — and, decisively, the frame path and the motion path are gated to
7728
+ * the SAME designated post-processing node, so the mirror is never empty for
7729
+ * a camera whose births land here.
7730
+ *
7731
+ * **Error bars, all of them.**
7732
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7733
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7734
+ * latency without bound. Mitigated, never removed, by
7735
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7736
+ * candidate for "this burst is this subject", and even then it is a
7737
+ * candidate, not a fact.
7738
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7739
+ * intensity threshold. A subject entering slowly at the far edge of the
7740
+ * frame can clear the detector's confidence floor BEFORE it clears the
7741
+ * motion floor, making this negative. Negatives are stored as-is and
7742
+ * never clamped — clamping would fabricate the distribution's left tail,
7743
+ * which is the half that says the proxy is unreliable.
7744
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7745
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7746
+ * therefore comparable WITHIN a camera and not across cameras of
7747
+ * different motion sources. The motion source is deliberately not copied
7748
+ * here — it belongs to the addon that owns the device (D224) and this is
7749
+ * a write on the frame path — so group by `deviceId`, which is how the
7750
+ * question is always asked anyway.
7751
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7752
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7753
+ * past it this is `null`.
7754
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7755
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7756
+ * camera nobody has a reference instant for.
7757
+ *
7758
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7759
+ * as such. It is not a per-track fact and must never be shown as one.
7760
+ */
7761
+ birthLatencyMs: number().int().nullable(),
7762
+ /**
7763
+ * How many births this device has already decided since that motion onset.
7764
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7765
+ * this subject. `null` when there is no usable onset.
7766
+ */
7767
+ birthIndexInBurst: number().int().nullable()
7768
+ });
7769
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
7770
+ var BirthDecisionQueryInputSchema = object({
7771
+ /** Restrict to a single camera; omit for every row. */
7772
+ deviceId: number().int().optional(),
7773
+ /** Only decisions at or after this epoch ms. */
7774
+ since: number().int().optional(),
7775
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
7776
+ verdict: BirthDecisionVerdictSchema.optional(),
7777
+ /** Max rows returned, newest-first. */
7778
+ limit: number().int().min(1).max(5e3).optional()
7779
+ });
7629
7780
  /** One archived note — the operator's words plus enough context to find what
7630
7781
  * they were looking at, after the track itself is gone. */
7631
7782
  var ArchivedDebugNoteSchema = object({
@@ -20118,7 +20269,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20118
20269
  deviceId: number(),
20119
20270
  trackId: string(),
20120
20271
  flags: TrackFlagsPatchSchema
20121
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20272
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20122
20273
  kind: "query",
20123
20274
  auth: "admin"
20124
20275
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -20560,6 +20711,22 @@ var occupancyRecheckFramesField = {
20560
20711
  step: 1
20561
20712
  };
20562
20713
  /**
20714
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
20715
+ *
20716
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
20717
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
20718
+ * fleet measures — one-shot, and only ever taken while a permit would still be
20719
+ * spare for live. `0` turns the burst off entirely (the history is still
20720
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
20721
+ * discarded — the pre-D411 behaviour).
20722
+ */
20723
+ var preRollInferenceFramesField = {
20724
+ min: 0,
20725
+ max: 30,
20726
+ default: 12,
20727
+ step: 1
20728
+ };
20729
+ /**
20563
20730
  * Source enum for motion signals fed to the runner. Extensible — add
20564
20731
  * new variants here when new motion-trigger paths are wired in
20565
20732
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -20800,6 +20967,31 @@ var RunnerCameraConfigSchema = object({
20800
20967
  * to every occupancy rule until something moved in front of it. The churn is
20801
20968
  * now paid on the interval instead — see `occupancyRecheckSecField`.
20802
20969
  */
20970
+ /**
20971
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
20972
+ * at session open — instead of decoding it and throwing it away.
20973
+ *
20974
+ * DEFAULT `true`, and the default is the argument. This is not a new
20975
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
20976
+ * already served, already decoded and already paid for on every on-motion
20977
+ * detection session that asks for history. What shipped was a last-moment
20978
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
20979
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
20980
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
20981
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
20982
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
20983
+ * was decoded, and was freed.
20984
+ *
20985
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
20986
+ * setting whose absence looks exactly like a camera that noticed the cyclist
20987
+ * late. What makes ON safe is not a switch but the BOUND —
20988
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
20989
+ * the last inference permit — so the switch exists for the camera where the
20990
+ * history is worthless (a doorbell whose subject is always already at the
20991
+ * door), not as a hedge against the feature.
20992
+ */
20993
+ preRollInferenceEnabled: boolean().default(true),
20994
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
20803
20995
  occupancyRecheckEnabled: boolean().default(true),
20804
20996
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
20805
20997
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -20828,7 +21020,7 @@ var RunnerCameraConfigSchema = object({
20828
21020
  */
20829
21021
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
20830
21022
  });
20831
- 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;
21023
+ 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;
20832
21024
  /**
20833
21025
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
20834
21026
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -37535,6 +37727,12 @@ Object.freeze({
37535
37727
  addonId: null,
37536
37728
  access: "view"
37537
37729
  },
37730
+ "pipelineAnalytics.listBirthDecisions": {
37731
+ capName: "pipeline-analytics",
37732
+ capScope: "device",
37733
+ addonId: null,
37734
+ access: "view"
37735
+ },
37538
37736
  "pipelineAnalytics.listEventKinds": {
37539
37737
  capName: "pipeline-analytics",
37540
37738
  capScope: "device",
@@ -41327,6 +41525,11 @@ Object.freeze({
41327
41525
  form: "single",
41328
41526
  optional: true
41329
41527
  }],
41528
+ "pipelineAnalytics.listBirthDecisions": [{
41529
+ name: "deviceId",
41530
+ form: "single",
41531
+ optional: true
41532
+ }],
41330
41533
  "pipelineAnalytics.listEventKinds": [{
41331
41534
  name: "deviceId",
41332
41535
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-unifi",
3
- "version": "0.2.87",
3
+ "version": "0.2.89",
4
4
  "description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
5
5
  "keywords": [
6
6
  "camstack",