@camstack/addon-export-hap 1.2.98 → 1.2.100

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.
@@ -8293,6 +8293,157 @@ var CameraSwitchGroupSchema = object({
8293
8293
  /** Unix ms when the group was composed server-side. */
8294
8294
  fetchedAt: number()
8295
8295
  });
8296
+ /**
8297
+ * What the gate decided about a birth, from the CALLER's point of view.
8298
+ *
8299
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
8300
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
8301
+ * The third member is the one the gate's own type cannot express, because
8302
+ * exhaustion is a property of how long the caller waited.
8303
+ */
8304
+ var BirthDecisionVerdictSchema = _enum([
8305
+ "confirmed",
8306
+ "suppressed",
8307
+ "exhausted-fallback"
8308
+ ]);
8309
+ /** One birth decision, as it is kept. */
8310
+ var BirthDecisionRecordSchema = object({
8311
+ id: string(),
8312
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
8313
+ at: number().int(),
8314
+ /** The camera. Required: every question here is asked per-camera. */
8315
+ deviceId: number().int(),
8316
+ /**
8317
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
8318
+ * birth has no track at all, and a confirmed one is expected to age out long
8319
+ * before this row does. Named `sourceTrackId` so the retention model's
8320
+ * ownership derivation (`collection-classification.ts`, which keys on a
8321
+ * column literally called `trackId`) cannot reach it.
8322
+ */
8323
+ sourceTrackId: string(),
8324
+ /** The candidate's claimed class. The miss rate is asked per class too. */
8325
+ className: string(),
8326
+ verdict: BirthDecisionVerdictSchema,
8327
+ /**
8328
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
8329
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
8330
+ * when the gate is DISABLED and every birth is waved through. `null` is not
8331
+ * "unknown": it says the gate took no measurement because it was off, which
8332
+ * is a different population and must never be averaged in with the rest.
8333
+ */
8334
+ reason: string().nullable(),
8335
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
8336
+ attempts: number().int(),
8337
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
8338
+ deferredForMs: number().int(),
8339
+ /**
8340
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
8341
+ *
8342
+ * `true` when the frame the verdict was taken on carried no matched
8343
+ * detection for this track — the tracker was coasting a frozen box and the
8344
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
8345
+ * straight out of `result.tracked` without checking, so this is reachable
8346
+ * today; the question is the RATE, per camera, and whether refusing those
8347
+ * frames would have cost real tracks (cross-read against `verdict` and
8348
+ * `decidedByBirthEvidence`).
8349
+ */
8350
+ decidedOnCoastedFrame: boolean(),
8351
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
8352
+ birthEvidenceAvailable: boolean(),
8353
+ /**
8354
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
8355
+ * deciding are different: the carried crop is confirm-only, so a candidate
8356
+ * can hold evidence, be found inconclusive on it, and be decided by a native
8357
+ * crop of a later instant. A coasted decision backed by carried evidence is
8358
+ * a real observation of the birth instant; one without it is not.
8359
+ */
8360
+ decidedByBirthEvidence: boolean(),
8361
+ /** Best class-compatible crop score, or `null` when nothing compatible was
8362
+ * found — deliberately not 0, which would be a measurement that never was. */
8363
+ bestScore: number().nullable(),
8364
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
8365
+ appliedMinConfidence: number().nullable(),
8366
+ /**
8367
+ * The track's own `firstSeen` — the candidate's first frame, which is where
8368
+ * the timeline starts. `null` for a suppressed birth, which has no track.
8369
+ */
8370
+ firstSeen: number().int().nullable(),
8371
+ /**
8372
+ * The device's most recent motion RISING EDGE at the moment of the decision,
8373
+ * or `null` when there is none, it is older than
8374
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
8375
+ */
8376
+ motionOnsetAt: number().int().nullable(),
8377
+ /**
8378
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
8379
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
8380
+ *
8381
+ * **Why motion onset and not something else.** Two other proxies were
8382
+ * considered and rejected:
8383
+ * - *the recording/pipeline session start*: for a camera on
8384
+ * `detectionMode: 'always'` the session opens at process start, hours
8385
+ * before any subject. It measures nothing.
8386
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
8387
+ * `firstSeen` IS the first detection of that object, so for the track that
8388
+ * OPENS a burst — the only one the operator is complaining about — the two
8389
+ * are the same instant and the latency is 0 by construction.
8390
+ * Motion onset is the only in-process signal produced by a DIFFERENT
8391
+ * mechanism from the object detector, so it is the only one that can precede
8392
+ * it. It is also already maintained per-device at frame rate on this very
8393
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
8394
+ * it free — and, decisively, the frame path and the motion path are gated to
8395
+ * the SAME designated post-processing node, so the mirror is never empty for
8396
+ * a camera whose births land here.
8397
+ *
8398
+ * **Error bars, all of them.**
8399
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
8400
+ * wall or a branch, and only later joined by the person, OVERSTATES the
8401
+ * latency without bound. Mitigated, never removed, by
8402
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
8403
+ * candidate for "this burst is this subject", and even then it is a
8404
+ * candidate, not a fact.
8405
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
8406
+ * intensity threshold. A subject entering slowly at the far edge of the
8407
+ * frame can clear the detector's confidence floor BEFORE it clears the
8408
+ * motion floor, making this negative. Negatives are stored as-is and
8409
+ * never clamped — clamping would fabricate the distribution's left tail,
8410
+ * which is the half that says the proxy is unreliable.
8411
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
8412
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
8413
+ * therefore comparable WITHIN a camera and not across cameras of
8414
+ * different motion sources. The motion source is deliberately not copied
8415
+ * here — it belongs to the addon that owns the device (D224) and this is
8416
+ * a write on the frame path — so group by `deviceId`, which is how the
8417
+ * question is always asked anyway.
8418
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
8419
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
8420
+ * past it this is `null`.
8421
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
8422
+ * reporting, or nothing since boot: `null`. Which is the truth about a
8423
+ * camera nobody has a reference instant for.
8424
+ *
8425
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
8426
+ * as such. It is not a per-track fact and must never be shown as one.
8427
+ */
8428
+ birthLatencyMs: number().int().nullable(),
8429
+ /**
8430
+ * How many births this device has already decided since that motion onset.
8431
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
8432
+ * this subject. `null` when there is no usable onset.
8433
+ */
8434
+ birthIndexInBurst: number().int().nullable()
8435
+ });
8436
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8437
+ var BirthDecisionQueryInputSchema = object({
8438
+ /** Restrict to a single camera; omit for every row. */
8439
+ deviceId: number().int().optional(),
8440
+ /** Only decisions at or after this epoch ms. */
8441
+ since: number().int().optional(),
8442
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8443
+ verdict: BirthDecisionVerdictSchema.optional(),
8444
+ /** Max rows returned, newest-first. */
8445
+ limit: number().int().min(1).max(5e3).optional()
8446
+ });
8296
8447
  /** One archived note — the operator's words plus enough context to find what
8297
8448
  * they were looking at, after the track itself is gone. */
