@camstack/addon-provider-homematic 1.2.91 → 1.2.93

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
@@ -8,7 +8,7 @@ let http = require("http");
8
8
  let crypto$1 = require("crypto");
9
9
  let fs_promises = require("fs/promises");
10
10
  let path = require("path");
11
- //#region ../types/dist/event-category-CnLqLOKs.mjs
11
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
12
12
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
13
13
  EventCategory["SystemBoot"] = "system.boot";
14
14
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -600,7 +600,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
600
600
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
601
601
  */
602
602
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
603
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
604
603
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
605
604
  /**
606
605
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12683,7 +12682,7 @@ DeviceType.Camera;
12683
12682
  var SourceInfoSchema = object({
12684
12683
  /** Live dispatch key — mutable when the source system allows rename. */
12685
12684
  id: string(),
12686
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12685
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12687
12686
  system: string(),
12688
12687
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12689
12688
  * Used to detect rename when `id` changes. */
@@ -12696,7 +12695,7 @@ var SourceInfoSchema = object({
12696
12695
  /**
12697
12696
  * Build the synthetic SourceInfo every existing provider falls back to
12698
12697
  * when no upstream value has been persisted. Keeps non-migrated providers
12699
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12698
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12700
12699
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12701
12700
  * id. Real upstream identity replaces this once a provider migrates and
12702
12701
  * calls `updateSourceInfo()` with concrete values.
@@ -13375,7 +13374,7 @@ var deviceProviderCapability = {
13375
13374
  * - `device-management.router.ts` (deleted in Phase 2)
13376
13375
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13377
13376
  *
13378
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13377
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13379
13378
  * fork into separate processes but never run on remote cluster agents. Therefore:
13380
13379
  * - No nodeId routing needed — this is a pure hub singleton.
13381
13380
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17423,7 +17422,7 @@ var NcRuleInputSchema = object({
17423
17422
  * The measured seven-person arrival on device 590 spans 110 s with every
17424
17423
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17425
17424
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17426
- * 30 is Frigate's shipped value for the same decision.
17425
+ * 30 s is a widely shipped value for the same decision.
17427
17426
  *
17428
17427
  * ### What it replaces
17429
17428
  *
@@ -19505,6 +19504,13 @@ var ZoneCrossingSchema = object({
19505
19504
  /** Zone display name at crossing time (falls back to the id). */
19506
19505
  zoneName: string().optional()
19507
19506
  });
