@camstack/addon-export-hap 1.2.101 → 1.2.104

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.
@@ -84,7 +84,7 @@ function carryForward(base, existing, keys) {
84
84
  return out;
85
85
  }
86
86
  //#endregion
87
- //#region ../types/dist/event-category-CnLqLOKs.mjs
87
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
88
88
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
89
89
  EventCategory["SystemBoot"] = "system.boot";
90
90
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -676,7 +676,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
676
676
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
677
677
  */
678
678
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
679
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
680
679
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
681
680
  /**
682
681
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -13299,7 +13298,7 @@ DeviceType.Camera;
13299
13298
  var SourceInfoSchema = object({
13300
13299
  /** Live dispatch key — mutable when the source system allows rename. */
13301
13300
  id: string(),
13302
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
13301
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
13303
13302
  system: string(),
13304
13303
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
13305
13304
  * Used to detect rename when `id` changes. */
@@ -13811,7 +13810,7 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
13811
13810
  * - `device-management.router.ts` (deleted in Phase 2)
13812
13811
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13813
13812
  *
13814
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13813
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13815
13814
  * fork into separate processes but never run on remote cluster agents. Therefore:
13816
13815
  * - No nodeId routing needed — this is a pure hub singleton.
13817
13816
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17821,7 +17820,7 @@ var NcRuleInputSchema = object({
17821
17820
  * The measured seven-person arrival on device 590 spans 110 s with every
17822
17821
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17823
17822
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17824
- * 30 is Frigate's shipped value for the same decision.
17823
+ * 30 s is a widely shipped value for the same decision.
17825
17824
  *
17826
17825
  * ### What it replaces
17827
17826
  *
@@ -19863,6 +19862,13 @@ var ZoneCrossingSchema = object({
19863
19862
  /** Zone display name at crossing time (falls back to the id). */
19864
19863
  zoneName: string().optional()
19865
19864
  });
19865
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19866
+ var ZoneOverlapSchema = object({
19867
+ zoneId: string(),
19868
+ zoneName: string().optional(),
19869
+ /** Percentage of the BOX area inside the zone, 0–100. */
19870
+ overlapPct: number()
19871
+ });
19866
19872
  var ObjectEventSchema = object({
19867
19873
  ...BaseEventFields,
19868
19874
  kind: literal("object"),
@@ -19887,6 +19893,35 @@ var ObjectEventSchema = object({
19887
19893
  bbox: BoundingBoxSchema.optional(),
19888
19894
  /** Heavy JSON — omitted in slim projection. */
19889
19895
  zones: array(string()).readonly().optional(),
19896
+ /**
19897
+ * How far inside each stamped zone the box actually was, as a percentage of
19898
+ * the BOX area.
19899
+ *
19900
+ * Membership alone cannot express "at least a third of it inside", which is
19901
+ * the bar an operator argues with — and the number already existed: the
19902
+ * engine computed it, the pipeline logged it, and then discarded it. It
19903
+ * matters most on the events that carry no track, where a rule has nothing
19904
+ * else to judge by.
19905
+ */
19906
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19907
+ /**
19908
+ * Present when this event describes a detection the TRACKER refused, so it
19909
+ * has no track and never will.
19910
+ *
19911
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19912
+ * NOW?"; tracking answers a different question ("is this the same subject as
19913
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19914
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19915
+ * seconds with three different candidate ids — seven analysed frames in the
19916
+ * window, the subject in a handful of them, metres apart — and produced no
19917
+ * event at all.
19918
+ *
19919
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19920
+ * with no track and no reason is indistinguishable from a track whose media
19921
+ * went missing, and a consumer that asks this one for a best shot or a
19922
+ * history is asking for something that never existed.
19923
+ */
19924
+ spawnRefused: string().optional(),
19890
19925
  /** Omitted in slim projection. */
19891
19926
  state: TrackStateSchema.optional(),
19892
19927
  /**
@@ -20313,7 +20348,17 @@ var EventDensityBucketSchema = object({
20313
20348
  bucketStart: number(),
20314
20349
  motion: number().int(),
20315
20350
  object: number().int(),
20316
- audio: number().int()
20351
+ audio: number().int(),
20352
+ /**
20353
+ * Energy-weighted mean dBFS of the audio events in this bucket — the LEVEL,
20354
+ * as opposed to `audio`, which is their COUNT (D431).
20355
+ *
20356
+ * ABSENT when the bucket holds no audio event. Absence means "nothing was
20357
+ * measured", which is not the same claim as silence, and a lane that cannot
20358
+ * tell them apart paints a quiet hour at full scale — which is exactly what
20359
+ * the count-on-a-level-meter did.
20360
+ */
20361
+ audioDbfs: number().optional()
20317
20362
  });
20318
20363
  /**
20319
20364
  * One camera's row in a `getEventDensityBatch` answer.
@@ -20960,6 +21005,60 @@ var NativeCropResultSchema = object({
20960
21005
  */
20961
21006
  tier: _enum(["native", "ram-fullframe"]).optional()
20962
21007
  });
21008
+ /**
21009
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
21010
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
21011
+ *
21012
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
21013
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
21014
+ * from, and what the detail plane's full-frame rung cuts from.
21015
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
21016
+ * window, cut by the runner at uncapped native resolution.
21017
+ *
21018
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
21019
+ */
21020
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
21021
+ /**
21022
+ * Why a park did NOT happen. Every one is logged on the runner with
21023
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
21024
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
21025
+ * never a reason to retry in a loop.
21026
+ *
21027
+ * - `handle-gone` — the native surface no longer resolves this handle (never
21028
+ * registered, past the lease bound, or the worker released it). `detail`
21029
+ * carries the runner's own miss reason.
21030
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
21031
+ */
21032
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
21033
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
21034
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
21035
+ parked: literal(true),
21036
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
21037
+ nodeId: string(),
21038
+ width: number().int().positive(),
21039
+ height: number().int().positive(),
21040
+ /** JPEG bytes the parcel costs on the node. */
21041
+ bytes: number().int().nonnegative(),
21042
+ /** Whether this park replaced a parcel already held for the key. */
21043
+ replaced: boolean()
21044
+ }), object({
21045
+ parked: literal(false),
21046
+ nodeId: string(),
21047
+ reason: ParkRefusalSchema,
21048
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
21049
+ handleAgeMs: number().nullable(),
21050
+ detail: string().optional()
21051
+ })]);
21052
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
21053
+ var ParkedTrackFrameSchema = object({
21054
+ jpeg: string(),
21055
+ width: number().int().positive(),
21056
+ height: number().int().positive(),
21057
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
21058
+ timestamp: number(),
21059
+ /** When the node stored it (the node's clock). */
21060
+ parkedAt: number()
21061
+ });
20963
21062
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20964
21063
  * originating detection, in FRAME-space coordinates. Reuses
