@camstack/addon-provider-rtsp 1.2.90 → 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 +205 -18
  2. package/dist/addon.mjs +205 -18
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  //#endregion
24
24
  let node_net = require("node:net");
25
25
  node_net = __toESM(node_net);
26
- //#region ../types/dist/event-category-CnLqLOKs.mjs
26
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
27
27
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
28
28
  EventCategory["SystemBoot"] = "system.boot";
29
29
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -615,7 +615,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
615
615
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
616
616
  */
617
617
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
618
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
619
618
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
620
619
  /**
621
620
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12681,7 +12680,7 @@ DeviceType.Camera;
12681
12680
  var SourceInfoSchema = object({
12682
12681
  /** Live dispatch key — mutable when the source system allows rename. */
12683
12682
  id: string(),
12684
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12683
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12685
12684
  system: string(),
12686
12685
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12687
12686
  * Used to detect rename when `id` changes. */
@@ -12694,7 +12693,7 @@ var SourceInfoSchema = object({
12694
12693
  /**
12695
12694
  * Build the synthetic SourceInfo every existing provider falls back to
12696
12695
  * when no upstream value has been persisted. Keeps non-migrated providers
12697
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12696
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12698
12697
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12699
12698
  * id. Real upstream identity replaces this once a provider migrates and
12700
12699
  * calls `updateSourceInfo()` with concrete values.
@@ -13356,7 +13355,7 @@ var deviceProviderCapability = {
13356
13355
  * - `device-management.router.ts` (deleted in Phase 2)
13357
13356
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13358
13357
  *
13359
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13358
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13360
13359
  * fork into separate processes but never run on remote cluster agents. Therefore:
13361
13360
  * - No nodeId routing needed — this is a pure hub singleton.
13362
13361
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17404,7 +17403,7 @@ var NcRuleInputSchema = object({
17404
17403
  * The measured seven-person arrival on device 590 spans 110 s with every
17405
17404
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17406
17405
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17407
- * 30 is Frigate's shipped value for the same decision.
17406
+ * 30 s is a widely shipped value for the same decision.
17408
17407
  *
17409
17408
  * ### What it replaces
17410
17409
  *
@@ -19486,6 +19485,13 @@ var ZoneCrossingSchema = object({
19486
19485
  /** Zone display name at crossing time (falls back to the id). */
19487
19486
  zoneName: string().optional()
19488
19487
  });