8298
8449
  var ArchivedDebugNoteSchema = object({
@@ -20552,7 +20703,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20552
20703
  deviceId: number(),
20553
20704
  trackId: string(),
20554
20705
  flags: TrackFlagsPatchSchema
20555
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20706
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20556
20707
  kind: "query",
20557
20708
  auth: "admin"
20558
20709
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -20994,6 +21145,22 @@ var occupancyRecheckFramesField = {
20994
21145
  step: 1
20995
21146
  };
20996
21147
  /**
21148
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
21149
+ *
21150
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
21151
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
21152
+ * fleet measures — one-shot, and only ever taken while a permit would still be
21153
+ * spare for live. `0` turns the burst off entirely (the history is still
21154
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
21155
+ * discarded — the pre-D411 behaviour).
21156
+ */
21157
+ var preRollInferenceFramesField = {
21158
+ min: 0,
21159
+ max: 30,
21160
+ default: 12,
21161
+ step: 1
21162
+ };
21163
+ /**
20997
21164
  * Source enum for motion signals fed to the runner. Extensible — add
20998
21165
  * new variants here when new motion-trigger paths are wired in
20999
21166
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -21234,6 +21401,31 @@ var RunnerCameraConfigSchema = object({
21234
21401
  * to every occupancy rule until something moved in front of it. The churn is
21235
21402
  * now paid on the interval instead — see `occupancyRecheckSecField`.
21236
21403
  */
21404
+ /**
21405
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
21406
+ * at session open — instead of decoding it and throwing it away.
21407
+ *
21408
+ * DEFAULT `true`, and the default is the argument. This is not a new
21409
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
21410
+ * already served, already decoded and already paid for on every on-motion
21411
+ * detection session that asks for history. What shipped was a last-moment
21412
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
21413
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
21414
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
21415
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
21416
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
21417
+ * was decoded, and was freed.
21418
+ *
21419
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
21420
+ * setting whose absence looks exactly like a camera that noticed the cyclist
21421
+ * late. What makes ON safe is not a switch but the BOUND —
21422
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
21423
+ * the last inference permit — so the switch exists for the camera where the
21424
+ * history is worthless (a doorbell whose subject is always already at the
21425
+ * door), not as a hedge against the feature.
21426
+ */
21427
+ preRollInferenceEnabled: boolean().default(true),
21428
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
21237
21429
  occupancyRecheckEnabled: boolean().default(true),
21238
21430
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
21239
21431
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -21262,7 +21454,7 @@ var RunnerCameraConfigSchema = object({
21262
21454
  */
21263
21455
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
21264
21456
  });
21265
- motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
21457
+ motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, preRollInferenceFramesField.min, preRollInferenceFramesField.max, preRollInferenceFramesField.step, preRollInferenceFramesField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
21266
21458
  /**
21267
21459
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
21268
21460
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -34029,6 +34221,12 @@ Object.freeze({
34029
34221
  addonId: null,
34030
34222
  access: "view"
34031
34223
  },
34224
+ "pipelineAnalytics.listBirthDecisions": {
34225
+ capName: "pipeline-analytics",
34226
+ capScope: "device",
34227
+ addonId: null,
34228
+ access: "view"
34229
+ },
34032
34230
  "pipelineAnalytics.listEventKinds": {
34033
34231
  capName: "pipeline-analytics",
34034
34232
  capScope: "device",
@@ -37821,6 +38019,11 @@ Object.freeze({
37821
38019
  form: "single",
37822
38020
  optional: true
37823
38021
  }],
38022
+ "pipelineAnalytics.listBirthDecisions": [{
38023
+ name: "deviceId",
38024
+ form: "single",
38025
+ optional: true
38026
+ }],
37824
38027
  "pipelineAnalytics.listEventKinds": [{
37825
38028
  name: "deviceId",
37826
38029
  form: "single",
@@ -8281,6 +8281,157 @@ var CameraSwitchGroupSchema = object({
8281
8281
  /** Unix ms when the group was composed server-side. */
8282
8282
  fetchedAt: number()
8283
8283
  });
