@camstack/addon-provider-petkit 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
@@ -8729,6 +8729,157 @@ var CameraSwitchGroupSchema = object({
8729
8729
  /** Unix ms when the group was composed server-side. */
8730
8730
  fetchedAt: number()
8731
8731
  });
8732
+ /**
8733
+ * What the gate decided about a birth, from the CALLER's point of view.
8734
+ *
8735
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
8736
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
8737
+ * The third member is the one the gate's own type cannot express, because
8738
+ * exhaustion is a property of how long the caller waited.
8739
+ */
8740
+ var BirthDecisionVerdictSchema = _enum([
8741
+ "confirmed",
8742
+ "suppressed",
8743
+ "exhausted-fallback"
8744
+ ]);
8745
+ /** One birth decision, as it is kept. */
8746
+ var BirthDecisionRecordSchema = object({
8747
+ id: string(),
8748
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
8749
+ at: number().int(),
8750
+ /** The camera. Required: every question here is asked per-camera. */
8751
+ deviceId: number().int(),
8752
+ /**
8753
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
8754
+ * birth has no track at all, and a confirmed one is expected to age out long
8755
+ * before this row does. Named `sourceTrackId` so the retention model's
8756
+ * ownership derivation (`collection-classification.ts`, which keys on a
8757
+ * column literally called `trackId`) cannot reach it.
8758
+ */
8759
+ sourceTrackId: string(),
8760
+ /** The candidate's claimed class. The miss rate is asked per class too. */
8761
+ className: string(),
8762
+ verdict: BirthDecisionVerdictSchema,
8763
+ /**
8764
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
8765
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
8766
+ * when the gate is DISABLED and every birth is waved through. `null` is not
8767
+ * "unknown": it says the gate took no measurement because it was off, which
8768
+ * is a different population and must never be averaged in with the rest.
8769
+ */
8770
+ reason: string().nullable(),
8771
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
8772
+ attempts: number().int(),
8773
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
8774
+ deferredForMs: number().int(),
8775
+ /**
8776
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
8777
+ *
8778
+ * `true` when the frame the verdict was taken on carried no matched
8779
+ * detection for this track — the tracker was coasting a frozen box and the
8780
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
8781
+ * straight out of `result.tracked` without checking, so this is reachable
8782
+ * today; the question is the RATE, per camera, and whether refusing those
8783
+ * frames would have cost real tracks (cross-read against `verdict` and
8784
+ * `decidedByBirthEvidence`).
8785
+ */
8786
+ decidedOnCoastedFrame: boolean(),
8787
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
8788
+ birthEvidenceAvailable: boolean(),
8789
+ /**
8790
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
8791
+ * deciding are different: the carried crop is confirm-only, so a candidate
8792
+ * can hold evidence, be found inconclusive on it, and be decided by a native
8793
+ * crop of a later instant. A coasted decision backed by carried evidence is
8794
+ * a real observation of the birth instant; one without it is not.
8795
+ */
8796
+ decidedByBirthEvidence: boolean(),
8797
+ /** Best class-compatible crop score, or `null` when nothing compatible was
8798
+ * found — deliberately not 0, which would be a measurement that never was. */
8799
+ bestScore: number().nullable(),
8800
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
8801
+ appliedMinConfidence: number().nullable(),
8802
+ /**
8803
+ * The track's own `firstSeen` — the candidate's first frame, which is where
8804
+ * the timeline starts. `null` for a suppressed birth, which has no track.
8805
+ */
8806
+ firstSeen: number().int().nullable(),
8807
+ /**
8808
+ * The device's most recent motion RISING EDGE at the moment of the decision,
8809
+ * or `null` when there is none, it is older than
8810
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
8811
+ */
8812
+ motionOnsetAt: number().int().nullable(),
8813
+ /**
8814
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
8815
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
8816
+ *
8817
+ * **Why motion onset and not something else.** Two other proxies were
8818
+ * considered and rejected:
8819
+ * - *the recording/pipeline session start*: for a camera on
8820
+ * `detectionMode: 'always'` the session opens at process start, hours
8821
+ * before any subject. It measures nothing.
8822
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
8823
+ * `firstSeen` IS the first detection of that object, so for the track that
8824
+ * OPENS a burst — the only one the operator is complaining about — the two
8825
+ * are the same instant and the latency is 0 by construction.
8826
+ * Motion onset is the only in-process signal produced by a DIFFERENT
8827
+ * mechanism from the object detector, so it is the only one that can precede
8828
+ * it. It is also already maintained per-device at frame rate on this very
8829
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
8830
+ * it free — and, decisively, the frame path and the motion path are gated to
8831
+ * the SAME designated post-processing node, so the mirror is never empty for
8832
+ * a camera whose births land here.
8833
+ *
8834
+ * **Error bars, all of them.**
8835
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
8836
+ * wall or a branch, and only later joined by the person, OVERSTATES the
8837
+ * latency without bound. Mitigated, never removed, by
8838
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
8839
+ * candidate for "this burst is this subject", and even then it is a
8840
+ * candidate, not a fact.
8841
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
8842
+ * intensity threshold. A subject entering slowly at the far edge of the
8843
+ * frame can clear the detector's confidence floor BEFORE it clears the
8844
+ * motion floor, making this negative. Negatives are stored as-is and
8845
+ * never clamped — clamping would fabricate the distribution's left tail,
8846
+ * which is the half that says the proxy is unreliable.
8847
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
8848
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
8849
+ * therefore comparable WITHIN a camera and not across cameras of
8850
+ * different motion sources. The motion source is deliberately not copied
8851
+ * here — it belongs to the addon that owns the device (D224) and this is
8852
+ * a write on the frame path — so group by `deviceId`, which is how the
8853
+ * question is always asked anyway.
8854
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
8855
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
8856
+ * past it this is `null`.
8857
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
8858
+ * reporting, or nothing since boot: `null`. Which is the truth about a
8859
+ * camera nobody has a reference instant for.
8860
+ *
8861
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
8862
+ * as such. It is not a per-track fact and must never be shown as one.
8863
+ */
8864
+ birthLatencyMs: number().int().nullable(),
8865
+ /**
8866
+ * How many births this device has already decided since that motion onset.
8867
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
8868
+ * this subject. `null` when there is no usable onset.
8869
+ */
8870
+ birthIndexInBurst: number().int().nullable()
8871
+ });
8872
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8873
+ var BirthDecisionQueryInputSchema = object({
8874
+ /** Restrict to a single camera; omit for every row. */
8875
+ deviceId: number().int().optional(),
8876
+ /** Only decisions at or after this epoch ms. */
8877
+ since: number().int().optional(),
8878
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8879
+ verdict: BirthDecisionVerdictSchema.optional(),
8880
+ /** Max rows returned, newest-first. */
8881
+ limit: number().int().min(1).max(5e3).optional()
8882
+ });
8732
8883
  /** One archived note — the operator's words plus enough context to find what
8733
8884
  * they were looking at, after the track itself is gone. */
