@camstack/addon-provider-amcrest 0.2.91 → 0.2.94

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
@@ -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.
@@ -12620,7 +12619,7 @@ DeviceType.Camera;
12620
12619
  var SourceInfoSchema = object({
12621
12620
  /** Live dispatch key — mutable when the source system allows rename. */
12622
12621
  id: string(),
12623
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12622
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12624
12623
  system: string(),
12625
12624
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12626
12625
  * Used to detect rename when `id` changes. */
@@ -12633,7 +12632,7 @@ var SourceInfoSchema = object({
12633
12632
  /**
12634
12633
  * Build the synthetic SourceInfo every existing provider falls back to
12635
12634
  * when no upstream value has been persisted. Keeps non-migrated providers
12636
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12635
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12637
12636
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12638
12637
  * id. Real upstream identity replaces this once a provider migrates and
12639
12638
  * calls `updateSourceInfo()` with concrete values.
@@ -13295,7 +13294,7 @@ var deviceProviderCapability = {
13295
13294
  * - `device-management.router.ts` (deleted in Phase 2)
13296
13295
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13297
13296
  *
13298
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13297
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13299
13298
  * fork into separate processes but never run on remote cluster agents. Therefore:
13300
13299
  * - No nodeId routing needed — this is a pure hub singleton.
13301
13300
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17343,7 +17342,7 @@ var NcRuleInputSchema = object({
17343
17342
  * The measured seven-person arrival on device 590 spans 110 s with every
17344
17343
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17345
17344
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17346
- * 30 is Frigate's shipped value for the same decision.
17345
+ * 30 s is a widely shipped value for the same decision.
17347
17346
  *
17348
17347
  * ### What it replaces
17349
17348
  *
@@ -19425,6 +19424,13 @@ var ZoneCrossingSchema = object({
19425
19424
  /** Zone display name at crossing time (falls back to the id). */
19426
19425
  zoneName: string().optional()
19427
19426
  });
19427
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19428
+ var ZoneOverlapSchema = object({
19429
+ zoneId: string(),
19430
+ zoneName: string().optional(),
19431
+ /** Percentage of the BOX area inside the zone, 0–100. */
19432
+ overlapPct: number()
19433
+ });
19428
19434
  var ObjectEventSchema = object({
19429
19435
  ...BaseEventFields,
19430
19436
  kind: literal("object"),
@@ -19449,6 +19455,35 @@ var ObjectEventSchema = object({
19449
19455
  bbox: BoundingBoxSchema.optional(),
19450
19456
  /** Heavy JSON — omitted in slim projection. */
19451
19457
  zones: array(string()).readonly().optional(),
19458
+ /**
19459
+ * How far inside each stamped zone the box actually was, as a percentage of
19460
+ * the BOX area.
19461
+ *
19462
+ * Membership alone cannot express "at least a third of it inside", which is
19463
+ * the bar an operator argues with — and the number already existed: the
19464
+ * engine computed it, the pipeline logged it, and then discarded it. It
19465
+ * matters most on the events that carry no track, where a rule has nothing
19466
+ * else to judge by.
19467
+ */
19468
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19469
+ /**
19470
+ * Present when this event describes a detection the TRACKER refused, so it
19471
+ * has no track and never will.
19472
+ *
19473
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19474
+ * NOW?"; tracking answers a different question ("is this the same subject as
19475
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19476
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19477
+ * seconds with three different candidate ids — seven analysed frames in the
19478
+ * window, the subject in a handful of them, metres apart — and produced no
19479
+ * event at all.
19480
+ *
19481
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19482
+ * with no track and no reason is indistinguishable from a track whose media
19483
+ * went missing, and a consumer that asks this one for a best shot or a
19484
+ * history is asking for something that never existed.
19485
+ */
19486
+ spawnRefused: string().optional(),
19452
19487
  /** Omitted in slim projection. */
19453
19488
  state: TrackStateSchema.optional(),
19454
19489
  /**
@@ -20522,6 +20557,60 @@ var NativeCropResultSchema = object({
20522
20557
  */
20523
20558
  tier: _enum(["native", "ram-fullframe"]).optional()
20524
20559
  });
20560
+ /**
20561
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20562
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20563
+ *
20564
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20565
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20566
+ * from, and what the detail plane's full-frame rung cuts from.
20567
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20568
+ * window, cut by the runner at uncapped native resolution.
20569
+ *
20570
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20571
+ */
20572
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20573
+ /**
20574
+ * Why a park did NOT happen. Every one is logged on the runner with
20575
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20576
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20577
+ * never a reason to retry in a loop.
20578
+ *
20579
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20580
+ * registered, past the lease bound, or the worker released it). `detail`
20581
+ * carries the runner's own miss reason.
20582
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20583
+ */
20584
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20585
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20586
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20587
+ parked: literal(true),
20588
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20589
+ nodeId: string(),
20590
+ width: number().int().positive(),
20591
+ height: number().int().positive(),
20592
+ /** JPEG bytes the parcel costs on the node. */
20593
+ bytes: number().int().nonnegative(),
20594
+ /** Whether this park replaced a parcel already held for the key. */
20595
+ replaced: boolean()
20596
+ }), object({
20597
+ parked: literal(false),
20598
+ nodeId: string(),
20599
+ reason: ParkRefusalSchema,
20600
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20601
+ handleAgeMs: number().nullable(),
20602
+ detail: string().optional()
20603
+ })]);
20604
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20605
+ var ParkedTrackFrameSchema = object({
20606
+ jpeg: string(),
20607
+ width: number().int().positive(),
20608
+ height: number().int().positive(),
20609
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20610
+ timestamp: number(),
20611
+ /** When the node stored it (the node's clock). */
20612
+ parkedAt: number()
20613
+ });
20525
20614
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20526
20615
  * originating detection, in FRAME-space coordinates. Reuses