8284
+ /**
8285
+ * What the gate decided about a birth, from the CALLER's point of view.
8286
+ *
8287
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
8288
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
8289
+ * The third member is the one the gate's own type cannot express, because
8290
+ * exhaustion is a property of how long the caller waited.
8291
+ */
8292
+ var BirthDecisionVerdictSchema = _enum([
8293
+ "confirmed",
8294
+ "suppressed",
8295
+ "exhausted-fallback"
8296
+ ]);
8297
+ /** One birth decision, as it is kept. */
8298
+ var BirthDecisionRecordSchema = object({
8299
+ id: string(),
8300
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
8301
+ at: number().int(),
8302
+ /** The camera. Required: every question here is asked per-camera. */
8303
+ deviceId: number().int(),
8304
+ /**
8305
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
8306
+ * birth has no track at all, and a confirmed one is expected to age out long
8307
+ * before this row does. Named `sourceTrackId` so the retention model's
8308
+ * ownership derivation (`collection-classification.ts`, which keys on a
8309
+ * column literally called `trackId`) cannot reach it.
8310
+ */
8311
+ sourceTrackId: string(),
8312
+ /** The candidate's claimed class. The miss rate is asked per class too. */
8313
+ className: string(),
8314
+ verdict: BirthDecisionVerdictSchema,
8315
+ /**
8316
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
8317
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
8318
+ * when the gate is DISABLED and every birth is waved through. `null` is not
8319
+ * "unknown": it says the gate took no measurement because it was off, which
8320
+ * is a different population and must never be averaged in with the rest.
8321
+ */
8322
+ reason: string().nullable(),
8323
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
8324
+ attempts: number().int(),
8325
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
8326
+ deferredForMs: number().int(),
8327
+ /**
8328
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
8329
+ *
8330
+ * `true` when the frame the verdict was taken on carried no matched
8331
+ * detection for this track — the tracker was coasting a frozen box and the
8332
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
8333
+ * straight out of `result.tracked` without checking, so this is reachable
8334
+ * today; the question is the RATE, per camera, and whether refusing those
8335
+ * frames would have cost real tracks (cross-read against `verdict` and
8336
+ * `decidedByBirthEvidence`).
8337
+ */
8338
+ decidedOnCoastedFrame: boolean(),
8339
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
8340
+ birthEvidenceAvailable: boolean(),
8341
+ /**
8342
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
8343
+ * deciding are different: the carried crop is confirm-only, so a candidate
8344
+ * can hold evidence, be found inconclusive on it, and be decided by a native
8345
+ * crop of a later instant. A coasted decision backed by carried evidence is
8346
+ * a real observation of the birth instant; one without it is not.
8347
+ */
8348
+ decidedByBirthEvidence: boolean(),
8349
+ /** Best class-compatible crop score, or `null` when nothing compatible was
8350
+ * found — deliberately not 0, which would be a measurement that never was. */
8351
+ bestScore: number().nullable(),
8352
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
8353
+ appliedMinConfidence: number().nullable(),
8354
+ /**
8355
+ * The track's own `firstSeen` — the candidate's first frame, which is where
8356
+ * the timeline starts. `null` for a suppressed birth, which has no track.
8357
+ */
8358
+ firstSeen: number().int().nullable(),
8359
+ /**
8360
+ * The device's most recent motion RISING EDGE at the moment of the decision,
8361
+ * or `null` when there is none, it is older than
8362
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
8363
+ */
8364
+ motionOnsetAt: number().int().nullable(),
8365
+ /**
8366
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
8367
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
8368
+ *
8369
+ * **Why motion onset and not something else.** Two other proxies were
8370
+ * considered and rejected:
8371
+ * - *the recording/pipeline session start*: for a camera on
8372
+ * `detectionMode: 'always'` the session opens at process start, hours
8373
+ * before any subject. It measures nothing.
8374
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
8375
+ * `firstSeen` IS the first detection of that object, so for the track that
8376
+ * OPENS a burst — the only one the operator is complaining about — the two
8377
+ * are the same instant and the latency is 0 by construction.
8378
+ * Motion onset is the only in-process signal produced by a DIFFERENT
8379
+ * mechanism from the object detector, so it is the only one that can precede
8380
+ * it. It is also already maintained per-device at frame rate on this very
8381
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
8382
+ * it free — and, decisively, the frame path and the motion path are gated to
8383
+ * the SAME designated post-processing node, so the mirror is never empty for
8384
+ * a camera whose births land here.
8385
+ *
8386
+ * **Error bars, all of them.**
8387
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
8388
+ * wall or a branch, and only later joined by the person, OVERSTATES the
8389
+ * latency without bound. Mitigated, never removed, by
8390
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
8391
+ * candidate for "this burst is this subject", and even then it is a
8392
+ * candidate, not a fact.
8393
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
8394
+ * intensity threshold. A subject entering slowly at the far edge of the
8395
+ * frame can clear the detector's confidence floor BEFORE it clears the
8396
+ * motion floor, making this negative. Negatives are stored as-is and
8397
+ * never clamped — clamping would fabricate the distribution's left tail,
8398
+ * which is the half that says the proxy is unreliable.
8399
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
8400
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
8401
+ * therefore comparable WITHIN a camera and not across cameras of
8402
+ * different motion sources. The motion source is deliberately not copied
8403
+ * here — it belongs to the addon that owns the device (D224) and this is
8404
+ * a write on the frame path — so group by `deviceId`, which is how the
8405
+ * question is always asked anyway.
8406
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
8407
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
8408
+ * past it this is `null`.
8409
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
8410
+ * reporting, or nothing since boot: `null`. Which is the truth about a
8411
+ * camera nobody has a reference instant for.
8412
+ *
8413
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
8414
+ * as such. It is not a per-track fact and must never be shown as one.
8415
+ */
8416
+ birthLatencyMs: number().int().nullable(),
8417
+ /**
8418
+ * How many births this device has already decided since that motion onset.
8419
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
8420
+ * this subject. `null` when there is no usable onset.
8421
+ */
8422
+ birthIndexInBurst: number().int().nullable()
8423
+ });
8424
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8425
+ var BirthDecisionQueryInputSchema = object({
8426
+ /** Restrict to a single camera; omit for every row. */
8427
+ deviceId: number().int().optional(),
8428
+ /** Only decisions at or after this epoch ms. */
8429
+ since: number().int().optional(),
8430
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8431
+ verdict: BirthDecisionVerdictSchema.optional(),
8432
+ /** Max rows returned, newest-first. */
8433
+ limit: number().int().min(1).max(5e3).optional()
8434
+ });
8284
8435
  /** One archived note — the operator's words plus enough context to find what
8285
8436
  * they were looking at, after the track itself is gone. */