8734
8885
  var ArchivedDebugNoteSchema = object({
@@ -21238,7 +21389,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21238
21389
  deviceId: number(),
21239
21390
  trackId: string(),
21240
21391
  flags: TrackFlagsPatchSchema
21241
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
21392
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
21242
21393
  kind: "query",
21243
21394
  auth: "admin"
21244
21395
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -21680,6 +21831,22 @@ var occupancyRecheckFramesField = {
21680
21831
  step: 1
21681
21832
  };
21682
21833
  /**
21834
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
21835
+ *
21836
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
21837
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
21838
+ * fleet measures — one-shot, and only ever taken while a permit would still be
21839
+ * spare for live. `0` turns the burst off entirely (the history is still
21840
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
21841
+ * discarded — the pre-D411 behaviour).
21842
+ */
21843
+ var preRollInferenceFramesField = {
21844
+ min: 0,
21845
+ max: 30,
21846
+ default: 12,
21847
+ step: 1
21848
+ };
21849
+ /**
21683
21850
  * Source enum for motion signals fed to the runner. Extensible — add
21684
21851
  * new variants here when new motion-trigger paths are wired in
21685
21852
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -21920,6 +22087,31 @@ var RunnerCameraConfigSchema = object({
21920
22087
  * to every occupancy rule until something moved in front of it. The churn is
21921
22088
  * now paid on the interval instead — see `occupancyRecheckSecField`.
21922
22089
  */
22090
+ /**
22091
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
22092
+ * at session open — instead of decoding it and throwing it away.
22093
+ *
22094
+ * DEFAULT `true`, and the default is the argument. This is not a new
22095
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
22096
+ * already served, already decoded and already paid for on every on-motion
22097
+ * detection session that asks for history. What shipped was a last-moment
22098
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
22099
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
22100
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
22101
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
22102
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
22103
+ * was decoded, and was freed.
22104
+ *
22105
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
22106
+ * setting whose absence looks exactly like a camera that noticed the cyclist
22107
+ * late. What makes ON safe is not a switch but the BOUND —
22108
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
22109
+ * the last inference permit — so the switch exists for the camera where the
22110
+ * history is worthless (a doorbell whose subject is always already at the
22111
+ * door), not as a hedge against the feature.
22112
+ */
22113
+ preRollInferenceEnabled: boolean().default(true),
22114
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
21923
22115
  occupancyRecheckEnabled: boolean().default(true),
21924
22116
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
21925
22117
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -21948,7 +22140,7 @@ var RunnerCameraConfigSchema = object({
21948
22140
  */
21949
22141
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
21950
22142
  });
21951
- 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;
22143
+ 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;
21952
22144
  /**
21953
22145
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
21954
22146
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -38646,6 +38838,12 @@ Object.freeze({
38646
38838
  addonId: null,
38647
38839
  access: "view"
38648
38840
  },
38841
+ "pipelineAnalytics.listBirthDecisions": {
38842
+ capName: "pipeline-analytics",
38843
+ capScope: "device",
38844
+ addonId: null,
38845
+ access: "view"
38846
+ },
38649
38847
  "pipelineAnalytics.listEventKinds": {
38650
38848
  capName: "pipeline-analytics",
38651
38849
  capScope: "device",
@@ -42438,6 +42636,11 @@ Object.freeze({
42438
42636
  form: "single",
42439
42637
  optional: true
42440
42638
  }],
42639
+ "pipelineAnalytics.listBirthDecisions": [{
42640
+ name: "deviceId",
42641
+ form: "single",
42642
+ optional: true
42643
+ }],
42441
42644
  "pipelineAnalytics.listEventKinds": [{
42442
42645
  name: "deviceId",
42443
42646
  form: "single",
package/dist/addon.mjs CHANGED
@@ -8728,6 +8728,157 @@ var CameraSwitchGroupSchema = object({
8728
8728
  /** Unix ms when the group was composed server-side. */
8729
8729
  fetchedAt: number()
8730
8730
  });
