@camstack/addon-provider-petkit 0.2.89 → 0.2.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +205 -18
  2. package/dist/addon.mjs +205 -18
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1101,7 +1101,7 @@ var Nodepetkit = class {
1101
1101
  }
1102
1102
  };
1103
1103
  //#endregion
1104
- //#region ../types/dist/event-category-CnLqLOKs.mjs
1104
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
1105
1105
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
1106
1106
  EventCategory["SystemBoot"] = "system.boot";
1107
1107
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1693,7 +1693,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1693
1693
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
1694
1694
  */
1695
1695
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
1696
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
1697
1696
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
1698
1697
  /**
1699
1698
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -13727,7 +13726,7 @@ DeviceType.Camera;
13727
13726
  var SourceInfoSchema = object({
13728
13727
  /** Live dispatch key — mutable when the source system allows rename. */
13729
13728
  id: string(),
13730
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
13729
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
13731
13730
  system: string(),
13732
13731
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
13733
13732
  * Used to detect rename when `id` changes. */
@@ -13740,7 +13739,7 @@ var SourceInfoSchema = object({
13740
13739
  /**
13741
13740
  * Build the synthetic SourceInfo every existing provider falls back to
13742
13741
  * when no upstream value has been persisted. Keeps non-migrated providers
13743
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
13742
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
13744
13743
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
13745
13744
  * id. Real upstream identity replaces this once a provider migrates and
13746
13745
  * calls `updateSourceInfo()` with concrete values.
@@ -14419,7 +14418,7 @@ var deviceProviderCapability = {
14419
14418
  * - `device-management.router.ts` (deleted in Phase 2)
14420
14419
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
14421
14420
  *
14422
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
14421
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
14423
14422
  * fork into separate processes but never run on remote cluster agents. Therefore:
14424
14423
  * - No nodeId routing needed — this is a pure hub singleton.
14425
14424
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -18467,7 +18466,7 @@ var NcRuleInputSchema = object({
18467
18466
  * The measured seven-person arrival on device 590 spans 110 s with every
18468
18467
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
18469
18468
  * idle cutoff holds it as one and ends it when the arrival actually ends.
18470
- * 30 is Frigate's shipped value for the same decision.
18469
+ * 30 s is a widely shipped value for the same decision.
18471
18470
  *
18472
18471
  * ### What it replaces
18473
18472
  *
@@ -20549,6 +20548,13 @@ var ZoneCrossingSchema = object({
20549
20548
  /** Zone display name at crossing time (falls back to the id). */
20550
20549
  zoneName: string().optional()
20551
20550
  });