19507
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19508
+ var ZoneOverlapSchema = object({
19509
+ zoneId: string(),
19510
+ zoneName: string().optional(),
19511
+ /** Percentage of the BOX area inside the zone, 0–100. */
19512
+ overlapPct: number()
19513
+ });
19508
19514
  var ObjectEventSchema = object({
19509
19515
  ...BaseEventFields,
19510
19516
  kind: literal("object"),
@@ -19529,6 +19535,35 @@ var ObjectEventSchema = object({
19529
19535
  bbox: BoundingBoxSchema.optional(),
19530
19536
  /** Heavy JSON — omitted in slim projection. */
19531
19537
  zones: array(string()).readonly().optional(),
19538
+ /**
19539
+ * How far inside each stamped zone the box actually was, as a percentage of
19540
+ * the BOX area.
19541
+ *
19542
+ * Membership alone cannot express "at least a third of it inside", which is
19543
+ * the bar an operator argues with — and the number already existed: the
19544
+ * engine computed it, the pipeline logged it, and then discarded it. It
19545
+ * matters most on the events that carry no track, where a rule has nothing
19546
+ * else to judge by.
19547
+ */
19548
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19549
+ /**
19550
+ * Present when this event describes a detection the TRACKER refused, so it
19551
+ * has no track and never will.
19552
+ *
19553
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19554
+ * NOW?"; tracking answers a different question ("is this the same subject as
19555
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19556
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19557
+ * seconds with three different candidate ids — seven analysed frames in the
19558
+ * window, the subject in a handful of them, metres apart — and produced no
19559
+ * event at all.
19560
+ *
19561
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19562
+ * with no track and no reason is indistinguishable from a track whose media
19563
+ * went missing, and a consumer that asks this one for a best shot or a
19564
+ * history is asking for something that never existed.
19565
+ */
19566
+ spawnRefused: string().optional(),
19532
19567
  /** Omitted in slim projection. */
19533
19568
  state: TrackStateSchema.optional(),
19534
19569
  /**
@@ -20602,6 +20637,60 @@ var NativeCropResultSchema = object({
20602
20637
  */
20603
20638
  tier: _enum(["native", "ram-fullframe"]).optional()
20604
20639
  });
20640
+ /**
20641
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20642
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20643
+ *
20644
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20645
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20646
+ * from, and what the detail plane's full-frame rung cuts from.
20647
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20648
+ * window, cut by the runner at uncapped native resolution.
20649
+ *
20650
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20651
+ */
20652
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20653
+ /**
20654
+ * Why a park did NOT happen. Every one is logged on the runner with
20655
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20656
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20657
+ * never a reason to retry in a loop.
20658
+ *
20659
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20660
+ * registered, past the lease bound, or the worker released it). `detail`
20661
+ * carries the runner's own miss reason.
20662
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20663
+ */
20664
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20665
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20666
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20667
+ parked: literal(true),
20668
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20669
+ nodeId: string(),
20670
+ width: number().int().positive(),
20671
+ height: number().int().positive(),
20672
+ /** JPEG bytes the parcel costs on the node. */
20673
+ bytes: number().int().nonnegative(),
20674
+ /** Whether this park replaced a parcel already held for the key. */
20675
+ replaced: boolean()
20676
+ }), object({
20677
+ parked: literal(false),
20678
+ nodeId: string(),
20679
+ reason: ParkRefusalSchema,
20680
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20681
+ handleAgeMs: number().nullable(),
20682
+ detail: string().optional()
20683
+ })]);
20684
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20685
+ var ParkedTrackFrameSchema = object({
20686
+ jpeg: string(),
20687
+ width: number().int().positive(),
20688
+ height: number().int().positive(),
20689
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20690
+ timestamp: number(),
20691
+ /** When the node stored it (the node's clock). */
20692
+ parkedAt: number()
20693
+ });
20605
20694
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20606
20695
  * originating detection, in FRAME-space coordinates. Reuses
20607
20696
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20991,7 +21080,7 @@ var RunnerCameraConfigSchema = object({
20991
21080
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20992
21081
  * analyzer providers) running on decoded frames in this runner.
20993
21082
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20994
- * analytics, Frigate motion). The provider emits ProviderMotion
21083
+ * analytics). The provider emits ProviderMotion
20995
21084
  * events; the orchestrator forwards to `reportMotion`.
20996
21085
  */
20997
21086
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21233,7 +21322,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21233
21322
  className: string(),
21234
21323
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21235
21324
  sourceDeviceId: number()
