@camstack/addon-provider-onvif 1.2.89 → 1.2.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.
Files changed (3) hide show
  1. package/dist/addon.js +202 -15
  2. package/dist/addon.mjs +202 -15
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region \0rolldown/runtime.js
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  //#endregion
5
- //#region ../types/dist/event-category-CnLqLOKs.mjs
5
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -594,7 +594,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
594
594
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
595
595
  */
596
596
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
597
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
598
597
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
599
598
  /**
600
599
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12522,7 +12521,7 @@ DeviceType.Camera;
12522
12521
  var SourceInfoSchema = object({
12523
12522
  /** Live dispatch key — mutable when the source system allows rename. */
12524
12523
  id: string(),
12525
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12524
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12526
12525
  system: string(),
12527
12526
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12528
12527
  * Used to detect rename when `id` changes. */
@@ -13090,7 +13089,7 @@ var deviceProviderCapability = {
13090
13089
  * - `device-management.router.ts` (deleted in Phase 2)
13091
13090
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13092
13091
  *
13093
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13092
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13094
13093
  * fork into separate processes but never run on remote cluster agents. Therefore:
13095
13094
  * - No nodeId routing needed — this is a pure hub singleton.
13096
13095
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17100,7 +17099,7 @@ var NcRuleInputSchema = object({
17100
17099
  * The measured seven-person arrival on device 590 spans 110 s with every
17101
17100
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17102
17101
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17103
- * 30 is Frigate's shipped value for the same decision.
17102
+ * 30 s is a widely shipped value for the same decision.
17104
17103
  *
17105
17104
  * ### What it replaces
17106
17105
  *
@@ -19142,6 +19141,13 @@ var ZoneCrossingSchema = object({
19142
19141
  /** Zone display name at crossing time (falls back to the id). */
19143
19142
  zoneName: string().optional()
19144
19143
  });
19144
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19145
+ var ZoneOverlapSchema = object({
19146
+ zoneId: string(),
19147
+ zoneName: string().optional(),
19148
+ /** Percentage of the BOX area inside the zone, 0–100. */
19149
+ overlapPct: number()
19150
+ });
19145
19151
  var ObjectEventSchema = object({
19146
19152
  ...BaseEventFields,
19147
19153
  kind: literal("object"),
@@ -19166,6 +19172,35 @@ var ObjectEventSchema = object({
19166
19172
  bbox: BoundingBoxSchema.optional(),
19167
19173
  /** Heavy JSON — omitted in slim projection. */
19168
19174
  zones: array(string()).readonly().optional(),
19175
+ /**
19176
+ * How far inside each stamped zone the box actually was, as a percentage of
19177
+ * the BOX area.
19178
+ *
19179
+ * Membership alone cannot express "at least a third of it inside", which is
19180
+ * the bar an operator argues with — and the number already existed: the
19181
+ * engine computed it, the pipeline logged it, and then discarded it. It
19182
+ * matters most on the events that carry no track, where a rule has nothing
19183
+ * else to judge by.
19184
+ */
19185
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19186
+ /**
19187
+ * Present when this event describes a detection the TRACKER refused, so it
19188
+ * has no track and never will.
19189
+ *
19190
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19191
+ * NOW?"; tracking answers a different question ("is this the same subject as
19192
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19193
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19194
+ * seconds with three different candidate ids — seven analysed frames in the
19195
+ * window, the subject in a handful of them, metres apart — and produced no
19196
+ * event at all.
19197
+ *
19198
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19199
+ * with no track and no reason is indistinguishable from a track whose media
19200
+ * went missing, and a consumer that asks this one for a best shot or a
19201
+ * history is asking for something that never existed.
19202
+ */
19203
+ spawnRefused: string().optional(),
19169
19204
  /** Omitted in slim projection. */
19170
19205
  state: TrackStateSchema.optional(),
19171
19206
  /**
@@ -20239,6 +20274,60 @@ var NativeCropResultSchema = object({
20239
20274
  */
20240
20275
  tier: _enum(["native", "ram-fullframe"]).optional()
20241
20276
  });
20277
+ /**
20278
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20279
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20280
+ *
20281
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20282
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20283
+ * from, and what the detail plane's full-frame rung cuts from.
20284
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20285
+ * window, cut by the runner at uncapped native resolution.
20286
+ *
20287
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20288
+ */
20289
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20290
+ /**
20291
+ * Why a park did NOT happen. Every one is logged on the runner with
20292
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20293
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20294
+ * never a reason to retry in a loop.
20295
+ *
20296
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20297
+ * registered, past the lease bound, or the worker released it). `detail`
20298
+ * carries the runner's own miss reason.
20299
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20300
+ */
20301
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20302
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20303
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20304
+ parked: literal(true),
20305
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20306
+ nodeId: string(),
20307
+ width: number().int().positive(),
20308
+ height: number().int().positive(),
20309
+ /** JPEG bytes the parcel costs on the node. */
20310
+ bytes: number().int().nonnegative(),
20311
+ /** Whether this park replaced a parcel already held for the key. */
20312
+ replaced: boolean()
20313
+ }), object({
20314
+ parked: literal(false),
20315
+ nodeId: string(),
20316
+ reason: ParkRefusalSchema,
20317
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20318
+ handleAgeMs: number().nullable(),
20319
+ detail: string().optional()
20320
+ })]);
20321
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20322
+ var ParkedTrackFrameSchema = object({
20323
+ jpeg: string(),
20324
+ width: number().int().positive(),
20325
+ height: number().int().positive(),
20326
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20327
+ timestamp: number(),
20328
+ /** When the node stored it (the node's clock). */
20329
+ parkedAt: number()
20330
+ });
20242
20331
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20243
20332
  * originating detection, in FRAME-space coordinates. Reuses
20244
20333
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20628,7 +20717,7 @@ var RunnerCameraConfigSchema = object({
20628
20717
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20629
20718
  * analyzer providers) running on decoded frames in this runner.
20630
20719
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20631
- * analytics, Frigate motion). The provider emits ProviderMotion
20720
+ * analytics). The provider emits ProviderMotion
20632
20721
  * events; the orchestrator forwards to `reportMotion`.