19488
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19489
+ var ZoneOverlapSchema = object({
19490
+ zoneId: string(),
19491
+ zoneName: string().optional(),
19492
+ /** Percentage of the BOX area inside the zone, 0–100. */
19493
+ overlapPct: number()
19494
+ });
19489
19495
  var ObjectEventSchema = object({
19490
19496
  ...BaseEventFields,
19491
19497
  kind: literal("object"),
@@ -19510,6 +19516,35 @@ var ObjectEventSchema = object({
19510
19516
  bbox: BoundingBoxSchema.optional(),
19511
19517
  /** Heavy JSON — omitted in slim projection. */
19512
19518
  zones: array(string()).readonly().optional(),
19519
+ /**
19520
+ * How far inside each stamped zone the box actually was, as a percentage of
19521
+ * the BOX area.
19522
+ *
19523
+ * Membership alone cannot express "at least a third of it inside", which is
19524
+ * the bar an operator argues with — and the number already existed: the
19525
+ * engine computed it, the pipeline logged it, and then discarded it. It
19526
+ * matters most on the events that carry no track, where a rule has nothing
19527
+ * else to judge by.
19528
+ */
19529
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19530
+ /**
19531
+ * Present when this event describes a detection the TRACKER refused, so it
19532
+ * has no track and never will.
19533
+ *
19534
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19535
+ * NOW?"; tracking answers a different question ("is this the same subject as
19536
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19537
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19538
+ * seconds with three different candidate ids — seven analysed frames in the
19539
+ * window, the subject in a handful of them, metres apart — and produced no
19540
+ * event at all.
19541
+ *
19542
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19543
+ * with no track and no reason is indistinguishable from a track whose media
19544
+ * went missing, and a consumer that asks this one for a best shot or a
19545
+ * history is asking for something that never existed.
19546
+ */
19547
+ spawnRefused: string().optional(),
19513
19548
  /** Omitted in slim projection. */
19514
19549
  state: TrackStateSchema.optional(),
19515
19550
  /**
@@ -20583,6 +20618,60 @@ var NativeCropResultSchema = object({
20583
20618
  */
20584
20619
  tier: _enum(["native", "ram-fullframe"]).optional()
20585
20620
  });
20621
+ /**
20622
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20623
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20624
+ *
20625
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20626
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20627
+ * from, and what the detail plane's full-frame rung cuts from.
20628
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20629
+ * window, cut by the runner at uncapped native resolution.
20630
+ *
20631
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20632
+ */
20633
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20634
+ /**
20635
+ * Why a park did NOT happen. Every one is logged on the runner with
20636
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20637
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20638
+ * never a reason to retry in a loop.
20639
+ *
20640
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20641
+ * registered, past the lease bound, or the worker released it). `detail`
20642
+ * carries the runner's own miss reason.
20643
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20644
+ */
20645
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20646
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20647
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20648
+ parked: literal(true),
20649
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20650
+ nodeId: string(),
20651
+ width: number().int().positive(),
20652
+ height: number().int().positive(),
20653
+ /** JPEG bytes the parcel costs on the node. */
20654
+ bytes: number().int().nonnegative(),
20655
+ /** Whether this park replaced a parcel already held for the key. */
20656
+ replaced: boolean()
20657
+ }), object({
20658
+ parked: literal(false),
20659
+ nodeId: string(),
20660
+ reason: ParkRefusalSchema,
20661
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20662
+ handleAgeMs: number().nullable(),
20663
+ detail: string().optional()
20664
+ })]);
20665
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20666
+ var ParkedTrackFrameSchema = object({
20667
+ jpeg: string(),
20668
+ width: number().int().positive(),
20669
+ height: number().int().positive(),
20670
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20671
+ timestamp: number(),
20672
+ /** When the node stored it (the node's clock). */
20673
+ parkedAt: number()
20674
+ });
20586
20675
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20587
20676
  * originating detection, in FRAME-space coordinates. Reuses
20588
20677
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20972,7 +21061,7 @@ var RunnerCameraConfigSchema = object({
20972
21061
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20973
21062
  * analyzer providers) running on decoded frames in this runner.
20974
21063
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20975
- * analytics, Frigate motion). The provider emits ProviderMotion
21064
+ * analytics). The provider emits ProviderMotion
20976
21065
  * events; the orchestrator forwards to `reportMotion`.
20977
21066
  */
20978
21067
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21214,7 +21303,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21214
21303
  className: string(),
21215
21304
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21216
21305
  sourceDeviceId: number()
