@camstack/addon-provider-homeassistant 1.2.102 → 1.2.104

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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("./dist-DAeDXQbg.js");
2
+ const require_dist = require("./dist-CxmQzhSg.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  let node_zlib = require("node:zlib");
5
5
  //#region src/ha-device-source.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-CCXWoJdR.mjs";
1
+ import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-ptOv7XHh.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
4
4
  //#region src/ha-device-source.ts
@@ -7831,6 +7831,186 @@ var CameraSwitchGroupSchema = object({
7831
7831
  fetchedAt: number()
7832
7832
  });
7833
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().int(),
7851
+ /** The camera. Required: every question here is asked per-camera. */
7852
+ deviceId: number().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().int(),
7874
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7875
+ deferredForMs: number().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().nullable(),
7901
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7902
+ appliedMinConfidence: number().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().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().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().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().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().int().optional(),
7977
+ /** Only decisions at or after this epoch ms. */
7978
+ since: number().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().int().min(1).max(5e3).optional()
7983
+ });
7984
+ /** One archived note — the operator's words plus enough context to find what
7985
+ * they were looking at, after the track itself is gone. */
7986
+ var ArchivedDebugNoteSchema = object({
7987
+ /** Archive row id. Derived from `(sourceTrackId, note)`, so re-archiving the
7988
+ * same sentence about the same track lands on the row already there. */
7989
+ id: string(),
7990
+ /** The operator's own words, verbatim. */
7991
+ note: string(),
7992
+ /** The camera. Required — every question here is asked per-camera. */
7993
+ deviceId: number().int(),
7994
+ /** The track the note was written on. PROVENANCE, not ownership: the track
7995
+ * is expected to be gone, and this row is not a reference to it. */
7996
+ sourceTrackId: string(),
7997
+ /** Epoch ms the note was moved here, i.e. when the operator reviewed it. */
7998
+ archivedAt: number().int(),
7999
+ /** The track's `firstSeen`, when the row still knew it; `null` otherwise. */
8000
+ trackStartedAt: number().int().nullable(),
8001
+ /** The track's detector class (`person`, `car`, …); `null` when unknown. */
8002
+ trackClass: string().nullable(),
8003
+ /** The track's display label at review time; `null` when it had none. */
8004
+ trackLabel: string().nullable()
8005
+ });
8006
+ /** Query input for `listArchivedDebugNotes` — newest first, one camera or all. */
8007
+ var ArchivedDebugNoteQueryInputSchema = object({
8008
+ /** Restrict to a single camera; omit for every row. */
8009
+ deviceId: number().int().optional(),
8010
+ /** Max rows returned, newest-first. */
8011
+ limit: number().int().min(1).max(1e3).optional()
8012
+ });
8013
+ /**
7834
8014
  * Ops-log — the durable, append-only operations audit shared by the
7835
8015
  * recordings and events management surfaces.
7836
8016
  *
@@ -20478,7 +20658,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20478
20658
  deviceId: number(),
20479
20659
  trackId: string(),
20480
20660
  flags: TrackFlagsPatchSchema
20481
- }), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
20661
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20482
20662
  kind: "query",
20483
20663
  auth: "admin"
20484
20664
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -37961,6 +38141,18 @@ Object.freeze({
37961
38141
  addonId: null,
37962
38142
  access: "view"
37963
38143
  },
38144
+ "pipelineAnalytics.listArchivedDebugNotes": {
38145
+ capName: "pipeline-analytics",
38146
+ capScope: "device",
38147
+ addonId: null,
38148
+ access: "view"
38149
+ },
38150
+ "pipelineAnalytics.listBirthDecisions": {
38151
+ capName: "pipeline-analytics",
38152
+ capScope: "device",
38153
+ addonId: null,
38154
+ access: "view"
38155
+ },
37964
38156
  "pipelineAnalytics.listEventKinds": {
37965
38157
  capName: "pipeline-analytics",
37966
38158
  capScope: "device",
@@ -41748,6 +41940,16 @@ Object.freeze({
41748
41940
  form: "array",
41749
41941
  optional: true
41750
41942
  }],
41943
+ "pipelineAnalytics.listArchivedDebugNotes": [{
41944
+ name: "deviceId",
41945
+ form: "single",
41946
+ optional: true
41947
+ }],
41948
+ "pipelineAnalytics.listBirthDecisions": [{
41949
+ name: "deviceId",
41950
+ form: "single",
41951
+ optional: true
41952
+ }],
41751
41953
  "pipelineAnalytics.listEventKinds": [{
41752
41954
  name: "deviceId",
41753
41955
  form: "single",
@@ -7831,6 +7831,186 @@ var CameraSwitchGroupSchema = object({
7831
7831
  fetchedAt: number()
7832
7832
  });
7833
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().int(),
7851
+ /** The camera. Required: every question here is asked per-camera. */
7852
+ deviceId: number().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().int(),
7874
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
7875
+ deferredForMs: number().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().nullable(),
7901
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
7902
+ appliedMinConfidence: number().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().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().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().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().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().int().optional(),
7977
+ /** Only decisions at or after this epoch ms. */
7978
+ since: number().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().int().min(1).max(5e3).optional()
7983
+ });
7984
+ /** One archived note — the operator's words plus enough context to find what
7985
+ * they were looking at, after the track itself is gone. */
7986
+ var ArchivedDebugNoteSchema = object({
7987
+ /** Archive row id. Derived from `(sourceTrackId, note)`, so re-archiving the
7988
+ * same sentence about the same track lands on the row already there. */
7989
+ id: string(),
7990
+ /** The operator's own words, verbatim. */
7991
+ note: string(),
7992
+ /** The camera. Required — every question here is asked per-camera. */
7993
+ deviceId: number().int(),
7994
+ /** The track the note was written on. PROVENANCE, not ownership: the track
7995
+ * is expected to be gone, and this row is not a reference to it. */
7996
+ sourceTrackId: string(),
7997
+ /** Epoch ms the note was moved here, i.e. when the operator reviewed it. */
7998
+ archivedAt: number().int(),
7999
+ /** The track's `firstSeen`, when the row still knew it; `null` otherwise. */
8000
+ trackStartedAt: number().int().nullable(),
8001
+ /** The track's detector class (`person`, `car`, …); `null` when unknown. */
8002
+ trackClass: string().nullable(),
8003
+ /** The track's display label at review time; `null` when it had none. */
8004
+ trackLabel: string().nullable()
8005
+ });
8006
+ /** Query input for `listArchivedDebugNotes` — newest first, one camera or all. */
8007
+ var ArchivedDebugNoteQueryInputSchema = object({
8008
+ /** Restrict to a single camera; omit for every row. */
8009
+ deviceId: number().int().optional(),
8010
+ /** Max rows returned, newest-first. */
8011
+ limit: number().int().min(1).max(1e3).optional()
8012
+ });
8013
+ /**
7834
8014
  * Ops-log — the durable, append-only operations audit shared by the
7835
8015
  * recordings and events management surfaces.
7836
8016
  *
@@ -20478,7 +20658,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20478
20658
  deviceId: number(),
20479
20659
  trackId: string(),
20480
20660
  flags: TrackFlagsPatchSchema
20481
- }), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
20661
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20482
20662
  kind: "query",
20483
20663
  auth: "admin"
20484
20664
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -37961,6 +38141,18 @@ Object.freeze({
37961
38141
  addonId: null,
37962
38142
  access: "view"
37963
38143
  },
38144
+ "pipelineAnalytics.listArchivedDebugNotes": {
38145
+ capName: "pipeline-analytics",
38146
+ capScope: "device",
38147
+ addonId: null,
38148
+ access: "view"
38149
+ },
38150
+ "pipelineAnalytics.listBirthDecisions": {
38151
+ capName: "pipeline-analytics",
38152
+ capScope: "device",
38153
+ addonId: null,
38154
+ access: "view"
38155
+ },
37964
38156
  "pipelineAnalytics.listEventKinds": {
37965
38157
  capName: "pipeline-analytics",
37966
38158
  capScope: "device",
@@ -41748,6 +41940,16 @@ Object.freeze({
41748
41940
  form: "array",
41749
41941
  optional: true
41750
41942
  }],
41943
+ "pipelineAnalytics.listArchivedDebugNotes": [{
41944
+ name: "deviceId",
41945
+ form: "single",
41946
+ optional: true
41947
+ }],
41948
+ "pipelineAnalytics.listBirthDecisions": [{
41949
+ name: "deviceId",
41950
+ form: "single",
41951
+ optional: true
41952
+ }],
41751
41953
  "pipelineAnalytics.listEventKinds": [{
41752
41954
  name: "deviceId",
41753
41955
  form: "single",
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#endregion
6
- const require_dist = require("../dist-DAeDXQbg.js");
6
+ const require_dist = require("../dist-CxmQzhSg.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  //#region src/ha-export/topics.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-CCXWoJdR.mjs";
1
+ import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-ptOv7XHh.mjs";
2
2
  import { createHmac, timingSafeEqual } from "node:crypto";
3
3
  //#region src/ha-export/topics.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homeassistant",
3
- "version": "1.2.102",
3
+ "version": "1.2.104",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",