@camstack/addon-provider-onvif 1.2.89 → 1.2.92

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 +243 -19
  2. package/dist/addon.mjs +243 -19
  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
  /**
@@ -19592,7 +19627,17 @@ var EventDensityBucketSchema = object({
19592
19627
  bucketStart: number(),
19593
19628
  motion: number().int(),
19594
19629
  object: number().int(),
19595
- audio: number().int()
19630
+ audio: number().int(),
19631
+ /**
19632
+ * Energy-weighted mean dBFS of the audio events in this bucket — the LEVEL,
19633
+ * as opposed to `audio`, which is their COUNT (D431).
19634
+ *
19635
+ * ABSENT when the bucket holds no audio event. Absence means "nothing was
19636
+ * measured", which is not the same claim as silence, and a lane that cannot
19637
+ * tell them apart paints a quiet hour at full scale — which is exactly what
19638
+ * the count-on-a-level-meter did.
19639
+ */
19640
+ audioDbfs: number().optional()
19596
19641
  });
19597
19642
  /**
19598
19643
  * One camera's row in a `getEventDensityBatch` answer.
@@ -20239,6 +20284,60 @@ var NativeCropResultSchema = object({
20239
20284
  */
20240
20285
  tier: _enum(["native", "ram-fullframe"]).optional()
20241
20286
  });
20287
+ /**
20288
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20289
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20290
+ *
20291
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20292
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20293
+ * from, and what the detail plane's full-frame rung cuts from.
20294
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20295
+ * window, cut by the runner at uncapped native resolution.
20296
+ *
20297
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20298
+ */
20299
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20300
+ /**
20301
+ * Why a park did NOT happen. Every one is logged on the runner with
20302
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20303
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20304
+ * never a reason to retry in a loop.
20305
+ *
20306
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20307
+ * registered, past the lease bound, or the worker released it). `detail`
20308
+ * carries the runner's own miss reason.
20309
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20310
+ */
20311
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20312
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20313
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20314
+ parked: literal(true),
20315
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20316
+ nodeId: string(),
20317
+ width: number().int().positive(),
20318
+ height: number().int().positive(),
20319
+ /** JPEG bytes the parcel costs on the node. */
20320
+ bytes: number().int().nonnegative(),
20321
+ /** Whether this park replaced a parcel already held for the key. */
20322
+ replaced: boolean()
20323
+ }), object({
20324
+ parked: literal(false),
20325
+ nodeId: string(),
20326
+ reason: ParkRefusalSchema,
20327
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20328
+ handleAgeMs: number().nullable(),
20329
+ detail: string().optional()
20330
+ })]);
20331
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20332
+ var ParkedTrackFrameSchema = object({
20333
+ jpeg: string(),
20334
+ width: number().int().positive(),
20335
+ height: number().int().positive(),
20336
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20337
+ timestamp: number(),
20338
+ /** When the node stored it (the node's clock). */
20339
+ parkedAt: number()
20340
+ });
20242
20341
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20243
20342
  * originating detection, in FRAME-space coordinates. Reuses
20244
20343
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20628,7 +20727,7 @@ var RunnerCameraConfigSchema = object({
20628
20727
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20629
20728
  * analyzer providers) running on decoded frames in this runner.
20630
20729
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20631
- * analytics, Frigate motion). The provider emits ProviderMotion
20730
+ * analytics). The provider emits ProviderMotion
20632
20731
  * events; the orchestrator forwards to `reportMotion`.
20633
20732
  */
20634
20733
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -20870,7 +20969,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
20870
20969
  className: string(),
20871
20970
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
20872
20971
  sourceDeviceId: number()
