@camstack/addon-ai 0.4.90 → 0.4.91

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
@@ -7830,6 +7830,157 @@ var CameraSwitchGroupSchema = object({
7830
7830
  /** Unix ms when the group was composed server-side. */
7831
7831
  fetchedAt: number$1()
7832
7832
  });
7833
+ /**
7834
+ * What the gate decided about a birth, from the CALLER's point of view.
7835
+ *
7836
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7837
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7838
+ * The third member is the one the gate's own type cannot express, because
7839
+ * exhaustion is a property of how long the caller waited.
7840
+ */
7841
+ var BirthDecisionVerdictSchema = _enum([
7842
+ "confirmed",
7843
+ "suppressed",
7844
+ "exhausted-fallback"
7845
+ ]);
7846
+ /** One birth decision, as it is kept. */
7847
+ var BirthDecisionRecordSchema = object({
7848
+ id: string(),
7849
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7850
+ at: number$1().int(),
7851
+ /** The camera. Required: every question here is asked per-camera. */
7852
+ deviceId: number$1().int(),
7853
+ /**
7854
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7855
+ * birth has no track at all, and a confirmed one is expected to age out long
7856
+ * before this row does. Named `sourceTrackId` so the retention model's
7857
+ * ownership derivation (`collection-classification.ts`, which keys on a
7858
+ * column literally called `trackId`) cannot reach it.
7859
+ */
7860
+ sourceTrackId: string(),
7861
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7862
+ className: string(),
7863
+ verdict: BirthDecisionVerdictSchema,
7864
+ /**
7865
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7866
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7867
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7868
+ * "unknown": it says the gate took no measurement because it was off, which
7869
+ * is a different population and must never be averaged in with the rest.
7870
+ */
7871
+ reason: string().nullable(),
7872
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7873
+ attempts: number$1().int(),
7874
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7875
+ deferredForMs: number$1().int(),
7876
+ /**
7877
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7878
+ *
7879
+ * `true` when the frame the verdict was taken on carried no matched
7880
+ * detection for this track — the tracker was coasting a frozen box and the
7881
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7882
+ * straight out of `result.tracked` without checking, so this is reachable
7883
+ * today; the question is the RATE, per camera, and whether refusing those
7884
+ * frames would have cost real tracks (cross-read against `verdict` and
7885
+ * `decidedByBirthEvidence`).
7886
+ */
7887
+ decidedOnCoastedFrame: boolean(),
7888
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7889
+ birthEvidenceAvailable: boolean(),
7890
+ /**
7891
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7892
+ * deciding are different: the carried crop is confirm-only, so a candidate
7893
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7894
+ * crop of a later instant. A coasted decision backed by carried evidence is
7895
+ * a real observation of the birth instant; one without it is not.
7896
+ */
7897
+ decidedByBirthEvidence: boolean(),
7898
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7899
+ * found — deliberately not 0, which would be a measurement that never was. */
7900
+ bestScore: number$1().nullable(),
7901
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7902
+ appliedMinConfidence: number$1().nullable(),
7903
+ /**
7904
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7905
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7906
+ */
7907
+ firstSeen: number$1().int().nullable(),
7908
+ /**
7909
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7910
+ * or `null` when there is none, it is older than
7911
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7912
+ */
7913
+ motionOnsetAt: number$1().int().nullable(),
7914
+ /**
7915
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7916
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7917
+ *
7918
+ * **Why motion onset and not something else.** Two other proxies were
7919
+ * considered and rejected:
7920
+ * - *the recording/pipeline session start*: for a camera on
7921
+ * `detectionMode: 'always'` the session opens at process start, hours
7922
+ * before any subject. It measures nothing.
7923
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7924
+ * `firstSeen` IS the first detection of that object, so for the track that
7925
+ * OPENS a burst — the only one the operator is complaining about — the two
7926
+ * are the same instant and the latency is 0 by construction.
7927
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7928
+ * mechanism from the object detector, so it is the only one that can precede
7929
+ * it. It is also already maintained per-device at frame rate on this very
7930
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7931
+ * it free — and, decisively, the frame path and the motion path are gated to
7932
+ * the SAME designated post-processing node, so the mirror is never empty for
7933
+ * a camera whose births land here.
7934
+ *
7935
+ * **Error bars, all of them.**
7936
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7937
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7938
+ * latency without bound. Mitigated, never removed, by
7939
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7940
+ * candidate for "this burst is this subject", and even then it is a
7941
+ * candidate, not a fact.
7942
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7943
+ * intensity threshold. A subject entering slowly at the far edge of the
7944
+ * frame can clear the detector's confidence floor BEFORE it clears the
7945
+ * motion floor, making this negative. Negatives are stored as-is and
7946
+ * never clamped — clamping would fabricate the distribution's left tail,
7947
+ * which is the half that says the proxy is unreliable.
7948
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7949
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7950
+ * therefore comparable WITHIN a camera and not across cameras of
7951
+ * different motion sources. The motion source is deliberately not copied
7952
+ * here — it belongs to the addon that owns the device (D224) and this is
7953
+ * a write on the frame path — so group by `deviceId`, which is how the
7954
+ * question is always asked anyway.
7955
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7956
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7957
+ * past it this is `null`.
7958
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7959
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7960
+ * camera nobody has a reference instant for.
7961
+ *
7962
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7963
+ * as such. It is not a per-track fact and must never be shown as one.
7964
+ */
7965
+ birthLatencyMs: number$1().int().nullable(),
7966
+ /**
7967
+ * How many births this device has already decided since that motion onset.
7968
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7969
+ * this subject. `null` when there is no usable onset.
7970
+ */
7971
+ birthIndexInBurst: number$1().int().nullable()
7972
+ });
7973
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
7974
+ var BirthDecisionQueryInputSchema = object({
7975
+ /** Restrict to a single camera; omit for every row. */
7976
+ deviceId: number$1().int().optional(),
7977
+ /** Only decisions at or after this epoch ms. */
7978
+ since: number$1().int().optional(),
7979
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
7980
+ verdict: BirthDecisionVerdictSchema.optional(),
7981
+ /** Max rows returned, newest-first. */
7982
+ limit: number$1().int().min(1).max(5e3).optional()
7983
+ });
7833
7984
  /** One archived note — the operator's words plus enough context to find what
7834
7985
  * they were looking at, after the track itself is gone. */