8731
+ /**
8732
+ * What the gate decided about a birth, from the CALLER's point of view.
8733
+ *
8734
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
8735
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
8736
+ * The third member is the one the gate's own type cannot express, because
8737
+ * exhaustion is a property of how long the caller waited.
8738
+ */
8739
+ var BirthDecisionVerdictSchema = _enum([
8740
+ "confirmed",
8741
+ "suppressed",
8742
+ "exhausted-fallback"
8743
+ ]);
8744
+ /** One birth decision, as it is kept. */
8745
+ var BirthDecisionRecordSchema = object({
8746
+ id: string(),
8747
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
8748
+ at: number().int(),
8749
+ /** The camera. Required: every question here is asked per-camera. */
8750
+ deviceId: number().int(),
8751
+ /**
8752
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
8753
+ * birth has no track at all, and a confirmed one is expected to age out long
8754
+ * before this row does. Named `sourceTrackId` so the retention model's
8755
+ * ownership derivation (`collection-classification.ts`, which keys on a
8756
+ * column literally called `trackId`) cannot reach it.
8757
+ */
8758
+ sourceTrackId: string(),
8759
+ /** The candidate's claimed class. The miss rate is asked per class too. */
8760
+ className: string(),
8761
+ verdict: BirthDecisionVerdictSchema,
8762
+ /**
8763
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
8764
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
8765
+ * when the gate is DISABLED and every birth is waved through. `null` is not
8766
+ * "unknown": it says the gate took no measurement because it was off, which
8767
+ * is a different population and must never be averaged in with the rest.
8768
+ */
8769
+ reason: string().nullable(),
8770
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
8771
+ attempts: number().int(),
8772
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
8773
+ deferredForMs: number().int(),
8774
+ /**
8775
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
8776
+ *
8777
+ * `true` when the frame the verdict was taken on carried no matched
8778
+ * detection for this track — the tracker was coasting a frozen box and the
8779
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
8780
+ * straight out of `result.tracked` without checking, so this is reachable
8781
+ * today; the question is the RATE, per camera, and whether refusing those
8782
+ * frames would have cost real tracks (cross-read against `verdict` and
8783
+ * `decidedByBirthEvidence`).
8784
+ */
8785
+ decidedOnCoastedFrame: boolean(),
8786
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
8787
+ birthEvidenceAvailable: boolean(),
8788
+ /**
8789
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
8790
+ * deciding are different: the carried crop is confirm-only, so a candidate
8791
+ * can hold evidence, be found inconclusive on it, and be decided by a native
8792
+ * crop of a later instant. A coasted decision backed by carried evidence is
8793
+ * a real observation of the birth instant; one without it is not.
8794
+ */
8795
+ decidedByBirthEvidence: boolean(),
8796
+ /** Best class-compatible crop score, or `null` when nothing compatible was
8797
+ * found — deliberately not 0, which would be a measurement that never was. */
8798
+ bestScore: number().nullable(),
8799
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
8800
+ appliedMinConfidence: number().nullable(),
8801
+ /**
8802
+ * The track's own `firstSeen` — the candidate's first frame, which is where
8803
+ * the timeline starts. `null` for a suppressed birth, which has no track.
8804
+ */
8805
+ firstSeen: number().int().nullable(),
8806
+ /**
8807
+ * The device's most recent motion RISING EDGE at the moment of the decision,
8808
+ * or `null` when there is none, it is older than
8809
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
8810
+ */
8811
+ motionOnsetAt: number().int().nullable(),
8812
+ /**
8813
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
8814
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
8815
+ *
8816
+ * **Why motion onset and not something else.** Two other proxies were
8817
+ * considered and rejected:
8818
+ * - *the recording/pipeline session start*: for a camera on
8819
+ * `detectionMode: 'always'` the session opens at process start, hours
8820
+ * before any subject. It measures nothing.
8821
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
8822
+ * `firstSeen` IS the first detection of that object, so for the track that
8823
+ * OPENS a burst — the only one the operator is complaining about — the two
8824
+ * are the same instant and the latency is 0 by construction.
8825
+ * Motion onset is the only in-process signal produced by a DIFFERENT
8826
+ * mechanism from the object detector, so it is the only one that can precede
8827
+ * it. It is also already maintained per-device at frame rate on this very
8828
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
8829
+ * it free — and, decisively, the frame path and the motion path are gated to
8830
+ * the SAME designated post-processing node, so the mirror is never empty for
8831
+ * a camera whose births land here.
8832
+ *
8833
+ * **Error bars, all of them.**
8834
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
8835
+ * wall or a branch, and only later joined by the person, OVERSTATES the
8836
+ * latency without bound. Mitigated, never removed, by
8837
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
8838
+ * candidate for "this burst is this subject", and even then it is a
8839
+ * candidate, not a fact.
8840
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
8841
+ * intensity threshold. A subject entering slowly at the far edge of the
8842
+ * frame can clear the detector's confidence floor BEFORE it clears the
8843
+ * motion floor, making this negative. Negatives are stored as-is and
8844
+ * never clamped — clamping would fabricate the distribution's left tail,
8845
+ * which is the half that says the proxy is unreliable.
8846
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
8847
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
8848
+ * therefore comparable WITHIN a camera and not across cameras of
8849
+ * different motion sources. The motion source is deliberately not copied
8850
+ * here — it belongs to the addon that owns the device (D224) and this is
8851
+ * a write on the frame path — so group by `deviceId`, which is how the
8852
+ * question is always asked anyway.
8853
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
8854
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
8855
+ * past it this is `null`.
8856
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
8857
+ * reporting, or nothing since boot: `null`. Which is the truth about a
8858
+ * camera nobody has a reference instant for.
8859
+ *
8860
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
8861
+ * as such. It is not a per-track fact and must never be shown as one.
8862
+ */
8863
+ birthLatencyMs: number().int().nullable(),
8864
+ /**
8865
+ * How many births this device has already decided since that motion onset.
8866
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
8867
+ * this subject. `null` when there is no usable onset.
8868
+ */
8869
+ birthIndexInBurst: number().int().nullable()
8870
+ });
8871
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8872
+ var BirthDecisionQueryInputSchema = object({
8873
+ /** Restrict to a single camera; omit for every row. */
8874
+ deviceId: number().int().optional(),
8875
+ /** Only decisions at or after this epoch ms. */
8876
+ since: number().int().optional(),
8877
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8878
+ verdict: BirthDecisionVerdictSchema.optional(),
8879
+ /** Max rows returned, newest-first. */
8880
+ limit: number().int().min(1).max(5e3).optional()
8881
+ });
8731
8882
  /** One archived note — the operator's words plus enough context to find what
8732
8883
  * they were looking at, after the track itself is gone. */
