@camstack/addon-provider-hikvision 1.2.98 → 1.2.100

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 +206 -19
  2. package/dist/addon.mjs +206 -19
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -6,7 +6,7 @@ let node_crypto = require("node:crypto");
6
6
  let node_http = require("node:http");
7
7
  let node_https = require("node:https");
8
8
  let node_os = require("node:os");
9
- //#region ../types/dist/event-category-CnLqLOKs.mjs
9
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
10
10
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
11
11
  EventCategory["SystemBoot"] = "system.boot";
12
12
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -598,7 +598,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
598
598
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
599
599
  */
600
600
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
601
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
602
601
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
603
602
  /**
604
603
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12913,7 +12912,7 @@ DeviceType.Camera;
12913
12912
  var SourceInfoSchema = object({
12914
12913
  /** Live dispatch key — mutable when the source system allows rename. */
12915
12914
  id: string(),
12916
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12915
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12917
12916
  system: string(),
12918
12917
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12919
12918
  * Used to detect rename when `id` changes. */
@@ -12926,7 +12925,7 @@ var SourceInfoSchema = object({
12926
12925
  /**
12927
12926
  * Build the synthetic SourceInfo every existing provider falls back to
12928
12927
  * when no upstream value has been persisted. Keeps non-migrated providers
12929
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12928
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12930
12929
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12931
12930
  * id. Real upstream identity replaces this once a provider migrates and
12932
12931
  * calls `updateSourceInfo()` with concrete values.
@@ -13588,7 +13587,7 @@ var deviceProviderCapability = {
13588
13587
  * - `device-management.router.ts` (deleted in Phase 2)
13589
13588
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13590
13589
  *
13591
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13590
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13592
13591
  * fork into separate processes but never run on remote cluster agents. Therefore:
13593
13592
  * - No nodeId routing needed — this is a pure hub singleton.
13594
13593
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17655,7 +17654,7 @@ var NcRuleInputSchema = object({
17655
17654
  * The measured seven-person arrival on device 590 spans 110 s with every
17656
17655
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17657
17656
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17658
- * 30 is Frigate's shipped value for the same decision.
17657
+ * 30 s is a widely shipped value for the same decision.
17659
17658
  *
17660
17659
  * ### What it replaces
17661
17660
  *
@@ -19737,6 +19736,13 @@ var ZoneCrossingSchema = object({
19737
19736
  /** Zone display name at crossing time (falls back to the id). */
19738
19737
  zoneName: string().optional()
19739
19738
  });