8286
8437
  var ArchivedDebugNoteSchema = object({
@@ -20540,7 +20691,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20540
20691
  deviceId: number(),
20541
20692
  trackId: string(),
20542
20693
  flags: TrackFlagsPatchSchema
20543
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20694
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20544
20695
  kind: "query",
20545
20696
  auth: "admin"
20546
20697
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -20982,6 +21133,22 @@ var occupancyRecheckFramesField = {
20982
21133
  step: 1
20983
21134
  };
20984
21135
  /**
21136
+ * Frames one PRE-ROLL catch-up burst may send to inference at session open.
21137
+ *
21138
+ * The default of 12 over a ~4 s retained window is one frame per ~333 ms of
21139
+ * footage, and costs ~480 ms of ONE inference permit at the 40 ms/frame this
21140
+ * fleet measures — one-shot, and only ever taken while a permit would still be
21141
+ * spare for live. `0` turns the burst off entirely (the history is still
21142
+ * decoded, because that is how the dial reaches a decodable GOP, and is then
21143
+ * discarded — the pre-D411 behaviour).
21144
+ */
21145
+ var preRollInferenceFramesField = {
21146
+ min: 0,
21147
+ max: 30,
21148
+ default: 12,
21149
+ step: 1
21150
+ };
21151
+ /**
20985
21152
  * Source enum for motion signals fed to the runner. Extensible — add
20986
21153
  * new variants here when new motion-trigger paths are wired in
20987
21154
  * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
@@ -21222,6 +21389,31 @@ var RunnerCameraConfigSchema = object({
21222
21389
  * to every occupancy rule until something moved in front of it. The churn is
21223
21390
  * now paid on the interval instead — see `occupancyRecheckSecField`.
21224
21391
  */
21392
+ /**
21393
+ * Infer the session's PRE-ROLL — the retained history the restreamer replays
21394
+ * at session open — instead of decoding it and throwing it away.
21395
+ *
21396
+ * DEFAULT `true`, and the default is the argument. This is not a new
21397
+ * capability being offered cautiously: the pre-roll is ALREADY requested,
21398
+ * already served, already decoded and already paid for on every on-motion
21399
+ * detection session that asks for history. What shipped was a last-moment
21400
+ * discard — `FrameSlot`'s throttle compares wall clocks, and ~4 s of media
21401
+ * arriving inside a few hundred ms of wall clock looks to it like one frame's
21402
+ * worth. Device 617, 2026-09-08: a re-run of the SAME model over the stored
21403
+ * recording scored the subject `vehicle 0.5669` — above the 0.50 floor —
21404
+ * 1.68 s BEFORE the live track was born, on a frame that was in the pre-roll,
21405
+ * was decoded, and was freed.
21406
+ *
21407
+ * Shipping that as opt-in would ship the bug: an operator cannot discover a
21408
+ * setting whose absence looks exactly like a camera that noticed the cyclist
21409
+ * late. What makes ON safe is not a switch but the BOUND —
21410
+ * `preRollInferenceFrames`, a wall-clock ceiling, and a lane that never takes
21411
+ * the last inference permit — so the switch exists for the camera where the
21412
+ * history is worthless (a doorbell whose subject is always already at the
21413
+ * door), not as a hedge against the feature.
21414
+ */
21415
+ preRollInferenceEnabled: boolean().default(true),
21416
+ preRollInferenceFrames: number().min(preRollInferenceFramesField.min).max(preRollInferenceFramesField.max).default(preRollInferenceFramesField.default),
21225
21417
  occupancyRecheckEnabled: boolean().default(true),
21226
21418
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
21227
21419
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
@@ -21250,7 +21442,7 @@ var RunnerCameraConfigSchema = object({
21250
21442
  */
21251
21443
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
21252
21444
  });
21253
- motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
21445
+ motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, preRollInferenceFramesField.min, preRollInferenceFramesField.max, preRollInferenceFramesField.step, preRollInferenceFramesField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
21254
21446
  /**
21255
21447
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
21256
21448
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -34017,6 +34209,12 @@ Object.freeze({
34017
34209
  addonId: null,
34018
34210
  access: "view"
34019
34211
  },
34212
+ "pipelineAnalytics.listBirthDecisions": {
34213
+ capName: "pipeline-analytics",
34214
+ capScope: "device",
34215
+ addonId: null,
34216
+ access: "view"
34217
+ },
34020
34218
  "pipelineAnalytics.listEventKinds": {
34021
34219
  capName: "pipeline-analytics",
34022
34220
  capScope: "device",
@@ -37809,6 +38007,11 @@ Object.freeze({
37809
38007
  form: "single",
37810
38008
  optional: true
37811
38009
  }],
38010
+ "pipelineAnalytics.listBirthDecisions": [{
38011
+ name: "deviceId",
38012
+ form: "single",
38013
+ optional: true
38014
+ }],
37812
38015
  "pipelineAnalytics.listEventKinds": [{
37813
38016
  name: "deviceId",
37814
38017
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-hap",
3
- "version": "1.2.98",
3
+ "version": "1.2.100",
4
4
  "description": "HomeKit (HAP) exporter for CamStack devices. Publishes each exposed device as its own HomeKit accessory: cameras and doorbells with SRTP streaming, HomeKit Secure Video, motion, two-way audio, PTZ and battery; switches, lights, locks and sensors through a capability→service table.",
5
5
  "keywords": [
6
6
  "camstack",