8733
8884
  var ArchivedDebugNoteSchema = object({
@@ -21237,7 +21388,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
21237
21388
  deviceId: number(),
21238
21389
  trackId: string(),
21239
21390
  flags: TrackFlagsPatchSchema
21240
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
21391
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
21241
21392
  kind: "query",
21242
21393
  auth: "admin"
21243
21394
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -21679,6 +21830,22 @@ var occupancyRecheckFramesField = {
21679
21830
  step: 1
21680
21831
  };
21681
21832
  /**
21833
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
21834
+ *
21835
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
21836
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
21837
+ * fleet measures — one-shot, and only ever taken while a permit would still be
21838
+ * spare for live. `0` turns the burst off entirely (the history is still
21839
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
21840
+ * discarded — the pre-D411 behaviour).
21841
+ */
21842
+ var preRollInferenceFramesField = {
21843
+ min: 0,
21844
+ max: 30,
21845
+ default: 12,
21846
+ step: 1
21847
+ };
21848
+ /**
21682
21849
  * Source enum for motion signals fed to the runner. Extensible — add
21683
21850
  * new variants here when new motion-trigger paths are wired in
21684
21851
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -21919,6 +22086,31 @@ var RunnerCameraConfigSchema = object({
21919
22086
  * to every occupancy rule until something moved in front of it. The churn is
21920
22087
  * now paid on the interval instead — see `occupancyRecheckSecField`.
21921
22088
  */
22089
+ /**
22090
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
22091
+ * at session open — instead of decoding it and throwing it away.
22092
+ *
22093
+ * DEFAULT `true`, and the default is the argument. This is not a new
22094
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
22095
+ * already served, already decoded and already paid for on every on-motion
22096
+ * detection session that asks for history. What shipped was a last-moment
22097
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
22098
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
22099
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
22100
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
22101
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
22102
+ * was decoded, and was freed.
22103
+ *
22104
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
22105
+ * setting whose absence looks exactly like a camera that noticed the cyclist
22106
+ * late. What makes ON safe is not a switch but the BOUND —
22107
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
22108
+ * the last inference permit — so the switch exists for the camera where the
22109
+ * history is worthless (a doorbell whose subject is always already at the
22110
+ * door), not as a hedge against the feature.
22111
+ */
22112
+ preRollInferenceEnabled: boolean().default(true),
22113
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
21922
22114
  occupancyRecheckEnabled: boolean().default(true),
21923
22115
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
21924
22116
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -21947,7 +22139,7 @@ var RunnerCameraConfigSchema = object({
21947
22139
  */
21948
22140
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
21949
22141
  });
21950
- 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;
22142
+ 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;
21951
22143
  /**
21952
22144
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
21953
22145
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -38645,6 +38837,12 @@ Object.freeze({
38645
38837
  addonId: null,
38646
38838
  access: "view"
38647
38839
  },
38840
+ "pipelineAnalytics.listBirthDecisions": {
38841
+ capName: "pipeline-analytics",
38842
+ capScope: "device",
38843
+ addonId: null,
38844
+ access: "view"
38845
+ },
38648
38846
  "pipelineAnalytics.listEventKinds": {
38649
38847
  capName: "pipeline-analytics",
38650
38848
  capScope: "device",
@@ -42437,6 +42635,11 @@ Object.freeze({
42437
42635
  form: "single",
42438
42636
  optional: true
42439
42637
  }],
42638
+ "pipelineAnalytics.listBirthDecisions": [{
42639
+ name: "deviceId",
42640
+ form: "single",
42641
+ optional: true
42642
+ }],
42440
42643
  "pipelineAnalytics.listEventKinds": [{
42441
42644
  name: "deviceId",
42442
42645
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.2.87",
3
+ "version": "0.2.89",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",