@camstack/addon-provider-petkit 0.2.87 → 0.2.88

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, {
@@ -38646,6 +38797,12 @@ Object.freeze({
38646
38797
  addonId: null,
38647
38798
  access: "view"
38648
38799
  },
38800
+ "pipelineAnalytics.listBirthDecisions": {
38801
+ capName: "pipeline-analytics",
38802
+ capScope: "device",
38803
+ addonId: null,
38804
+ access: "view"
38805
+ },
38649
38806
  "pipelineAnalytics.listEventKinds": {
38650
38807
  capName: "pipeline-analytics",
38651
38808
  capScope: "device",
@@ -42438,6 +42595,11 @@ Object.freeze({
42438
42595
  form: "single",
42439
42596
  optional: true
42440
42597
  }],
42598
+ "pipelineAnalytics.listBirthDecisions": [{
42599
+ name: "deviceId",
42600
+ form: "single",
42601
+ optional: true
42602
+ }],
42441
42603
  "pipelineAnalytics.listEventKinds": [{
42442
42604
  name: "deviceId",
42443
42605
  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, {
@@ -38645,6 +38796,12 @@ Object.freeze({
38645
38796
  addonId: null,
38646
38797
  access: "view"
38647
38798
  },
38799
+ "pipelineAnalytics.listBirthDecisions": {
38800
+ capName: "pipeline-analytics",
38801
+ capScope: "device",
38802
+ addonId: null,
38803
+ access: "view"
38804
+ },
38648
38805
  "pipelineAnalytics.listEventKinds": {
38649
38806
  capName: "pipeline-analytics",
38650
38807
  capScope: "device",
@@ -42437,6 +42594,11 @@ Object.freeze({
42437
42594
  form: "single",
42438
42595
  optional: true
42439
42596
  }],
42597
+ "pipelineAnalytics.listBirthDecisions": [{
42598
+ name: "deviceId",
42599
+ form: "single",
42600
+ optional: true
42601
+ }],
42440
42602
  "pipelineAnalytics.listEventKinds": [{
42441
42603
  name: "deviceId",
42442
42604
  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.88",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",