20527
20616
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20911,7 +21000,7 @@ var RunnerCameraConfigSchema = object({
20911
21000
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20912
21001
  * analyzer providers) running on decoded frames in this runner.
20913
21002
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20914
- * analytics, Frigate motion). The provider emits ProviderMotion
21003
+ * analytics). The provider emits ProviderMotion
20915
21004
  * events; the orchestrator forwards to `reportMotion`.
20916
21005
  */
20917
21006
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21153,7 +21242,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21153
21242
  className: string(),
21154
21243
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21155
21244
  sourceDeviceId: number()
21156
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21245
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21246
+ deviceId: number(),
21247
+ /** Opaque to the runner — the hub's track id. */
21248
+ trackId: string(),
21249
+ kind: ParkedFrameKindSchema,
21250
+ handle: FrameHandleSchema,
21251
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21252
+ bbox: NativeCropBboxSchema,
21253
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21254
+ maxWidth: number().int().positive().optional(),
21255
+ /** The frame instant (caller's clock) — orders parks for one key. */
21256
+ timestamp: number()
21257
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21258
+ deviceId: number(),
21259
+ trackId: string(),
21260
+ kind: ParkedFrameKindSchema
21261
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21262
+ deviceId: number(),
21263
+ trackId: string()
21264
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21157
21265
  var CameraPipelineConfigSchema = object({
21158
21266
  engine: PipelineEngineChoiceSchema.optional(),
21159
21267
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24327,8 +24435,8 @@ onStatusChanged: { data: object({
24327
24435
  /**
24328
24436
  * Runtime-state slice — every provider that registers this cap
24329
24437
  * stores the same shape under `device.runtimeState[battery]`.
24330
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24331
- * proxy, an ONVIF battery cam all read/write the same keys.
24438
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24439
+ * an ONVIF battery cam all read/write the same keys.
24332
24440
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24333
24441
  * via `device.runtimeState.getCapState('battery')` regardless of
24334
24442
  * the underlying driver.
@@ -24461,7 +24569,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24461
24569
  *
24462
24570
  * Implementations:
24463
24571
  * - Each camera-providing addon registers this cap natively per
24464
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24572
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24465
24573
  * - Returns a snapshot from the persisted device config blob — no
24466
24574
  * extra round-trip to the camera, no probing.
24467
24575
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26553,7 +26661,7 @@ var AvailableIntegrationTypeSchema = object({
26553
26661
  * Which integration-marker cap the addon declared, so the wizard can
26554
26662
  * branch on CAP — never on addon name. `device-adoption` integrations
26555
26663
  * (Home Assistant, …) route through the broker step (Approach A);
26556
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26664
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26557
26665
  * legacy config → discovery flow.
26558
26666
  */
26559
26667
  kind: _enum(["device-adoption", "device-provider"]),
@@ -30085,13 +30193,31 @@ var RecordingManifestSchema = object({
30085
30193
  */
30086
30194
  playbackEndpoints: array(string())
30087
30195
  });
30088
- /** Recording storage usage for one camera (bytes on disk across all its
30089
- * profiles/subtrees/locations on this node). */
30196
+ /**
30197
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30198
+ * across every profile and every resolvable location on this node.
30199
+ *
30200
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30201
+ *
30202
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30203
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30204
+ * this camera writes to, so the two can be added up and compared.
30205
+ *
30206
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30207
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30208
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30209
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30210
+ * that said otherwise, and two people read it as retention eating recent
30211
+ * footage. Residency is still reported, under `residentBytes` /
30212
+ * `residentOldestMs`, which answer a different question and say so.
30213
+ */
30090
30214
  var RecordingDeviceUsageSchema = object({
30091
30215
  deviceId: number(),
30216
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30217
+ * recordings locations. */
30092
30218
  usedBytes: number(),
30093
30219
  /**
30094
- * Start of this camera's OLDEST indexed segment, across every profile and
30220
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
30095
30221
  * location — the "Oldest footage" column in Recordings → Storage, and the
30096
30222
  * only honest answer to "is retention actually holding?" per camera.
30097
30223
  *
@@ -30101,7 +30227,24 @@ var RecordingDeviceUsageSchema = object({
30101
30227
  * (types) and the addon ship on different trains, and the addon is usually
30102
30228
  * the later of the two.
30103
30229
  */
30104
- oldestMs: number().nullable().optional()
30230
+ oldestMs: number().nullable().optional(),
30231
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30232
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30233
+ segments: number().optional(),
30234
+ /**
30235
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30236
+ * its RAM index — the live tail plus the hours a reader hydrated.
30237
+ *
30238
+ * It answers "what can be served without touching the disk", never "how much
30239
+ * footage this camera has". A UI that renders it must label it as such, and
30240
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30241
+ * it, and so does a node whose ledger could not answer.
30242
+ */
30243
+ residentBytes: number().optional(),
30244
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30245
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30246
+ * retention. `null` = nothing resident. */
30247
+ residentOldestMs: number().nullable().optional()
30105
30248
  });
30106
30249
  /** Recording storage usage + capacity for one storage location. */
30107
30250
  var RecordingLocationUsageSchema = object({
@@ -30139,6 +30282,17 @@ var RecordingStorageUsageSchema = object({
30139
30282
  totalUsedBytes: number(),
30140
30283
  devices: array(RecordingDeviceUsageSchema),
30141
30284
  /**
30285
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30286
+ * disks (D418).
30287
+ *
30288
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30289
+ * declared no ledger and the recorder REFUSED rather than answering the
30290
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30291
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30292
+ * and its rows are residency.
30293
+ */
30294
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30295
+ /**
30142
30296
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30143
30297
  * of the payload without it: the hub serves this method through a BAKED
30144
30298
  * router, so a hub whose framework train predates a change to this array
@@ -34216,7 +34370,7 @@ function toDeviceSummary(device, addonId) {
34216
34370
  };
34217
34371
  }
34218
34372
  /**
34219
- * Base class for device-provider addons (rtsp, onvif, frigate).
34373
+ * Base class for device-provider addons (rtsp, onvif).
34220
34374
  *
34221
34375
  * Provides default implementations for the common device-provider cap
34222
34376
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -39078,6 +39232,24 @@ Object.freeze({
39078
39232
  addonId: null,
39079
39233
  access: "view"
39080
39234
  },
39235
+ "pipelineRunner.getParkedTrackFrame": {
39236
+ capName: "pipeline-runner",
39237
+ capScope: "system",
39238
+ addonId: null,
39239
+ access: "view"
39240
+ },
39241
+ "pipelineRunner.parkTrackFrame": {
39242
+ capName: "pipeline-runner",
39243
+ capScope: "system",
39244
+ addonId: null,
39245
+ access: "create"
39246
+ },
39247
+ "pipelineRunner.releaseParkedTrackFrames": {
39248
+ capName: "pipeline-runner",
39249
+ capScope: "system",
39250
+ addonId: null,
39251
+ access: "create"
39252
+ },
39081
39253
  "pipelineRunner.reportMotion": {
39082
39254
  capName: "pipeline-runner",
39083
39255
  capScope: "system",
@@ -42355,6 +42527,21 @@ Object.freeze({
42355
42527
  form: "single",
42356
42528
  optional: false
42357
42529
  }],
42530
+ "pipelineRunner.getParkedTrackFrame": [{
42531
+ name: "deviceId",
42532
+ form: "single",
42533
+ optional: false
42534
+ }],
42535
+ "pipelineRunner.parkTrackFrame": [{
42536
+ name: "deviceId",
42537
+ form: "single",
42538
+ optional: false
42539
+ }],
42540
+ "pipelineRunner.releaseParkedTrackFrames": [{
42541
+ name: "deviceId",
42542
+ form: "single",
42543
+ optional: false
42544
+ }],
42358
42545
  "pipelineRunner.reportMotion": [{
42359
42546
  name: "deviceId",
42360
42547
  form: "single",
@@ -43046,7 +43233,7 @@ var PreviewTextField = string().max(200);
43046
43233
  * Whether the notification's preview is a STILL or a short animation.
43047
43234
  *
43048
43235
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
43049
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
43236
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
43050
43237
  * night reads better as three seconds of motion than as one frame of it. Both
43051
43238
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
43052
43239
  * simply applies it to a dozen frames sampled across the render and assembles
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.
@@ -12621,7 +12620,7 @@ DeviceType.Camera;
12621
12620
  var SourceInfoSchema = object({
12622
12621
  /** Live dispatch key — mutable when the source system allows rename. */
12623
12622
  id: string(),
12624
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12623
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12625
12624
  system: string(),
12626
12625
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12627
12626
  * Used to detect rename when `id` changes. */
@@ -12634,7 +12633,7 @@ var SourceInfoSchema = object({
12634
12633
  /**
12635
12634
  * Build the synthetic SourceInfo every existing provider falls back to
12636
12635
  * when no upstream value has been persisted. Keeps non-migrated providers
12637
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12636
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12638
12637
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12639
12638
  * id. Real upstream identity replaces this once a provider migrates and
12640
12639
  * calls `updateSourceInfo()` with concrete values.
@@ -13296,7 +13295,7 @@ var deviceProviderCapability = {
13296
13295
  * - `device-management.router.ts` (deleted in Phase 2)
13297
13296
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13298
13297
  *
13299
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13298
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13300
13299
  * fork into separate processes but never run on remote cluster agents. Therefore:
13301
13300
  * - No nodeId routing needed — this is a pure hub singleton.
13302
13301
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17344,7 +17343,7 @@ var NcRuleInputSchema = object({
17344
17343
  * The measured seven-person arrival on device 590 spans 110 s with every
17345
17344
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17346
17345
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17347
- * 30 is Frigate's shipped value for the same decision.
17346
+ * 30 s is a widely shipped value for the same decision.
17348
17347
  *
17349
17348
  * ### What it replaces
17350
17349
  *
@@ -19426,6 +19425,13 @@ var ZoneCrossingSchema = object({
19426
19425
  /** Zone display name at crossing time (falls back to the id). */
19427
19426
  zoneName: string().optional()
19428
19427
  });
19428
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19429
+ var ZoneOverlapSchema = object({
19430
+ zoneId: string(),
19431
+ zoneName: string().optional(),
19432
+ /** Percentage of the BOX area inside the zone, 0–100. */
19433
+ overlapPct: number()
19434
+ });
19429
19435
  var ObjectEventSchema = object({
19430
19436
  ...BaseEventFields,
19431
19437
  kind: literal("object"),
@@ -19450,6 +19456,35 @@ var ObjectEventSchema = object({
19450
19456
  bbox: BoundingBoxSchema.optional(),
19451
19457
  /** Heavy JSON — omitted in slim projection. */
19452
19458
  zones: array(string()).readonly().optional(),
19459
+ /**
19460
+ * How far inside each stamped zone the box actually was, as a percentage of
19461
+ * the BOX area.
19462
+ *
19463
+ * Membership alone cannot express "at least a third of it inside", which is
19464
+ * the bar an operator argues with — and the number already existed: the
19465
+ * engine computed it, the pipeline logged it, and then discarded it. It
19466
+ * matters most on the events that carry no track, where a rule has nothing
19467
+ * else to judge by.
19468
+ */
19469
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19470
+ /**
19471
+ * Present when this event describes a detection the TRACKER refused, so it
19472
+ * has no track and never will.
19473
+ *
19474
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19475
+ * NOW?"; tracking answers a different question ("is this the same subject as
19476
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19477
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19478
+ * seconds with three different candidate ids — seven analysed frames in the
19479
+ * window, the subject in a handful of them, metres apart — and produced no
19480
+ * event at all.
19481
+ *
19482
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19483
+ * with no track and no reason is indistinguishable from a track whose media
19484
+ * went missing, and a consumer that asks this one for a best shot or a
19485
+ * history is asking for something that never existed.
19486
+ */
19487
+ spawnRefused: string().optional(),
19453
19488
  /** Omitted in slim projection. */
19454
19489
  state: TrackStateSchema.optional(),
19455
19490
  /**
@@ -20523,6 +20558,60 @@ var NativeCropResultSchema = object({
20523
20558
  */
20524
20559
  tier: _enum(["native", "ram-fullframe"]).optional()
20525
20560
  });
20561
+ /**
20562
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20563
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20564
+ *
20565
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20566
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20567
+ * from, and what the detail plane's full-frame rung cuts from.
20568
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20569
+ * window, cut by the runner at uncapped native resolution.
20570
+ *
20571
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20572
+ */
20573
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20574
+ /**
20575
+ * Why a park did NOT happen. Every one is logged on the runner with
20576
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20577
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20578
+ * never a reason to retry in a loop.
20579
+ *
20580
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20581
+ * registered, past the lease bound, or the worker released it). `detail`
20582
+ * carries the runner's own miss reason.
20583
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20584
+ */
20585
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20586
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20587
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20588
+ parked: literal(true),
20589
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20590
+ nodeId: string(),
20591
+ width: number().int().positive(),
20592
+ height: number().int().positive(),
20593
+ /** JPEG bytes the parcel costs on the node. */
20594
+ bytes: number().int().nonnegative(),
20595
+ /** Whether this park replaced a parcel already held for the key. */
20596
+ replaced: boolean()
20597
+ }), object({
20598
+ parked: literal(false),
20599
+ nodeId: string(),
20600
+ reason: ParkRefusalSchema,
20601
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20602
+ handleAgeMs: number().nullable(),
20603
+ detail: string().optional()
20604
+ })]);
20605
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20606
+ var ParkedTrackFrameSchema = object({
20607
+ jpeg: string(),
20608
+ width: number().int().positive(),
20609
+ height: number().int().positive(),
20610
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20611
+ timestamp: number(),
20612
+ /** When the node stored it (the node's clock). */
20613
+ parkedAt: number()
20614
+ });
20526
20615
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20527
20616
  * originating detection, in FRAME-space coordinates. Reuses
20528
20617
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20912,7 +21001,7 @@ var RunnerCameraConfigSchema = object({
20912
21001
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20913
21002
  * analyzer providers) running on decoded frames in this runner.
20914
21003
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20915
- * analytics, Frigate motion). The provider emits ProviderMotion
21004
+ * analytics). The provider emits ProviderMotion
20916
21005
  * events; the orchestrator forwards to `reportMotion`.
20917
21006
  */
20918
21007
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21154,7 +21243,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21154
21243
  className: string(),
21155
21244
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21156
21245
  sourceDeviceId: number()
21157
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21246
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21247
+ deviceId: number(),
21248
+ /** Opaque to the runner — the hub's track id. */
21249
+ trackId: string(),
21250
+ kind: ParkedFrameKindSchema,
21251
+ handle: FrameHandleSchema,
21252
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21253
+ bbox: NativeCropBboxSchema,
21254
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21255
+ maxWidth: number().int().positive().optional(),
21256
+ /** The frame instant (caller's clock) — orders parks for one key. */
21257
+ timestamp: number()
21258
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21259
+ deviceId: number(),
21260
+ trackId: string(),
21261
+ kind: ParkedFrameKindSchema
21262
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21263
+ deviceId: number(),
21264
+ trackId: string()
21265
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21158
21266
  var CameraPipelineConfigSchema = object({
21159
21267
  engine: PipelineEngineChoiceSchema.optional(),
21160
21268
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24328,8 +24436,8 @@ onStatusChanged: { data: object({
24328
24436
  /**
24329
24437
  * Runtime-state slice — every provider that registers this cap
24330
24438
  * stores the same shape under `device.runtimeState[battery]`.
24331
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24332
- * proxy, an ONVIF battery cam all read/write the same keys.
24439
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24440
+ * an ONVIF battery cam all read/write the same keys.
24333
24441
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24334
24442
  * via `device.runtimeState.getCapState('battery')` regardless of
24335
24443
  * the underlying driver.
@@ -24462,7 +24570,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24462
24570
  *
24463
24571
  * Implementations:
24464
24572
  * - Each camera-providing addon registers this cap natively per
24465
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24573
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24466
24574
  * - Returns a snapshot from the persisted device config blob — no
24467
24575
  * extra round-trip to the camera, no probing.
24468
24576
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26554,7 +26662,7 @@ var AvailableIntegrationTypeSchema = object({
26554
26662
  * Which integration-marker cap the addon declared, so the wizard can
26555
26663
  * branch on CAP — never on addon name. `device-adoption` integrations
26556
26664
  * (Home Assistant, …) route through the broker step (Approach A);
26557
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26665
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26558
26666
  * legacy config → discovery flow.
26559
26667
  */
26560
26668
  kind: _enum(["device-adoption", "device-provider"]),
@@ -30086,13 +30194,31 @@ var RecordingManifestSchema = object({
30086
30194
  */
30087
30195
  playbackEndpoints: array(string())
30088
30196
  });
30089
- /** Recording storage usage for one camera (bytes on disk across all its
30090
- * profiles/subtrees/locations on this node). */
30197
+ /**
30198
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30199
+ * across every profile and every resolvable location on this node.
30200
+ *
30201
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30202
+ *
30203
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30204
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30205
+ * this camera writes to, so the two can be added up and compared.
30206
+ *
30207
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30208
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30209
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30210
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30211
+ * that said otherwise, and two people read it as retention eating recent
30212
+ * footage. Residency is still reported, under `residentBytes` /
30213
+ * `residentOldestMs`, which answer a different question and say so.
30214
+ */
30091
30215
  var RecordingDeviceUsageSchema = object({
30092
30216
  deviceId: number(),
30217
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30218
+ * recordings locations. */
30093
30219
  usedBytes: number(),
30094
30220
  /**
30095
- * Start of this camera's OLDEST indexed segment, across every profile and
30221
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
30096
30222
  * location — the "Oldest footage" column in Recordings → Storage, and the
30097
30223
  * only honest answer to "is retention actually holding?" per camera.
30098
30224
  *
@@ -30102,7 +30228,24 @@ var RecordingDeviceUsageSchema = object({
30102
30228
  * (types) and the addon ship on different trains, and the addon is usually
30103
30229
  * the later of the two.
30104
30230
  */
30105
- oldestMs: number().nullable().optional()
30231
+ oldestMs: number().nullable().optional(),
30232
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30233
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30234
+ segments: number().optional(),
30235
+ /**
30236
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30237
+ * its RAM index — the live tail plus the hours a reader hydrated.
30238
+ *
30239
+ * It answers "what can be served without touching the disk", never "how much
30240
+ * footage this camera has". A UI that renders it must label it as such, and
30241
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30242
+ * it, and so does a node whose ledger could not answer.
30243
+ */
30244
+ residentBytes: number().optional(),
30245
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30246
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30247
+ * retention. `null` = nothing resident. */
30248
+ residentOldestMs: number().nullable().optional()
30106
30249
  });
30107
30250
  /** Recording storage usage + capacity for one storage location. */
30108
30251
  var RecordingLocationUsageSchema = object({
@@ -30140,6 +30283,17 @@ var RecordingStorageUsageSchema = object({
30140
30283
  totalUsedBytes: number(),
30141
30284
  devices: array(RecordingDeviceUsageSchema),
30142
30285
  /**
30286
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30287
+ * disks (D418).
30288
+ *
30289
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30290
+ * declared no ledger and the recorder REFUSED rather than answering the
30291
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30292
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30293
+ * and its rows are residency.
30294
+ */
30295
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30296
+ /**
30143
30297
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30144
30298
  * of the payload without it: the hub serves this method through a BAKED
30145
30299
  * router, so a hub whose framework train predates a change to this array
@@ -34217,7 +34371,7 @@ function toDeviceSummary(device, addonId) {
34217
34371
  };
34218
34372
  }
34219
34373
  /**
34220
- * Base class for device-provider addons (rtsp, onvif, frigate).
34374
+ * Base class for device-provider addons (rtsp, onvif).
34221
34375
  *
34222
34376
  * Provides default implementations for the common device-provider cap
34223
34377
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -39079,6 +39233,24 @@ Object.freeze({
39079
39233
  addonId: null,
39080
39234
  access: "view"
39081
39235
  },
39236
+ "pipelineRunner.getParkedTrackFrame": {
39237
+ capName: "pipeline-runner",
39238
+ capScope: "system",
39239
+ addonId: null,
39240
+ access: "view"
39241
+ },
39242
+ "pipelineRunner.parkTrackFrame": {
39243
+ capName: "pipeline-runner",
39244
+ capScope: "system",
39245
+ addonId: null,
39246
+ access: "create"
39247
+ },
39248
+ "pipelineRunner.releaseParkedTrackFrames": {
39249
+ capName: "pipeline-runner",
39250
+ capScope: "system",
39251
+ addonId: null,
39252
+ access: "create"
39253
+ },
39082
39254
  "pipelineRunner.reportMotion": {
39083
39255
  capName: "pipeline-runner",
39084
39256
  capScope: "system",
@@ -42356,6 +42528,21 @@ Object.freeze({
42356
42528
  form: "single",
42357
42529
  optional: false
42358
42530
  }],
42531
+ "pipelineRunner.getParkedTrackFrame": [{
42532
+ name: "deviceId",
42533
+ form: "single",
42534
+ optional: false
42535
+ }],
42536
+ "pipelineRunner.parkTrackFrame": [{
42537
+ name: "deviceId",
42538
+ form: "single",
42539
+ optional: false
42540
+ }],
42541
+ "pipelineRunner.releaseParkedTrackFrames": [{
42542
+ name: "deviceId",
42543
+ form: "single",
42544
+ optional: false
42545
+ }],
42359
42546
  "pipelineRunner.reportMotion": [{
42360
42547
  name: "deviceId",
42361
42548
  form: "single",
@@ -43047,7 +43234,7 @@ var PreviewTextField = string().max(200);
43047
43234
  * Whether the notification's preview is a STILL or a short animation.
43048
43235
  *
43049
43236
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
43050
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
43237
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
43051
43238
  * night reads better as three seconds of motion than as one frame of it. Both
43052
43239
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
43053
43240
  * 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-amcrest",
3
- "version": "0.2.91",
3
+ "version": "0.2.94",
4
4
  "description": "Amcrest/Dahua camera device provider addon for CamStack — Dahua CGI over HTTP(S) with digest auth (snapshot, RTSP catalog, PTZ, image/day-night config)",
5
5
  "keywords": [
6
6
  "camstack",