20551
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
20552
+ var ZoneOverlapSchema = object({
20553
+ zoneId: string(),
20554
+ zoneName: string().optional(),
20555
+ /** Percentage of the BOX area inside the zone, 0–100. */
20556
+ overlapPct: number()
20557
+ });
20552
20558
  var ObjectEventSchema = object({
20553
20559
  ...BaseEventFields,
20554
20560
  kind: literal("object"),
@@ -20573,6 +20579,35 @@ var ObjectEventSchema = object({
20573
20579
  bbox: BoundingBoxSchema.optional(),
20574
20580
  /** Heavy JSON — omitted in slim projection. */
20575
20581
  zones: array(string()).readonly().optional(),
20582
+ /**
20583
+ * How far inside each stamped zone the box actually was, as a percentage of
20584
+ * the BOX area.
20585
+ *
20586
+ * Membership alone cannot express "at least a third of it inside", which is
20587
+ * the bar an operator argues with — and the number already existed: the
20588
+ * engine computed it, the pipeline logged it, and then discarded it. It
20589
+ * matters most on the events that carry no track, where a rule has nothing
20590
+ * else to judge by.
20591
+ */
20592
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
20593
+ /**
20594
+ * Present when this event describes a detection the TRACKER refused, so it
20595
+ * has no track and never will.
20596
+ *
20597
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
20598
+ * NOW?"; tracking answers a different question ("is this the same subject as
20599
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
20600
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
20601
+ * seconds with three different candidate ids — seven analysed frames in the
20602
+ * window, the subject in a handful of them, metres apart — and produced no
20603
+ * event at all.
20604
+ *
20605
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
20606
+ * with no track and no reason is indistinguishable from a track whose media
20607
+ * went missing, and a consumer that asks this one for a best shot or a
20608
+ * history is asking for something that never existed.
20609
+ */
20610
+ spawnRefused: string().optional(),
20576
20611
  /** Omitted in slim projection. */
20577
20612
  state: TrackStateSchema.optional(),
20578
20613
  /**
@@ -21646,6 +21681,60 @@ var NativeCropResultSchema = object({
21646
21681
  */
21647
21682
  tier: _enum(["native", "ram-fullframe"]).optional()
21648
21683
  });
21684
+ /**
21685
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
21686
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
21687
+ *
21688
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
21689
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
21690
+ * from, and what the detail plane's full-frame rung cuts from.
21691
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
21692
+ * window, cut by the runner at uncapped native resolution.
21693
+ *
21694
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
21695
+ */
21696
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
21697
+ /**
21698
+ * Why a park did NOT happen. Every one is logged on the runner with
21699
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
21700
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
21701
+ * never a reason to retry in a loop.
21702
+ *
21703
+ * - `handle-gone` — the native surface no longer resolves this handle (never
21704
+ * registered, past the lease bound, or the worker released it). `detail`
21705
+ * carries the runner's own miss reason.
21706
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
21707
+ */
21708
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
21709
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
21710
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
21711
+ parked: literal(true),
21712
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
21713
+ nodeId: string(),
21714
+ width: number().int().positive(),
21715
+ height: number().int().positive(),
21716
+ /** JPEG bytes the parcel costs on the node. */
21717
+ bytes: number().int().nonnegative(),
21718
+ /** Whether this park replaced a parcel already held for the key. */
21719
+ replaced: boolean()
21720
+ }), object({
21721
+ parked: literal(false),
21722
+ nodeId: string(),
21723
+ reason: ParkRefusalSchema,
21724
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
21725
+ handleAgeMs: number().nullable(),
21726
+ detail: string().optional()
21727
+ })]);
21728
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
21729
+ var ParkedTrackFrameSchema = object({
21730
+ jpeg: string(),
21731
+ width: number().int().positive(),
21732
+ height: number().int().positive(),
21733
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
21734
+ timestamp: number(),
21735
+ /** When the node stored it (the node's clock). */
21736
+ parkedAt: number()
21737
+ });
21649
21738
  /** Parent detection context passed to `runDetailSubtree` — the crop's
21650
21739
  * originating detection, in FRAME-space coordinates. Reuses
21651
21740
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -22035,7 +22124,7 @@ var RunnerCameraConfigSchema = object({
22035
22124
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
22036
22125
  * analyzer providers) running on decoded frames in this runner.
22037
22126
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
22038
- * analytics, Frigate motion). The provider emits ProviderMotion
22127
+ * analytics). The provider emits ProviderMotion
22039
22128
  * events; the orchestrator forwards to `reportMotion`.
22040
22129
  */
22041
22130
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -22277,7 +22366,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
22277
22366
  className: string(),
22278
22367
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
22279
22368
  sourceDeviceId: number()
