@camstack/addon-export-alexa 1.2.93 → 1.2.94

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.
@@ -7795,6 +7795,157 @@ var CameraSwitchGroupSchema = object({
7795
7795
  /** Unix ms when the group was composed server-side. */
7796
7796
  fetchedAt: number()
7797
7797
  });
7798
+ /**
7799
+ * What the gate decided about a birth, from the CALLER's point of view.
7800
+ *
7801
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7802
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7803
+ * The third member is the one the gate's own type cannot express, because
7804
+ * exhaustion is a property of how long the caller waited.
7805
+ */
7806
+ var BirthDecisionVerdictSchema = _enum([
7807
+ "confirmed",
7808
+ "suppressed",
7809
+ "exhausted-fallback"
7810
+ ]);
7811
+ /** One birth decision, as it is kept. */
7812
+ var BirthDecisionRecordSchema = object({
7813
+ id: string(),
7814
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7815
+ at: number().int(),
7816
+ /** The camera. Required: every question here is asked per-camera. */
7817
+ deviceId: number().int(),
7818
+ /**
7819
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7820
+ * birth has no track at all, and a confirmed one is expected to age out long
7821
+ * before this row does. Named `sourceTrackId` so the retention model's
7822
+ * ownership derivation (`collection-classification.ts`, which keys on a
7823
+ * column literally called `trackId`) cannot reach it.
7824
+ */
7825
+ sourceTrackId: string(),
7826
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7827
+ className: string(),
7828
+ verdict: BirthDecisionVerdictSchema,
7829
+ /**
7830
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7831
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7832
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7833
+ * "unknown": it says the gate took no measurement because it was off, which
7834
+ * is a different population and must never be averaged in with the rest.
7835
+ */
7836
+ reason: string().nullable(),
7837
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7838
+ attempts: number().int(),
7839
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7840
+ deferredForMs: number().int(),
7841
+ /**
7842
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7843
+ *
7844
+ * `true` when the frame the verdict was taken on carried no matched
7845
+ * detection for this track — the tracker was coasting a frozen box and the
7846
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7847
+ * straight out of `result.tracked` without checking, so this is reachable
7848
+ * today; the question is the RATE, per camera, and whether refusing those
7849
+ * frames would have cost real tracks (cross-read against `verdict` and
7850
+ * `decidedByBirthEvidence`).
7851
+ */
7852
+ decidedOnCoastedFrame: boolean(),
7853
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7854
+ birthEvidenceAvailable: boolean(),
7855
+ /**
7856
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7857
+ * deciding are different: the carried crop is confirm-only, so a candidate
7858
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7859
+ * crop of a later instant. A coasted decision backed by carried evidence is
7860
+ * a real observation of the birth instant; one without it is not.
7861
+ */
7862
+ decidedByBirthEvidence: boolean(),
7863
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7864
+ * found — deliberately not 0, which would be a measurement that never was. */
7865
+ bestScore: number().nullable(),
7866
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7867
+ appliedMinConfidence: number().nullable(),
7868
+ /**
7869
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7870
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7871
+ */
7872
+ firstSeen: number().int().nullable(),
7873
+ /**
7874
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7875
+ * or `null` when there is none, it is older than
7876
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7877
+ */
7878
+ motionOnsetAt: number().int().nullable(),
7879
+ /**
7880
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7881
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7882
+ *
7883
+ * **Why motion onset and not something else.** Two other proxies were
7884
+ * considered and rejected:
7885
+ * - *the recording/pipeline session start*: for a camera on
7886
+ * `detectionMode: 'always'` the session opens at process start, hours
7887
+ * before any subject. It measures nothing.
7888
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7889
+ * `firstSeen` IS the first detection of that object, so for the track that
7890
+ * OPENS a burst — the only one the operator is complaining about — the two
7891
+ * are the same instant and the latency is 0 by construction.
7892
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7893
+ * mechanism from the object detector, so it is the only one that can precede
7894
+ * it. It is also already maintained per-device at frame rate on this very
7895
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7896
+ * it free — and, decisively, the frame path and the motion path are gated to
7897
+ * the SAME designated post-processing node, so the mirror is never empty for
7898
+ * a camera whose births land here.
7899
+ *
7900
+ * **Error bars, all of them.**
7901
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7902
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7903
+ * latency without bound. Mitigated, never removed, by
7904
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7905
+ * candidate for "this burst is this subject", and even then it is a
7906
+ * candidate, not a fact.
7907
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7908
+ * intensity threshold. A subject entering slowly at the far edge of the
7909
+ * frame can clear the detector's confidence floor BEFORE it clears the
7910
+ * motion floor, making this negative. Negatives are stored as-is and
7911
+ * never clamped — clamping would fabricate the distribution's left tail,
7912
+ * which is the half that says the proxy is unreliable.
7913
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7914
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7915
+ * therefore comparable WITHIN a camera and not across cameras of
7916
+ * different motion sources. The motion source is deliberately not copied
7917
+ * here — it belongs to the addon that owns the device (D224) and this is
7918
+ * a write on the frame path — so group by `deviceId`, which is how the
7919
+ * question is always asked anyway.
7920
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7921
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7922
+ * past it this is `null`.
7923
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7924
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7925
+ * camera nobody has a reference instant for.
7926
+ *
7927
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7928
+ * as such. It is not a per-track fact and must never be shown as one.
7929
+ */
7930
+ birthLatencyMs: number().int().nullable(),
7931
+ /**
7932
+ * How many births this device has already decided since that motion onset.
7933
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7934
+ * this subject. `null` when there is no usable onset.
7935
+ */
7936
+ birthIndexInBurst: number().int().nullable()
7937
+ });
7938
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
7939
+ var BirthDecisionQueryInputSchema = object({
7940
+ /** Restrict to a single camera; omit for every row. */
7941
+ deviceId: number().int().optional(),
7942
+ /** Only decisions at or after this epoch ms. */
7943
+ since: number().int().optional(),
7944
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
7945
+ verdict: BirthDecisionVerdictSchema.optional(),
7946
+ /** Max rows returned, newest-first. */
7947
+ limit: number().int().min(1).max(5e3).optional()
7948
+ });
7798
7949
  /** One archived note — the operator's words plus enough context to find what
7799
7950
  * they were looking at, after the track itself is gone. */
