@camstack/addon-provider-unifi 0.2.89 → 0.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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
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.
@@ -12625,7 +12624,7 @@ DeviceType.Camera;
12625
12624
  var SourceInfoSchema = object({
12626
12625
  /** Live dispatch key — mutable when the source system allows rename. */
12627
12626
  id: string(),
12628
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12627
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12629
12628
  system: string(),
12630
12629
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12631
12630
  * Used to detect rename when `id` changes. */
@@ -12638,7 +12637,7 @@ var SourceInfoSchema = object({
12638
12637
  /**
12639
12638
  * Build the synthetic SourceInfo every existing provider falls back to
12640
12639
  * when no upstream value has been persisted. Keeps non-migrated providers
12641
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12640
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12642
12641
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12643
12642
  * id. Real upstream identity replaces this once a provider migrates and
12644
12643
  * calls `updateSourceInfo()` with concrete values.
@@ -13300,7 +13299,7 @@ var deviceProviderCapability = {
13300
13299
  * - `device-management.router.ts` (deleted in Phase 2)
13301
13300
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13302
13301
  *
13303
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13302
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13304
13303
  * fork into separate processes but never run on remote cluster agents. Therefore:
13305
13304
  * - No nodeId routing needed — this is a pure hub singleton.
13306
13305
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17348,7 +17347,7 @@ var NcRuleInputSchema = object({
17348
17347
  * The measured seven-person arrival on device 590 spans 110 s with every
17349
17348
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17350
17349
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17351
- * 30 is Frigate's shipped value for the same decision.
17350
+ * 30 s is a widely shipped value for the same decision.
17352
17351
  *
17353
17352
  * ### What it replaces
17354
17353
  *
@@ -19430,6 +19429,13 @@ var ZoneCrossingSchema = object({
19430
19429
  /** Zone display name at crossing time (falls back to the id). */
19431
19430
  zoneName: string().optional()
19432
19431
  });
19432
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19433
+ var ZoneOverlapSchema = object({
19434
+ zoneId: string(),
19435
+ zoneName: string().optional(),
19436
+ /** Percentage of the BOX area inside the zone, 0–100. */
19437
+ overlapPct: number()
19438
+ });
19433
19439
  var ObjectEventSchema = object({
19434
19440
  ...BaseEventFields,
19435
19441
  kind: literal("object"),
@@ -19454,6 +19460,35 @@ var ObjectEventSchema = object({
19454
19460
  bbox: BoundingBoxSchema.optional(),
19455
19461
  /** Heavy JSON — omitted in slim projection. */
19456
19462
  zones: array(string()).readonly().optional(),
19463
+ /**
19464
+ * How far inside each stamped zone the box actually was, as a percentage of
19465
+ * the BOX area.
19466
+ *
19467
+ * Membership alone cannot express "at least a third of it inside", which is
19468
+ * the bar an operator argues with — and the number already existed: the
19469
+ * engine computed it, the pipeline logged it, and then discarded it. It
19470
+ * matters most on the events that carry no track, where a rule has nothing
19471
+ * else to judge by.
19472
+ */
19473
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19474
+ /**
19475
+ * Present when this event describes a detection the TRACKER refused, so it
19476
+ * has no track and never will.
19477
+ *
19478
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19479
+ * NOW?"; tracking answers a different question ("is this the same subject as
19480
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19481
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19482
+ * seconds with three different candidate ids — seven analysed frames in the
19483
+ * window, the subject in a handful of them, metres apart — and produced no
19484
+ * event at all.
19485
+ *
19486
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19487
+ * with no track and no reason is indistinguishable from a track whose media
19488
+ * went missing, and a consumer that asks this one for a best shot or a
19489
+ * history is asking for something that never existed.
19490
+ */
19491
+ spawnRefused: string().optional(),
19457
19492
  /** Omitted in slim projection. */
19458
19493
  state: TrackStateSchema.optional(),
19459
19494
  /**
@@ -20527,6 +20562,60 @@ var NativeCropResultSchema = object({
20527
20562
  */
20528
20563
  tier: _enum(["native", "ram-fullframe"]).optional()
20529
20564
  });
20565
+ /**
20566
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20567
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20568
+ *
20569
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20570
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20571
+ * from, and what the detail plane's full-frame rung cuts from.
20572
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20573
+ * window, cut by the runner at uncapped native resolution.
20574
+ *
20575
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20576
+ */
20577
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20578
+ /**
20579
+ * Why a park did NOT happen. Every one is logged on the runner with
20580
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20581
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20582
+ * never a reason to retry in a loop.
20583
+ *
20584
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20585
+ * registered, past the lease bound, or the worker released it). `detail`
20586
+ * carries the runner's own miss reason.
20587
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20588
+ */
20589
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20590
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20591
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20592
+ parked: literal(true),
20593
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20594
+ nodeId: string(),
20595
+ width: number().int().positive(),
20596
+ height: number().int().positive(),
20597
+ /** JPEG bytes the parcel costs on the node. */
20598
+ bytes: number().int().nonnegative(),
20599
+ /** Whether this park replaced a parcel already held for the key. */
20600
+ replaced: boolean()
20601
+ }), object({
20602
+ parked: literal(false),
20603
+ nodeId: string(),
20604
+ reason: ParkRefusalSchema,
20605
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20606
+ handleAgeMs: number().nullable(),
20607
+ detail: string().optional()
20608
+ })]);
20609
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20610
+ var ParkedTrackFrameSchema = object({
20611
+ jpeg: string(),
20612
+ width: number().int().positive(),
20613
+ height: number().int().positive(),
20614
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20615
+ timestamp: number(),
20616
+ /** When the node stored it (the node's clock). */
20617
+ parkedAt: number()
20618
+ });
20530
20619
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20531
20620
  * originating detection, in FRAME-space coordinates. Reuses