22280
- }), RunStatelessStepResultSchema, { kind: "mutation" });
22369
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
22370
+ deviceId: number(),
22371
+ /** Opaque to the runner — the hub's track id. */
22372
+ trackId: string(),
22373
+ kind: ParkedFrameKindSchema,
22374
+ handle: FrameHandleSchema,
22375
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
22376
+ bbox: NativeCropBboxSchema,
22377
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
22378
+ maxWidth: number().int().positive().optional(),
22379
+ /** The frame instant (caller's clock) — orders parks for one key. */
22380
+ timestamp: number()
22381
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
22382
+ deviceId: number(),
22383
+ trackId: string(),
22384
+ kind: ParkedFrameKindSchema
22385
+ }), ParkedTrackFrameSchema.nullable()), method(object({
22386
+ deviceId: number(),
22387
+ trackId: string()
22388
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
22281
22389
  var CameraPipelineConfigSchema = object({
22282
22390
  engine: PipelineEngineChoiceSchema.optional(),
22283
22391
  steps: array(PipelineStepInputSchema).readonly(),
@@ -25347,8 +25455,8 @@ onStatusChanged: { data: object({
25347
25455
  /**
25348
25456
  * Runtime-state slice — every provider that registers this cap
25349
25457
  * stores the same shape under `device.runtimeState[battery]`.
25350
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
25351
- * proxy, an ONVIF battery cam all read/write the same keys.
25458
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
25459
+ * an ONVIF battery cam all read/write the same keys.
25352
25460
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
25353
25461
  * via `device.runtimeState.getCapState('battery')` regardless of
25354
25462
  * the underlying driver.
@@ -25481,7 +25589,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
25481
25589
  *
25482
25590
  * Implementations:
25483
25591
  * - Each camera-providing addon registers this cap natively per
25484
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
25592
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
25485
25593
  * - Returns a snapshot from the persisted device config blob — no
25486
25594
  * extra round-trip to the camera, no probing.
25487
25595
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -27581,7 +27689,7 @@ var AvailableIntegrationTypeSchema = object({
27581
27689
  * Which integration-marker cap the addon declared, so the wizard can
27582
27690
  * branch on CAP — never on addon name. `device-adoption` integrations
27583
27691
  * (Home Assistant, …) route through the broker step (Approach A);
27584
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
27692
+ * `device-provider` integrations (Reolink/ONVIF) keep the
27585
27693
  * legacy config → discovery flow.
27586
27694
  */
27587
27695
  kind: _enum(["device-adoption", "device-provider"]),
@@ -31005,13 +31113,31 @@ var RecordingManifestSchema = object({
31005
31113
  */
31006
31114
  playbackEndpoints: array(string())
31007
31115
  });
31008
- /** Recording storage usage for one camera (bytes on disk across all its
31009
- * profiles/subtrees/locations on this node). */
31116
+ /**
31117
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
31118
+ * across every profile and every resolvable location on this node.
31119
+ *
31120
+ * ## Archive vs residency, which is the whole point of this shape (D418)
31121
+ *
31122
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
31123
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
31124
+ * this camera writes to, so the two can be added up and compared.
31125
+ *
31126
+ * They were not always. Until D418 this row came from the recorder's in-RAM
31127
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
31128
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
31129
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
31130
+ * that said otherwise, and two people read it as retention eating recent
31131
+ * footage. Residency is still reported, under `residentBytes` /
31132
+ * `residentOldestMs`, which answer a different question and say so.
31133
+ */
31010
31134
  var RecordingDeviceUsageSchema = object({
31011
31135
  deviceId: number(),
31136
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
31137
+ * recordings locations. */
31012
31138
  usedBytes: number(),
31013
31139
  /**
31014
- * Start of this camera's OLDEST indexed segment, across every profile and
31140
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
31015
31141
  * location — the "Oldest footage" column in Recordings → Storage, and the
31016
31142
  * only honest answer to "is retention actually holding?" per camera.
31017
31143
  *
@@ -31021,7 +31147,24 @@ var RecordingDeviceUsageSchema = object({
31021
31147
  * (types) and the addon ship on different trains, and the addon is usually
31022
31148
  * the later of the two.
31023
31149
  */
31024
- oldestMs: number().nullable().optional()
31150
+ oldestMs: number().nullable().optional(),
31151
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
31152
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
31153
+ segments: number().optional(),
31154
+ /**
31155
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
31156
+ * its RAM index — the live tail plus the hours a reader hydrated.
31157
+ *
31158
+ * It answers "what can be served without touching the disk", never "how much
31159
+ * footage this camera has". A UI that renders it must label it as such, and
31160
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
31161
+ * it, and so does a node whose ledger could not answer.
31162
+ */
31163
+ residentBytes: number().optional(),
31164
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
31165
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
31166
+ * retention. `null` = nothing resident. */
31167
+ residentOldestMs: number().nullable().optional()
31025
31168
  });
31026
31169
  /** Recording storage usage + capacity for one storage location. */
31027
31170
  var RecordingLocationUsageSchema = object({
@@ -31059,6 +31202,17 @@ var RecordingStorageUsageSchema = object({
31059
31202
  totalUsedBytes: number(),
31060
31203
  devices: array(RecordingDeviceUsageSchema),
31061
31204
  /**
31205
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
31206
+ * disks (D418).
31207
+ *
31208
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
31209
+ * declared no ledger and the recorder REFUSED rather than answering the
31210
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
31211
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
31212
+ * and its rows are residency.
31213
+ */
31214
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
31215
+ /**
31062
31216
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
31063
31217
  * of the payload without it: the hub serves this method through a BAKED
31064
31218
  * router, so a hub whose framework train predates a change to this array
@@ -34938,7 +35092,7 @@ function toDeviceSummary(device, addonId) {
34938
35092
  };
34939
35093
  }
34940
35094
  /**
34941
- * Base class for device-provider addons (rtsp, onvif, frigate).
35095
+ * Base class for device-provider addons (rtsp, onvif).
34942
35096
  *
34943
35097
  * Provides default implementations for the common device-provider cap
34944
35098
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -39594,6 +39748,24 @@ Object.freeze({
39594
39748
  addonId: null,
39595
39749
  access: "view"
39596
39750
  },
39751
+ "pipelineRunner.getParkedTrackFrame": {
39752
+ capName: "pipeline-runner",
39753
+ capScope: "system",
39754
+ addonId: null,
39755
+ access: "view"
39756
+ },
39757
+ "pipelineRunner.parkTrackFrame": {
39758
+ capName: "pipeline-runner",
39759
+ capScope: "system",
39760
+ addonId: null,
39761
+ access: "create"
39762
+ },
39763
+ "pipelineRunner.releaseParkedTrackFrames": {
39764
+ capName: "pipeline-runner",
39765
+ capScope: "system",
39766
+ addonId: null,
39767
+ access: "create"
39768
+ },
39597
39769
  "pipelineRunner.reportMotion": {
39598
39770
  capName: "pipeline-runner",
39599
39771
  capScope: "system",
@@ -42871,6 +43043,21 @@ Object.freeze({
42871
43043
  form: "single",
42872
43044
  optional: false
42873
43045
  }],
43046
+ "pipelineRunner.getParkedTrackFrame": [{
43047
+ name: "deviceId",
43048
+ form: "single",
43049
+ optional: false
43050
+ }],
43051
+ "pipelineRunner.parkTrackFrame": [{
43052
+ name: "deviceId",
43053
+ form: "single",
43054
+ optional: false
43055
+ }],
43056
+ "pipelineRunner.releaseParkedTrackFrames": [{
43057
+ name: "deviceId",
43058
+ form: "single",
43059
+ optional: false
43060
+ }],
42874
43061
  "pipelineRunner.reportMotion": [{
42875
43062
  name: "deviceId",
42876
43063
  form: "single",
@@ -43562,7 +43749,7 @@ var PreviewTextField = string().max(200);
43562
43749
  * Whether the notification's preview is a STILL or a short animation.
43563
43750
  *
43564
43751
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
43565
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
43752
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
43566
43753
  * night reads better as three seconds of motion than as one frame of it. Both
43567
43754
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
43568
43755
  * simply applies it to a dozen frames sampled across the render and assembles
package/dist/addon.mjs CHANGED
@@ -1100,7 +1100,7 @@ var Nodepetkit = class {
1100
1100
  }
1101
1101
  };
1102
1102
  //#endregion
1103
- //#region ../types/dist/event-category-CnLqLOKs.mjs
1103
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
1104
1104
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
1105
1105
  EventCategory["SystemBoot"] = "system.boot";
1106
1106
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1692,7 +1692,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1692
1692
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
1693
1693
  */
1694
1694
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
1695
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
1696
1695
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
1697
1696
  /**
1698
1697
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -13726,7 +13725,7 @@ DeviceType.Camera;
13726
13725
  var SourceInfoSchema = object({
13727
13726
  /** Live dispatch key — mutable when the source system allows rename. */
13728
13727
  id: string(),
13729
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
13728
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
13730
13729
  system: string(),
13731
13730
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
13732
13731
  * Used to detect rename when `id` changes. */
@@ -13739,7 +13738,7 @@ var SourceInfoSchema = object({
13739
13738
  /**
13740
13739
  * Build the synthetic SourceInfo every existing provider falls back to
13741
13740
  * when no upstream value has been persisted. Keeps non-migrated providers
13742
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
13741
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
13743
13742
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
13744
13743
  * id. Real upstream identity replaces this once a provider migrates and
13745
13744
  * calls `updateSourceInfo()` with concrete values.
@@ -14418,7 +14417,7 @@ var deviceProviderCapability = {
14418
14417
  * - `device-management.router.ts` (deleted in Phase 2)
14419
14418
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
14420
14419
  *
14421
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
14420
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
14422
14421
  * fork into separate processes but never run on remote cluster agents. Therefore:
14423
14422
  * - No nodeId routing needed — this is a pure hub singleton.
14424
14423
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -18466,7 +18465,7 @@ var NcRuleInputSchema = object({
18466
18465
  * The measured seven-person arrival on device 590 spans 110 s with every
18467
18466
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
18468
18467
  * idle cutoff holds it as one and ends it when the arrival actually ends.
18469
- * 30 is Frigate's shipped value for the same decision.
18468
+ * 30 s is a widely shipped value for the same decision.
18470
18469
  *
18471
18470
  * ### What it replaces
18472
18471
  *
@@ -20548,6 +20547,13 @@ var ZoneCrossingSchema = object({
20548
20547
  /** Zone display name at crossing time (falls back to the id). */
20549
20548
  zoneName: string().optional()
20550
20549
  });
20550
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
20551
+ var ZoneOverlapSchema = object({
20552
+ zoneId: string(),
20553
+ zoneName: string().optional(),
20554
+ /** Percentage of the BOX area inside the zone, 0–100. */
20555
+ overlapPct: number()
20556
+ });
20551
20557
  var ObjectEventSchema = object({
20552
20558
  ...BaseEventFields,
20553
20559
  kind: literal("object"),
@@ -20572,6 +20578,35 @@ var ObjectEventSchema = object({
20572
20578
  bbox: BoundingBoxSchema.optional(),
20573
20579
  /** Heavy JSON — omitted in slim projection. */
20574
20580
  zones: array(string()).readonly().optional(),
20581
+ /**
20582
+ * How far inside each stamped zone the box actually was, as a percentage of
20583
+ * the BOX area.
20584
+ *
20585
+ * Membership alone cannot express "at least a third of it inside", which is
20586
+ * the bar an operator argues with — and the number already existed: the
20587
+ * engine computed it, the pipeline logged it, and then discarded it. It
20588
+ * matters most on the events that carry no track, where a rule has nothing
20589
+ * else to judge by.
20590
+ */
20591
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
20592
+ /**
20593
+ * Present when this event describes a detection the TRACKER refused, so it
20594
+ * has no track and never will.
20595
+ *
20596
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
20597
+ * NOW?"; tracking answers a different question ("is this the same subject as
20598
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
20599
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
20600
+ * seconds with three different candidate ids — seven analysed frames in the
20601
+ * window, the subject in a handful of them, metres apart — and produced no
20602
+ * event at all.
20603
+ *
20604
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
20605
+ * with no track and no reason is indistinguishable from a track whose media
20606
+ * went missing, and a consumer that asks this one for a best shot or a
20607
+ * history is asking for something that never existed.
20608
+ */
20609
+ spawnRefused: string().optional(),
20575
20610
  /** Omitted in slim projection. */
20576
20611
  state: TrackStateSchema.optional(),
20577
20612
  /**
@@ -21645,6 +21680,60 @@ var NativeCropResultSchema = object({
21645
21680
  */
21646
21681
  tier: _enum(["native", "ram-fullframe"]).optional()
21647
21682
  });
21683
+ /**
21684
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
21685
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
21686
+ *
21687
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
21688
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
21689
+ * from, and what the detail plane's full-frame rung cuts from.
21690
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
21691
+ * window, cut by the runner at uncapped native resolution.
21692
+ *
21693
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
21694
+ */
21695
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
21696
+ /**
21697
+ * Why a park did NOT happen. Every one is logged on the runner with
21698
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
21699
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
21700
+ * never a reason to retry in a loop.
21701
+ *
21702
+ * - `handle-gone` — the native surface no longer resolves this handle (never
21703
+ * registered, past the lease bound, or the worker released it). `detail`
21704
+ * carries the runner's own miss reason.
21705
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
21706
+ */
21707
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
21708
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
21709
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
21710
+ parked: literal(true),
21711
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
21712
+ nodeId: string(),
21713
+ width: number().int().positive(),
21714
+ height: number().int().positive(),
21715
+ /** JPEG bytes the parcel costs on the node. */
21716
+ bytes: number().int().nonnegative(),
21717
+ /** Whether this park replaced a parcel already held for the key. */
21718
+ replaced: boolean()
21719
+ }), object({
21720
+ parked: literal(false),
21721
+ nodeId: string(),
21722
+ reason: ParkRefusalSchema,
21723
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
21724
+ handleAgeMs: number().nullable(),
21725
+ detail: string().optional()
21726
+ })]);
21727
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
21728
+ var ParkedTrackFrameSchema = object({
21729
+ jpeg: string(),
21730
+ width: number().int().positive(),
21731
+ height: number().int().positive(),
21732
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
21733
+ timestamp: number(),
21734
+ /** When the node stored it (the node's clock). */
21735
+ parkedAt: number()
21736
+ });
21648
21737
  /** Parent detection context passed to `runDetailSubtree` — the crop's
21649
21738
  * originating detection, in FRAME-space coordinates. Reuses
21650
21739
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -22034,7 +22123,7 @@ var RunnerCameraConfigSchema = object({
22034
22123
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
22035
22124
  * analyzer providers) running on decoded frames in this runner.
22036
22125
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
22037
- * analytics, Frigate motion). The provider emits ProviderMotion
22126
+ * analytics). The provider emits ProviderMotion
22038
22127
  * events; the orchestrator forwards to `reportMotion`.
22039
22128
  */
22040
22129
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -22276,7 +22365,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
22276
22365
  className: string(),
22277
22366
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
22278
22367
  sourceDeviceId: number()
22279
- }), RunStatelessStepResultSchema, { kind: "mutation" });
22368
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
22369
+ deviceId: number(),
22370
+ /** Opaque to the runner — the hub's track id. */
22371
+ trackId: string(),
22372
+ kind: ParkedFrameKindSchema,
22373
+ handle: FrameHandleSchema,
22374
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
22375
+ bbox: NativeCropBboxSchema,
22376
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
22377
+ maxWidth: number().int().positive().optional(),
22378
+ /** The frame instant (caller's clock) — orders parks for one key. */
22379
+ timestamp: number()
22380
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
22381
+ deviceId: number(),
22382
+ trackId: string(),
22383
+ kind: ParkedFrameKindSchema
22384
+ }), ParkedTrackFrameSchema.nullable()), method(object({
22385
+ deviceId: number(),
22386
+ trackId: string()
22387
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
22280
22388
  var CameraPipelineConfigSchema = object({
22281
22389
  engine: PipelineEngineChoiceSchema.optional(),
22282
22390
  steps: array(PipelineStepInputSchema).readonly(),
@@ -25346,8 +25454,8 @@ onStatusChanged: { data: object({
25346
25454
  /**
25347
25455
  * Runtime-state slice — every provider that registers this cap
25348
25456
  * stores the same shape under `device.runtimeState[battery]`.
25349
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
25350
- * proxy, an ONVIF battery cam all read/write the same keys.
25457
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
25458
+ * an ONVIF battery cam all read/write the same keys.
25351
25459
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
25352
25460
  * via `device.runtimeState.getCapState('battery')` regardless of
25353
25461
  * the underlying driver.
@@ -25480,7 +25588,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
25480
25588
  *
25481
25589
  * Implementations:
25482
25590
  * - Each camera-providing addon registers this cap natively per
25483
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
25591
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
25484
25592
  * - Returns a snapshot from the persisted device config blob — no
25485
25593
  * extra round-trip to the camera, no probing.
25486
25594
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -27580,7 +27688,7 @@ var AvailableIntegrationTypeSchema = object({
27580
27688
  * Which integration-marker cap the addon declared, so the wizard can
27581
27689
  * branch on CAP — never on addon name. `device-adoption` integrations
27582
27690
  * (Home Assistant, …) route through the broker step (Approach A);
27583
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
27691
+ * `device-provider` integrations (Reolink/ONVIF) keep the
27584
27692
  * legacy config → discovery flow.
27585
27693
  */
27586
27694
  kind: _enum(["device-adoption", "device-provider"]),
@@ -31004,13 +31112,31 @@ var RecordingManifestSchema = object({
31004
31112
  */
31005
31113
  playbackEndpoints: array(string())
31006
31114
  });
31007
- /** Recording storage usage for one camera (bytes on disk across all its
31008
- * profiles/subtrees/locations on this node). */
31115
+ /**
31116
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
31117
+ * across every profile and every resolvable location on this node.
31118
+ *
31119
+ * ## Archive vs residency, which is the whole point of this shape (D418)
31120
+ *
31121
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
31122
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
31123
+ * this camera writes to, so the two can be added up and compared.
31124
+ *
31125
+ * They were not always. Until D418 this row came from the recorder's in-RAM
31126
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
31127
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
31128
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
31129
+ * that said otherwise, and two people read it as retention eating recent
31130
+ * footage. Residency is still reported, under `residentBytes` /
31131
+ * `residentOldestMs`, which answer a different question and say so.
31132
+ */
31009
31133
  var RecordingDeviceUsageSchema = object({
31010
31134
  deviceId: number(),
31135
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
31136
+ * recordings locations. */
31011
31137
  usedBytes: number(),
31012
31138
  /**
31013
- * Start of this camera's OLDEST indexed segment, across every profile and
31139
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
31014
31140
  * location — the "Oldest footage" column in Recordings → Storage, and the
31015
31141
  * only honest answer to "is retention actually holding?" per camera.
31016
31142
  *
@@ -31020,7 +31146,24 @@ var RecordingDeviceUsageSchema = object({
31020
31146
  * (types) and the addon ship on different trains, and the addon is usually
31021
31147
  * the later of the two.
31022
31148
  */
31023
- oldestMs: number().nullable().optional()
31149
+ oldestMs: number().nullable().optional(),
31150
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
31151
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
31152
+ segments: number().optional(),
31153
+ /**
31154
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
31155
+ * its RAM index — the live tail plus the hours a reader hydrated.
31156
+ *
31157
+ * It answers "what can be served without touching the disk", never "how much
31158
+ * footage this camera has". A UI that renders it must label it as such, and
31159
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
31160
+ * it, and so does a node whose ledger could not answer.
31161
+ */
31162
+ residentBytes: number().optional(),
31163
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
31164
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
31165
+ * retention. `null` = nothing resident. */
31166
+ residentOldestMs: number().nullable().optional()
31024
31167
  });
31025
31168
  /** Recording storage usage + capacity for one storage location. */
31026
31169
  var RecordingLocationUsageSchema = object({
@@ -31058,6 +31201,17 @@ var RecordingStorageUsageSchema = object({
31058
31201
  totalUsedBytes: number(),
31059
31202
  devices: array(RecordingDeviceUsageSchema),
31060
31203
  /**
31204
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
31205
+ * disks (D418).
31206
+ *
31207
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
31208
+ * declared no ledger and the recorder REFUSED rather than answering the
31209
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
31210
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
31211
+ * and its rows are residency.
31212
+ */
31213
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
31214
+ /**
31061
31215
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
31062
31216
  * of the payload without it: the hub serves this method through a BAKED
31063
31217
  * router, so a hub whose framework train predates a change to this array
@@ -34937,7 +35091,7 @@ function toDeviceSummary(device, addonId) {
34937
35091
  };
34938
35092
  }
34939
35093
  /**
34940
- * Base class for device-provider addons (rtsp, onvif, frigate).
35094
+ * Base class for device-provider addons (rtsp, onvif).
34941
35095
  *
34942
35096
  * Provides default implementations for the common device-provider cap
34943
35097
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -39593,6 +39747,24 @@ Object.freeze({
39593
39747
  addonId: null,
39594
39748
  access: "view"
39595
39749
  },
39750
+ "pipelineRunner.getParkedTrackFrame": {
39751
+ capName: "pipeline-runner",
39752
+ capScope: "system",
39753
+ addonId: null,
39754
+ access: "view"
39755
+ },
39756
+ "pipelineRunner.parkTrackFrame": {
39757
+ capName: "pipeline-runner",
39758
+ capScope: "system",
39759
+ addonId: null,
39760
+ access: "create"
39761
+ },
39762
+ "pipelineRunner.releaseParkedTrackFrames": {
39763
+ capName: "pipeline-runner",
39764
+ capScope: "system",
39765
+ addonId: null,
39766
+ access: "create"
39767
+ },
39596
39768
  "pipelineRunner.reportMotion": {
39597
39769
  capName: "pipeline-runner",
39598
39770
  capScope: "system",
@@ -42870,6 +43042,21 @@ Object.freeze({
42870
43042
  form: "single",
42871
43043
  optional: false
42872
43044
  }],
43045
+ "pipelineRunner.getParkedTrackFrame": [{
43046
+ name: "deviceId",
43047
+ form: "single",
43048
+ optional: false
43049
+ }],
43050
+ "pipelineRunner.parkTrackFrame": [{
43051
+ name: "deviceId",
43052
+ form: "single",
43053
+ optional: false
43054
+ }],
43055
+ "pipelineRunner.releaseParkedTrackFrames": [{
43056
+ name: "deviceId",
43057
+ form: "single",
43058
+ optional: false
43059
+ }],
42873
43060
  "pipelineRunner.reportMotion": [{
42874
43061
  name: "deviceId",
42875
43062
  form: "single",
@@ -43561,7 +43748,7 @@ var PreviewTextField = string().max(200);
43561
43748
  * Whether the notification's preview is a STILL or a short animation.
43562
43749
  *
43563
43750
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
43564
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
43751
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
43565
43752
  * night reads better as three seconds of motion than as one frame of it. Both
43566
43753
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
43567
43754
  * 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-petkit",
3
- "version": "0.2.89",
3
+ "version": "0.2.92",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",