@camstack/addon-post-analysis 1.2.214 → 1.2.217

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.
@@ -29,7 +29,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  enumerable: true
30
30
  }) : target, mod));
31
31
  //#endregion
32
- //#region ../types/dist/event-category-CnLqLOKs.mjs
32
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
33
33
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
34
34
  EventCategory["SystemBoot"] = "system.boot";
35
35
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -621,7 +621,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
621
621
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
622
622
  */
623
623
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
624
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
625
624
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
626
625
  /**
627
626
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -13249,7 +13248,7 @@ DeviceType.Camera;
13249
13248
  var SourceInfoSchema = object({
13250
13249
  /** Live dispatch key — mutable when the source system allows rename. */
13251
13250
  id: string(),
13252
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
13251
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
13253
13252
  system: string(),
13254
13253
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
13255
13254
  * Used to detect rename when `id` changes. */
@@ -13262,7 +13261,7 @@ var SourceInfoSchema = object({
13262
13261
  /**
13263
13262
  * Build the synthetic SourceInfo every existing provider falls back to
13264
13263
  * when no upstream value has been persisted. Keeps non-migrated providers
13265
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
13264
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
13266
13265
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
13267
13266
  * id. Real upstream identity replaces this once a provider migrates and
13268
13267
  * calls `updateSourceInfo()` with concrete values.
@@ -13843,7 +13842,7 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
13843
13842
  * - `device-management.router.ts` (deleted in Phase 2)
13844
13843
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13845
13844
  *
13846
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13845
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13847
13846
  * fork into separate processes but never run on remote cluster agents. Therefore:
13848
13847
  * - No nodeId routing needed — this is a pure hub singleton.
13849
13848
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17995,7 +17994,7 @@ var NcRuleInputSchema = object({
17995
17994
  * The measured seven-person arrival on device 590 spans 110 s with every
17996
17995
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17997
17996
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17998
- * 30 is Frigate's shipped value for the same decision.
17997
+ * 30 s is a widely shipped value for the same decision.
17999
17998
  *
18000
17999
  * ### What it replaces
18001
18000
  *
@@ -20637,6 +20636,13 @@ var ZoneCrossingSchema = object({
20637
20636
  /** Zone display name at crossing time (falls back to the id). */
20638
20637
  zoneName: string().optional()
20639
20638
  });
20639
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
20640
+ var ZoneOverlapSchema = object({
20641
+ zoneId: string(),
20642
+ zoneName: string().optional(),
20643
+ /** Percentage of the BOX area inside the zone, 0–100. */
20644
+ overlapPct: number()
20645
+ });
20640
20646
  var ObjectEventSchema = object({
20641
20647
  ...BaseEventFields,
20642
20648
  kind: literal("object"),
@@ -20661,6 +20667,35 @@ var ObjectEventSchema = object({
20661
20667
  bbox: BoundingBoxSchema.optional(),
20662
20668
  /** Heavy JSON — omitted in slim projection. */
20663
20669
  zones: array(string()).readonly().optional(),
20670
+ /**
20671
+ * How far inside each stamped zone the box actually was, as a percentage of
20672
+ * the BOX area.
20673
+ *
20674
+ * Membership alone cannot express "at least a third of it inside", which is
20675
+ * the bar an operator argues with — and the number already existed: the
20676
+ * engine computed it, the pipeline logged it, and then discarded it. It
20677
+ * matters most on the events that carry no track, where a rule has nothing
20678
+ * else to judge by.
20679
+ */
20680
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
20681
+ /**
20682
+ * Present when this event describes a detection the TRACKER refused, so it
20683
+ * has no track and never will.
20684
+ *
20685
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
20686
+ * NOW?"; tracking answers a different question ("is this the same subject as
20687
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
20688
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
20689
+ * seconds with three different candidate ids — seven analysed frames in the
20690
+ * window, the subject in a handful of them, metres apart — and produced no
20691
+ * event at all.
20692
+ *
20693
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
20694
+ * with no track and no reason is indistinguishable from a track whose media
20695
+ * went missing, and a consumer that asks this one for a best shot or a
20696
+ * history is asking for something that never existed.
20697
+ */
20698
+ spawnRefused: string().optional(),
20664
20699
  /** Omitted in slim projection. */
20665
20700
  state: TrackStateSchema.optional(),
20666
20701
  /**
@@ -22329,6 +22364,60 @@ var NativeCropResultSchema = object({
22329
22364
  */
22330
22365
  tier: _enum(["native", "ram-fullframe"]).optional()
22331
22366
  });
22367
+ /**
22368
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
22369
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
22370
+ *
22371
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
22372
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
22373
+ * from, and what the detail plane's full-frame rung cuts from.
22374
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
22375
+ * window, cut by the runner at uncapped native resolution.
22376
+ *
22377
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
22378
+ */
22379
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
22380
+ /**
22381
+ * Why a park did NOT happen. Every one is logged on the runner with
22382
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
22383
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
22384
+ * never a reason to retry in a loop.
22385
+ *
22386
+ * - `handle-gone` — the native surface no longer resolves this handle (never
22387
+ * registered, past the lease bound, or the worker released it). `detail`
22388
+ * carries the runner's own miss reason.
22389
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
22390
+ */
22391
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
22392
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
22393
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
22394
+ parked: literal(true),
22395
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
22396
+ nodeId: string(),
22397
+ width: number().int().positive(),
22398
+ height: number().int().positive(),
22399
+ /** JPEG bytes the parcel costs on the node. */
22400
+ bytes: number().int().nonnegative(),
22401
+ /** Whether this park replaced a parcel already held for the key. */
22402
+ replaced: boolean()
22403
+ }), object({
22404
+ parked: literal(false),
22405
+ nodeId: string(),
22406
+ reason: ParkRefusalSchema,
22407
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
22408
+ handleAgeMs: number().nullable(),
22409
+ detail: string().optional()
22410
+ })]);
22411
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
22412
+ var ParkedTrackFrameSchema = object({
22413
+ jpeg: string(),
22414
+ width: number().int().positive(),
22415
+ height: number().int().positive(),
22416
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
22417
+ timestamp: number(),
22418
+ /** When the node stored it (the node's clock). */
22419
+ parkedAt: number()
22420
+ });
22332
22421
  /** Parent detection context passed to `runDetailSubtree` — the crop's
22333
22422
  * originating detection, in FRAME-space coordinates. Reuses
22334
22423
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -22718,7 +22807,7 @@ var RunnerCameraConfigSchema = object({
22718
22807
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
22719
22808
  * analyzer providers) running on decoded frames in this runner.
22720
22809
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
22721
- * analytics, Frigate motion). The provider emits ProviderMotion
22810
+ * analytics). The provider emits ProviderMotion
22722
22811
  * events; the orchestrator forwards to `reportMotion`.
22723
22812
  */