20873
- }), RunStatelessStepResultSchema, { kind: "mutation" });
20972
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
20973
+ deviceId: number(),
20974
+ /** Opaque to the runner — the hub's track id. */
20975
+ trackId: string(),
20976
+ kind: ParkedFrameKindSchema,
20977
+ handle: FrameHandleSchema,
20978
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
20979
+ bbox: NativeCropBboxSchema,
20980
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
20981
+ maxWidth: number().int().positive().optional(),
20982
+ /** The frame instant (caller's clock) — orders parks for one key. */
20983
+ timestamp: number()
20984
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
20985
+ deviceId: number(),
20986
+ trackId: string(),
20987
+ kind: ParkedFrameKindSchema
20988
+ }), ParkedTrackFrameSchema.nullable()), method(object({
20989
+ deviceId: number(),
20990
+ trackId: string()
20991
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
20874
20992
  var CameraPipelineConfigSchema = object({
20875
20993
  engine: PipelineEngineChoiceSchema.optional(),
20876
20994
  steps: array(PipelineStepInputSchema).readonly(),
@@ -23903,7 +24021,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
23903
24021
  *
23904
24022
  * Implementations:
23905
24023
  * - Each camera-providing addon registers this cap natively per
23906
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24024
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
23907
24025
  * - Returns a snapshot from the persisted device config blob — no
23908
24026
  * extra round-trip to the camera, no probing.
23909
24027
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -25289,7 +25407,7 @@ var AvailableIntegrationTypeSchema = object({
25289
25407
  * Which integration-marker cap the addon declared, so the wizard can
25290
25408
  * branch on CAP — never on addon name. `device-adoption` integrations
25291
25409
  * (Home Assistant, …) route through the broker step (Approach A);
25292
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
25410
+ * `device-provider` integrations (Reolink/ONVIF) keep the
25293
25411
  * legacy config → discovery flow.
25294
25412
  */
25295
25413
  kind: _enum(["device-adoption", "device-provider"]),
@@ -27832,7 +27950,23 @@ var RecordingRangeSchema = object({
27832
27950
  });
27833
27951
  var RecordingAvailabilitySchema = object({
27834
27952
  deviceId: number(),
27835
- ranges: array(RecordingRangeSchema)
27953
+ ranges: array(RecordingRangeSchema),
27954
+ /**
27955
+ * Every profile this camera has footage in — not only the one `ranges`
27956
+ * describes (D433).
27957
+ *
27958
+ * `ranges` answers for ONE profile by design: the timeline is a single bar,
27959
+ * and enumerating all of them triples the directory reads for a bar that
27960
+ * would look identical. But the answer used to say nothing about that, so a
27961
+ * caller asking "what can I export?" read the single preferred profile as
27962
+ * the only one that exists — on this deployment every camera records `high`
27963
+ * AND `low`, the low tree holding 14 GB for camera 615 alone, and the export
27964
+ * UI could not see it.
27965
+ *
27966
+ * Cheap: it is the same shallow directory read the profile CHOICE already
27967
+ * makes. Ask for a specific profile's ranges with the `profile` input.
27968
+ */
27969
+ profilesWithFootage: array(string())
27836
27970
  });
27837
27971
  var RecordingDaysSchema = object({
27838
27972
  deviceId: number(),
@@ -27858,7 +27992,11 @@ var RecordingDaysSchema = object({
27858
27992
  var RecordingAvailabilityForDeviceSchema = object({
27859
27993
  deviceId: number(),
27860
27994
  read: _enum(["read", "unreadable"]),
27861
- ranges: array(RecordingRangeSchema).readonly()
27995
+ ranges: array(RecordingRangeSchema).readonly(),
27996
+ /** Same field, same meaning, as the singular answer (D433). A row that
27997
+ * dropped it would tell a grid caller the archive holds one profile.
27998
+ * Empty on an `'unreadable'` row: nobody looked. */
27999
+ profilesWithFootage: array(string()).readonly()
27862
28000
  });
27863
28001
  /**
27864
28002
  * One camera's row in a `getDaysWithRecordingsBatch` answer. Same rule as
@@ -27888,13 +28026,31 @@ var RecordingManifestSchema = object({
27888
28026
  */
27889
28027
  playbackEndpoints: array(string())
27890
28028
  });
27891
- /** Recording storage usage for one camera (bytes on disk across all its
27892
- * profiles/subtrees/locations on this node). */
28029
+ /**
28030
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
28031
+ * across every profile and every resolvable location on this node.
28032
+ *
28033
+ * ## Archive vs residency, which is the whole point of this shape (D418)
28034
+ *
28035
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
28036
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
28037
+ * this camera writes to, so the two can be added up and compared.
28038
+ *
28039
+ * They were not always. Until D418 this row came from the recorder's in-RAM
28040
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
28041
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
28042
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
28043
+ * that said otherwise, and two people read it as retention eating recent
28044
+ * footage. Residency is still reported, under `residentBytes` /
28045
+ * `residentOldestMs`, which answer a different question and say so.
28046
+ */
27893
28047
  var RecordingDeviceUsageSchema = object({
27894
28048
  deviceId: number(),
28049
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
28050
+ * recordings locations. */
27895
28051
  usedBytes: number(),
27896
28052
  /**
27897
- * Start of this camera's OLDEST indexed segment, across every profile and
28053
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
27898
28054
  * location — the "Oldest footage" column in Recordings → Storage, and the
27899
28055
  * only honest answer to "is retention actually holding?" per camera.
27900
28056
  *
@@ -27904,7 +28060,24 @@ var RecordingDeviceUsageSchema = object({
27904
28060
  * (types) and the addon ship on different trains, and the addon is usually
27905
28061
  * the later of the two.
27906
28062
  */
27907
- oldestMs: number().nullable().optional()
28063
+ oldestMs: number().nullable().optional(),
28064
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
28065
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
28066
+ segments: number().optional(),
28067
+ /**
28068
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
28069
+ * its RAM index — the live tail plus the hours a reader hydrated.
28070
+ *
28071
+ * It answers "what can be served without touching the disk", never "how much
28072
+ * footage this camera has". A UI that renders it must label it as such, and
28073
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
28074
+ * it, and so does a node whose ledger could not answer.
28075
+ */
28076
+ residentBytes: number().optional(),
28077
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
28078
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
28079
+ * retention. `null` = nothing resident. */
28080
+ residentOldestMs: number().nullable().optional()
27908
28081
  });
27909
28082
  /** Recording storage usage + capacity for one storage location. */
27910
28083
  var RecordingLocationUsageSchema = object({
@@ -27942,6 +28115,17 @@ var RecordingStorageUsageSchema = object({
27942
28115
  totalUsedBytes: number(),
27943
28116
  devices: array(RecordingDeviceUsageSchema),
27944
28117
  /**
28118
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
28119
+ * disks (D418).
28120
+ *
28121
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
28122
+ * declared no ledger and the recorder REFUSED rather than answering the
28123
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
28124
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
28125
+ * and its rows are residency.
28126
+ */
28127
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
28128
+ /**
27945
28129
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
27946
28130
  * of the payload without it: the hub serves this method through a BAKED
27947
28131
  * router, so a hub whose framework train predates a change to this array
@@ -28102,7 +28286,14 @@ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
28102
28286
  method(object({
28103
28287
  deviceId: number(),
28104
28288
  fromMs: number(),
28105
- toMs: number()
28289
+ toMs: number(),
28290
+ /**
28291
+ * Answer for THIS profile instead of the preferred one (D433). Absent
28292
+ * keeps the timeline's behaviour — one bar, one profile, one set of
28293
+ * reads. `profilesWithFootage` on the answer says what may be asked
28294
+ * for.
28295
+ */
28296
+ profile: string().optional()
28106
28297
  }), RecordingAvailabilitySchema, {
28107
28298
  kind: "query",
28108
28299
  auth: "protected"
@@ -30433,7 +30624,7 @@ function toDeviceSummary(device, addonId) {
30433
30624
  };
30434
30625
  }
30435
30626
  /**
30436
- * Base class for device-provider addons (rtsp, onvif, frigate).
30627
+ * Base class for device-provider addons (rtsp, onvif).
30437
30628
  *
30438
30629
  * Provides default implementations for the common device-provider cap
30439
30630
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -35155,6 +35346,24 @@ Object.freeze({
35155
35346
  addonId: null,
35156
35347
  access: "view"
35157
35348
  },
35349
+ "pipelineRunner.getParkedTrackFrame": {
35350
+ capName: "pipeline-runner",
35351
+ capScope: "system",
35352
+ addonId: null,
35353
+ access: "view"
35354
+ },
35355
+ "pipelineRunner.parkTrackFrame": {
35356
+ capName: "pipeline-runner",
35357
+ capScope: "system",
35358
+ addonId: null,
35359
+ access: "create"
35360
+ },
35361
+ "pipelineRunner.releaseParkedTrackFrames": {
35362
+ capName: "pipeline-runner",
35363
+ capScope: "system",
35364
+ addonId: null,
35365
+ access: "create"
35366
+ },
35158
35367
  "pipelineRunner.reportMotion": {
35159
35368
  capName: "pipeline-runner",
35160
35369
  capScope: "system",
@@ -38432,6 +38641,21 @@ Object.freeze({
38432
38641
  form: "single",
38433
38642
  optional: false
38434
38643
  }],
38644
+ "pipelineRunner.getParkedTrackFrame": [{
38645
+ name: "deviceId",
38646
+ form: "single",
38647
+ optional: false
38648
+ }],
38649
+ "pipelineRunner.parkTrackFrame": [{
38650
+ name: "deviceId",
38651
+ form: "single",
38652
+ optional: false
38653
+ }],
38654
+ "pipelineRunner.releaseParkedTrackFrames": [{
38655
+ name: "deviceId",
38656
+ form: "single",
38657
+ optional: false
38658
+ }],
38435
38659
  "pipelineRunner.reportMotion": [{
38436
38660
  name: "deviceId",
38437
38661
  form: "single",
@@ -39123,7 +39347,7 @@ var PreviewTextField = string().max(200);
39123
39347
  * Whether the notification's preview is a STILL or a short animation.
39124
39348
  *
39125
39349
  * 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
39350
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
39127
39351
  * night reads better as three seconds of motion than as one frame of it. Both
39128
39352
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
39129
39353
  * 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
  /**
@@ -19593,7 +19628,17 @@ var EventDensityBucketSchema = object({
19593
19628
  bucketStart: number(),
19594
19629
  motion: number().int(),
19595
19630
  object: number().int(),
19596
- audio: number().int()
19631
+ audio: number().int(),
19632
+ /**
19633
+ * Energy-weighted mean dBFS of the audio events in this bucket — the LEVEL,
19634
+ * as opposed to `audio`, which is their COUNT (D431).
19635
+ *
19636
+ * ABSENT when the bucket holds no audio event. Absence means "nothing was
19637
+ * measured", which is not the same claim as silence, and a lane that cannot
19638
+ * tell them apart paints a quiet hour at full scale — which is exactly what
19639
+ * the count-on-a-level-meter did.
19640
+ */
19641
+ audioDbfs: number().optional()
19597
19642
  });
19598
19643
  /**
19599
19644
  * One camera's row in a `getEventDensityBatch` answer.
@@ -20240,6 +20285,60 @@ var NativeCropResultSchema = object({
20240
20285
  */
20241
20286
  tier: _enum(["native", "ram-fullframe"]).optional()
20242
20287
  });
20288
+ /**
20289
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20290
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20291
+ *
20292
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20293
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20294
+ * from, and what the detail plane's full-frame rung cuts from.
20295
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20296
+ * window, cut by the runner at uncapped native resolution.
20297
+ *
20298
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20299
+ */
20300
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20301
+ /**
20302
+ * Why a park did NOT happen. Every one is logged on the runner with
20303
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20304
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20305
+ * never a reason to retry in a loop.
20306
+ *
20307
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20308
+ * registered, past the lease bound, or the worker released it). `detail`
20309
+ * carries the runner's own miss reason.
20310
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20311
+ */
20312
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20313
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20314
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20315
+ parked: literal(true),
20316
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20317
+ nodeId: string(),
20318
+ width: number().int().positive(),
20319
+ height: number().int().positive(),
20320
+ /** JPEG bytes the parcel costs on the node. */
20321
+ bytes: number().int().nonnegative(),
20322
+ /** Whether this park replaced a parcel already held for the key. */
20323
+ replaced: boolean()
20324
+ }), object({
20325
+ parked: literal(false),
20326
+ nodeId: string(),
20327
+ reason: ParkRefusalSchema,
20328
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20329
+ handleAgeMs: number().nullable(),
20330
+ detail: string().optional()
20331
+ })]);
20332
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20333
+ var ParkedTrackFrameSchema = object({
20334
+ jpeg: string(),
20335
+ width: number().int().positive(),
20336
+ height: number().int().positive(),
20337
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20338
+ timestamp: number(),
20339
+ /** When the node stored it (the node's clock). */
20340
+ parkedAt: number()
20341
+ });
20243
20342
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20244
20343
  * originating detection, in FRAME-space coordinates. Reuses
20245
20344
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20629,7 +20728,7 @@ var RunnerCameraConfigSchema = object({
20629
20728
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20630
20729
  * analyzer providers) running on decoded frames in this runner.
20631
20730
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20632
- * analytics, Frigate motion). The provider emits ProviderMotion
20731
+ * analytics). The provider emits ProviderMotion
20633
20732
  * events; the orchestrator forwards to `reportMotion`.
20634
20733
  */
20635
20734
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -20871,7 +20970,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
20871
20970
  className: string(),
20872
20971
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
20873
20972
  sourceDeviceId: number()
20874
- }), RunStatelessStepResultSchema, { kind: "mutation" });
20973
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
20974
+ deviceId: number(),
20975
+ /** Opaque to the runner — the hub's track id. */
20976
+ trackId: string(),
20977
+ kind: ParkedFrameKindSchema,
20978
+ handle: FrameHandleSchema,
20979
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
20980
+ bbox: NativeCropBboxSchema,
20981
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
20982
+ maxWidth: number().int().positive().optional(),
20983
+ /** The frame instant (caller's clock) — orders parks for one key. */
20984
+ timestamp: number()
20985
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
20986
+ deviceId: number(),
20987
+ trackId: string(),
20988
+ kind: ParkedFrameKindSchema
20989
+ }), ParkedTrackFrameSchema.nullable()), method(object({
20990
+ deviceId: number(),
20991
+ trackId: string()
20992
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
20875
20993
  var CameraPipelineConfigSchema = object({
20876
20994
  engine: PipelineEngineChoiceSchema.optional(),
20877
20995
  steps: array(PipelineStepInputSchema).readonly(),
@@ -23904,7 +24022,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
23904
24022
  *
23905
24023
  * Implementations:
23906
24024
  * - Each camera-providing addon registers this cap natively per
23907
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24025
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
23908
24026
  * - Returns a snapshot from the persisted device config blob — no
23909
24027
  * extra round-trip to the camera, no probing.
23910
24028
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -25290,7 +25408,7 @@ var AvailableIntegrationTypeSchema = object({
25290
25408
  * Which integration-marker cap the addon declared, so the wizard can
25291
25409
  * branch on CAP — never on addon name. `device-adoption` integrations
25292
25410
  * (Home Assistant, …) route through the broker step (Approach A);
25293
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
25411
+ * `device-provider` integrations (Reolink/ONVIF) keep the
25294
25412
  * legacy config → discovery flow.
25295
25413
  */
25296
25414
  kind: _enum(["device-adoption", "device-provider"]),
@@ -27833,7 +27951,23 @@ var RecordingRangeSchema = object({
27833
27951
  });
27834
27952
  var RecordingAvailabilitySchema = object({
27835
27953
  deviceId: number(),
27836
- ranges: array(RecordingRangeSchema)
27954
+ ranges: array(RecordingRangeSchema),
27955
+ /**
27956
+ * Every profile this camera has footage in — not only the one `ranges`
27957
+ * describes (D433).
27958
+ *
27959
+ * `ranges` answers for ONE profile by design: the timeline is a single bar,
27960
+ * and enumerating all of them triples the directory reads for a bar that
27961
+ * would look identical. But the answer used to say nothing about that, so a
27962
+ * caller asking "what can I export?" read the single preferred profile as
27963
+ * the only one that exists — on this deployment every camera records `high`
27964
+ * AND `low`, the low tree holding 14 GB for camera 615 alone, and the export
27965
+ * UI could not see it.
27966
+ *
27967
+ * Cheap: it is the same shallow directory read the profile CHOICE already
27968
+ * makes. Ask for a specific profile's ranges with the `profile` input.
27969
+ */
27970
+ profilesWithFootage: array(string())
27837
27971
  });
27838
27972
  var RecordingDaysSchema = object({
27839
27973
  deviceId: number(),
@@ -27859,7 +27993,11 @@ var RecordingDaysSchema = object({
27859
27993
  var RecordingAvailabilityForDeviceSchema = object({
27860
27994
  deviceId: number(),
27861
27995
  read: _enum(["read", "unreadable"]),
27862
- ranges: array(RecordingRangeSchema).readonly()
27996
+ ranges: array(RecordingRangeSchema).readonly(),
27997
+ /** Same field, same meaning, as the singular answer (D433). A row that
27998
+ * dropped it would tell a grid caller the archive holds one profile.
27999
+ * Empty on an `'unreadable'` row: nobody looked. */
28000
+ profilesWithFootage: array(string()).readonly()
27863
28001
  });
27864
28002
  /**
27865
28003
  * One camera's row in a `getDaysWithRecordingsBatch` answer. Same rule as
@@ -27889,13 +28027,31 @@ var RecordingManifestSchema = object({
27889
28027
  */
27890
28028
  playbackEndpoints: array(string())
27891
28029
  });
27892
- /** Recording storage usage for one camera (bytes on disk across all its
27893
- * profiles/subtrees/locations on this node). */
28030
+ /**
28031
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
28032
+ * across every profile and every resolvable location on this node.
28033
+ *
28034
+ * ## Archive vs residency, which is the whole point of this shape (D418)
28035
+ *
28036
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
28037
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
28038
+ * this camera writes to, so the two can be added up and compared.
28039
+ *
28040
+ * They were not always. Until D418 this row came from the recorder's in-RAM
28041
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
28042
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
28043
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
28044
+ * that said otherwise, and two people read it as retention eating recent
28045
+ * footage. Residency is still reported, under `residentBytes` /
28046
+ * `residentOldestMs`, which answer a different question and say so.
28047
+ */
27894
28048
  var RecordingDeviceUsageSchema = object({
27895
28049
  deviceId: number(),
28050
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
28051
+ * recordings locations. */
27896
28052
  usedBytes: number(),
27897
28053
  /**
27898
- * Start of this camera's OLDEST indexed segment, across every profile and
28054
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
27899
28055
  * location — the "Oldest footage" column in Recordings → Storage, and the
27900
28056
  * only honest answer to "is retention actually holding?" per camera.
27901
28057
  *
@@ -27905,7 +28061,24 @@ var RecordingDeviceUsageSchema = object({
27905
28061
  * (types) and the addon ship on different trains, and the addon is usually
27906
28062
  * the later of the two.
27907
28063
  */
27908
- oldestMs: number().nullable().optional()
28064
+ oldestMs: number().nullable().optional(),
28065
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
28066
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
28067
+ segments: number().optional(),
28068
+ /**
28069
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
28070
+ * its RAM index — the live tail plus the hours a reader hydrated.
28071
+ *
28072
+ * It answers "what can be served without touching the disk", never "how much
28073
+ * footage this camera has". A UI that renders it must label it as such, and
28074
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
28075
+ * it, and so does a node whose ledger could not answer.
28076
+ */
28077
+ residentBytes: number().optional(),
28078
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
28079
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
28080
+ * retention. `null` = nothing resident. */
28081
+ residentOldestMs: number().nullable().optional()
27909
28082
  });
27910
28083
  /** Recording storage usage + capacity for one storage location. */
27911
28084
  var RecordingLocationUsageSchema = object({
@@ -27943,6 +28116,17 @@ var RecordingStorageUsageSchema = object({
27943
28116
  totalUsedBytes: number(),
27944
28117
  devices: array(RecordingDeviceUsageSchema),
27945
28118
  /**
28119
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
28120
+ * disks (D418).
28121
+ *
28122
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
28123
+ * declared no ledger and the recorder REFUSED rather than answering the
28124
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
28125
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
28126
+ * and its rows are residency.
28127
+ */
28128
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
28129
+ /**
27946
28130
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
27947
28131
  * of the payload without it: the hub serves this method through a BAKED
27948
28132
  * router, so a hub whose framework train predates a change to this array
@@ -28103,7 +28287,14 @@ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
28103
28287
  method(object({
28104
28288
  deviceId: number(),
28105
28289
  fromMs: number(),
28106
- toMs: number()
28290
+ toMs: number(),
28291
+ /**
28292
+ * Answer for THIS profile instead of the preferred one (D433). Absent
28293
+ * keeps the timeline's behaviour — one bar, one profile, one set of
28294
+ * reads. `profilesWithFootage` on the answer says what may be asked
28295
+ * for.
28296
+ */
28297
+ profile: string().optional()
28107
28298
  }), RecordingAvailabilitySchema, {
28108
28299
  kind: "query",
28109
28300
  auth: "protected"
@@ -30434,7 +30625,7 @@ function toDeviceSummary(device, addonId) {
30434
30625
  };
30435
30626
  }
30436
30627
  /**
30437
- * Base class for device-provider addons (rtsp, onvif, frigate).
30628
+ * Base class for device-provider addons (rtsp, onvif).
30438
30629
  *
30439
30630
  * Provides default implementations for the common device-provider cap
30440
30631
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -35156,6 +35347,24 @@ Object.freeze({
35156
35347
  addonId: null,
35157
35348
  access: "view"
35158
35349
  },
35350
+ "pipelineRunner.getParkedTrackFrame": {
35351
+ capName: "pipeline-runner",
35352
+ capScope: "system",
35353
+ addonId: null,
35354
+ access: "view"
35355
+ },
35356
+ "pipelineRunner.parkTrackFrame": {
35357
+ capName: "pipeline-runner",
35358
+ capScope: "system",
35359
+ addonId: null,
35360
+ access: "create"
35361
+ },
35362
+ "pipelineRunner.releaseParkedTrackFrames": {
35363
+ capName: "pipeline-runner",
35364
+ capScope: "system",
35365
+ addonId: null,
35366
+ access: "create"
35367
+ },
35159
35368
  "pipelineRunner.reportMotion": {
35160
35369
  capName: "pipeline-runner",
35161
35370
  capScope: "system",
@@ -38433,6 +38642,21 @@ Object.freeze({
38433
38642
  form: "single",
38434
38643
  optional: false
38435
38644
  }],
38645
+ "pipelineRunner.getParkedTrackFrame": [{
38646
+ name: "deviceId",
38647
+ form: "single",
38648
+ optional: false
38649
+ }],
38650
+ "pipelineRunner.parkTrackFrame": [{
38651
+ name: "deviceId",
38652
+ form: "single",
38653
+ optional: false
38654
+ }],
38655
+ "pipelineRunner.releaseParkedTrackFrames": [{
38656
+ name: "deviceId",
38657
+ form: "single",
38658
+ optional: false
38659
+ }],
38436
38660
  "pipelineRunner.reportMotion": [{
38437
38661
  name: "deviceId",
38438
38662
  form: "single",
@@ -39124,7 +39348,7 @@ var PreviewTextField = string().max(200);
39124
39348
  * Whether the notification's preview is a STILL or a short animation.
39125
39349
  *
39126
39350
  * 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
39351
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
39128
39352
  * night reads better as three seconds of motion than as one frame of it. Both
39129
39353
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
39130
39354
  * 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.92",
4
4
  "description": "ONVIF camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",