21217
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21306
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21307
+ deviceId: number(),
21308
+ /** Opaque to the runner — the hub's track id. */
21309
+ trackId: string(),
21310
+ kind: ParkedFrameKindSchema,
21311
+ handle: FrameHandleSchema,
21312
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21313
+ bbox: NativeCropBboxSchema,
21314
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21315
+ maxWidth: number().int().positive().optional(),
21316
+ /** The frame instant (caller's clock) — orders parks for one key. */
21317
+ timestamp: number()
21318
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21319
+ deviceId: number(),
21320
+ trackId: string(),
21321
+ kind: ParkedFrameKindSchema
21322
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21323
+ deviceId: number(),
21324
+ trackId: string()
21325
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21218
21326
  var CameraPipelineConfigSchema = object({
21219
21327
  engine: PipelineEngineChoiceSchema.optional(),
21220
21328
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24388,8 +24496,8 @@ onStatusChanged: { data: object({
24388
24496
  /**
24389
24497
  * Runtime-state slice — every provider that registers this cap
24390
24498
  * stores the same shape under `device.runtimeState[battery]`.
24391
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24392
- * proxy, an ONVIF battery cam all read/write the same keys.
24499
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24500
+ * an ONVIF battery cam all read/write the same keys.
24393
24501
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24394
24502
  * via `device.runtimeState.getCapState('battery')` regardless of
24395
24503
  * the underlying driver.
@@ -24522,7 +24630,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24522
24630
  *
24523
24631
  * Implementations:
24524
24632
  * - Each camera-providing addon registers this cap natively per
24525
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24633
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24526
24634
  * - Returns a snapshot from the persisted device config blob — no
24527
24635
  * extra round-trip to the camera, no probing.
24528
24636
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26622,7 +26730,7 @@ var AvailableIntegrationTypeSchema = object({
26622
26730
  * Which integration-marker cap the addon declared, so the wizard can
26623
26731
  * branch on CAP — never on addon name. `device-adoption` integrations
26624
26732
  * (Home Assistant, …) route through the broker step (Approach A);
26625
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26733
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26626
26734
  * legacy config → discovery flow.
26627
26735
  */
26628
26736
  kind: _enum(["device-adoption", "device-provider"]),
@@ -30046,13 +30154,31 @@ var RecordingManifestSchema = object({
30046
30154
  */
30047
30155
  playbackEndpoints: array(string())
30048
30156
  });
30049
- /** Recording storage usage for one camera (bytes on disk across all its
30050
- * profiles/subtrees/locations on this node). */
30157
+ /**
30158
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30159
+ * across every profile and every resolvable location on this node.
30160
+ *
30161
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30162
+ *
30163
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30164
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30165
+ * this camera writes to, so the two can be added up and compared.
30166
+ *
30167
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30168
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30169
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30170
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30171
+ * that said otherwise, and two people read it as retention eating recent
30172
+ * footage. Residency is still reported, under `residentBytes` /
30173
+ * `residentOldestMs`, which answer a different question and say so.
30174
+ */
30051
30175
  var RecordingDeviceUsageSchema = object({
30052
30176
  deviceId: number(),
30177
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30178
+ * recordings locations. */
30053
30179
  usedBytes: number(),
30054
30180
  /**
30055
- * Start of this camera's OLDEST indexed segment, across every profile and
30181
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
30056
30182
  * location — the "Oldest footage" column in Recordings → Storage, and the
30057
30183
  * only honest answer to "is retention actually holding?" per camera.
30058
30184
  *
@@ -30062,7 +30188,24 @@ var RecordingDeviceUsageSchema = object({
30062
30188
  * (types) and the addon ship on different trains, and the addon is usually
30063
30189
  * the later of the two.
30064
30190
  */
30065
- oldestMs: number().nullable().optional()
30191
+ oldestMs: number().nullable().optional(),
30192
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30193
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30194
+ segments: number().optional(),
30195
+ /**
30196
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30197
+ * its RAM index — the live tail plus the hours a reader hydrated.
30198
+ *
30199
+ * It answers "what can be served without touching the disk", never "how much
30200
+ * footage this camera has". A UI that renders it must label it as such, and
30201
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30202
+ * it, and so does a node whose ledger could not answer.
30203
+ */
30204
+ residentBytes: number().optional(),
30205
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30206
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30207
+ * retention. `null` = nothing resident. */
30208
+ residentOldestMs: number().nullable().optional()
30066
30209
  });
30067
30210
  /** Recording storage usage + capacity for one storage location. */
30068
30211
  var RecordingLocationUsageSchema = object({
@@ -30100,6 +30243,17 @@ var RecordingStorageUsageSchema = object({
30100
30243
  totalUsedBytes: number(),
30101
30244
  devices: array(RecordingDeviceUsageSchema),
30102
30245
  /**
30246
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30247
+ * disks (D418).
30248
+ *
30249
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30250
+ * declared no ledger and the recorder REFUSED rather than answering the
30251
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30252
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30253
+ * and its rows are residency.
30254
+ */
30255
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30256
+ /**
30103
30257
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30104
30258
  * of the payload without it: the hub serves this method through a BAKED
30105
30259
  * router, so a hub whose framework train predates a change to this array
@@ -33979,7 +34133,7 @@ function toDeviceSummary(device, addonId) {
33979
34133
  };
33980
34134
  }
33981
34135
  /**
33982
- * Base class for device-provider addons (rtsp, onvif, frigate).
34136
+ * Base class for device-provider addons (rtsp, onvif).
33983
34137
  *
33984
34138
  * Provides default implementations for the common device-provider cap
33985
34139
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -38701,6 +38855,24 @@ Object.freeze({
38701
38855
  addonId: null,
38702
38856
  access: "view"
38703
38857
  },
38858
+ "pipelineRunner.getParkedTrackFrame": {
38859
+ capName: "pipeline-runner",
38860
+ capScope: "system",
38861
+ addonId: null,
38862
+ access: "view"
38863
+ },
38864
+ "pipelineRunner.parkTrackFrame": {
38865
+ capName: "pipeline-runner",
38866
+ capScope: "system",
38867
+ addonId: null,
38868
+ access: "create"
38869
+ },
38870
+ "pipelineRunner.releaseParkedTrackFrames": {
38871
+ capName: "pipeline-runner",
38872
+ capScope: "system",
38873
+ addonId: null,
38874
+ access: "create"
38875
+ },
38704
38876
  "pipelineRunner.reportMotion": {
38705
38877
  capName: "pipeline-runner",
38706
38878
  capScope: "system",
@@ -41978,6 +42150,21 @@ Object.freeze({
41978
42150
  form: "single",
41979
42151
  optional: false
41980
42152
  }],
42153
+ "pipelineRunner.getParkedTrackFrame": [{
42154
+ name: "deviceId",
42155
+ form: "single",
42156
+ optional: false
42157
+ }],
42158
+ "pipelineRunner.parkTrackFrame": [{
42159
+ name: "deviceId",
42160
+ form: "single",
42161
+ optional: false
42162
+ }],
42163
+ "pipelineRunner.releaseParkedTrackFrames": [{
42164
+ name: "deviceId",
42165
+ form: "single",
42166
+ optional: false
42167
+ }],
41981
42168
  "pipelineRunner.reportMotion": [{
41982
42169
  name: "deviceId",
41983
42170
  form: "single",
@@ -42669,7 +42856,7 @@ var PreviewTextField = string().max(200);
42669
42856
  * Whether the notification's preview is a STILL or a short animation.
42670
42857
  *
42671
42858
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
42672
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
42859
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
42673
42860
  * night reads better as three seconds of motion than as one frame of it. Both
42674
42861
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
42675
42862
  * simply applies it to a dozen frames sampled across the render and assembles
package/dist/addon.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import net from "node:net";
2
- //#region ../types/dist/event-category-CnLqLOKs.mjs
2
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -591,7 +591,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
591
591
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
592
592
  */
593
593
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
594
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
595
594
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
596
595
  /**
597
596
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12657,7 +12656,7 @@ DeviceType.Camera;
12657
12656
  var SourceInfoSchema = object({
12658
12657
  /** Live dispatch key — mutable when the source system allows rename. */
12659
12658
  id: string(),
12660
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12659
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12661
12660
  system: string(),
12662
12661
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12663
12662
  * Used to detect rename when `id` changes. */
@@ -12670,7 +12669,7 @@ var SourceInfoSchema = object({
12670
12669
  /**
12671
12670
  * Build the synthetic SourceInfo every existing provider falls back to
12672
12671
  * when no upstream value has been persisted. Keeps non-migrated providers
12673
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12672
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12674
12673
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12675
12674
  * id. Real upstream identity replaces this once a provider migrates and
12676
12675
  * calls `updateSourceInfo()` with concrete values.
@@ -13332,7 +13331,7 @@ var deviceProviderCapability = {
13332
13331
  * - `device-management.router.ts` (deleted in Phase 2)
13333
13332
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13334
13333
  *
13335
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13334
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13336
13335
  * fork into separate processes but never run on remote cluster agents. Therefore:
13337
13336
  * - No nodeId routing needed — this is a pure hub singleton.
13338
13337
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17380,7 +17379,7 @@ var NcRuleInputSchema = object({
17380
17379
  * The measured seven-person arrival on device 590 spans 110 s with every
17381
17380
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17382
17381
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17383
- * 30 is Frigate's shipped value for the same decision.
17382
+ * 30 s is a widely shipped value for the same decision.
17384
17383
  *
17385
17384
  * ### What it replaces
17386
17385
  *
@@ -19462,6 +19461,13 @@ var ZoneCrossingSchema = object({
19462
19461
  /** Zone display name at crossing time (falls back to the id). */
19463
19462
  zoneName: string().optional()
19464
19463
  });
19464
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19465
+ var ZoneOverlapSchema = object({
19466
+ zoneId: string(),
19467
+ zoneName: string().optional(),
19468
+ /** Percentage of the BOX area inside the zone, 0–100. */
19469
+ overlapPct: number()
19470
+ });
19465
19471
  var ObjectEventSchema = object({
19466
19472
  ...BaseEventFields,
19467
19473
  kind: literal("object"),
@@ -19486,6 +19492,35 @@ var ObjectEventSchema = object({
19486
19492
  bbox: BoundingBoxSchema.optional(),
19487
19493
  /** Heavy JSON — omitted in slim projection. */
19488
19494
  zones: array(string()).readonly().optional(),
19495
+ /**
19496
+ * How far inside each stamped zone the box actually was, as a percentage of
19497
+ * the BOX area.
19498
+ *
19499
+ * Membership alone cannot express "at least a third of it inside", which is
19500
+ * the bar an operator argues with — and the number already existed: the
19501
+ * engine computed it, the pipeline logged it, and then discarded it. It
19502
+ * matters most on the events that carry no track, where a rule has nothing
19503
+ * else to judge by.
19504
+ */
19505
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19506
+ /**
19507
+ * Present when this event describes a detection the TRACKER refused, so it
19508
+ * has no track and never will.
19509
+ *
19510
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19511
+ * NOW?"; tracking answers a different question ("is this the same subject as
19512
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19513
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19514
+ * seconds with three different candidate ids — seven analysed frames in the
19515
+ * window, the subject in a handful of them, metres apart — and produced no
19516
+ * event at all.
19517
+ *
19518
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19519
+ * with no track and no reason is indistinguishable from a track whose media
19520
+ * went missing, and a consumer that asks this one for a best shot or a
19521
+ * history is asking for something that never existed.
19522
+ */
19523
+ spawnRefused: string().optional(),
19489
19524
  /** Omitted in slim projection. */
19490
19525
  state: TrackStateSchema.optional(),
19491
19526
  /**
@@ -20559,6 +20594,60 @@ var NativeCropResultSchema = object({
20559
20594
  */
20560
20595
  tier: _enum(["native", "ram-fullframe"]).optional()
20561
20596
  });
20597
+ /**
20598
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20599
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20600
+ *
20601
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20602
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20603
+ * from, and what the detail plane's full-frame rung cuts from.
20604
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20605
+ * window, cut by the runner at uncapped native resolution.
20606
+ *
20607
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20608
+ */
20609
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20610
+ /**
20611
+ * Why a park did NOT happen. Every one is logged on the runner with
20612
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20613
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20614
+ * never a reason to retry in a loop.
20615
+ *
20616
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20617
+ * registered, past the lease bound, or the worker released it). `detail`
20618
+ * carries the runner's own miss reason.
20619
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20620
+ */
20621
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20622
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20623
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20624
+ parked: literal(true),
20625
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20626
+ nodeId: string(),
20627
+ width: number().int().positive(),
20628
+ height: number().int().positive(),
20629
+ /** JPEG bytes the parcel costs on the node. */
20630
+ bytes: number().int().nonnegative(),
20631
+ /** Whether this park replaced a parcel already held for the key. */
20632
+ replaced: boolean()
20633
+ }), object({
20634
+ parked: literal(false),
20635
+ nodeId: string(),
20636
+ reason: ParkRefusalSchema,
20637
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20638
+ handleAgeMs: number().nullable(),
20639
+ detail: string().optional()
20640
+ })]);
20641
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20642
+ var ParkedTrackFrameSchema = object({
20643
+ jpeg: string(),
20644
+ width: number().int().positive(),
20645
+ height: number().int().positive(),
20646
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20647
+ timestamp: number(),
20648
+ /** When the node stored it (the node's clock). */
20649
+ parkedAt: number()
20650
+ });
20562
20651
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20563
20652
  * originating detection, in FRAME-space coordinates. Reuses
20564
20653
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20948,7 +21037,7 @@ var RunnerCameraConfigSchema = object({
20948
21037
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20949
21038
  * analyzer providers) running on decoded frames in this runner.
20950
21039
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20951
- * analytics, Frigate motion). The provider emits ProviderMotion
21040
+ * analytics). The provider emits ProviderMotion
20952
21041
  * events; the orchestrator forwards to `reportMotion`.
20953
21042
  */
20954
21043
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21190,7 +21279,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21190
21279
  className: string(),
21191
21280
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21192
21281
  sourceDeviceId: number()
21193
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21282
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21283
+ deviceId: number(),
21284
+ /** Opaque to the runner — the hub's track id. */
21285
+ trackId: string(),
21286
+ kind: ParkedFrameKindSchema,
21287
+ handle: FrameHandleSchema,
21288
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21289
+ bbox: NativeCropBboxSchema,
21290
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21291
+ maxWidth: number().int().positive().optional(),
21292
+ /** The frame instant (caller's clock) — orders parks for one key. */
21293
+ timestamp: number()
21294
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21295
+ deviceId: number(),
21296
+ trackId: string(),
21297
+ kind: ParkedFrameKindSchema
21298
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21299
+ deviceId: number(),
21300
+ trackId: string()
21301
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21194
21302
  var CameraPipelineConfigSchema = object({
21195
21303
  engine: PipelineEngineChoiceSchema.optional(),
21196
21304
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24364,8 +24472,8 @@ onStatusChanged: { data: object({
24364
24472
  /**
24365
24473
  * Runtime-state slice — every provider that registers this cap
24366
24474
  * stores the same shape under `device.runtimeState[battery]`.
24367
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24368
- * proxy, an ONVIF battery cam all read/write the same keys.
24475
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24476
+ * an ONVIF battery cam all read/write the same keys.
24369
24477
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24370
24478
  * via `device.runtimeState.getCapState('battery')` regardless of
24371
24479
  * the underlying driver.
@@ -24498,7 +24606,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24498
24606
  *
24499
24607
  * Implementations:
24500
24608
  * - Each camera-providing addon registers this cap natively per
24501
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24609
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24502
24610
  * - Returns a snapshot from the persisted device config blob — no
24503
24611
  * extra round-trip to the camera, no probing.
24504
24612
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26598,7 +26706,7 @@ var AvailableIntegrationTypeSchema = object({
26598
26706
  * Which integration-marker cap the addon declared, so the wizard can
26599
26707
  * branch on CAP — never on addon name. `device-adoption` integrations
26600
26708
  * (Home Assistant, …) route through the broker step (Approach A);
26601
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26709
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26602
26710
  * legacy config → discovery flow.
26603
26711
  */
26604
26712
  kind: _enum(["device-adoption", "device-provider"]),
@@ -30022,13 +30130,31 @@ var RecordingManifestSchema = object({
30022
30130
  */
30023
30131
  playbackEndpoints: array(string())
30024
30132
  });
30025
- /** Recording storage usage for one camera (bytes on disk across all its
30026
- * profiles/subtrees/locations on this node). */
30133
+ /**
30134
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30135
+ * across every profile and every resolvable location on this node.
30136
+ *
30137
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30138
+ *
30139
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30140
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30141
+ * this camera writes to, so the two can be added up and compared.
30142
+ *
30143
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30144
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30145
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30146
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30147
+ * that said otherwise, and two people read it as retention eating recent
30148
+ * footage. Residency is still reported, under `residentBytes` /
30149
+ * `residentOldestMs`, which answer a different question and say so.
30150
+ */
30027
30151
  var RecordingDeviceUsageSchema = object({
30028
30152
  deviceId: number(),
30153
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30154
+ * recordings locations. */
30029
30155
  usedBytes: number(),
30030
30156
  /**
30031
- * Start of this camera's OLDEST indexed segment, across every profile and
30157
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
30032
30158
  * location — the "Oldest footage" column in Recordings → Storage, and the
30033
30159
  * only honest answer to "is retention actually holding?" per camera.
30034
30160
  *
@@ -30038,7 +30164,24 @@ var RecordingDeviceUsageSchema = object({
30038
30164
  * (types) and the addon ship on different trains, and the addon is usually
30039
30165
  * the later of the two.
30040
30166
  */
30041
- oldestMs: number().nullable().optional()
30167
+ oldestMs: number().nullable().optional(),
30168
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30169
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30170
+ segments: number().optional(),
30171
+ /**
30172
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30173
+ * its RAM index — the live tail plus the hours a reader hydrated.
30174
+ *
30175
+ * It answers "what can be served without touching the disk", never "how much
30176
+ * footage this camera has". A UI that renders it must label it as such, and
30177
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30178
+ * it, and so does a node whose ledger could not answer.
30179
+ */
30180
+ residentBytes: number().optional(),
30181
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30182
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30183
+ * retention. `null` = nothing resident. */
30184
+ residentOldestMs: number().nullable().optional()
30042
30185
  });
30043
30186
  /** Recording storage usage + capacity for one storage location. */
30044
30187
  var RecordingLocationUsageSchema = object({
@@ -30076,6 +30219,17 @@ var RecordingStorageUsageSchema = object({
30076
30219
  totalUsedBytes: number(),
30077
30220
  devices: array(RecordingDeviceUsageSchema),
30078
30221
  /**
30222
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30223
+ * disks (D418).
30224
+ *
30225
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30226
+ * declared no ledger and the recorder REFUSED rather than answering the
30227
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30228
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30229
+ * and its rows are residency.
30230
+ */
30231
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30232
+ /**
30079
30233
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30080
30234
  * of the payload without it: the hub serves this method through a BAKED
30081
30235
  * router, so a hub whose framework train predates a change to this array
@@ -33955,7 +34109,7 @@ function toDeviceSummary(device, addonId) {
33955
34109
  };
33956
34110
  }
33957
34111
  /**
33958
- * Base class for device-provider addons (rtsp, onvif, frigate).
34112
+ * Base class for device-provider addons (rtsp, onvif).
33959
34113
  *
33960
34114
  * Provides default implementations for the common device-provider cap
33961
34115
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -38677,6 +38831,24 @@ Object.freeze({
38677
38831
  addonId: null,
38678
38832
  access: "view"
38679
38833
  },
38834
+ "pipelineRunner.getParkedTrackFrame": {
38835
+ capName: "pipeline-runner",
38836
+ capScope: "system",
38837
+ addonId: null,
38838
+ access: "view"
38839
+ },
38840
+ "pipelineRunner.parkTrackFrame": {
38841
+ capName: "pipeline-runner",
38842
+ capScope: "system",
38843
+ addonId: null,
38844
+ access: "create"
38845
+ },
38846
+ "pipelineRunner.releaseParkedTrackFrames": {
38847
+ capName: "pipeline-runner",
38848
+ capScope: "system",
38849
+ addonId: null,
38850
+ access: "create"
38851
+ },
38680
38852
  "pipelineRunner.reportMotion": {
38681
38853
  capName: "pipeline-runner",
38682
38854
  capScope: "system",
@@ -41954,6 +42126,21 @@ Object.freeze({
41954
42126
  form: "single",
41955
42127
  optional: false
41956
42128
  }],
42129
+ "pipelineRunner.getParkedTrackFrame": [{
42130
+ name: "deviceId",
42131
+ form: "single",
42132
+ optional: false
42133
+ }],
42134
+ "pipelineRunner.parkTrackFrame": [{
42135
+ name: "deviceId",
42136
+ form: "single",
42137
+ optional: false
42138
+ }],
42139
+ "pipelineRunner.releaseParkedTrackFrames": [{
42140
+ name: "deviceId",
42141
+ form: "single",
42142
+ optional: false
42143
+ }],
41957
42144
  "pipelineRunner.reportMotion": [{
41958
42145
  name: "deviceId",
41959
42146
  form: "single",
@@ -42645,7 +42832,7 @@ var PreviewTextField = string().max(200);
42645
42832
  * Whether the notification's preview is a STILL or a short animation.
42646
42833
  *
42647
42834
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
42648
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
42835
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
42649
42836
  * night reads better as three seconds of motion than as one frame of it. Both
42650
42837
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
42651
42838
  * 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-rtsp",
3
- "version": "1.2.90",
3
+ "version": "1.2.92",
4
4
  "description": "Generic RTSP camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",