20965
21064
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -21349,7 +21448,7 @@ var RunnerCameraConfigSchema = object({
21349
21448
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
21350
21449
  * analyzer providers) running on decoded frames in this runner.
21351
21450
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
21352
- * analytics, Frigate motion). The provider emits ProviderMotion
21451
+ * analytics). The provider emits ProviderMotion
21353
21452
  * events; the orchestrator forwards to `reportMotion`.
21354
21453
  */
21355
21454
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21591,7 +21690,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21591
21690
  className: string(),
21592
21691
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21593
21692
  sourceDeviceId: number()
21594
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21693
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21694
+ deviceId: number(),
21695
+ /** Opaque to the runner — the hub's track id. */
21696
+ trackId: string(),
21697
+ kind: ParkedFrameKindSchema,
21698
+ handle: FrameHandleSchema,
21699
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21700
+ bbox: NativeCropBboxSchema,
21701
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21702
+ maxWidth: number().int().positive().optional(),
21703
+ /** The frame instant (caller's clock) — orders parks for one key. */
21704
+ timestamp: number()
21705
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21706
+ deviceId: number(),
21707
+ trackId: string(),
21708
+ kind: ParkedFrameKindSchema
21709
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21710
+ deviceId: number(),
21711
+ trackId: string()
21712
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21595
21713
  var CameraPipelineConfigSchema = object({
21596
21714
  engine: PipelineEngineChoiceSchema.optional(),
21597
21715
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24524,7 +24642,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24524
24642
  *
24525
24643
  * Implementations:
24526
24644
  * - Each camera-providing addon registers this cap natively per
24527
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24645
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24528
24646
  * - Returns a snapshot from the persisted device config blob — no
24529
24647
  * extra round-trip to the camera, no probing.
24530
24648
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -25942,7 +26060,7 @@ var AvailableIntegrationTypeSchema = object({
25942
26060
  * Which integration-marker cap the addon declared, so the wizard can
25943
26061
  * branch on CAP — never on addon name. `device-adoption` integrations
25944
26062
  * (Home Assistant, …) route through the broker step (Approach A);
25945
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26063
+ * `device-provider` integrations (Reolink/ONVIF) keep the
25946
26064
  * legacy config → discovery flow.
25947
26065
  */
25948
26066
  kind: _enum(["device-adoption", "device-provider"]),
@@ -28455,7 +28573,23 @@ var RecordingRangeSchema = object({
28455
28573
  });
28456
28574
  var RecordingAvailabilitySchema = object({
28457
28575
  deviceId: number(),
28458
- ranges: array(RecordingRangeSchema)
28576
+ ranges: array(RecordingRangeSchema),
28577
+ /**
28578
+ * Every profile this camera has footage in — not only the one `ranges`
28579
+ * describes (D433).
28580
+ *
28581
+ * `ranges` answers for ONE profile by design: the timeline is a single bar,
28582
+ * and enumerating all of them triples the directory reads for a bar that
28583
+ * would look identical. But the answer used to say nothing about that, so a
28584
+ * caller asking "what can I export?" read the single preferred profile as
28585
+ * the only one that exists — on this deployment every camera records `high`
28586
+ * AND `low`, the low tree holding 14 GB for camera 615 alone, and the export
28587
+ * UI could not see it.
28588
+ *
28589
+ * Cheap: it is the same shallow directory read the profile CHOICE already
28590
+ * makes. Ask for a specific profile's ranges with the `profile` input.
28591
+ */
28592
+ profilesWithFootage: array(string())
28459
28593
  });
28460
28594
  var RecordingDaysSchema = object({
28461
28595
  deviceId: number(),
@@ -28481,7 +28615,11 @@ var RecordingDaysSchema = object({
28481
28615
  var RecordingAvailabilityForDeviceSchema = object({
28482
28616
  deviceId: number(),
28483
28617
  read: _enum(["read", "unreadable"]),
28484
- ranges: array(RecordingRangeSchema).readonly()
28618
+ ranges: array(RecordingRangeSchema).readonly(),
28619
+ /** Same field, same meaning, as the singular answer (D433). A row that
28620
+ * dropped it would tell a grid caller the archive holds one profile.
28621
+ * Empty on an `'unreadable'` row: nobody looked. */
28622
+ profilesWithFootage: array(string()).readonly()
28485
28623
  });
28486
28624
  /**
28487
28625
  * One camera's row in a `getDaysWithRecordingsBatch` answer. Same rule as
@@ -28511,13 +28649,31 @@ var RecordingManifestSchema = object({
28511
28649
  */
28512
28650
  playbackEndpoints: array(string())
28513
28651
  });
28514
- /** Recording storage usage for one camera (bytes on disk across all its
28515
- * profiles/subtrees/locations on this node). */
28652
+ /**
28653
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
28654
+ * across every profile and every resolvable location on this node.
28655
+ *
28656
+ * ## Archive vs residency, which is the whole point of this shape (D418)
28657
+ *
28658
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
28659
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
28660
+ * this camera writes to, so the two can be added up and compared.
28661
+ *
28662
+ * They were not always. Until D418 this row came from the recorder's in-RAM
28663
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
28664
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
28665
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
28666
+ * that said otherwise, and two people read it as retention eating recent
28667
+ * footage. Residency is still reported, under `residentBytes` /
28668
+ * `residentOldestMs`, which answer a different question and say so.
28669
+ */
28516
28670
  var RecordingDeviceUsageSchema = object({
28517
28671
  deviceId: number(),
28672
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
28673
+ * recordings locations. */
28518
28674
  usedBytes: number(),
28519
28675
  /**
28520
- * Start of this camera's OLDEST indexed segment, across every profile and
28676
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
28521
28677
  * location — the "Oldest footage" column in Recordings → Storage, and the
28522
28678
  * only honest answer to "is retention actually holding?" per camera.
28523
28679
  *
@@ -28527,7 +28683,24 @@ var RecordingDeviceUsageSchema = object({
28527
28683
  * (types) and the addon ship on different trains, and the addon is usually
28528
28684
  * the later of the two.
28529
28685
  */
28530
- oldestMs: number().nullable().optional()
28686
+ oldestMs: number().nullable().optional(),
28687
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
28688
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
28689
+ segments: number().optional(),
28690
+ /**
28691
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
28692
+ * its RAM index — the live tail plus the hours a reader hydrated.
28693
+ *
28694
+ * It answers "what can be served without touching the disk", never "how much
28695
+ * footage this camera has". A UI that renders it must label it as such, and
28696
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
28697
+ * it, and so does a node whose ledger could not answer.
28698
+ */
28699
+ residentBytes: number().optional(),
28700
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
28701
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
28702
+ * retention. `null` = nothing resident. */
28703
+ residentOldestMs: number().nullable().optional()
28531
28704
  });
28532
28705
  /** Recording storage usage + capacity for one storage location. */
28533
28706
  var RecordingLocationUsageSchema = object({
@@ -28565,6 +28738,17 @@ var RecordingStorageUsageSchema = object({
28565
28738
  totalUsedBytes: number(),
28566
28739
  devices: array(RecordingDeviceUsageSchema),
28567
28740
  /**
28741
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
28742
+ * disks (D418).
28743
+ *
28744
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
28745
+ * declared no ledger and the recorder REFUSED rather than answering the
28746
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
28747
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
28748
+ * and its rows are residency.
28749
+ */
28750
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
28751
+ /**
28568
28752
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
28569
28753
  * of the payload without it: the hub serves this method through a BAKED
28570
28754
  * router, so a hub whose framework train predates a change to this array
@@ -28725,7 +28909,14 @@ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
28725
28909
  method(object({
28726
28910
  deviceId: number(),
28727
28911
  fromMs: number(),
28728
- toMs: number()
28912
+ toMs: number(),
28913
+ /**
28914
+ * Answer for THIS profile instead of the preferred one (D433). Absent
28915
+ * keeps the timeline's behaviour — one bar, one profile, one set of
28916
+ * reads. `profilesWithFootage` on the answer says what may be asked
28917
+ * for.
28918
+ */
28919
+ profile: string().optional()
28729
28920
  }), RecordingAvailabilitySchema, {
28730
28921
  kind: "query",
28731
28922
  auth: "protected"
@@ -34977,6 +35168,24 @@ Object.freeze({
34977
35168
  addonId: null,
34978
35169
  access: "view"
34979
35170
  },
35171
+ "pipelineRunner.getParkedTrackFrame": {
35172
+ capName: "pipeline-runner",
35173
+ capScope: "system",
35174
+ addonId: null,
35175
+ access: "view"
35176
+ },
35177
+ "pipelineRunner.parkTrackFrame": {
35178
+ capName: "pipeline-runner",
35179
+ capScope: "system",
35180
+ addonId: null,
35181
+ access: "create"
35182
+ },
35183
+ "pipelineRunner.releaseParkedTrackFrames": {
35184
+ capName: "pipeline-runner",
35185
+ capScope: "system",
35186
+ addonId: null,
35187
+ access: "create"
35188
+ },
34980
35189
  "pipelineRunner.reportMotion": {
34981
35190
  capName: "pipeline-runner",
34982
35191
  capScope: "system",
@@ -38254,6 +38463,21 @@ Object.freeze({
38254
38463
  form: "single",
38255
38464
  optional: false
38256
38465
  }],
38466
+ "pipelineRunner.getParkedTrackFrame": [{
38467
+ name: "deviceId",
38468
+ form: "single",
38469
+ optional: false
38470
+ }],
38471
+ "pipelineRunner.parkTrackFrame": [{
38472
+ name: "deviceId",
38473
+ form: "single",
38474
+ optional: false
38475
+ }],
38476
+ "pipelineRunner.releaseParkedTrackFrames": [{
38477
+ name: "deviceId",
38478
+ form: "single",
38479
+ optional: false
38480
+ }],
38257
38481
  "pipelineRunner.reportMotion": [{
38258
38482
  name: "deviceId",
38259
38483
  form: "single",
@@ -38945,7 +39169,7 @@ var PreviewTextField = string().max(200);
38945
39169
  * Whether the notification's preview is a STILL or a short animation.
38946
39170
  *
38947
39171
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
38948
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
39172
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
38949
39173
  * night reads better as three seconds of motion than as one frame of it. Both
38950
39174
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
38951
39175
  * simply applies it to a dozen frames sampled across the render and assembles
@@ -72,7 +72,7 @@ function carryForward(base, existing, keys) {
72
72
  return out;
73
73
  }
74
74
  //#endregion
75
- //#region ../types/dist/event-category-CnLqLOKs.mjs
75
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
76
76
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
77
77
  EventCategory["SystemBoot"] = "system.boot";
78
78
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -664,7 +664,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
664
664
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
665
665
  */
666
666
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
667
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
668
667
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
669
668
  /**
670
669
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -13287,7 +13286,7 @@ DeviceType.Camera;
13287
13286
  var SourceInfoSchema = object({
13288
13287
  /** Live dispatch key — mutable when the source system allows rename. */
13289
13288
  id: string(),
13290
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
13289
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
13291
13290
  system: string(),
13292
13291
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
13293
13292
  * Used to detect rename when `id` changes. */
@@ -13799,7 +13798,7 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
13799
13798
  * - `device-management.router.ts` (deleted in Phase 2)
13800
13799
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13801
13800
  *
13802
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13801
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13803
13802
  * fork into separate processes but never run on remote cluster agents. Therefore:
13804
13803
  * - No nodeId routing needed — this is a pure hub singleton.
13805
13804
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17809,7 +17808,7 @@ var NcRuleInputSchema = object({
17809
17808
  * The measured seven-person arrival on device 590 spans 110 s with every
17810
17809
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17811
17810
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17812
- * 30 is Frigate's shipped value for the same decision.
17811
+ * 30 s is a widely shipped value for the same decision.
17813
17812
  *
17814
17813
  * ### What it replaces
17815
17814
  *
@@ -19851,6 +19850,13 @@ var ZoneCrossingSchema = object({
19851
19850
  /** Zone display name at crossing time (falls back to the id). */
19852
19851
  zoneName: string().optional()
19853
19852
  });
19853
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19854
+ var ZoneOverlapSchema = object({
19855
+ zoneId: string(),
19856
+ zoneName: string().optional(),
19857
+ /** Percentage of the BOX area inside the zone, 0–100. */
19858
+ overlapPct: number()
19859
+ });
19854
19860
  var ObjectEventSchema = object({
19855
19861
  ...BaseEventFields,
19856
19862
  kind: literal("object"),
@@ -19875,6 +19881,35 @@ var ObjectEventSchema = object({
19875
19881
  bbox: BoundingBoxSchema.optional(),
19876
19882
  /** Heavy JSON — omitted in slim projection. */
19877
19883
  zones: array(string()).readonly().optional(),
19884
+ /**
19885
+ * How far inside each stamped zone the box actually was, as a percentage of
19886
+ * the BOX area.
19887
+ *
19888
+ * Membership alone cannot express "at least a third of it inside", which is
19889
+ * the bar an operator argues with — and the number already existed: the
19890
+ * engine computed it, the pipeline logged it, and then discarded it. It
19891
+ * matters most on the events that carry no track, where a rule has nothing
19892
+ * else to judge by.
19893
+ */
19894
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19895
+ /**
19896
+ * Present when this event describes a detection the TRACKER refused, so it
19897
+ * has no track and never will.
19898
+ *
19899
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19900
+ * NOW?"; tracking answers a different question ("is this the same subject as
19901
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19902
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19903
+ * seconds with three different candidate ids — seven analysed frames in the
19904
+ * window, the subject in a handful of them, metres apart — and produced no
19905
+ * event at all.
19906
+ *
19907
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19908
+ * with no track and no reason is indistinguishable from a track whose media
19909
+ * went missing, and a consumer that asks this one for a best shot or a
19910
+ * history is asking for something that never existed.
19911
+ */
19912
+ spawnRefused: string().optional(),
19878
19913
  /** Omitted in slim projection. */
19879
19914
  state: TrackStateSchema.optional(),
19880
19915
  /**
@@ -20301,7 +20336,17 @@ var EventDensityBucketSchema = object({
20301
20336
  bucketStart: number(),
20302
20337
  motion: number().int(),
20303
20338
  object: number().int(),
20304
- audio: number().int()
20339
+ audio: number().int(),
20340
+ /**
20341
+ * Energy-weighted mean dBFS of the audio events in this bucket — the LEVEL,
20342
+ * as opposed to `audio`, which is their COUNT (D431).
20343
+ *
20344
+ * ABSENT when the bucket holds no audio event. Absence means "nothing was
20345
+ * measured", which is not the same claim as silence, and a lane that cannot
20346
+ * tell them apart paints a quiet hour at full scale — which is exactly what
20347
+ * the count-on-a-level-meter did.
20348
+ */
20349
+ audioDbfs: number().optional()
20305
20350
  });
20306
20351
  /**
20307
20352
  * One camera's row in a `getEventDensityBatch` answer.
@@ -20948,6 +20993,60 @@ var NativeCropResultSchema = object({
20948
20993
  */
20949
20994
  tier: _enum(["native", "ram-fullframe"]).optional()
20950
20995
  });
20996
+ /**
20997
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20998
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20999
+ *
21000
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
21001
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
21002
+ * from, and what the detail plane's full-frame rung cuts from.
21003
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
21004
+ * window, cut by the runner at uncapped native resolution.
21005
+ *
21006
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
21007
+ */
21008
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
21009
+ /**
21010
+ * Why a park did NOT happen. Every one is logged on the runner with
21011
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
21012
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
21013
+ * never a reason to retry in a loop.
21014
+ *
21015
+ * - `handle-gone` — the native surface no longer resolves this handle (never
21016
+ * registered, past the lease bound, or the worker released it). `detail`
21017
+ * carries the runner's own miss reason.
21018
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
21019
+ */
21020
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
21021
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
21022
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
21023
+ parked: literal(true),
21024
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
21025
+ nodeId: string(),
21026
+ width: number().int().positive(),
21027
+ height: number().int().positive(),
21028
+ /** JPEG bytes the parcel costs on the node. */
21029
+ bytes: number().int().nonnegative(),
21030
+ /** Whether this park replaced a parcel already held for the key. */
21031
+ replaced: boolean()
21032
+ }), object({
21033
+ parked: literal(false),
21034
+ nodeId: string(),
21035
+ reason: ParkRefusalSchema,
21036
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
21037
+ handleAgeMs: number().nullable(),
21038
+ detail: string().optional()
21039
+ })]);
21040
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
21041
+ var ParkedTrackFrameSchema = object({
21042
+ jpeg: string(),
21043
+ width: number().int().positive(),
21044
+ height: number().int().positive(),
21045
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
21046
+ timestamp: number(),
21047
+ /** When the node stored it (the node's clock). */
21048
+ parkedAt: number()
21049
+ });
20951
21050
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20952
21051
  * originating detection, in FRAME-space coordinates. Reuses
20953
21052
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -21337,7 +21436,7 @@ var RunnerCameraConfigSchema = object({
21337
21436
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
21338
21437
  * analyzer providers) running on decoded frames in this runner.
21339
21438
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
21340
- * analytics, Frigate motion). The provider emits ProviderMotion
21439
+ * analytics). The provider emits ProviderMotion
21341
21440
  * events; the orchestrator forwards to `reportMotion`.
21342
21441
  */
21343
21442
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21579,7 +21678,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21579
21678
  className: string(),
21580
21679
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21581
21680
  sourceDeviceId: number()
21582
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21681
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21682
+ deviceId: number(),
21683
+ /** Opaque to the runner — the hub's track id. */
21684
+ trackId: string(),
21685
+ kind: ParkedFrameKindSchema,
21686
+ handle: FrameHandleSchema,
21687
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21688
+ bbox: NativeCropBboxSchema,
21689
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21690
+ maxWidth: number().int().positive().optional(),
21691
+ /** The frame instant (caller's clock) — orders parks for one key. */
21692
+ timestamp: number()
21693
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21694
+ deviceId: number(),
21695
+ trackId: string(),
21696
+ kind: ParkedFrameKindSchema
21697
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21698
+ deviceId: number(),
21699
+ trackId: string()
21700
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21583
21701
  var CameraPipelineConfigSchema = object({
21584
21702
  engine: PipelineEngineChoiceSchema.optional(),
21585
21703
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24512,7 +24630,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24512
24630
  *
24513
24631
  * Implementations:
24514
24632
  * - Each camera-providing addon registers this cap natively per
24515
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24633
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24516
24634
  * - Returns a snapshot from the persisted device config blob — no
24517
24635
  * extra round-trip to the camera, no probing.
24518
24636
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -25930,7 +26048,7 @@ var AvailableIntegrationTypeSchema = object({
25930
26048
  * Which integration-marker cap the addon declared, so the wizard can
25931
26049
  * branch on CAP — never on addon name. `device-adoption` integrations
25932
26050
  * (Home Assistant, …) route through the broker step (Approach A);
25933
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26051
+ * `device-provider` integrations (Reolink/ONVIF) keep the
25934
26052
  * legacy config → discovery flow.
25935
26053
  */
25936
26054
  kind: _enum(["device-adoption", "device-provider"]),
@@ -28443,7 +28561,23 @@ var RecordingRangeSchema = object({
28443
28561
  });
28444
28562
  var RecordingAvailabilitySchema = object({
28445
28563
  deviceId: number(),
28446
- ranges: array(RecordingRangeSchema)
28564
+ ranges: array(RecordingRangeSchema),
28565
+ /**
28566
+ * Every profile this camera has footage in — not only the one `ranges`
28567
+ * describes (D433).
28568
+ *
28569
+ * `ranges` answers for ONE profile by design: the timeline is a single bar,
28570
+ * and enumerating all of them triples the directory reads for a bar that
28571
+ * would look identical. But the answer used to say nothing about that, so a
28572
+ * caller asking "what can I export?" read the single preferred profile as
28573
+ * the only one that exists — on this deployment every camera records `high`
28574
+ * AND `low`, the low tree holding 14 GB for camera 615 alone, and the export
28575
+ * UI could not see it.
28576
+ *
28577
+ * Cheap: it is the same shallow directory read the profile CHOICE already
28578
+ * makes. Ask for a specific profile's ranges with the `profile` input.
28579
+ */
28580
+ profilesWithFootage: array(string())
28447
28581
  });
28448
28582
  var RecordingDaysSchema = object({
28449
28583
  deviceId: number(),
@@ -28469,7 +28603,11 @@ var RecordingDaysSchema = object({
28469
28603
  var RecordingAvailabilityForDeviceSchema = object({
28470
28604
  deviceId: number(),
28471
28605
  read: _enum(["read", "unreadable"]),
28472
- ranges: array(RecordingRangeSchema).readonly()
28606
+ ranges: array(RecordingRangeSchema).readonly(),
28607
+ /** Same field, same meaning, as the singular answer (D433). A row that
28608
+ * dropped it would tell a grid caller the archive holds one profile.
28609
+ * Empty on an `'unreadable'` row: nobody looked. */
28610
+ profilesWithFootage: array(string()).readonly()
28473
28611
  });
28474
28612
  /**
28475
28613
  * One camera's row in a `getDaysWithRecordingsBatch` answer. Same rule as
@@ -28499,13 +28637,31 @@ var RecordingManifestSchema = object({
28499
28637
  */
28500
28638
  playbackEndpoints: array(string())
28501
28639
  });
28502
- /** Recording storage usage for one camera (bytes on disk across all its
28503
- * profiles/subtrees/locations on this node). */
28640
+ /**
28641
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
28642
+ * across every profile and every resolvable location on this node.
28643
+ *
28644
+ * ## Archive vs residency, which is the whole point of this shape (D418)
28645
+ *
28646
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
28647
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
28648
+ * this camera writes to, so the two can be added up and compared.
28649
+ *
28650
+ * They were not always. Until D418 this row came from the recorder's in-RAM
28651
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
28652
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
28653
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
28654
+ * that said otherwise, and two people read it as retention eating recent
28655
+ * footage. Residency is still reported, under `residentBytes` /
28656
+ * `residentOldestMs`, which answer a different question and say so.
28657
+ */
28504
28658
  var RecordingDeviceUsageSchema = object({
28505
28659
  deviceId: number(),
28660
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
28661
+ * recordings locations. */
28506
28662
  usedBytes: number(),
28507
28663
  /**
28508
- * Start of this camera's OLDEST indexed segment, across every profile and
28664
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
28509
28665
  * location — the "Oldest footage" column in Recordings → Storage, and the
28510
28666
  * only honest answer to "is retention actually holding?" per camera.
28511
28667
  *
@@ -28515,7 +28671,24 @@ var RecordingDeviceUsageSchema = object({
28515
28671
  * (types) and the addon ship on different trains, and the addon is usually
28516
28672
  * the later of the two.
28517
28673
  */
28518
- oldestMs: number().nullable().optional()
28674
+ oldestMs: number().nullable().optional(),
28675
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
28676
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
28677
+ segments: number().optional(),
28678
+ /**
28679
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
28680
+ * its RAM index — the live tail plus the hours a reader hydrated.
28681
+ *
28682
+ * It answers "what can be served without touching the disk", never "how much
28683
+ * footage this camera has". A UI that renders it must label it as such, and
28684
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
28685
+ * it, and so does a node whose ledger could not answer.
28686
+ */
28687
+ residentBytes: number().optional(),
28688
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
28689
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
28690
+ * retention. `null` = nothing resident. */
28691
+ residentOldestMs: number().nullable().optional()
28519
28692
  });
28520
28693
  /** Recording storage usage + capacity for one storage location. */
28521
28694
  var RecordingLocationUsageSchema = object({
@@ -28553,6 +28726,17 @@ var RecordingStorageUsageSchema = object({
28553
28726
  totalUsedBytes: number(),
28554
28727
  devices: array(RecordingDeviceUsageSchema),
28555
28728
  /**
28729
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
28730
+ * disks (D418).
28731
+ *
28732
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
28733
+ * declared no ledger and the recorder REFUSED rather than answering the
28734
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
28735
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
28736
+ * and its rows are residency.
28737
+ */
28738
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
28739
+ /**
28556
28740
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
28557
28741
  * of the payload without it: the hub serves this method through a BAKED
28558
28742
  * router, so a hub whose framework train predates a change to this array
@@ -28713,7 +28897,14 @@ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
28713
28897
  method(object({
28714
28898
  deviceId: number(),
28715
28899
  fromMs: number(),
28716
- toMs: number()
28900
+ toMs: number(),
28901
+ /**
28902
+ * Answer for THIS profile instead of the preferred one (D433). Absent
28903
+ * keeps the timeline's behaviour — one bar, one profile, one set of
28904
+ * reads. `profilesWithFootage` on the answer says what may be asked
28905
+ * for.
28906
+ */
28907
+ profile: string().optional()
28717
28908
  }), RecordingAvailabilitySchema, {
28718
28909
  kind: "query",
28719
28910
  auth: "protected"
@@ -34965,6 +35156,24 @@ Object.freeze({
34965
35156
  addonId: null,
34966
35157
  access: "view"
34967
35158
  },
35159
+ "pipelineRunner.getParkedTrackFrame": {
35160
+ capName: "pipeline-runner",
35161
+ capScope: "system",
35162
+ addonId: null,
35163
+ access: "view"
35164
+ },
35165
+ "pipelineRunner.parkTrackFrame": {
35166
+ capName: "pipeline-runner",
35167
+ capScope: "system",
35168
+ addonId: null,
35169
+ access: "create"
35170
+ },
35171
+ "pipelineRunner.releaseParkedTrackFrames": {
35172
+ capName: "pipeline-runner",
35173
+ capScope: "system",
35174
+ addonId: null,
35175
+ access: "create"
35176
+ },
34968
35177
  "pipelineRunner.reportMotion": {
34969
35178
  capName: "pipeline-runner",
34970
35179
  capScope: "system",
@@ -38242,6 +38451,21 @@ Object.freeze({
38242
38451
  form: "single",
38243
38452
  optional: false
38244
38453
  }],
38454
+ "pipelineRunner.getParkedTrackFrame": [{
38455
+ name: "deviceId",
38456
+ form: "single",
38457
+ optional: false
38458
+ }],
38459
+ "pipelineRunner.parkTrackFrame": [{
38460
+ name: "deviceId",
38461
+ form: "single",
38462
+ optional: false
38463
+ }],
38464
+ "pipelineRunner.releaseParkedTrackFrames": [{
38465
+ name: "deviceId",
38466
+ form: "single",
38467
+ optional: false
38468
+ }],
38245
38469
  "pipelineRunner.reportMotion": [{
38246
38470
  name: "deviceId",
38247
38471
  form: "single",
@@ -38933,7 +39157,7 @@ var PreviewTextField = string().max(200);
38933
39157
  * Whether the notification's preview is a STILL or a short animation.
38934
39158
  *
38935
39159
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
38936
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
39160
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
38937
39161
  * night reads better as three seconds of motion than as one frame of it. Both
38938
39162
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
38939
39163
  * 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-export-hap",
3
- "version": "1.2.101",
3
+ "version": "1.2.104",
4
4
  "description": "HomeKit (HAP) exporter for CamStack devices. Publishes each exposed device as its own HomeKit accessory: cameras and doorbells with SRTP streaming, HomeKit Secure Video, motion, two-way audio, PTZ and battery; switches, lights, locks and sensors through a capability→service table.",
5
5
  "keywords": [
6
6
  "camstack",