20633
20722
  */
20634
20723
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -20870,7 +20959,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
20870
20959
  className: string(),
20871
20960
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
20872
20961
  sourceDeviceId: number()
20873
- }), RunStatelessStepResultSchema, { kind: "mutation" });
20962
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
20963
+ deviceId: number(),
20964
+ /** Opaque to the runner — the hub's track id. */
20965
+ trackId: string(),
20966
+ kind: ParkedFrameKindSchema,
20967
+ handle: FrameHandleSchema,
20968
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
20969
+ bbox: NativeCropBboxSchema,
20970
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
20971
+ maxWidth: number().int().positive().optional(),
20972
+ /** The frame instant (caller's clock) — orders parks for one key. */
20973
+ timestamp: number()
20974
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
20975
+ deviceId: number(),
20976
+ trackId: string(),
20977
+ kind: ParkedFrameKindSchema
20978
+ }), ParkedTrackFrameSchema.nullable()), method(object({
20979
+ deviceId: number(),
20980
+ trackId: string()
20981
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
20874
20982
  var CameraPipelineConfigSchema = object({
20875
20983
  engine: PipelineEngineChoiceSchema.optional(),
20876
20984
  steps: array(PipelineStepInputSchema).readonly(),
@@ -23903,7 +24011,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
23903
24011
  *
23904
24012
  * Implementations:
23905
24013
  * - Each camera-providing addon registers this cap natively per
23906
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24014
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
23907
24015
  * - Returns a snapshot from the persisted device config blob — no
23908
24016
  * extra round-trip to the camera, no probing.
23909
24017
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -25289,7 +25397,7 @@ var AvailableIntegrationTypeSchema = object({
25289
25397
  * Which integration-marker cap the addon declared, so the wizard can
25290
25398
  * branch on CAP — never on addon name. `device-adoption` integrations
25291
25399
  * (Home Assistant, …) route through the broker step (Approach A);
25292
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
25400
+ * `device-provider` integrations (Reolink/ONVIF) keep the
25293
25401
  * legacy config → discovery flow.
25294
25402
  */
25295
25403
  kind: _enum(["device-adoption", "device-provider"]),
@@ -27888,13 +27996,31 @@ var RecordingManifestSchema = object({
27888
27996
  */
27889
27997
  playbackEndpoints: array(string())
27890
27998
  });
27891
- /** Recording storage usage for one camera (bytes on disk across all its
27892
- * profiles/subtrees/locations on this node). */
27999
+ /**
28000
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
28001
+ * across every profile and every resolvable location on this node.
28002
+ *
28003
+ * ## Archive vs residency, which is the whole point of this shape (D418)
28004
+ *
28005
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
28006
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
28007
+ * this camera writes to, so the two can be added up and compared.
28008
+ *
28009
+ * They were not always. Until D418 this row came from the recorder's in-RAM
28010
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
28011
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
28012
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
28013
+ * that said otherwise, and two people read it as retention eating recent
28014
+ * footage. Residency is still reported, under `residentBytes` /
28015
+ * `residentOldestMs`, which answer a different question and say so.
28016
+ */
27893
28017
  var RecordingDeviceUsageSchema = object({
27894
28018
  deviceId: number(),
28019
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
28020
+ * recordings locations. */
27895
28021
  usedBytes: number(),
27896
28022
  /**
27897
- * Start of this camera's OLDEST indexed segment, across every profile and
28023
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
27898
28024
  * location — the "Oldest footage" column in Recordings → Storage, and the
27899
28025
  * only honest answer to "is retention actually holding?" per camera.
27900
28026
  *
@@ -27904,7 +28030,24 @@ var RecordingDeviceUsageSchema = object({
27904
28030
  * (types) and the addon ship on different trains, and the addon is usually
27905
28031
  * the later of the two.
27906
28032
  */
27907
- oldestMs: number().nullable().optional()
28033
+ oldestMs: number().nullable().optional(),
28034
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
28035
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
28036
+ segments: number().optional(),
28037
+ /**
28038
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
28039
+ * its RAM index — the live tail plus the hours a reader hydrated.
28040
+ *
28041
+ * It answers "what can be served without touching the disk", never "how much
28042
+ * footage this camera has". A UI that renders it must label it as such, and
28043
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
28044
+ * it, and so does a node whose ledger could not answer.
28045
+ */
28046
+ residentBytes: number().optional(),
28047
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
28048
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
28049
+ * retention. `null` = nothing resident. */
28050
+ residentOldestMs: number().nullable().optional()
27908
28051
  });
27909
28052
  /** Recording storage usage + capacity for one storage location. */
27910
28053
  var RecordingLocationUsageSchema = object({
@@ -27942,6 +28085,17 @@ var RecordingStorageUsageSchema = object({
27942
28085
  totalUsedBytes: number(),
27943
28086
  devices: array(RecordingDeviceUsageSchema),
27944
28087
  /**
28088
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
28089
+ * disks (D418).
28090
+ *
28091
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
28092
+ * declared no ledger and the recorder REFUSED rather than answering the
28093
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
28094
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
28095
+ * and its rows are residency.
28096
+ */
28097
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
28098
+ /**
27945
28099
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
27946
28100
  * of the payload without it: the hub serves this method through a BAKED
27947
28101
  * router, so a hub whose framework train predates a change to this array
@@ -30433,7 +30587,7 @@ function toDeviceSummary(device, addonId) {
30433
30587
  };
30434
30588
  }
30435
30589
  /**
30436
- * Base class for device-provider addons (rtsp, onvif, frigate).
30590
+ * Base class for device-provider addons (rtsp, onvif).
30437
30591
  *
30438
30592
  * Provides default implementations for the common device-provider cap
30439
30593
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -35155,6 +35309,24 @@ Object.freeze({
35155
35309
  addonId: null,
35156
35310
  access: "view"
35157
35311
  },
35312
+ "pipelineRunner.getParkedTrackFrame": {
35313
+ capName: "pipeline-runner",
35314
+ capScope: "system",
35315
+ addonId: null,
35316
+ access: "view"
35317
+ },
35318
+ "pipelineRunner.parkTrackFrame": {
35319
+ capName: "pipeline-runner",
35320
+ capScope: "system",
35321
+ addonId: null,
35322
+ access: "create"
35323
+ },
35324
+ "pipelineRunner.releaseParkedTrackFrames": {
35325
+ capName: "pipeline-runner",
35326
+ capScope: "system",
35327
+ addonId: null,
35328
+ access: "create"
35329
+ },
35158
35330
  "pipelineRunner.reportMotion": {
35159
35331
  capName: "pipeline-runner",
35160
35332
  capScope: "system",
@@ -38432,6 +38604,21 @@ Object.freeze({
38432
38604
  form: "single",
38433
38605
  optional: false
38434
38606
  }],
38607
+ "pipelineRunner.getParkedTrackFrame": [{
38608
+ name: "deviceId",
38609
+ form: "single",
38610
+ optional: false
38611
+ }],
38612
+ "pipelineRunner.parkTrackFrame": [{
38613
+ name: "deviceId",
38614
+ form: "single",
38615
+ optional: false
38616
+ }],
38617
+ "pipelineRunner.releaseParkedTrackFrames": [{
38618
+ name: "deviceId",
38619
+ form: "single",
38620
+ optional: false
38621
+ }],
38435
38622
  "pipelineRunner.reportMotion": [{
38436
38623
  name: "deviceId",
38437
38624
  form: "single",
@@ -39123,7 +39310,7 @@ var PreviewTextField = string().max(200);
39123
39310
  * Whether the notification's preview is a STILL or a short animation.
39124
39311
  *
39125
39312
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
39126
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
39313
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
39127
39314
  * night reads better as three seconds of motion than as one frame of it. Both
39128
39315
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
39129
39316
  * simply applies it to a dozen frames sampled across the render and assembles
package/dist/addon.mjs CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
5
  //#endregion
6
- //#region ../types/dist/event-category-CnLqLOKs.mjs
6
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
7
7
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
8
8
  EventCategory["SystemBoot"] = "system.boot";
9
9
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -595,7 +595,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
595
595
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
596
596
  */
597
597
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
598
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
599
598
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
600
599
  /**
601
600
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12523,7 +12522,7 @@ DeviceType.Camera;
12523
12522
  var SourceInfoSchema = object({
12524
12523
  /** Live dispatch key — mutable when the source system allows rename. */
12525
12524
  id: string(),
12526
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12525
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12527
12526
  system: string(),
12528
12527
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12529
12528
  * Used to detect rename when `id` changes. */
@@ -13091,7 +13090,7 @@ var deviceProviderCapability = {
13091
13090
  * - `device-management.router.ts` (deleted in Phase 2)
13092
13091
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13093
13092
  *
13094
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13093
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13095
13094
  * fork into separate processes but never run on remote cluster agents. Therefore:
13096
13095
  * - No nodeId routing needed — this is a pure hub singleton.
13097
13096
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17101,7 +17100,7 @@ var NcRuleInputSchema = object({
17101
17100
  * The measured seven-person arrival on device 590 spans 110 s with every
17102
17101
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17103
17102
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17104
- * 30 is Frigate's shipped value for the same decision.
17103
+ * 30 s is a widely shipped value for the same decision.
17105
17104
  *
17106
17105
  * ### What it replaces
17107
17106
  *
@@ -19143,6 +19142,13 @@ var ZoneCrossingSchema = object({
19143
19142
  /** Zone display name at crossing time (falls back to the id). */
19144
19143
  zoneName: string().optional()
19145
19144
  });
19145
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19146
+ var ZoneOverlapSchema = object({
19147
+ zoneId: string(),
19148
+ zoneName: string().optional(),
19149
+ /** Percentage of the BOX area inside the zone, 0–100. */
19150
+ overlapPct: number()
19151
+ });
19146
19152
  var ObjectEventSchema = object({
19147
19153
  ...BaseEventFields,
19148
19154
  kind: literal("object"),
@@ -19167,6 +19173,35 @@ var ObjectEventSchema = object({
19167
19173
  bbox: BoundingBoxSchema.optional(),
19168
19174
  /** Heavy JSON — omitted in slim projection. */
19169
19175
  zones: array(string()).readonly().optional(),
19176
+ /**
19177
+ * How far inside each stamped zone the box actually was, as a percentage of
19178
+ * the BOX area.
19179
+ *
19180
+ * Membership alone cannot express "at least a third of it inside", which is
19181
+ * the bar an operator argues with — and the number already existed: the
19182
+ * engine computed it, the pipeline logged it, and then discarded it. It
19183
+ * matters most on the events that carry no track, where a rule has nothing
19184
+ * else to judge by.
19185
+ */
19186
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19187
+ /**
19188
+ * Present when this event describes a detection the TRACKER refused, so it
19189
+ * has no track and never will.
19190
+ *
19191
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19192
+ * NOW?"; tracking answers a different question ("is this the same subject as
19193
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19194
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19195
+ * seconds with three different candidate ids — seven analysed frames in the
19196
+ * window, the subject in a handful of them, metres apart — and produced no
19197
+ * event at all.
19198
+ *
19199
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19200
+ * with no track and no reason is indistinguishable from a track whose media
19201
+ * went missing, and a consumer that asks this one for a best shot or a
19202
+ * history is asking for something that never existed.
19203
+ */
19204
+ spawnRefused: string().optional(),
19170
19205
  /** Omitted in slim projection. */
19171
19206
  state: TrackStateSchema.optional(),
19172
19207
  /**
@@ -20240,6 +20275,60 @@ var NativeCropResultSchema = object({
20240
20275
  */
20241
20276
  tier: _enum(["native", "ram-fullframe"]).optional()
20242
20277
  });
20278
+ /**
20279
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20280
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20281
+ *
20282
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20283
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20284
+ * from, and what the detail plane's full-frame rung cuts from.
20285
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20286
+ * window, cut by the runner at uncapped native resolution.
20287
+ *
20288
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20289
+ */
20290
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20291
+ /**
20292
+ * Why a park did NOT happen. Every one is logged on the runner with
20293
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20294
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20295
+ * never a reason to retry in a loop.
20296
+ *
20297
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20298
+ * registered, past the lease bound, or the worker released it). `detail`
20299
+ * carries the runner's own miss reason.
20300
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20301
+ */
20302
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20303
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20304
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20305
+ parked: literal(true),
20306
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20307
+ nodeId: string(),
20308
+ width: number().int().positive(),
20309
+ height: number().int().positive(),
20310
+ /** JPEG bytes the parcel costs on the node. */
20311
+ bytes: number().int().nonnegative(),
20312
+ /** Whether this park replaced a parcel already held for the key. */
20313
+ replaced: boolean()
20314
+ }), object({
20315
+ parked: literal(false),
20316
+ nodeId: string(),
20317
+ reason: ParkRefusalSchema,
20318
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20319
+ handleAgeMs: number().nullable(),
20320
+ detail: string().optional()
20321
+ })]);
20322
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20323
+ var ParkedTrackFrameSchema = object({
20324
+ jpeg: string(),
20325
+ width: number().int().positive(),
20326
+ height: number().int().positive(),
20327
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20328
+ timestamp: number(),
20329
+ /** When the node stored it (the node's clock). */
20330
+ parkedAt: number()
20331
+ });
20243
20332
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20244
20333
  * originating detection, in FRAME-space coordinates. Reuses
20245
20334
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20629,7 +20718,7 @@ var RunnerCameraConfigSchema = object({
20629
20718
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20630
20719
  * analyzer providers) running on decoded frames in this runner.
20631
20720
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20632
- * analytics, Frigate motion). The provider emits ProviderMotion
20721
+ * analytics). The provider emits ProviderMotion
20633
20722
  * events; the orchestrator forwards to `reportMotion`.
20634
20723
  */
20635
20724
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -20871,7 +20960,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
20871
20960
  className: string(),
20872
20961
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
20873
20962
  sourceDeviceId: number()
20874
- }), RunStatelessStepResultSchema, { kind: "mutation" });
20963
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
20964
+ deviceId: number(),
20965
+ /** Opaque to the runner — the hub's track id. */
20966
+ trackId: string(),
20967
+ kind: ParkedFrameKindSchema,
20968
+ handle: FrameHandleSchema,
20969
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
20970
+ bbox: NativeCropBboxSchema,
20971
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
20972
+ maxWidth: number().int().positive().optional(),
20973
+ /** The frame instant (caller's clock) — orders parks for one key. */
20974
+ timestamp: number()
20975
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
20976
+ deviceId: number(),
20977
+ trackId: string(),
20978
+ kind: ParkedFrameKindSchema
20979
+ }), ParkedTrackFrameSchema.nullable()), method(object({
20980
+ deviceId: number(),
20981
+ trackId: string()
20982
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
20875
20983
  var CameraPipelineConfigSchema = object({
20876
20984
  engine: PipelineEngineChoiceSchema.optional(),
20877
20985
  steps: array(PipelineStepInputSchema).readonly(),
@@ -23904,7 +24012,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
23904
24012
  *
23905
24013
  * Implementations:
23906
24014
  * - Each camera-providing addon registers this cap natively per
23907
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24015
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
23908
24016
  * - Returns a snapshot from the persisted device config blob — no
23909
24017
  * extra round-trip to the camera, no probing.
23910
24018
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -25290,7 +25398,7 @@ var AvailableIntegrationTypeSchema = object({
25290
25398
  * Which integration-marker cap the addon declared, so the wizard can
25291
25399
  * branch on CAP — never on addon name. `device-adoption` integrations
25292
25400
  * (Home Assistant, …) route through the broker step (Approach A);
25293
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
25401
+ * `device-provider` integrations (Reolink/ONVIF) keep the
25294
25402
  * legacy config → discovery flow.
25295
25403
  */
25296
25404
  kind: _enum(["device-adoption", "device-provider"]),
@@ -27889,13 +27997,31 @@ var RecordingManifestSchema = object({
27889
27997
  */
27890
27998
  playbackEndpoints: array(string())
27891
27999
  });
27892
- /** Recording storage usage for one camera (bytes on disk across all its
27893
- * profiles/subtrees/locations on this node). */
28000
+ /**
28001
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
28002
+ * across every profile and every resolvable location on this node.
28003
+ *
28004
+ * ## Archive vs residency, which is the whole point of this shape (D418)
28005
+ *
28006
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
28007
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
28008
+ * this camera writes to, so the two can be added up and compared.
28009
+ *
28010
+ * They were not always. Until D418 this row came from the recorder's in-RAM
28011
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
28012
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
28013
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
28014
+ * that said otherwise, and two people read it as retention eating recent
28015
+ * footage. Residency is still reported, under `residentBytes` /
28016
+ * `residentOldestMs`, which answer a different question and say so.
28017
+ */
27894
28018
  var RecordingDeviceUsageSchema = object({
27895
28019
  deviceId: number(),
28020
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
28021
+ * recordings locations. */
27896
28022
  usedBytes: number(),
27897
28023
  /**
27898
- * Start of this camera's OLDEST indexed segment, across every profile and
28024
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
27899
28025
  * location — the "Oldest footage" column in Recordings → Storage, and the
27900
28026
  * only honest answer to "is retention actually holding?" per camera.
27901
28027
  *
@@ -27905,7 +28031,24 @@ var RecordingDeviceUsageSchema = object({
27905
28031
  * (types) and the addon ship on different trains, and the addon is usually
27906
28032
  * the later of the two.
27907
28033
  */
27908
- oldestMs: number().nullable().optional()
28034
+ oldestMs: number().nullable().optional(),
28035
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
28036
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
28037
+ segments: number().optional(),
28038
+ /**
28039
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
28040
+ * its RAM index — the live tail plus the hours a reader hydrated.
28041
+ *
28042
+ * It answers "what can be served without touching the disk", never "how much
28043
+ * footage this camera has". A UI that renders it must label it as such, and
28044
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
28045
+ * it, and so does a node whose ledger could not answer.
28046
+ */
28047
+ residentBytes: number().optional(),
28048
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
28049
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
28050
+ * retention. `null` = nothing resident. */
28051
+ residentOldestMs: number().nullable().optional()
27909
28052
  });
27910
28053
  /** Recording storage usage + capacity for one storage location. */
27911
28054
  var RecordingLocationUsageSchema = object({
@@ -27943,6 +28086,17 @@ var RecordingStorageUsageSchema = object({
27943
28086
  totalUsedBytes: number(),
27944
28087
  devices: array(RecordingDeviceUsageSchema),
27945
28088
  /**
28089
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
28090
+ * disks (D418).
28091
+ *
28092
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
28093
+ * declared no ledger and the recorder REFUSED rather than answering the
28094
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
28095
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
28096
+ * and its rows are residency.
28097
+ */
28098
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
28099
+ /**
27946
28100
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
27947
28101
  * of the payload without it: the hub serves this method through a BAKED
27948
28102
  * router, so a hub whose framework train predates a change to this array
@@ -30434,7 +30588,7 @@ function toDeviceSummary(device, addonId) {
30434
30588
  };
30435
30589
  }
30436
30590
  /**
30437
- * Base class for device-provider addons (rtsp, onvif, frigate).
30591
+ * Base class for device-provider addons (rtsp, onvif).
30438
30592
  *
30439
30593
  * Provides default implementations for the common device-provider cap
30440
30594
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -35156,6 +35310,24 @@ Object.freeze({
35156
35310
  addonId: null,
35157
35311
  access: "view"
35158
35312
  },
35313
+ "pipelineRunner.getParkedTrackFrame": {
35314
+ capName: "pipeline-runner",
35315
+ capScope: "system",
35316
+ addonId: null,
35317
+ access: "view"
35318
+ },
35319
+ "pipelineRunner.parkTrackFrame": {
35320
+ capName: "pipeline-runner",
35321
+ capScope: "system",
35322
+ addonId: null,
35323
+ access: "create"
35324
+ },
35325
+ "pipelineRunner.releaseParkedTrackFrames": {
35326
+ capName: "pipeline-runner",
35327
+ capScope: "system",
35328
+ addonId: null,
35329
+ access: "create"
35330
+ },
35159
35331
  "pipelineRunner.reportMotion": {
35160
35332
  capName: "pipeline-runner",
35161
35333
  capScope: "system",
@@ -38433,6 +38605,21 @@ Object.freeze({
38433
38605
  form: "single",
38434
38606
  optional: false
38435
38607
  }],
38608
+ "pipelineRunner.getParkedTrackFrame": [{
38609
+ name: "deviceId",
38610
+ form: "single",
38611
+ optional: false
38612
+ }],
38613
+ "pipelineRunner.parkTrackFrame": [{
38614
+ name: "deviceId",
38615
+ form: "single",
38616
+ optional: false
38617
+ }],
38618
+ "pipelineRunner.releaseParkedTrackFrames": [{
38619
+ name: "deviceId",
38620
+ form: "single",
38621
+ optional: false
38622
+ }],
38436
38623
  "pipelineRunner.reportMotion": [{
38437
38624
  name: "deviceId",
38438
38625
  form: "single",
@@ -39124,7 +39311,7 @@ var PreviewTextField = string().max(200);
39124
39311
  * Whether the notification's preview is a STILL or a short animation.
39125
39312
  *
39126
39313
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
39127
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
39314
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
39128
39315
  * night reads better as three seconds of motion than as one frame of it. Both
39129
39316
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
39130
39317
  * simply applies it to a dozen frames sampled across the render and assembles
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-onvif",
3
- "version": "1.2.89",
3
+ "version": "1.2.91",
4
4
  "description": "ONVIF camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",