19739
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19740
+ var ZoneOverlapSchema = object({
19741
+ zoneId: string(),
19742
+ zoneName: string().optional(),
19743
+ /** Percentage of the BOX area inside the zone, 0–100. */
19744
+ overlapPct: number()
19745
+ });
19740
19746
  var ObjectEventSchema = object({
19741
19747
  ...BaseEventFields,
19742
19748
  kind: literal("object"),
@@ -19761,6 +19767,35 @@ var ObjectEventSchema = object({
19761
19767
  bbox: BoundingBoxSchema.optional(),
19762
19768
  /** Heavy JSON — omitted in slim projection. */
19763
19769
  zones: array(string()).readonly().optional(),
19770
+ /**
19771
+ * How far inside each stamped zone the box actually was, as a percentage of
19772
+ * the BOX area.
19773
+ *
19774
+ * Membership alone cannot express "at least a third of it inside", which is
19775
+ * the bar an operator argues with — and the number already existed: the
19776
+ * engine computed it, the pipeline logged it, and then discarded it. It
19777
+ * matters most on the events that carry no track, where a rule has nothing
19778
+ * else to judge by.
19779
+ */
19780
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19781
+ /**
19782
+ * Present when this event describes a detection the TRACKER refused, so it
19783
+ * has no track and never will.
19784
+ *
19785
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19786
+ * NOW?"; tracking answers a different question ("is this the same subject as
19787
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19788
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19789
+ * seconds with three different candidate ids — seven analysed frames in the
19790
+ * window, the subject in a handful of them, metres apart — and produced no
19791
+ * event at all.
19792
+ *
19793
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19794
+ * with no track and no reason is indistinguishable from a track whose media
19795
+ * went missing, and a consumer that asks this one for a best shot or a
19796
+ * history is asking for something that never existed.
19797
+ */
19798
+ spawnRefused: string().optional(),
19764
19799
  /** Omitted in slim projection. */
19765
19800
  state: TrackStateSchema.optional(),
19766
19801
  /**
@@ -20834,6 +20869,60 @@ var NativeCropResultSchema = object({
20834
20869
  */
20835
20870
  tier: _enum(["native", "ram-fullframe"]).optional()
20836
20871
  });
20872
+ /**
20873
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20874
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20875
+ *
20876
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20877
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20878
+ * from, and what the detail plane's full-frame rung cuts from.
20879
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20880
+ * window, cut by the runner at uncapped native resolution.
20881
+ *
20882
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20883
+ */
20884
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20885
+ /**
20886
+ * Why a park did NOT happen. Every one is logged on the runner with
20887
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20888
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20889
+ * never a reason to retry in a loop.
20890
+ *
20891
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20892
+ * registered, past the lease bound, or the worker released it). `detail`
20893
+ * carries the runner's own miss reason.
20894
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20895
+ */
20896
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20897
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20898
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20899
+ parked: literal(true),
20900
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20901
+ nodeId: string(),
20902
+ width: number().int().positive(),
20903
+ height: number().int().positive(),
20904
+ /** JPEG bytes the parcel costs on the node. */
20905
+ bytes: number().int().nonnegative(),
20906
+ /** Whether this park replaced a parcel already held for the key. */
20907
+ replaced: boolean()
20908
+ }), object({
20909
+ parked: literal(false),
20910
+ nodeId: string(),
20911
+ reason: ParkRefusalSchema,
20912
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20913
+ handleAgeMs: number().nullable(),
20914
+ detail: string().optional()
20915
+ })]);
20916
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20917
+ var ParkedTrackFrameSchema = object({
20918
+ jpeg: string(),
20919
+ width: number().int().positive(),
20920
+ height: number().int().positive(),
20921
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20922
+ timestamp: number(),
20923
+ /** When the node stored it (the node's clock). */
20924
+ parkedAt: number()
20925
+ });
20837
20926
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20838
20927
  * originating detection, in FRAME-space coordinates. Reuses
20839
20928
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -21223,7 +21312,7 @@ var RunnerCameraConfigSchema = object({
21223
21312
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
21224
21313
  * analyzer providers) running on decoded frames in this runner.
21225
21314
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
21226
- * analytics, Frigate motion). The provider emits ProviderMotion
21315
+ * analytics). The provider emits ProviderMotion
21227
21316
  * events; the orchestrator forwards to `reportMotion`.
21228
21317
  */
21229
21318
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21465,7 +21554,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21465
21554
  className: string(),
21466
21555
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21467
21556
  sourceDeviceId: number()