7800
7951
  var ArchivedDebugNoteSchema = object({
@@ -20062,7 +20213,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20062
20213
  deviceId: number(),
20063
20214
  trackId: string(),
20064
20215
  flags: TrackFlagsPatchSchema
20065
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20216
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20066
20217
  kind: "query",
20067
20218
  auth: "admin"
20068
20219
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -33466,6 +33617,12 @@ Object.freeze({
33466
33617
  addonId: null,
33467
33618
  access: "view"
33468
33619
  },
33620
+ "pipelineAnalytics.listBirthDecisions": {
33621
+ capName: "pipeline-analytics",
33622
+ capScope: "device",
33623
+ addonId: null,
33624
+ access: "view"
33625
+ },
33469
33626
  "pipelineAnalytics.listEventKinds": {
33470
33627
  capName: "pipeline-analytics",
33471
33628
  capScope: "device",
@@ -37258,6 +37415,11 @@ Object.freeze({
37258
37415
  form: "single",
37259
37416
  optional: true
37260
37417
  }],
37418
+ "pipelineAnalytics.listBirthDecisions": [{
37419
+ name: "deviceId",
37420
+ form: "single",
37421
+ optional: true
37422
+ }],
37261
37423
  "pipelineAnalytics.listEventKinds": [{
37262
37424
  name: "deviceId",
37263
37425
  form: "single",
@@ -7768,6 +7768,157 @@ var CameraSwitchGroupSchema = object({
7768
7768
  /** Unix ms when the group was composed server-side. */
7769
7769
  fetchedAt: number()
7770
7770
  });
7771
+ /**
7772
+ * What the gate decided about a birth, from the CALLER's point of view.
7773
+ *
7774
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7775
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7776
+ * The third member is the one the gate's own type cannot express, because
7777
+ * exhaustion is a property of how long the caller waited.
7778
+ */
7779
+ var BirthDecisionVerdictSchema = _enum([
7780
+ "confirmed",
7781
+ "suppressed",
7782
+ "exhausted-fallback"
7783
+ ]);
7784
+ /** One birth decision, as it is kept. */
7785
+ var BirthDecisionRecordSchema = object({
7786
+ id: string(),
7787
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7788
+ at: number().int(),
7789
+ /** The camera. Required: every question here is asked per-camera. */
7790
+ deviceId: number().int(),
7791
+ /**
7792
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7793
+ * birth has no track at all, and a confirmed one is expected to age out long
7794
+ * before this row does. Named `sourceTrackId` so the retention model's
7795
+ * ownership derivation (`collection-classification.ts`, which keys on a
7796
+ * column literally called `trackId`) cannot reach it.
7797
+ */
7798
+ sourceTrackId: string(),
7799
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7800
+ className: string(),
7801
+ verdict: BirthDecisionVerdictSchema,
7802
+ /**
7803
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7804
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7805
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7806
+ * "unknown": it says the gate took no measurement because it was off, which
7807
+ * is a different population and must never be averaged in with the rest.
7808
+ */
7809
+ reason: string().nullable(),
7810
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7811
+ attempts: number().int(),
7812
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7813
+ deferredForMs: number().int(),
7814
+ /**
7815
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7816
+ *
7817
+ * `true` when the frame the verdict was taken on carried no matched
7818
+ * detection for this track — the tracker was coasting a frozen box and the
7819
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7820
+ * straight out of `result.tracked` without checking, so this is reachable
7821
+ * today; the question is the RATE, per camera, and whether refusing those
7822
+ * frames would have cost real tracks (cross-read against `verdict` and
7823
+ * `decidedByBirthEvidence`).
7824
+ */
7825
+ decidedOnCoastedFrame: boolean(),
7826
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7827
+ birthEvidenceAvailable: boolean(),
7828
+ /**
7829
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7830
+ * deciding are different: the carried crop is confirm-only, so a candidate
7831
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7832
+ * crop of a later instant. A coasted decision backed by carried evidence is
7833
+ * a real observation of the birth instant; one without it is not.
7834
+ */
7835
+ decidedByBirthEvidence: boolean(),
7836
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7837
+ * found — deliberately not 0, which would be a measurement that never was. */
7838
+ bestScore: number().nullable(),
7839
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7840
+ appliedMinConfidence: number().nullable(),
7841
+ /**
7842
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7843
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7844
+ */
7845
+ firstSeen: number().int().nullable(),
7846
+ /**
7847
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7848
+ * or `null` when there is none, it is older than
7849
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7850
+ */
7851
+ motionOnsetAt: number().int().nullable(),
7852
+ /**
7853
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7854
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7855
+ *
7856
+ * **Why motion onset and not something else.** Two other proxies were
7857
+ * considered and rejected:
7858
+ * - *the recording/pipeline session start*: for a camera on
7859
+ * `detectionMode: 'always'` the session opens at process start, hours
7860
+ * before any subject. It measures nothing.
7861
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7862
+ * `firstSeen` IS the first detection of that object, so for the track that
7863
+ * OPENS a burst — the only one the operator is complaining about — the two
7864
+ * are the same instant and the latency is 0 by construction.
7865
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7866
+ * mechanism from the object detector, so it is the only one that can precede
7867
+ * it. It is also already maintained per-device at frame rate on this very
7868
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7869
+ * it free — and, decisively, the frame path and the motion path are gated to
7870
+ * the SAME designated post-processing node, so the mirror is never empty for
7871
+ * a camera whose births land here.
7872
+ *
7873
+ * **Error bars, all of them.**
7874
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7875
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7876
+ * latency without bound. Mitigated, never removed, by
7877
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7878
+ * candidate for "this burst is this subject", and even then it is a
7879
+ * candidate, not a fact.
7880
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7881
+ * intensity threshold. A subject entering slowly at the far edge of the
7882
+ * frame can clear the detector's confidence floor BEFORE it clears the
7883
+ * motion floor, making this negative. Negatives are stored as-is and
7884
+ * never clamped — clamping would fabricate the distribution's left tail,
7885
+ * which is the half that says the proxy is unreliable.
7886
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7887
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7888
+ * therefore comparable WITHIN a camera and not across cameras of
7889
+ * different motion sources. The motion source is deliberately not copied
7890
+ * here — it belongs to the addon that owns the device (D224) and this is
7891
+ * a write on the frame path — so group by `deviceId`, which is how the
7892
+ * question is always asked anyway.
7893
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7894
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7895
+ * past it this is `null`.
7896
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7897
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7898
+ * camera nobody has a reference instant for.
7899
+ *
7900
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7901
+ * as such. It is not a per-track fact and must never be shown as one.
7902
+ */
7903
+ birthLatencyMs: number().int().nullable(),
7904
+ /**
7905
+ * How many births this device has already decided since that motion onset.
7906
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7907
+ * this subject. `null` when there is no usable onset.
7908
+ */
7909
+ birthIndexInBurst: number().int().nullable()
7910
+ });
7911
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
7912
+ var BirthDecisionQueryInputSchema = object({
7913
+ /** Restrict to a single camera; omit for every row. */
7914
+ deviceId: number().int().optional(),
7915
+ /** Only decisions at or after this epoch ms. */
7916
+ since: number().int().optional(),
7917
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
7918
+ verdict: BirthDecisionVerdictSchema.optional(),
7919
+ /** Max rows returned, newest-first. */
7920
+ limit: number().int().min(1).max(5e3).optional()
7921
+ });
7771
7922
  /** One archived note — the operator's words plus enough context to find what
7772
7923
  * they were looking at, after the track itself is gone. */
7773
7924
  var ArchivedDebugNoteSchema = object({
@@ -20035,7 +20186,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20035
20186
  deviceId: number(),
20036
20187
  trackId: string(),
20037
20188
  flags: TrackFlagsPatchSchema
20038
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20189
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20039
20190
  kind: "query",
20040
20191
  auth: "admin"
20041
20192
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -33439,6 +33590,12 @@ Object.freeze({
33439
33590
  addonId: null,
33440
33591
  access: "view"
33441
33592
  },
33593
+ "pipelineAnalytics.listBirthDecisions": {
33594
+ capName: "pipeline-analytics",
33595
+ capScope: "device",
33596
+ addonId: null,
33597
+ access: "view"
33598
+ },
33442
33599
  "pipelineAnalytics.listEventKinds": {
33443
33600
  capName: "pipeline-analytics",
33444
33601
  capScope: "device",
@@ -37231,6 +37388,11 @@ Object.freeze({
37231
37388
  form: "single",
37232
37389
  optional: true
37233
37390
  }],
37391
+ "pipelineAnalytics.listBirthDecisions": [{
37392
+ name: "deviceId",
37393
+ form: "single",
37394
+ optional: true
37395
+ }],
37234
37396
  "pipelineAnalytics.listEventKinds": [{
37235
37397
  name: "deviceId",
37236
37398
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-alexa",
3
- "version": "1.2.93",
3
+ "version": "1.2.94",
4
4
  "description": "Alexa Smart Home Skill export — hub-side OAuth provider + directive handler. The companion AWS Lambda forwards Alexa directives to this addon's /addon/export-alexa/directive endpoint.",
5
5
  "keywords": [
6
6
  "camstack",