22724
22813
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -22960,7 +23049,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
22960
23049
  className: string(),
22961
23050
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
22962
23051
  sourceDeviceId: number()
22963
- }), RunStatelessStepResultSchema, { kind: "mutation" });
23052
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
23053
+ deviceId: number(),
23054
+ /** Opaque to the runner — the hub's track id. */
23055
+ trackId: string(),
23056
+ kind: ParkedFrameKindSchema,
23057
+ handle: FrameHandleSchema,
23058
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
23059
+ bbox: NativeCropBboxSchema,
23060
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
23061
+ maxWidth: number().int().positive().optional(),
23062
+ /** The frame instant (caller's clock) — orders parks for one key. */
23063
+ timestamp: number()
23064
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
23065
+ deviceId: number(),
23066
+ trackId: string(),
23067
+ kind: ParkedFrameKindSchema
23068
+ }), ParkedTrackFrameSchema.nullable()), method(object({
23069
+ deviceId: number(),
23070
+ trackId: string()
23071
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
22964
23072
  var CameraPipelineConfigSchema = object({
22965
23073
  engine: PipelineEngineChoiceSchema.optional(),
22966
23074
  steps: array(PipelineStepInputSchema).readonly(),
@@ -26094,8 +26202,8 @@ onStatusChanged: { data: object({
26094
26202
  /**
26095
26203
  * Runtime-state slice — every provider that registers this cap
26096
26204
  * stores the same shape under `device.runtimeState[battery]`.
26097
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
26098
- * proxy, an ONVIF battery cam all read/write the same keys.
26205
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
26206
+ * an ONVIF battery cam all read/write the same keys.
26099
26207
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
26100
26208
  * via `device.runtimeState.getCapState('battery')` regardless of
26101
26209
  * the underlying driver.
@@ -26228,7 +26336,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
26228
26336
  *
26229
26337
  * Implementations:
26230
26338
  * - Each camera-providing addon registers this cap natively per
26231
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
26339
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
26232
26340
  * - Returns a snapshot from the persisted device config blob — no
26233
26341
  * extra round-trip to the camera, no probing.
26234
26342
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -28359,7 +28467,7 @@ var AvailableIntegrationTypeSchema = object({
28359
28467
  * Which integration-marker cap the addon declared, so the wizard can
28360
28468
  * branch on CAP — never on addon name. `device-adoption` integrations
28361
28469
  * (Home Assistant, …) route through the broker step (Approach A);
28362
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
28470
+ * `device-provider` integrations (Reolink/ONVIF) keep the
28363
28471
  * legacy config → discovery flow.
28364
28472
  */
28365
28473
  kind: _enum(["device-adoption", "device-provider"]),
@@ -31817,13 +31925,31 @@ var RecordingManifestSchema = object({
31817
31925
  */
31818
31926
  playbackEndpoints: array(string())
31819
31927
  });
31820
- /** Recording storage usage for one camera (bytes on disk across all its
31821
- * profiles/subtrees/locations on this node). */
31928
+ /**
31929
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
31930
+ * across every profile and every resolvable location on this node.
31931
+ *
31932
+ * ## Archive vs residency, which is the whole point of this shape (D418)
31933
+ *
31934
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
31935
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
31936
+ * this camera writes to, so the two can be added up and compared.
31937
+ *
31938
+ * They were not always. Until D418 this row came from the recorder's in-RAM
31939
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
31940
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
31941
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
31942
+ * that said otherwise, and two people read it as retention eating recent
31943
+ * footage. Residency is still reported, under `residentBytes` /
31944
+ * `residentOldestMs`, which answer a different question and say so.
31945
+ */
31822
31946
  var RecordingDeviceUsageSchema = object({
31823
31947
  deviceId: number(),
31948
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
31949
+ * recordings locations. */
31824
31950
  usedBytes: number(),
31825
31951
  /**
31826
- * Start of this camera's OLDEST indexed segment, across every profile and
31952
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
31827
31953
  * location — the "Oldest footage" column in Recordings → Storage, and the
31828
31954
  * only honest answer to "is retention actually holding?" per camera.
31829
31955
  *
@@ -31833,7 +31959,24 @@ var RecordingDeviceUsageSchema = object({
31833
31959
  * (types) and the addon ship on different trains, and the addon is usually
31834
31960
  * the later of the two.
31835
31961
  */
31836
- oldestMs: number().nullable().optional()
31962
+ oldestMs: number().nullable().optional(),
31963
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
31964
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
31965
+ segments: number().optional(),
31966
+ /**
31967
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
31968
+ * its RAM index — the live tail plus the hours a reader hydrated.
31969
+ *
31970
+ * It answers "what can be served without touching the disk", never "how much
31971
+ * footage this camera has". A UI that renders it must label it as such, and
31972
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
31973
+ * it, and so does a node whose ledger could not answer.
31974
+ */
31975
+ residentBytes: number().optional(),
31976
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
31977
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
31978
+ * retention. `null` = nothing resident. */
31979
+ residentOldestMs: number().nullable().optional()
31837
31980
  });
31838
31981
  /** Recording storage usage + capacity for one storage location. */
31839
31982
  var RecordingLocationUsageSchema = object({
@@ -31871,6 +32014,17 @@ var RecordingStorageUsageSchema = object({
31871
32014
  totalUsedBytes: number(),
31872
32015
  devices: array(RecordingDeviceUsageSchema),
31873
32016
  /**
32017
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
32018
+ * disks (D418).
32019
+ *
32020
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
32021
+ * declared no ledger and the recorder REFUSED rather than answering the
32022
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
32023
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
32024
+ * and its rows are residency.
32025
+ */
32026
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
32027
+ /**
31874
32028
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
31875
32029
  * of the payload without it: the hub serves this method through a BAKED
31876
32030
  * router, so a hub whose framework train predates a change to this array
@@ -40207,6 +40361,24 @@ Object.freeze({
40207
40361
  addonId: null,
40208
40362
  access: "view"
40209
40363
  },
40364
+ "pipelineRunner.getParkedTrackFrame": {
40365
+ capName: "pipeline-runner",
40366
+ capScope: "system",
40367
+ addonId: null,
40368
+ access: "view"
40369
+ },
40370
+ "pipelineRunner.parkTrackFrame": {
40371
+ capName: "pipeline-runner",
40372
+ capScope: "system",
40373
+ addonId: null,
40374
+ access: "create"
40375
+ },
40376
+ "pipelineRunner.releaseParkedTrackFrames": {
40377
+ capName: "pipeline-runner",
40378
+ capScope: "system",
40379
+ addonId: null,
40380
+ access: "create"
40381
+ },
40210
40382
  "pipelineRunner.reportMotion": {
40211
40383
  capName: "pipeline-runner",
40212
40384
  capScope: "system",
@@ -43484,6 +43656,21 @@ Object.freeze({
43484
43656
  form: "single",
43485
43657
  optional: false
43486
43658
  }],
43659
+ "pipelineRunner.getParkedTrackFrame": [{
43660
+ name: "deviceId",
43661
+ form: "single",
43662
+ optional: false
43663
+ }],
43664
+ "pipelineRunner.parkTrackFrame": [{
43665
+ name: "deviceId",
43666
+ form: "single",
43667
+ optional: false
43668
+ }],
43669
+ "pipelineRunner.releaseParkedTrackFrames": [{
43670
+ name: "deviceId",
43671
+ form: "single",
43672
+ optional: false
43673
+ }],
43487
43674
  "pipelineRunner.reportMotion": [{
43488
43675
  name: "deviceId",
43489
43676
  form: "single",
@@ -44276,7 +44463,7 @@ var PreviewTextField = string().max(200);
44276
44463
  * Whether the notification's preview is a STILL or a short animation.
44277
44464
  *
44278
44465
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
44279
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
44466
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
44280
44467
  * night reads better as three seconds of motion than as one frame of it. Both
44281
44468
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
44282
44469
  * simply applies it to a dozen frames sampled across the render and assembles