21236
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21325
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21326
+ deviceId: number(),
21327
+ /** Opaque to the runner — the hub's track id. */
21328
+ trackId: string(),
21329
+ kind: ParkedFrameKindSchema,
21330
+ handle: FrameHandleSchema,
21331
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21332
+ bbox: NativeCropBboxSchema,
21333
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21334
+ maxWidth: number().int().positive().optional(),
21335
+ /** The frame instant (caller's clock) — orders parks for one key. */
21336
+ timestamp: number()
21337
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21338
+ deviceId: number(),
21339
+ trackId: string(),
21340
+ kind: ParkedFrameKindSchema
21341
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21342
+ deviceId: number(),
21343
+ trackId: string()
21344
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21237
21345
  var CameraPipelineConfigSchema = object({
21238
21346
  engine: PipelineEngineChoiceSchema.optional(),
21239
21347
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24303,8 +24411,8 @@ onStatusChanged: { data: object({
24303
24411
  /**
24304
24412
  * Runtime-state slice — every provider that registers this cap
24305
24413
  * stores the same shape under `device.runtimeState[battery]`.
24306
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24307
- * proxy, an ONVIF battery cam all read/write the same keys.
24414
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24415
+ * an ONVIF battery cam all read/write the same keys.
24308
24416
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24309
24417
  * via `device.runtimeState.getCapState('battery')` regardless of
24310
24418
  * the underlying driver.
@@ -24437,7 +24545,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24437
24545
  *
24438
24546
  * Implementations:
24439
24547
  * - Each camera-providing addon registers this cap natively per
24440
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24548
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24441
24549
  * - Returns a snapshot from the persisted device config blob — no
24442
24550
  * extra round-trip to the camera, no probing.
24443
24551
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26529,7 +26637,7 @@ var AvailableIntegrationTypeSchema = object({
26529
26637
  * Which integration-marker cap the addon declared, so the wizard can
26530
26638
  * branch on CAP — never on addon name. `device-adoption` integrations
26531
26639
  * (Home Assistant, …) route through the broker step (Approach A);
26532
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26640
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26533
26641
  * legacy config → discovery flow.
26534
26642
  */
26535
26643
  kind: _enum(["device-adoption", "device-provider"]),
@@ -29953,13 +30061,31 @@ var RecordingManifestSchema = object({
29953
30061
  */
29954
30062
  playbackEndpoints: array(string())
29955
30063
  });
29956
- /** Recording storage usage for one camera (bytes on disk across all its
29957
- * profiles/subtrees/locations on this node). */
30064
+ /**
30065
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30066
+ * across every profile and every resolvable location on this node.
30067
+ *
30068
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30069
+ *
30070
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30071
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30072
+ * this camera writes to, so the two can be added up and compared.
30073
+ *
30074
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30075
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30076
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30077
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30078
+ * that said otherwise, and two people read it as retention eating recent
30079
+ * footage. Residency is still reported, under `residentBytes` /
30080
+ * `residentOldestMs`, which answer a different question and say so.
30081
+ */
29958
30082
  var RecordingDeviceUsageSchema = object({
29959
30083
  deviceId: number(),
30084
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30085
+ * recordings locations. */
29960
30086
  usedBytes: number(),
29961
30087
  /**
29962
- * Start of this camera's OLDEST indexed segment, across every profile and
30088
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
29963
30089
  * location — the "Oldest footage" column in Recordings → Storage, and the
29964
30090
  * only honest answer to "is retention actually holding?" per camera.
29965
30091
  *
@@ -29969,7 +30095,24 @@ var RecordingDeviceUsageSchema = object({
29969
30095
  * (types) and the addon ship on different trains, and the addon is usually
29970
30096
  * the later of the two.
29971
30097
  */
29972
- oldestMs: number().nullable().optional()
30098
+ oldestMs: number().nullable().optional(),
30099
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30100
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30101
+ segments: number().optional(),
30102
+ /**
30103
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30104
+ * its RAM index — the live tail plus the hours a reader hydrated.
30105
+ *
30106
+ * It answers "what can be served without touching the disk", never "how much
30107
+ * footage this camera has". A UI that renders it must label it as such, and
30108
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30109
+ * it, and so does a node whose ledger could not answer.
30110
+ */
30111
+ residentBytes: number().optional(),
30112
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30113
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30114
+ * retention. `null` = nothing resident. */
30115
+ residentOldestMs: number().nullable().optional()
29973
30116
  });
29974
30117
  /** Recording storage usage + capacity for one storage location. */
29975
30118
  var RecordingLocationUsageSchema = object({
@@ -30007,6 +30150,17 @@ var RecordingStorageUsageSchema = object({
30007
30150
  totalUsedBytes: number(),
30008
30151
  devices: array(RecordingDeviceUsageSchema),
30009
30152
  /**
30153
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30154
+ * disks (D418).
30155
+ *
30156
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30157
+ * declared no ledger and the recorder REFUSED rather than answering the
30158
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30159
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30160
+ * and its rows are residency.
30161
+ */
30162
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30163
+ /**
30010
30164
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30011
30165
  * of the payload without it: the hub serves this method through a BAKED
30012
30166
  * router, so a hub whose framework train predates a change to this array
@@ -33886,7 +34040,7 @@ function toDeviceSummary(device, addonId) {
33886
34040
  };
33887
34041
  }
33888
34042
  /**
33889
- * Base class for device-provider addons (rtsp, onvif, frigate).
34043
+ * Base class for device-provider addons (rtsp, onvif).
33890
34044
  *
33891
34045
  * Provides default implementations for the common device-provider cap
33892
34046
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -38542,6 +38696,24 @@ Object.freeze({
38542
38696
  addonId: null,
38543
38697
  access: "view"
38544
38698
  },
38699
+ "pipelineRunner.getParkedTrackFrame": {
38700
+ capName: "pipeline-runner",
38701
+ capScope: "system",
38702
+ addonId: null,
38703
+ access: "view"
38704
+ },
38705
+ "pipelineRunner.parkTrackFrame": {
38706
+ capName: "pipeline-runner",
38707
+ capScope: "system",
38708
+ addonId: null,
38709
+ access: "create"
38710
+ },
38711
+ "pipelineRunner.releaseParkedTrackFrames": {
38712
+ capName: "pipeline-runner",
38713
+ capScope: "system",
38714
+ addonId: null,
38715
+ access: "create"
38716
+ },
38545
38717
  "pipelineRunner.reportMotion": {
38546
38718
  capName: "pipeline-runner",
38547
38719
  capScope: "system",
@@ -41819,6 +41991,21 @@ Object.freeze({
41819
41991
  form: "single",
41820
41992
  optional: false
41821
41993
  }],
41994
+ "pipelineRunner.getParkedTrackFrame": [{
41995
+ name: "deviceId",
41996
+ form: "single",
41997
+ optional: false
41998
+ }],
41999
+ "pipelineRunner.parkTrackFrame": [{
42000
+ name: "deviceId",
42001
+ form: "single",
42002
+ optional: false
42003
+ }],
42004
+ "pipelineRunner.releaseParkedTrackFrames": [{
42005
+ name: "deviceId",
42006
+ form: "single",
42007
+ optional: false
42008
+ }],
41822
42009
  "pipelineRunner.reportMotion": [{
41823
42010
  name: "deviceId",
41824
42011
  form: "single",
@@ -42510,7 +42697,7 @@ var PreviewTextField = string().max(200);
42510
42697
  * Whether the notification's preview is a STILL or a short animation.
42511
42698
  *
42512
42699
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
42513
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
42700
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
42514
42701
  * night reads better as three seconds of motion than as one frame of it. Both
42515
42702
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
42516
42703
  * simply applies it to a dozen frames sampled across the render and assembles
package/dist/addon.mjs CHANGED
@@ -9,7 +9,7 @@ import { join } from "path";
9
9
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
10
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
11
11
  //#endregion
12
- //#region ../types/dist/event-category-CnLqLOKs.mjs
12
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
13
13
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
14
14
  EventCategory["SystemBoot"] = "system.boot";
15
15
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -601,7 +601,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
601
601
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
602
602
  */
603
603
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
604
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
605
604
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
606
605
  /**
607
606
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12684,7 +12683,7 @@ DeviceType.Camera;
12684
12683
  var SourceInfoSchema = object({
12685
12684
  /** Live dispatch key — mutable when the source system allows rename. */
12686
12685
  id: string(),
12687
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12686
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12688
12687
  system: string(),
12689
12688
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12690
12689
  * Used to detect rename when `id` changes. */
@@ -12697,7 +12696,7 @@ var SourceInfoSchema = object({
12697
12696
  /**
12698
12697
  * Build the synthetic SourceInfo every existing provider falls back to
12699
12698
  * when no upstream value has been persisted. Keeps non-migrated providers
12700
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12699
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12701
12700
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12702
12701
  * id. Real upstream identity replaces this once a provider migrates and
12703
12702
  * calls `updateSourceInfo()` with concrete values.
@@ -13376,7 +13375,7 @@ var deviceProviderCapability = {
13376
13375
  * - `device-management.router.ts` (deleted in Phase 2)
13377
13376
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13378
13377
  *
13379
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13378
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13380
13379
  * fork into separate processes but never run on remote cluster agents. Therefore:
13381
13380
  * - No nodeId routing needed — this is a pure hub singleton.
13382
13381
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17424,7 +17423,7 @@ var NcRuleInputSchema = object({
17424
17423
  * The measured seven-person arrival on device 590 spans 110 s with every
17425
17424
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17426
17425
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17427
- * 30 is Frigate's shipped value for the same decision.
17426
+ * 30 s is a widely shipped value for the same decision.
17428
17427
  *
17429
17428
  * ### What it replaces
17430
17429
  *
@@ -19506,6 +19505,13 @@ var ZoneCrossingSchema = object({
19506
19505
  /** Zone display name at crossing time (falls back to the id). */
19507
19506
  zoneName: string().optional()
19508
19507
  });
19508
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19509
+ var ZoneOverlapSchema = object({
19510
+ zoneId: string(),
19511
+ zoneName: string().optional(),
19512
+ /** Percentage of the BOX area inside the zone, 0–100. */
19513
+ overlapPct: number()
19514
+ });
19509
19515
  var ObjectEventSchema = object({
19510
19516
  ...BaseEventFields,
19511
19517
  kind: literal("object"),
@@ -19530,6 +19536,35 @@ var ObjectEventSchema = object({
19530
19536
  bbox: BoundingBoxSchema.optional(),
19531
19537
  /** Heavy JSON — omitted in slim projection. */
19532
19538
  zones: array(string()).readonly().optional(),
19539
+ /**
19540
+ * How far inside each stamped zone the box actually was, as a percentage of
19541
+ * the BOX area.
19542
+ *
19543
+ * Membership alone cannot express "at least a third of it inside", which is
19544
+ * the bar an operator argues with — and the number already existed: the
19545
+ * engine computed it, the pipeline logged it, and then discarded it. It
19546
+ * matters most on the events that carry no track, where a rule has nothing
19547
+ * else to judge by.
19548
+ */
19549
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19550
+ /**
19551
+ * Present when this event describes a detection the TRACKER refused, so it
19552
+ * has no track and never will.
19553
+ *
19554
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19555
+ * NOW?"; tracking answers a different question ("is this the same subject as
19556
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19557
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19558
+ * seconds with three different candidate ids — seven analysed frames in the
19559
+ * window, the subject in a handful of them, metres apart — and produced no
19560
+ * event at all.
19561
+ *
19562
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19563
+ * with no track and no reason is indistinguishable from a track whose media
19564
+ * went missing, and a consumer that asks this one for a best shot or a
19565
+ * history is asking for something that never existed.
19566
+ */
19567
+ spawnRefused: string().optional(),
19533
19568
  /** Omitted in slim projection. */
19534
19569
  state: TrackStateSchema.optional(),
19535
19570
  /**
@@ -20603,6 +20638,60 @@ var NativeCropResultSchema = object({
20603
20638
  */
20604
20639
  tier: _enum(["native", "ram-fullframe"]).optional()
20605
20640
  });
20641
+ /**
20642
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20643
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20644
+ *
20645
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20646
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20647
+ * from, and what the detail plane's full-frame rung cuts from.
20648
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20649
+ * window, cut by the runner at uncapped native resolution.
20650
+ *
20651
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20652
+ */
20653
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20654
+ /**
20655
+ * Why a park did NOT happen. Every one is logged on the runner with
20656
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20657
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20658
+ * never a reason to retry in a loop.
20659
+ *
20660
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20661
+ * registered, past the lease bound, or the worker released it). `detail`
20662
+ * carries the runner's own miss reason.
20663
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20664
+ */
20665
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20666
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20667
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20668
+ parked: literal(true),
20669
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20670
+ nodeId: string(),
20671
+ width: number().int().positive(),
20672
+ height: number().int().positive(),
20673
+ /** JPEG bytes the parcel costs on the node. */
20674
+ bytes: number().int().nonnegative(),
20675
+ /** Whether this park replaced a parcel already held for the key. */
20676
+ replaced: boolean()
20677
+ }), object({
20678
+ parked: literal(false),
20679
+ nodeId: string(),
20680
+ reason: ParkRefusalSchema,
20681
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20682
+ handleAgeMs: number().nullable(),
20683
+ detail: string().optional()
20684
+ })]);
20685
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20686
+ var ParkedTrackFrameSchema = object({
20687
+ jpeg: string(),
20688
+ width: number().int().positive(),
20689
+ height: number().int().positive(),
20690
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20691
+ timestamp: number(),
20692
+ /** When the node stored it (the node's clock). */
20693
+ parkedAt: number()
20694
+ });
20606
20695
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20607
20696
  * originating detection, in FRAME-space coordinates. Reuses
20608
20697
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20992,7 +21081,7 @@ var RunnerCameraConfigSchema = object({
20992
21081
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20993
21082
  * analyzer providers) running on decoded frames in this runner.
20994
21083
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20995
- * analytics, Frigate motion). The provider emits ProviderMotion
21084
+ * analytics). The provider emits ProviderMotion
20996
21085
  * events; the orchestrator forwards to `reportMotion`.
20997
21086
  */
20998
21087
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21234,7 +21323,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21234
21323
  className: string(),
21235
21324
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21236
21325
  sourceDeviceId: number()
21237
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21326
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21327
+ deviceId: number(),
21328
+ /** Opaque to the runner — the hub's track id. */
21329
+ trackId: string(),
21330
+ kind: ParkedFrameKindSchema,
21331
+ handle: FrameHandleSchema,
21332
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21333
+ bbox: NativeCropBboxSchema,
21334
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21335
+ maxWidth: number().int().positive().optional(),
21336
+ /** The frame instant (caller's clock) — orders parks for one key. */
21337
+ timestamp: number()
21338
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21339
+ deviceId: number(),
21340
+ trackId: string(),
21341
+ kind: ParkedFrameKindSchema
21342
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21343
+ deviceId: number(),
21344
+ trackId: string()
21345
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21238
21346
  var CameraPipelineConfigSchema = object({
21239
21347
  engine: PipelineEngineChoiceSchema.optional(),
21240
21348
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24304,8 +24412,8 @@ onStatusChanged: { data: object({
24304
24412
  /**
24305
24413
  * Runtime-state slice — every provider that registers this cap
24306
24414
  * stores the same shape under `device.runtimeState[battery]`.
24307
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24308
- * proxy, an ONVIF battery cam all read/write the same keys.
24415
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24416
+ * an ONVIF battery cam all read/write the same keys.
24309
24417
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24310
24418
  * via `device.runtimeState.getCapState('battery')` regardless of
24311
24419
  * the underlying driver.
@@ -24438,7 +24546,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24438
24546
  *
24439
24547
  * Implementations:
24440
24548
  * - Each camera-providing addon registers this cap natively per
24441
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24549
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24442
24550
  * - Returns a snapshot from the persisted device config blob — no
24443
24551
  * extra round-trip to the camera, no probing.
24444
24552
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26530,7 +26638,7 @@ var AvailableIntegrationTypeSchema = object({
26530
26638
  * Which integration-marker cap the addon declared, so the wizard can
26531
26639
  * branch on CAP — never on addon name. `device-adoption` integrations
26532
26640
  * (Home Assistant, …) route through the broker step (Approach A);
26533
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26641
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26534
26642
  * legacy config → discovery flow.
26535
26643
  */
26536
26644
  kind: _enum(["device-adoption", "device-provider"]),
@@ -29954,13 +30062,31 @@ var RecordingManifestSchema = object({
29954
30062
  */
29955
30063
  playbackEndpoints: array(string())
29956
30064
  });
29957
- /** Recording storage usage for one camera (bytes on disk across all its
29958
- * profiles/subtrees/locations on this node). */
30065
+ /**
30066
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30067
+ * across every profile and every resolvable location on this node.
30068
+ *
30069
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30070
+ *
30071
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30072
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30073
+ * this camera writes to, so the two can be added up and compared.
30074
+ *
30075
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30076
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30077
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30078
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30079
+ * that said otherwise, and two people read it as retention eating recent
30080
+ * footage. Residency is still reported, under `residentBytes` /
30081
+ * `residentOldestMs`, which answer a different question and say so.
30082
+ */
29959
30083
  var RecordingDeviceUsageSchema = object({
29960
30084
  deviceId: number(),
30085
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30086
+ * recordings locations. */
29961
30087
  usedBytes: number(),
29962
30088
  /**
29963
- * Start of this camera's OLDEST indexed segment, across every profile and
30089
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
29964
30090
  * location — the "Oldest footage" column in Recordings → Storage, and the
29965
30091
  * only honest answer to "is retention actually holding?" per camera.
29966
30092
  *
@@ -29970,7 +30096,24 @@ var RecordingDeviceUsageSchema = object({
29970
30096
  * (types) and the addon ship on different trains, and the addon is usually
29971
30097
  * the later of the two.
29972
30098
  */
29973
- oldestMs: number().nullable().optional()
30099
+ oldestMs: number().nullable().optional(),
30100
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30101
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30102
+ segments: number().optional(),
30103
+ /**
30104
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30105
+ * its RAM index — the live tail plus the hours a reader hydrated.
30106
+ *
30107
+ * It answers "what can be served without touching the disk", never "how much
30108
+ * footage this camera has". A UI that renders it must label it as such, and
30109
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30110
+ * it, and so does a node whose ledger could not answer.
30111
+ */
30112
+ residentBytes: number().optional(),
30113
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30114
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30115
+ * retention. `null` = nothing resident. */
30116
+ residentOldestMs: number().nullable().optional()
29974
30117
  });
29975
30118
  /** Recording storage usage + capacity for one storage location. */
29976
30119
  var RecordingLocationUsageSchema = object({
@@ -30008,6 +30151,17 @@ var RecordingStorageUsageSchema = object({
30008
30151
  totalUsedBytes: number(),
30009
30152
  devices: array(RecordingDeviceUsageSchema),
30010
30153
  /**
30154
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30155
+ * disks (D418).
30156
+ *
30157
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30158
+ * declared no ledger and the recorder REFUSED rather than answering the
30159
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30160
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30161
+ * and its rows are residency.
30162
+ */
30163
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30164
+ /**
30011
30165
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30012
30166
  * of the payload without it: the hub serves this method through a BAKED
30013
30167
  * router, so a hub whose framework train predates a change to this array
@@ -33887,7 +34041,7 @@ function toDeviceSummary(device, addonId) {
33887
34041
  };
33888
34042
  }
33889
34043
  /**
33890
- * Base class for device-provider addons (rtsp, onvif, frigate).
34044
+ * Base class for device-provider addons (rtsp, onvif).
33891
34045
  *
33892
34046
  * Provides default implementations for the common device-provider cap
33893
34047
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -38543,6 +38697,24 @@ Object.freeze({
38543
38697
  addonId: null,
38544
38698
  access: "view"
38545
38699
  },
38700
+ "pipelineRunner.getParkedTrackFrame": {
38701
+ capName: "pipeline-runner",
38702
+ capScope: "system",
38703
+ addonId: null,
38704
+ access: "view"
38705
+ },
38706
+ "pipelineRunner.parkTrackFrame": {
38707
+ capName: "pipeline-runner",
38708
+ capScope: "system",
38709
+ addonId: null,
38710
+ access: "create"
38711
+ },
38712
+ "pipelineRunner.releaseParkedTrackFrames": {
38713
+ capName: "pipeline-runner",
38714
+ capScope: "system",
38715
+ addonId: null,
38716
+ access: "create"
38717
+ },
38546
38718
  "pipelineRunner.reportMotion": {
38547
38719
  capName: "pipeline-runner",
38548
38720
  capScope: "system",
@@ -41820,6 +41992,21 @@ Object.freeze({
41820
41992
  form: "single",
41821
41993
  optional: false
41822
41994
  }],
41995
+ "pipelineRunner.getParkedTrackFrame": [{
41996
+ name: "deviceId",
41997
+ form: "single",
41998
+ optional: false
41999
+ }],
42000
+ "pipelineRunner.parkTrackFrame": [{
42001
+ name: "deviceId",
42002
+ form: "single",
42003
+ optional: false
42004
+ }],
42005
+ "pipelineRunner.releaseParkedTrackFrames": [{
42006
+ name: "deviceId",
42007
+ form: "single",
42008
+ optional: false
42009
+ }],
41823
42010
  "pipelineRunner.reportMotion": [{
41824
42011
  name: "deviceId",
41825
42012
  form: "single",
@@ -42511,7 +42698,7 @@ var PreviewTextField = string().max(200);
42511
42698
  * Whether the notification's preview is a STILL or a short animation.
42512
42699
  *
42513
42700
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
42514
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
42701
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
42515
42702
  * night reads better as three seconds of motion than as one frame of it. Both
42516
42703
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
42517
42704
  * 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-homematic",
3
- "version": "1.2.91",
3
+ "version": "1.2.93",
4
4
  "description": "Homematic / HomematicIP (CCU3 / RaspberryMatic) device-provider addon for CamStack — wraps the nodehomematic library",
5
5
  "keywords": [
6
6
  "camstack",