7835
7986
  var ArchivedDebugNoteSchema = object({
@@ -20048,7 +20199,7 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
20048
20199
  deviceId: number$1(),
20049
20200
  trackId: string(),
20050
20201
  flags: TrackFlagsPatchSchema
20051
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20202
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20052
20203
  kind: "query",
20053
20204
  auth: "admin"
20054
20205
  }), method(object({ deviceId: number$1().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -33452,6 +33603,12 @@ Object.freeze({
33452
33603
  addonId: null,
33453
33604
  access: "view"
33454
33605
  },
33606
+ "pipelineAnalytics.listBirthDecisions": {
33607
+ capName: "pipeline-analytics",
33608
+ capScope: "device",
33609
+ addonId: null,
33610
+ access: "view"
33611
+ },
33455
33612
  "pipelineAnalytics.listEventKinds": {
33456
33613
  capName: "pipeline-analytics",
33457
33614
  capScope: "device",
@@ -37244,6 +37401,11 @@ Object.freeze({
37244
37401
  form: "single",
37245
37402
  optional: true
37246
37403
  }],
37404
+ "pipelineAnalytics.listBirthDecisions": [{
37405
+ name: "deviceId",
37406
+ form: "single",
37407
+ optional: true
37408
+ }],
37247
37409
  "pipelineAnalytics.listEventKinds": [{
37248
37410
  name: "deviceId",
37249
37411
  form: "single",
package/dist/addon.mjs CHANGED
@@ -7857,6 +7857,157 @@ var CameraSwitchGroupSchema = object({
7857
7857
  /** Unix ms when the group was composed server-side. */
7858
7858
  fetchedAt: number$1()
7859
7859
  });
7860
+ /**
7861
+ * What the gate decided about a birth, from the CALLER's point of view.
7862
+ *
7863
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
7864
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
7865
+ * The third member is the one the gate's own type cannot express, because
7866
+ * exhaustion is a property of how long the caller waited.
7867
+ */
7868
+ var BirthDecisionVerdictSchema = _enum([
7869
+ "confirmed",
7870
+ "suppressed",
7871
+ "exhausted-fallback"
7872
+ ]);
7873
+ /** One birth decision, as it is kept. */
7874
+ var BirthDecisionRecordSchema = object({
7875
+ id: string(),
7876
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
7877
+ at: number$1().int(),
7878
+ /** The camera. Required: every question here is asked per-camera. */
7879
+ deviceId: number$1().int(),
7880
+ /**
7881
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
7882
+ * birth has no track at all, and a confirmed one is expected to age out long
7883
+ * before this row does. Named `sourceTrackId` so the retention model's
7884
+ * ownership derivation (`collection-classification.ts`, which keys on a
7885
+ * column literally called `trackId`) cannot reach it.
7886
+ */
7887
+ sourceTrackId: string(),
7888
+ /** The candidate's claimed class. The miss rate is asked per class too. */
7889
+ className: string(),
7890
+ verdict: BirthDecisionVerdictSchema,
7891
+ /**
7892
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
7893
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
7894
+ * when the gate is DISABLED and every birth is waved through. `null` is not
7895
+ * "unknown": it says the gate took no measurement because it was off, which
7896
+ * is a different population and must never be averaged in with the rest.
7897
+ */
7898
+ reason: string().nullable(),
7899
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
7900
+ attempts: number$1().int(),
7901
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7902
+ deferredForMs: number$1().int(),
7903
+ /**
7904
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
7905
+ *
7906
+ * `true` when the frame the verdict was taken on carried no matched
7907
+ * detection for this track — the tracker was coasting a frozen box and the
7908
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
7909
+ * straight out of `result.tracked` without checking, so this is reachable
7910
+ * today; the question is the RATE, per camera, and whether refusing those
7911
+ * frames would have cost real tracks (cross-read against `verdict` and
7912
+ * `decidedByBirthEvidence`).
7913
+ */
7914
+ decidedOnCoastedFrame: boolean(),
7915
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
7916
+ birthEvidenceAvailable: boolean(),
7917
+ /**
7918
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
7919
+ * deciding are different: the carried crop is confirm-only, so a candidate
7920
+ * can hold evidence, be found inconclusive on it, and be decided by a native
7921
+ * crop of a later instant. A coasted decision backed by carried evidence is
7922
+ * a real observation of the birth instant; one without it is not.
7923
+ */
7924
+ decidedByBirthEvidence: boolean(),
7925
+ /** Best class-compatible crop score, or `null` when nothing compatible was
7926
+ * found — deliberately not 0, which would be a measurement that never was. */
7927
+ bestScore: number$1().nullable(),
7928
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7929
+ appliedMinConfidence: number$1().nullable(),
7930
+ /**
7931
+ * The track's own `firstSeen` — the candidate's first frame, which is where
7932
+ * the timeline starts. `null` for a suppressed birth, which has no track.
7933
+ */
7934
+ firstSeen: number$1().int().nullable(),
7935
+ /**
7936
+ * The device's most recent motion RISING EDGE at the moment of the decision,
7937
+ * or `null` when there is none, it is older than
7938
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
7939
+ */
7940
+ motionOnsetAt: number$1().int().nullable(),
7941
+ /**
7942
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
7943
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
7944
+ *
7945
+ * **Why motion onset and not something else.** Two other proxies were
7946
+ * considered and rejected:
7947
+ * - *the recording/pipeline session start*: for a camera on
7948
+ * `detectionMode: 'always'` the session opens at process start, hours
7949
+ * before any subject. It measures nothing.
7950
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
7951
+ * `firstSeen` IS the first detection of that object, so for the track that
7952
+ * OPENS a burst — the only one the operator is complaining about — the two
7953
+ * are the same instant and the latency is 0 by construction.
7954
+ * Motion onset is the only in-process signal produced by a DIFFERENT
7955
+ * mechanism from the object detector, so it is the only one that can precede
7956
+ * it. It is also already maintained per-device at frame rate on this very
7957
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
7958
+ * it free — and, decisively, the frame path and the motion path are gated to
7959
+ * the SAME designated post-processing node, so the mirror is never empty for
7960
+ * a camera whose births land here.
7961
+ *
7962
+ * **Error bars, all of them.**
7963
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
7964
+ * wall or a branch, and only later joined by the person, OVERSTATES the
7965
+ * latency without bound. Mitigated, never removed, by
7966
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
7967
+ * candidate for "this burst is this subject", and even then it is a
7968
+ * candidate, not a fact.
7969
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
7970
+ * intensity threshold. A subject entering slowly at the far edge of the
7971
+ * frame can clear the detector's confidence floor BEFORE it clears the
7972
+ * motion floor, making this negative. Negatives are stored as-is and
7973
+ * never clamped — clamping would fabricate the distribution's left tail,
7974
+ * which is the half that says the proxy is unreliable.
7975
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
7976
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
7977
+ * therefore comparable WITHIN a camera and not across cameras of
7978
+ * different motion sources. The motion source is deliberately not copied
7979
+ * here — it belongs to the addon that owns the device (D224) and this is
7980
+ * a write on the frame path — so group by `deviceId`, which is how the
7981
+ * question is always asked anyway.
7982
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
7983
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
7984
+ * past it this is `null`.
7985
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
7986
+ * reporting, or nothing since boot: `null`. Which is the truth about a
7987
+ * camera nobody has a reference instant for.
7988
+ *
7989
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
7990
+ * as such. It is not a per-track fact and must never be shown as one.
7991
+ */
7992
+ birthLatencyMs: number$1().int().nullable(),
7993
+ /**
7994
+ * How many births this device has already decided since that motion onset.
7995
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
7996
+ * this subject. `null` when there is no usable onset.
7997
+ */
7998
+ birthIndexInBurst: number$1().int().nullable()
7999
+ });
8000
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8001
+ var BirthDecisionQueryInputSchema = object({
8002
+ /** Restrict to a single camera; omit for every row. */
8003
+ deviceId: number$1().int().optional(),
8004
+ /** Only decisions at or after this epoch ms. */
8005
+ since: number$1().int().optional(),
8006
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8007
+ verdict: BirthDecisionVerdictSchema.optional(),
8008
+ /** Max rows returned, newest-first. */
8009
+ limit: number$1().int().min(1).max(5e3).optional()
8010
+ });
7860
8011
  /** One archived note — the operator's words plus enough context to find what
7861
8012
  * they were looking at, after the track itself is gone. */
7862
8013
  var ArchivedDebugNoteSchema = object({
@@ -20075,7 +20226,7 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
20075
20226
  deviceId: number$1(),
20076
20227
  trackId: string(),
20077
20228
  flags: TrackFlagsPatchSchema
20078
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20229
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20079
20230
  kind: "query",
20080
20231
  auth: "admin"
20081
20232
  }), method(object({ deviceId: number$1().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -33479,6 +33630,12 @@ Object.freeze({
33479
33630
  addonId: null,
33480
33631
  access: "view"
33481
33632
  },
33633
+ "pipelineAnalytics.listBirthDecisions": {
33634
+ capName: "pipeline-analytics",
33635
+ capScope: "device",
33636
+ addonId: null,
33637
+ access: "view"
33638
+ },
33482
33639
  "pipelineAnalytics.listEventKinds": {
33483
33640
  capName: "pipeline-analytics",
33484
33641
  capScope: "device",
@@ -37271,6 +37428,11 @@ Object.freeze({
37271
37428
  form: "single",
37272
37429
  optional: true
37273
37430
  }],
37431
+ "pipelineAnalytics.listBirthDecisions": [{
37432
+ name: "deviceId",
37433
+ form: "single",
37434
+ optional: true
37435
+ }],
37274
37436
  "pipelineAnalytics.listEventKinds": [{
37275
37437
  name: "deviceId",
37276
37438
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-ai",
3
- "version": "0.4.90",
3
+ "version": "0.4.91",
4
4
  "description": "AI addon for CamStack — the `llm` collection provider (cloud, LAN, and camstack-managed local llama.cpp profiles) plus the per-node `llm-runtime` managed executor.",
5
5
  "keywords": [
6
6
  "camstack",