21468
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21557
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21558
+ deviceId: number(),
21559
+ /** Opaque to the runner — the hub's track id. */
21560
+ trackId: string(),
21561
+ kind: ParkedFrameKindSchema,
21562
+ handle: FrameHandleSchema,
21563
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21564
+ bbox: NativeCropBboxSchema,
21565
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21566
+ maxWidth: number().int().positive().optional(),
21567
+ /** The frame instant (caller's clock) — orders parks for one key. */
21568
+ timestamp: number()
21569
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21570
+ deviceId: number(),
21571
+ trackId: string(),
21572
+ kind: ParkedFrameKindSchema
21573
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21574
+ deviceId: number(),
21575
+ trackId: string()
21576
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21469
21577
  var CameraPipelineConfigSchema = object({
21470
21578
  engine: PipelineEngineChoiceSchema.optional(),
21471
21579
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24639,8 +24747,8 @@ onStatusChanged: { data: object({
24639
24747
  /**
24640
24748
  * Runtime-state slice — every provider that registers this cap
24641
24749
  * stores the same shape under `device.runtimeState[battery]`.
24642
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24643
- * proxy, an ONVIF battery cam all read/write the same keys.
24750
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24751
+ * an ONVIF battery cam all read/write the same keys.
24644
24752
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24645
24753
  * via `device.runtimeState.getCapState('battery')` regardless of
24646
24754
  * the underlying driver.
@@ -24773,7 +24881,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24773
24881
  *
24774
24882
  * Implementations:
24775
24883
  * - Each camera-providing addon registers this cap natively per
24776
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24884
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24777
24885
  * - Returns a snapshot from the persisted device config blob — no
24778
24886
  * extra round-trip to the camera, no probing.
24779
24887
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26865,7 +26973,7 @@ var AvailableIntegrationTypeSchema = object({
26865
26973
  * Which integration-marker cap the addon declared, so the wizard can
26866
26974
  * branch on CAP — never on addon name. `device-adoption` integrations
26867
26975
  * (Home Assistant, …) route through the broker step (Approach A);
26868
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26976
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26869
26977
  * legacy config → discovery flow.
26870
26978
  */
26871
26979
  kind: _enum(["device-adoption", "device-provider"]),
@@ -30422,13 +30530,31 @@ var RecordingManifestSchema = object({
30422
30530
  */
30423
30531
  playbackEndpoints: array(string())
30424
30532
  });
30425
- /** Recording storage usage for one camera (bytes on disk across all its
30426
- * profiles/subtrees/locations on this node). */
30533
+ /**
30534
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30535
+ * across every profile and every resolvable location on this node.
30536
+ *
30537
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30538
+ *
30539
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30540
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30541
+ * this camera writes to, so the two can be added up and compared.
30542
+ *
30543
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30544
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30545
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30546
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30547
+ * that said otherwise, and two people read it as retention eating recent
30548
+ * footage. Residency is still reported, under `residentBytes` /
30549
+ * `residentOldestMs`, which answer a different question and say so.
30550
+ */
30427
30551
  var RecordingDeviceUsageSchema = object({
30428
30552
  deviceId: number(),
30553
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30554
+ * recordings locations. */
30429
30555
  usedBytes: number(),
30430
30556
  /**
30431
- * Start of this camera's OLDEST indexed segment, across every profile and
30557
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
30432
30558
  * location — the "Oldest footage" column in Recordings → Storage, and the
30433
30559
  * only honest answer to "is retention actually holding?" per camera.
30434
30560
  *
@@ -30438,7 +30564,24 @@ var RecordingDeviceUsageSchema = object({
30438
30564
  * (types) and the addon ship on different trains, and the addon is usually
30439
30565
  * the later of the two.
30440
30566
  */
30441
- oldestMs: number().nullable().optional()
30567
+ oldestMs: number().nullable().optional(),
30568
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30569
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30570
+ segments: number().optional(),
30571
+ /**
30572
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30573
+ * its RAM index — the live tail plus the hours a reader hydrated.
30574
+ *
30575
+ * It answers "what can be served without touching the disk", never "how much
30576
+ * footage this camera has". A UI that renders it must label it as such, and
30577
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30578
+ * it, and so does a node whose ledger could not answer.
30579
+ */
30580
+ residentBytes: number().optional(),
30581
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30582
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30583
+ * retention. `null` = nothing resident. */
30584
+ residentOldestMs: number().nullable().optional()
30442
30585
  });
30443
30586
  /** Recording storage usage + capacity for one storage location. */
30444
30587
  var RecordingLocationUsageSchema = object({
@@ -30476,6 +30619,17 @@ var RecordingStorageUsageSchema = object({
30476
30619
  totalUsedBytes: number(),
30477
30620
  devices: array(RecordingDeviceUsageSchema),
30478
30621
  /**
30622
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30623
+ * disks (D418).
30624
+ *
30625
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30626
+ * declared no ledger and the recorder REFUSED rather than answering the
30627
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30628
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30629
+ * and its rows are residency.
30630
+ */
30631
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30632
+ /**
30479
30633
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30480
30634
  * of the payload without it: the hub serves this method through a BAKED
30481
30635
  * router, so a hub whose framework train predates a change to this array
@@ -34568,7 +34722,7 @@ function toDeviceSummary(device, addonId) {
34568
34722
  };
34569
34723
  }
34570
34724
  /**
34571
- * Base class for device-provider addons (rtsp, onvif, frigate).
34725
+ * Base class for device-provider addons (rtsp, onvif).
34572
34726
  *
34573
34727
  * Provides default implementations for the common device-provider cap
34574
34728
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -39442,6 +39596,24 @@ Object.freeze({
39442
39596
  addonId: null,
39443
39597
  access: "view"
39444
39598
  },
39599
+ "pipelineRunner.getParkedTrackFrame": {
39600
+ capName: "pipeline-runner",
39601
+ capScope: "system",
39602
+ addonId: null,
39603
+ access: "view"
39604
+ },
39605
+ "pipelineRunner.parkTrackFrame": {
39606
+ capName: "pipeline-runner",
39607
+ capScope: "system",
39608
+ addonId: null,
39609
+ access: "create"
39610
+ },
39611
+ "pipelineRunner.releaseParkedTrackFrames": {
39612
+ capName: "pipeline-runner",
39613
+ capScope: "system",
39614
+ addonId: null,
39615
+ access: "create"
39616
+ },
39445
39617
  "pipelineRunner.reportMotion": {
39446
39618
  capName: "pipeline-runner",
39447
39619
  capScope: "system",
@@ -42719,6 +42891,21 @@ Object.freeze({
42719
42891
  form: "single",
42720
42892
  optional: false
42721
42893
  }],
42894
+ "pipelineRunner.getParkedTrackFrame": [{
42895
+ name: "deviceId",
42896
+ form: "single",
42897
+ optional: false
42898
+ }],
42899
+ "pipelineRunner.parkTrackFrame": [{
42900
+ name: "deviceId",
42901
+ form: "single",
42902
+ optional: false
42903
+ }],
42904
+ "pipelineRunner.releaseParkedTrackFrames": [{
42905
+ name: "deviceId",
42906
+ form: "single",
42907
+ optional: false
42908
+ }],
42722
42909
  "pipelineRunner.reportMotion": [{
42723
42910
  name: "deviceId",
42724
42911
  form: "single",
@@ -43410,7 +43597,7 @@ var PreviewTextField = string().max(200);
43410
43597
  * Whether the notification's preview is a STILL or a short animation.
43411
43598
  *
43412
43599
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
43413
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
43600
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
43414
43601
  * night reads better as three seconds of motion than as one frame of it. Both
43415
43602
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
43416
43603
  * simply applies it to a dozen frames sampled across the render and assembles
@@ -48078,7 +48265,7 @@ var HIKVISION_ADDON_ID = "provider-hikvision";
48078
48265
  /**
48079
48266
  * Hikvision smart-detection class strings observed in alarm XML.
48080
48267
  * Mapped to the loose camstack `CameraNativeDetection.className`
48081
- * convention so other providers (Reolink, Frigate) emit the same
48268
+ * convention so other providers (Reolink) emit the same
48082
48269
  * strings for the same physical concept.
48083
48270
  */
48084
48271
  var HIKVISION_AI_CLASS_MAP = {
package/dist/addon.mjs CHANGED
@@ -7,7 +7,7 @@ import { networkInterfaces } from "node:os";
7
7
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
8
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
9
9
  //#endregion
10
- //#region ../types/dist/event-category-CnLqLOKs.mjs
10
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
11
11
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
12
12
  EventCategory["SystemBoot"] = "system.boot";
13
13
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -599,7 +599,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
599
599
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
600
600
  */
601
601
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
602
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
603
602
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
604
603
  /**
605
604
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12914,7 +12913,7 @@ DeviceType.Camera;
12914
12913
  var SourceInfoSchema = object({
12915
12914
  /** Live dispatch key — mutable when the source system allows rename. */
12916
12915
  id: string(),
12917
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12916
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12918
12917
  system: string(),
12919
12918
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12920
12919
  * Used to detect rename when `id` changes. */
@@ -12927,7 +12926,7 @@ var SourceInfoSchema = object({
12927
12926
  /**
12928
12927
  * Build the synthetic SourceInfo every existing provider falls back to
12929
12928
  * when no upstream value has been persisted. Keeps non-migrated providers
12930
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12929
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12931
12930
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12932
12931
  * id. Real upstream identity replaces this once a provider migrates and
12933
12932
  * calls `updateSourceInfo()` with concrete values.
@@ -13589,7 +13588,7 @@ var deviceProviderCapability = {
13589
13588
  * - `device-management.router.ts` (deleted in Phase 2)
13590
13589
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13591
13590
  *
13592
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13591
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13593
13592
  * fork into separate processes but never run on remote cluster agents. Therefore:
13594
13593
  * - No nodeId routing needed — this is a pure hub singleton.
13595
13594
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17656,7 +17655,7 @@ var NcRuleInputSchema = object({
17656
17655
  * The measured seven-person arrival on device 590 spans 110 s with every
17657
17656
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17658
17657
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17659
- * 30 is Frigate's shipped value for the same decision.
17658
+ * 30 s is a widely shipped value for the same decision.
17660
17659
  *
17661
17660
  * ### What it replaces
17662
17661
  *
@@ -19738,6 +19737,13 @@ var ZoneCrossingSchema = object({
19738
19737
  /** Zone display name at crossing time (falls back to the id). */
19739
19738
  zoneName: string().optional()
19740
19739
  });
19740
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19741
+ var ZoneOverlapSchema = object({
19742
+ zoneId: string(),
19743
+ zoneName: string().optional(),
19744
+ /** Percentage of the BOX area inside the zone, 0–100. */
19745
+ overlapPct: number()
19746
+ });
19741
19747
  var ObjectEventSchema = object({
19742
19748
  ...BaseEventFields,
19743
19749
  kind: literal("object"),
@@ -19762,6 +19768,35 @@ var ObjectEventSchema = object({
19762
19768
  bbox: BoundingBoxSchema.optional(),
19763
19769
  /** Heavy JSON — omitted in slim projection. */
19764
19770
  zones: array(string()).readonly().optional(),
19771
+ /**
19772
+ * How far inside each stamped zone the box actually was, as a percentage of
19773
+ * the BOX area.
19774
+ *
19775
+ * Membership alone cannot express "at least a third of it inside", which is
19776
+ * the bar an operator argues with — and the number already existed: the
19777
+ * engine computed it, the pipeline logged it, and then discarded it. It
19778
+ * matters most on the events that carry no track, where a rule has nothing
19779
+ * else to judge by.
19780
+ */
19781
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19782
+ /**
19783
+ * Present when this event describes a detection the TRACKER refused, so it
19784
+ * has no track and never will.
19785
+ *
19786
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19787
+ * NOW?"; tracking answers a different question ("is this the same subject as
19788
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19789
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19790
+ * seconds with three different candidate ids — seven analysed frames in the
19791
+ * window, the subject in a handful of them, metres apart — and produced no
19792
+ * event at all.
19793
+ *
19794
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19795
+ * with no track and no reason is indistinguishable from a track whose media
19796
+ * went missing, and a consumer that asks this one for a best shot or a
19797
+ * history is asking for something that never existed.
19798
+ */
19799
+ spawnRefused: string().optional(),
19765
19800
  /** Omitted in slim projection. */
19766
19801
  state: TrackStateSchema.optional(),
19767
19802
  /**
@@ -20835,6 +20870,60 @@ var NativeCropResultSchema = object({
20835
20870
  */
20836
20871
  tier: _enum(["native", "ram-fullframe"]).optional()
20837
20872
  });
20873
+ /**
20874
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20875
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20876
+ *
20877
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20878
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20879
+ * from, and what the detail plane's full-frame rung cuts from.
20880
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20881
+ * window, cut by the runner at uncapped native resolution.
20882
+ *
20883
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20884
+ */
20885
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20886
+ /**
20887
+ * Why a park did NOT happen. Every one is logged on the runner with
20888
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20889
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20890
+ * never a reason to retry in a loop.
20891
+ *
20892
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20893
+ * registered, past the lease bound, or the worker released it). `detail`
20894
+ * carries the runner's own miss reason.
20895
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20896
+ */
20897
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20898
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20899
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20900
+ parked: literal(true),
20901
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20902
+ nodeId: string(),
20903
+ width: number().int().positive(),
20904
+ height: number().int().positive(),
20905
+ /** JPEG bytes the parcel costs on the node. */
20906
+ bytes: number().int().nonnegative(),
20907
+ /** Whether this park replaced a parcel already held for the key. */
20908
+ replaced: boolean()
20909
+ }), object({
20910
+ parked: literal(false),
20911
+ nodeId: string(),
20912
+ reason: ParkRefusalSchema,
20913
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20914
+ handleAgeMs: number().nullable(),
20915
+ detail: string().optional()
20916
+ })]);
20917
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20918
+ var ParkedTrackFrameSchema = object({
20919
+ jpeg: string(),
20920
+ width: number().int().positive(),
20921
+ height: number().int().positive(),
20922
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20923
+ timestamp: number(),
20924
+ /** When the node stored it (the node's clock). */
20925
+ parkedAt: number()
20926
+ });
20838
20927
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20839
20928
  * originating detection, in FRAME-space coordinates. Reuses
20840
20929
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -21224,7 +21313,7 @@ var RunnerCameraConfigSchema = object({
21224
21313
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
21225
21314
  * analyzer providers) running on decoded frames in this runner.
21226
21315
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
21227
- * analytics, Frigate motion). The provider emits ProviderMotion
21316
+ * analytics). The provider emits ProviderMotion
21228
21317
  * events; the orchestrator forwards to `reportMotion`.
21229
21318
  */
21230
21319
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21466,7 +21555,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21466
21555
  className: string(),
21467
21556
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21468
21557
  sourceDeviceId: number()
21469
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21558
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21559
+ deviceId: number(),
21560
+ /** Opaque to the runner — the hub's track id. */
21561
+ trackId: string(),
21562
+ kind: ParkedFrameKindSchema,
21563
+ handle: FrameHandleSchema,
21564
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21565
+ bbox: NativeCropBboxSchema,
21566
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21567
+ maxWidth: number().int().positive().optional(),
21568
+ /** The frame instant (caller's clock) — orders parks for one key. */
21569
+ timestamp: number()
21570
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21571
+ deviceId: number(),
21572
+ trackId: string(),
21573
+ kind: ParkedFrameKindSchema
21574
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21575
+ deviceId: number(),
21576
+ trackId: string()
21577
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21470
21578
  var CameraPipelineConfigSchema = object({
21471
21579
  engine: PipelineEngineChoiceSchema.optional(),
21472
21580
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24640,8 +24748,8 @@ onStatusChanged: { data: object({
24640
24748
  /**
24641
24749
  * Runtime-state slice — every provider that registers this cap
24642
24750
  * stores the same shape under `device.runtimeState[battery]`.
24643
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24644
- * proxy, an ONVIF battery cam all read/write the same keys.
24751
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24752
+ * an ONVIF battery cam all read/write the same keys.
24645
24753
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24646
24754
  * via `device.runtimeState.getCapState('battery')` regardless of
24647
24755
  * the underlying driver.
@@ -24774,7 +24882,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24774
24882
  *
24775
24883
  * Implementations:
24776
24884
  * - Each camera-providing addon registers this cap natively per
24777
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24885
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24778
24886
  * - Returns a snapshot from the persisted device config blob — no
24779
24887
  * extra round-trip to the camera, no probing.
24780
24888
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26866,7 +26974,7 @@ var AvailableIntegrationTypeSchema = object({
26866
26974
  * Which integration-marker cap the addon declared, so the wizard can
26867
26975
  * branch on CAP — never on addon name. `device-adoption` integrations
26868
26976
  * (Home Assistant, …) route through the broker step (Approach A);
26869
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26977
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26870
26978
  * legacy config → discovery flow.
26871
26979
  */
26872
26980
  kind: _enum(["device-adoption", "device-provider"]),
@@ -30423,13 +30531,31 @@ var RecordingManifestSchema = object({
30423
30531
  */
30424
30532
  playbackEndpoints: array(string())
30425
30533
  });
30426
- /** Recording storage usage for one camera (bytes on disk across all its
30427
- * profiles/subtrees/locations on this node). */
30534
+ /**
30535
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30536
+ * across every profile and every resolvable location on this node.
30537
+ *
30538
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30539
+ *
30540
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30541
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30542
+ * this camera writes to, so the two can be added up and compared.
30543
+ *
30544
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30545
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30546
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30547
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30548
+ * that said otherwise, and two people read it as retention eating recent
30549
+ * footage. Residency is still reported, under `residentBytes` /
30550
+ * `residentOldestMs`, which answer a different question and say so.
30551
+ */
30428
30552
  var RecordingDeviceUsageSchema = object({
30429
30553
  deviceId: number(),
30554
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30555
+ * recordings locations. */
30430
30556
  usedBytes: number(),
30431
30557
  /**
30432
- * Start of this camera's OLDEST indexed segment, across every profile and
30558
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
30433
30559
  * location — the "Oldest footage" column in Recordings → Storage, and the
30434
30560
  * only honest answer to "is retention actually holding?" per camera.
30435
30561
  *
@@ -30439,7 +30565,24 @@ var RecordingDeviceUsageSchema = object({
30439
30565
  * (types) and the addon ship on different trains, and the addon is usually
30440
30566
  * the later of the two.
30441
30567
  */
30442
- oldestMs: number().nullable().optional()
30568
+ oldestMs: number().nullable().optional(),
30569
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30570
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30571
+ segments: number().optional(),
30572
+ /**
30573
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30574
+ * its RAM index — the live tail plus the hours a reader hydrated.
30575
+ *
30576
+ * It answers "what can be served without touching the disk", never "how much
30577
+ * footage this camera has". A UI that renders it must label it as such, and
30578
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30579
+ * it, and so does a node whose ledger could not answer.
30580
+ */
30581
+ residentBytes: number().optional(),
30582
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30583
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30584
+ * retention. `null` = nothing resident. */
30585
+ residentOldestMs: number().nullable().optional()
30443
30586
  });
30444
30587
  /** Recording storage usage + capacity for one storage location. */
30445
30588
  var RecordingLocationUsageSchema = object({
@@ -30477,6 +30620,17 @@ var RecordingStorageUsageSchema = object({
30477
30620
  totalUsedBytes: number(),
30478
30621
  devices: array(RecordingDeviceUsageSchema),
30479
30622
  /**
30623
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30624
+ * disks (D418).
30625
+ *
30626
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30627
+ * declared no ledger and the recorder REFUSED rather than answering the
30628
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30629
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30630
+ * and its rows are residency.
30631
+ */
30632
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30633
+ /**
30480
30634
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30481
30635
  * of the payload without it: the hub serves this method through a BAKED
30482
30636
  * router, so a hub whose framework train predates a change to this array
@@ -34569,7 +34723,7 @@ function toDeviceSummary(device, addonId) {
34569
34723
  };
34570
34724
  }
34571
34725
  /**
34572
- * Base class for device-provider addons (rtsp, onvif, frigate).
34726
+ * Base class for device-provider addons (rtsp, onvif).
34573
34727
  *
34574
34728
  * Provides default implementations for the common device-provider cap
34575
34729
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -39443,6 +39597,24 @@ Object.freeze({
39443
39597
  addonId: null,
39444
39598
  access: "view"
39445
39599
  },
39600
+ "pipelineRunner.getParkedTrackFrame": {
39601
+ capName: "pipeline-runner",
39602
+ capScope: "system",
39603
+ addonId: null,
39604
+ access: "view"
39605
+ },
39606
+ "pipelineRunner.parkTrackFrame": {
39607
+ capName: "pipeline-runner",
39608
+ capScope: "system",
39609
+ addonId: null,
39610
+ access: "create"
39611
+ },
39612
+ "pipelineRunner.releaseParkedTrackFrames": {
39613
+ capName: "pipeline-runner",
39614
+ capScope: "system",
39615
+ addonId: null,
39616
+ access: "create"
39617
+ },
39446
39618
  "pipelineRunner.reportMotion": {
39447
39619
  capName: "pipeline-runner",
39448
39620
  capScope: "system",
@@ -42720,6 +42892,21 @@ Object.freeze({
42720
42892
  form: "single",
42721
42893
  optional: false
42722
42894
  }],
42895
+ "pipelineRunner.getParkedTrackFrame": [{
42896
+ name: "deviceId",
42897
+ form: "single",
42898
+ optional: false
42899
+ }],
42900
+ "pipelineRunner.parkTrackFrame": [{
42901
+ name: "deviceId",
42902
+ form: "single",
42903
+ optional: false
42904
+ }],
42905
+ "pipelineRunner.releaseParkedTrackFrames": [{
42906
+ name: "deviceId",
42907
+ form: "single",
42908
+ optional: false
42909
+ }],
42723
42910
  "pipelineRunner.reportMotion": [{
42724
42911
  name: "deviceId",
42725
42912
  form: "single",
@@ -43411,7 +43598,7 @@ var PreviewTextField = string().max(200);
43411
43598
  * Whether the notification's preview is a STILL or a short animation.
43412
43599
  *
43413
43600
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
43414
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
43601
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
43415
43602
  * night reads better as three seconds of motion than as one frame of it. Both
43416
43603
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
43417
43604
  * simply applies it to a dozen frames sampled across the render and assembles
@@ -48079,7 +48266,7 @@ var HIKVISION_ADDON_ID = "provider-hikvision";
48079
48266
  /**
48080
48267
  * Hikvision smart-detection class strings observed in alarm XML.
48081
48268
  * Mapped to the loose camstack `CameraNativeDetection.className`
48082
- * convention so other providers (Reolink, Frigate) emit the same
48269
+ * convention so other providers (Reolink) emit the same
48083
48270
  * strings for the same physical concept.
48084
48271
  */
48085
48272
  var HIKVISION_AI_CLASS_MAP = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-hikvision",
3
- "version": "1.2.98",
3
+ "version": "1.2.100",
4
4
  "description": "Hikvision camera device provider addon for CamStack — ISAPI over HTTP(S) with digest auth (snapshot, alarm stream, RTSP discovery)",
5
5
  "keywords": [
6
6
  "camstack",