20532
20621
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20916,7 +21005,7 @@ var RunnerCameraConfigSchema = object({
20916
21005
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20917
21006
  * analyzer providers) running on decoded frames in this runner.
20918
21007
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20919
- * analytics, Frigate motion). The provider emits ProviderMotion
21008
+ * analytics). The provider emits ProviderMotion
20920
21009
  * events; the orchestrator forwards to `reportMotion`.
20921
21010
  */
20922
21011
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21158,7 +21247,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21158
21247
  className: string(),
21159
21248
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21160
21249
  sourceDeviceId: number()
21161
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21250
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21251
+ deviceId: number(),
21252
+ /** Opaque to the runner — the hub's track id. */
21253
+ trackId: string(),
21254
+ kind: ParkedFrameKindSchema,
21255
+ handle: FrameHandleSchema,
21256
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21257
+ bbox: NativeCropBboxSchema,
21258
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21259
+ maxWidth: number().int().positive().optional(),
21260
+ /** The frame instant (caller's clock) — orders parks for one key. */
21261
+ timestamp: number()
21262
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21263
+ deviceId: number(),
21264
+ trackId: string(),
21265
+ kind: ParkedFrameKindSchema
21266
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21267
+ deviceId: number(),
21268
+ trackId: string()
21269
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21162
21270
  var CameraPipelineConfigSchema = object({
21163
21271
  engine: PipelineEngineChoiceSchema.optional(),
21164
21272
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24228,8 +24336,8 @@ onStatusChanged: { data: object({
24228
24336
  /**
24229
24337
  * Runtime-state slice — every provider that registers this cap
24230
24338
  * stores the same shape under `device.runtimeState[battery]`.
24231
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24232
- * proxy, an ONVIF battery cam all read/write the same keys.
24339
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24340
+ * an ONVIF battery cam all read/write the same keys.
24233
24341
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24234
24342
  * via `device.runtimeState.getCapState('battery')` regardless of
24235
24343
  * the underlying driver.
@@ -24379,7 +24487,7 @@ var buttonCapability = {
24379
24487
  *
24380
24488
  * Implementations:
24381
24489
  * - Each camera-providing addon registers this cap natively per
24382
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24490
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24383
24491
  * - Returns a snapshot from the persisted device config blob — no
24384
24492
  * extra round-trip to the camera, no probing.
24385
24493
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26471,7 +26579,7 @@ var AvailableIntegrationTypeSchema = object({
26471
26579
  * Which integration-marker cap the addon declared, so the wizard can
26472
26580
  * branch on CAP — never on addon name. `device-adoption` integrations
26473
26581
  * (Home Assistant, …) route through the broker step (Approach A);
26474
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26582
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26475
26583
  * legacy config → discovery flow.
26476
26584
  */
26477
26585
  kind: _enum(["device-adoption", "device-provider"]),
@@ -29895,13 +30003,31 @@ var RecordingManifestSchema = object({
29895
30003
  */
29896
30004
  playbackEndpoints: array(string())
29897
30005
  });
29898
- /** Recording storage usage for one camera (bytes on disk across all its
29899
- * profiles/subtrees/locations on this node). */
30006
+ /**
30007
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30008
+ * across every profile and every resolvable location on this node.
30009
+ *
30010
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30011
+ *
30012
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30013
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30014
+ * this camera writes to, so the two can be added up and compared.
30015
+ *
30016
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30017
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30018
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30019
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30020
+ * that said otherwise, and two people read it as retention eating recent
30021
+ * footage. Residency is still reported, under `residentBytes` /
30022
+ * `residentOldestMs`, which answer a different question and say so.
30023
+ */
29900
30024
  var RecordingDeviceUsageSchema = object({
29901
30025
  deviceId: number(),
30026
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30027
+ * recordings locations. */
29902
30028
  usedBytes: number(),
29903
30029
  /**
29904
- * Start of this camera's OLDEST indexed segment, across every profile and
30030
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
29905
30031
  * location — the "Oldest footage" column in Recordings → Storage, and the
29906
30032
  * only honest answer to "is retention actually holding?" per camera.
29907
30033
  *
@@ -29911,7 +30037,24 @@ var RecordingDeviceUsageSchema = object({
29911
30037
  * (types) and the addon ship on different trains, and the addon is usually
29912
30038
  * the later of the two.
29913
30039
  */
29914
- oldestMs: number().nullable().optional()
30040
+ oldestMs: number().nullable().optional(),
30041
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30042
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30043
+ segments: number().optional(),
30044
+ /**
30045
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30046
+ * its RAM index — the live tail plus the hours a reader hydrated.
30047
+ *
30048
+ * It answers "what can be served without touching the disk", never "how much
30049
+ * footage this camera has". A UI that renders it must label it as such, and
30050
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30051
+ * it, and so does a node whose ledger could not answer.
30052
+ */
30053
+ residentBytes: number().optional(),
30054
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30055
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30056
+ * retention. `null` = nothing resident. */
30057
+ residentOldestMs: number().nullable().optional()
29915
30058
  });
29916
30059
  /** Recording storage usage + capacity for one storage location. */
29917
30060
  var RecordingLocationUsageSchema = object({
@@ -29949,6 +30092,17 @@ var RecordingStorageUsageSchema = object({
29949
30092
  totalUsedBytes: number(),
29950
30093
  devices: array(RecordingDeviceUsageSchema),
29951
30094
  /**
30095
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30096
+ * disks (D418).
30097
+ *
30098
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30099
+ * declared no ledger and the recorder REFUSED rather than answering the
30100
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30101
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30102
+ * and its rows are residency.
30103
+ */
30104
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30105
+ /**
29952
30106
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
29953
30107
  * of the payload without it: the hub serves this method through a BAKED
29954
30108
  * router, so a hub whose framework train predates a change to this array
@@ -33828,7 +33982,7 @@ function toDeviceSummary(device, addonId) {
33828
33982
  };
33829
33983
  }
33830
33984
  /**
33831
- * Base class for device-provider addons (rtsp, onvif, frigate).
33985
+ * Base class for device-provider addons (rtsp, onvif).
33832
33986
  *
33833
33987
  * Provides default implementations for the common device-provider cap
33834
33988
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -38484,6 +38638,24 @@ Object.freeze({
38484
38638
  addonId: null,
38485
38639
  access: "view"
38486
38640
  },
38641
+ "pipelineRunner.getParkedTrackFrame": {
38642
+ capName: "pipeline-runner",
38643
+ capScope: "system",
38644
+ addonId: null,
38645
+ access: "view"
38646
+ },
38647
+ "pipelineRunner.parkTrackFrame": {
38648
+ capName: "pipeline-runner",
38649
+ capScope: "system",
38650
+ addonId: null,
38651
+ access: "create"
38652
+ },
38653
+ "pipelineRunner.releaseParkedTrackFrames": {
38654
+ capName: "pipeline-runner",
38655
+ capScope: "system",
38656
+ addonId: null,
38657
+ access: "create"
38658
+ },
38487
38659
  "pipelineRunner.reportMotion": {
38488
38660
  capName: "pipeline-runner",
38489
38661
  capScope: "system",
@@ -41761,6 +41933,21 @@ Object.freeze({
41761
41933
  form: "single",
41762
41934
  optional: false
41763
41935
  }],
41936
+ "pipelineRunner.getParkedTrackFrame": [{
41937
+ name: "deviceId",
41938
+ form: "single",
41939
+ optional: false
41940
+ }],
41941
+ "pipelineRunner.parkTrackFrame": [{
41942
+ name: "deviceId",
41943
+ form: "single",
41944
+ optional: false
41945
+ }],
41946
+ "pipelineRunner.releaseParkedTrackFrames": [{
41947
+ name: "deviceId",
41948
+ form: "single",
41949
+ optional: false
41950
+ }],
41764
41951
  "pipelineRunner.reportMotion": [{
41765
41952
  name: "deviceId",
41766
41953
  form: "single",
@@ -42452,7 +42639,7 @@ var PreviewTextField = string().max(200);
42452
42639
  * Whether the notification's preview is a STILL or a short animation.
42453
42640
  *
42454
42641
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
42455
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
42642
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
42456
42643
  * night reads better as three seconds of motion than as one frame of it. Both
42457
42644
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
42458
42645
  * simply applies it to a dozen frames sampled across the render and assembles
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-CnLqLOKs.mjs
1
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -590,7 +590,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
590
590
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
591
591
  */
592
592
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
593
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
594
593
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
595
594
  /**
596
595
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12624,7 +12623,7 @@ DeviceType.Camera;
12624
12623
  var SourceInfoSchema = object({
12625
12624
  /** Live dispatch key — mutable when the source system allows rename. */
12626
12625
  id: string(),
12627
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12626
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12628
12627
  system: string(),
12629
12628
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12630
12629
  * Used to detect rename when `id` changes. */
@@ -12637,7 +12636,7 @@ var SourceInfoSchema = object({
12637
12636
  /**
12638
12637
  * Build the synthetic SourceInfo every existing provider falls back to
12639
12638
  * when no upstream value has been persisted. Keeps non-migrated providers
12640
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12639
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12641
12640
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12642
12641
  * id. Real upstream identity replaces this once a provider migrates and
12643
12642
  * calls `updateSourceInfo()` with concrete values.
@@ -13299,7 +13298,7 @@ var deviceProviderCapability = {
13299
13298
  * - `device-management.router.ts` (deleted in Phase 2)
13300
13299
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13301
13300
  *
13302
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13301
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13303
13302
  * fork into separate processes but never run on remote cluster agents. Therefore:
13304
13303
  * - No nodeId routing needed — this is a pure hub singleton.
13305
13304
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17347,7 +17346,7 @@ var NcRuleInputSchema = object({
17347
17346
  * The measured seven-person arrival on device 590 spans 110 s with every
17348
17347
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17349
17348
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17350
- * 30 is Frigate's shipped value for the same decision.
17349
+ * 30 s is a widely shipped value for the same decision.
17351
17350
  *
17352
17351
  * ### What it replaces
17353
17352
  *
@@ -19429,6 +19428,13 @@ var ZoneCrossingSchema = object({
19429
19428
  /** Zone display name at crossing time (falls back to the id). */
19430
19429
  zoneName: string().optional()
19431
19430
  });
19431
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19432
+ var ZoneOverlapSchema = object({
19433
+ zoneId: string(),
19434
+ zoneName: string().optional(),
19435
+ /** Percentage of the BOX area inside the zone, 0–100. */
19436
+ overlapPct: number()
19437
+ });
19432
19438
  var ObjectEventSchema = object({
19433
19439
  ...BaseEventFields,
19434
19440
  kind: literal("object"),
@@ -19453,6 +19459,35 @@ var ObjectEventSchema = object({
19453
19459
  bbox: BoundingBoxSchema.optional(),
19454
19460
  /** Heavy JSON — omitted in slim projection. */
19455
19461
  zones: array(string()).readonly().optional(),
19462
+ /**
19463
+ * How far inside each stamped zone the box actually was, as a percentage of
19464
+ * the BOX area.
19465
+ *
19466
+ * Membership alone cannot express "at least a third of it inside", which is
19467
+ * the bar an operator argues with — and the number already existed: the
19468
+ * engine computed it, the pipeline logged it, and then discarded it. It
19469
+ * matters most on the events that carry no track, where a rule has nothing
19470
+ * else to judge by.
19471
+ */
19472
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19473
+ /**
19474
+ * Present when this event describes a detection the TRACKER refused, so it
19475
+ * has no track and never will.
19476
+ *
19477
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19478
+ * NOW?"; tracking answers a different question ("is this the same subject as
19479
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19480
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19481
+ * seconds with three different candidate ids — seven analysed frames in the
19482
+ * window, the subject in a handful of them, metres apart — and produced no
19483
+ * event at all.
19484
+ *
19485
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19486
+ * with no track and no reason is indistinguishable from a track whose media
19487
+ * went missing, and a consumer that asks this one for a best shot or a
19488
+ * history is asking for something that never existed.
19489
+ */
19490
+ spawnRefused: string().optional(),
19456
19491
  /** Omitted in slim projection. */
19457
19492
  state: TrackStateSchema.optional(),
19458
19493
  /**
@@ -20526,6 +20561,60 @@ var NativeCropResultSchema = object({
20526
20561
  */
20527
20562
  tier: _enum(["native", "ram-fullframe"]).optional()
20528
20563
  });
20564
+ /**
20565
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20566
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20567
+ *
20568
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20569
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20570
+ * from, and what the detail plane's full-frame rung cuts from.
20571
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20572
+ * window, cut by the runner at uncapped native resolution.
20573
+ *
20574
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20575
+ */
20576
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20577
+ /**
20578
+ * Why a park did NOT happen. Every one is logged on the runner with
20579
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20580
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20581
+ * never a reason to retry in a loop.
20582
+ *
20583
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20584
+ * registered, past the lease bound, or the worker released it). `detail`
20585
+ * carries the runner's own miss reason.
20586
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20587
+ */
20588
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20589
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20590
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20591
+ parked: literal(true),
20592
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20593
+ nodeId: string(),
20594
+ width: number().int().positive(),
20595
+ height: number().int().positive(),
20596
+ /** JPEG bytes the parcel costs on the node. */
20597
+ bytes: number().int().nonnegative(),
20598
+ /** Whether this park replaced a parcel already held for the key. */
20599
+ replaced: boolean()
20600
+ }), object({
20601
+ parked: literal(false),
20602
+ nodeId: string(),
20603
+ reason: ParkRefusalSchema,
20604
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20605
+ handleAgeMs: number().nullable(),
20606
+ detail: string().optional()
20607
+ })]);
20608
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20609
+ var ParkedTrackFrameSchema = object({
20610
+ jpeg: string(),
20611
+ width: number().int().positive(),
20612
+ height: number().int().positive(),
20613
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20614
+ timestamp: number(),
20615
+ /** When the node stored it (the node's clock). */
20616
+ parkedAt: number()
20617
+ });
20529
20618
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20530
20619
  * originating detection, in FRAME-space coordinates. Reuses
20531
20620
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20915,7 +21004,7 @@ var RunnerCameraConfigSchema = object({
20915
21004
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20916
21005
  * analyzer providers) running on decoded frames in this runner.
20917
21006
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20918
- * analytics, Frigate motion). The provider emits ProviderMotion
21007
+ * analytics). The provider emits ProviderMotion
20919
21008
  * events; the orchestrator forwards to `reportMotion`.
20920
21009
  */
20921
21010
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21157,7 +21246,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21157
21246
  className: string(),
21158
21247
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21159
21248
  sourceDeviceId: number()
21160
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21249
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21250
+ deviceId: number(),
21251
+ /** Opaque to the runner — the hub's track id. */
21252
+ trackId: string(),
21253
+ kind: ParkedFrameKindSchema,
21254
+ handle: FrameHandleSchema,
21255
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21256
+ bbox: NativeCropBboxSchema,
21257
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21258
+ maxWidth: number().int().positive().optional(),
21259
+ /** The frame instant (caller's clock) — orders parks for one key. */
21260
+ timestamp: number()
21261
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21262
+ deviceId: number(),
21263
+ trackId: string(),
21264
+ kind: ParkedFrameKindSchema
21265
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21266
+ deviceId: number(),
21267
+ trackId: string()
21268
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21161
21269
  var CameraPipelineConfigSchema = object({
21162
21270
  engine: PipelineEngineChoiceSchema.optional(),
21163
21271
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24227,8 +24335,8 @@ onStatusChanged: { data: object({
24227
24335
  /**
24228
24336
  * Runtime-state slice — every provider that registers this cap
24229
24337
  * stores the same shape under `device.runtimeState[battery]`.
24230
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24231
- * proxy, an ONVIF battery cam all read/write the same keys.
24338
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24339
+ * an ONVIF battery cam all read/write the same keys.
24232
24340
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24233
24341
  * via `device.runtimeState.getCapState('battery')` regardless of
24234
24342
  * the underlying driver.
@@ -24378,7 +24486,7 @@ var buttonCapability = {
24378
24486
  *
24379
24487
  * Implementations:
24380
24488
  * - Each camera-providing addon registers this cap natively per
24381
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24489
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24382
24490
  * - Returns a snapshot from the persisted device config blob — no
24383
24491
  * extra round-trip to the camera, no probing.
24384
24492
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26470,7 +26578,7 @@ var AvailableIntegrationTypeSchema = object({
26470
26578
  * Which integration-marker cap the addon declared, so the wizard can
26471
26579
  * branch on CAP — never on addon name. `device-adoption` integrations
26472
26580
  * (Home Assistant, …) route through the broker step (Approach A);
26473
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26581
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26474
26582
  * legacy config → discovery flow.
26475
26583
  */
26476
26584
  kind: _enum(["device-adoption", "device-provider"]),
@@ -29894,13 +30002,31 @@ var RecordingManifestSchema = object({
29894
30002
  */
29895
30003
  playbackEndpoints: array(string())
29896
30004
  });
29897
- /** Recording storage usage for one camera (bytes on disk across all its
29898
- * profiles/subtrees/locations on this node). */
30005
+ /**
30006
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30007
+ * across every profile and every resolvable location on this node.
30008
+ *
30009
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30010
+ *
30011
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30012
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30013
+ * this camera writes to, so the two can be added up and compared.
30014
+ *
30015
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30016
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30017
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30018
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30019
+ * that said otherwise, and two people read it as retention eating recent
30020
+ * footage. Residency is still reported, under `residentBytes` /
30021
+ * `residentOldestMs`, which answer a different question and say so.
30022
+ */
29899
30023
  var RecordingDeviceUsageSchema = object({
29900
30024
  deviceId: number(),
30025
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30026
+ * recordings locations. */
29901
30027
  usedBytes: number(),
29902
30028
  /**
29903
- * Start of this camera's OLDEST indexed segment, across every profile and
30029
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
29904
30030
  * location — the "Oldest footage" column in Recordings → Storage, and the
29905
30031
  * only honest answer to "is retention actually holding?" per camera.
29906
30032
  *
@@ -29910,7 +30036,24 @@ var RecordingDeviceUsageSchema = object({
29910
30036
  * (types) and the addon ship on different trains, and the addon is usually
29911
30037
  * the later of the two.
29912
30038
  */
29913
- oldestMs: number().nullable().optional()
30039
+ oldestMs: number().nullable().optional(),
30040
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30041
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30042
+ segments: number().optional(),
30043
+ /**
30044
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30045
+ * its RAM index — the live tail plus the hours a reader hydrated.
30046
+ *
30047
+ * It answers "what can be served without touching the disk", never "how much
30048
+ * footage this camera has". A UI that renders it must label it as such, and
30049
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30050
+ * it, and so does a node whose ledger could not answer.
30051
+ */
30052
+ residentBytes: number().optional(),
30053
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30054
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30055
+ * retention. `null` = nothing resident. */
30056
+ residentOldestMs: number().nullable().optional()
29914
30057
  });
29915
30058
  /** Recording storage usage + capacity for one storage location. */
29916
30059
  var RecordingLocationUsageSchema = object({
@@ -29948,6 +30091,17 @@ var RecordingStorageUsageSchema = object({
29948
30091
  totalUsedBytes: number(),
29949
30092
  devices: array(RecordingDeviceUsageSchema),
29950
30093
  /**
30094
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30095
+ * disks (D418).
30096
+ *
30097
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30098
+ * declared no ledger and the recorder REFUSED rather than answering the
30099
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30100
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30101
+ * and its rows are residency.
30102
+ */
30103
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30104
+ /**
29951
30105
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
29952
30106
  * of the payload without it: the hub serves this method through a BAKED
29953
30107
  * router, so a hub whose framework train predates a change to this array
@@ -33827,7 +33981,7 @@ function toDeviceSummary(device, addonId) {
33827
33981
  };
33828
33982
  }
33829
33983
  /**
33830
- * Base class for device-provider addons (rtsp, onvif, frigate).
33984
+ * Base class for device-provider addons (rtsp, onvif).
33831
33985
  *
33832
33986
  * Provides default implementations for the common device-provider cap
33833
33987
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -38483,6 +38637,24 @@ Object.freeze({
38483
38637
  addonId: null,
38484
38638
  access: "view"
38485
38639
  },
38640
+ "pipelineRunner.getParkedTrackFrame": {
38641
+ capName: "pipeline-runner",
38642
+ capScope: "system",
38643
+ addonId: null,
38644
+ access: "view"
38645
+ },
38646
+ "pipelineRunner.parkTrackFrame": {
38647
+ capName: "pipeline-runner",
38648
+ capScope: "system",
38649
+ addonId: null,
38650
+ access: "create"
38651
+ },
38652
+ "pipelineRunner.releaseParkedTrackFrames": {
38653
+ capName: "pipeline-runner",
38654
+ capScope: "system",
38655
+ addonId: null,
38656
+ access: "create"
38657
+ },
38486
38658
  "pipelineRunner.reportMotion": {
38487
38659
  capName: "pipeline-runner",
38488
38660
  capScope: "system",
@@ -41760,6 +41932,21 @@ Object.freeze({
41760
41932
  form: "single",
41761
41933
  optional: false
41762
41934
  }],
41935
+ "pipelineRunner.getParkedTrackFrame": [{
41936
+ name: "deviceId",
41937
+ form: "single",
41938
+ optional: false
41939
+ }],
41940
+ "pipelineRunner.parkTrackFrame": [{
41941
+ name: "deviceId",
41942
+ form: "single",
41943
+ optional: false
41944
+ }],
41945
+ "pipelineRunner.releaseParkedTrackFrames": [{
41946
+ name: "deviceId",
41947
+ form: "single",
41948
+ optional: false
41949
+ }],
41763
41950
  "pipelineRunner.reportMotion": [{
41764
41951
  name: "deviceId",
41765
41952
  form: "single",
@@ -42451,7 +42638,7 @@ var PreviewTextField = string().max(200);
42451
42638
  * Whether the notification's preview is a STILL or a short animation.
42452
42639
  *
42453
42640
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
42454
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
42641
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
42455
42642
  * night reads better as three seconds of motion than as one frame of it. Both
42456
42643
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
42457
42644
  * 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-unifi",
3
- "version": "0.2.89",
3
+ "version": "0.2.92",
4
4
  "description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
5
5
  "keywords": [
6
6
  "camstack",