@camstack/addon-import-alexa 0.2.88 → 0.2.91

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
@@ -38,7 +38,7 @@ let node_os = require("node:os");
38
38
  let node_fs = require("node:fs");
39
39
  let node_path = require("node:path");
40
40
  node_path = __toESM(node_path);
41
- //#region ../types/dist/event-category-CnLqLOKs.mjs
41
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
42
42
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
43
43
  EventCategory["SystemBoot"] = "system.boot";
44
44
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -630,7 +630,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
630
630
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
631
631
  */
632
632
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
633
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
634
633
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
635
634
  /**
636
635
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12851,7 +12850,7 @@ DeviceType.Camera;
12851
12850
  var SourceInfoSchema = object({
12852
12851
  /** Live dispatch key — mutable when the source system allows rename. */
12853
12852
  id: string(),
12854
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12853
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12855
12854
  system: string(),
12856
12855
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12857
12856
  * Used to detect rename when `id` changes. */
@@ -12864,7 +12863,7 @@ var SourceInfoSchema = object({
12864
12863
  /**
12865
12864
  * Build the synthetic SourceInfo every existing provider falls back to
12866
12865
  * when no upstream value has been persisted. Keeps non-migrated providers
12867
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12866
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12868
12867
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12869
12868
  * id. Real upstream identity replaces this once a provider migrates and
12870
12869
  * calls `updateSourceInfo()` with concrete values.
@@ -13543,7 +13542,7 @@ var deviceProviderCapability = {
13543
13542
  * - `device-management.router.ts` (deleted in Phase 2)
13544
13543
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13545
13544
  *
13546
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13545
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13547
13546
  * fork into separate processes but never run on remote cluster agents. Therefore:
13548
13547
  * - No nodeId routing needed — this is a pure hub singleton.
13549
13548
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17591,7 +17590,7 @@ var NcRuleInputSchema = object({
17591
17590
  * The measured seven-person arrival on device 590 spans 110 s with every
17592
17591
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17593
17592
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17594
- * 30 is Frigate's shipped value for the same decision.
17593
+ * 30 s is a widely shipped value for the same decision.
17595
17594
  *
17596
17595
  * ### What it replaces
17597
17596
  *
@@ -19673,6 +19672,13 @@ var ZoneCrossingSchema = object({
19673
19672
  /** Zone display name at crossing time (falls back to the id). */
19674
19673
  zoneName: string().optional()
19675
19674
  });
19675
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19676
+ var ZoneOverlapSchema = object({
19677
+ zoneId: string(),
19678
+ zoneName: string().optional(),
19679
+ /** Percentage of the BOX area inside the zone, 0–100. */
19680
+ overlapPct: number()
19681
+ });
19676
19682
  var ObjectEventSchema = object({
19677
19683
  ...BaseEventFields,
19678
19684
  kind: literal("object"),
@@ -19697,6 +19703,35 @@ var ObjectEventSchema = object({
19697
19703
  bbox: BoundingBoxSchema.optional(),
19698
19704
  /** Heavy JSON — omitted in slim projection. */
19699
19705
  zones: array(string()).readonly().optional(),
19706
+ /**
19707
+ * How far inside each stamped zone the box actually was, as a percentage of
19708
+ * the BOX area.
19709
+ *
19710
+ * Membership alone cannot express "at least a third of it inside", which is
19711
+ * the bar an operator argues with — and the number already existed: the
19712
+ * engine computed it, the pipeline logged it, and then discarded it. It
19713
+ * matters most on the events that carry no track, where a rule has nothing
19714
+ * else to judge by.
19715
+ */
19716
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19717
+ /**
19718
+ * Present when this event describes a detection the TRACKER refused, so it
19719
+ * has no track and never will.
19720
+ *
19721
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19722
+ * NOW?"; tracking answers a different question ("is this the same subject as
19723
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19724
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19725
+ * seconds with three different candidate ids — seven analysed frames in the
19726
+ * window, the subject in a handful of them, metres apart — and produced no
19727
+ * event at all.
19728
+ *
19729
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19730
+ * with no track and no reason is indistinguishable from a track whose media
19731
+ * went missing, and a consumer that asks this one for a best shot or a
19732
+ * history is asking for something that never existed.
19733
+ */
19734
+ spawnRefused: string().optional(),
19700
19735
  /** Omitted in slim projection. */
19701
19736
  state: TrackStateSchema.optional(),
19702
19737
  /**
@@ -20770,6 +20805,60 @@ var NativeCropResultSchema = object({
20770
20805
  */
20771
20806
  tier: _enum(["native", "ram-fullframe"]).optional()
20772
20807
  });
20808
+ /**
20809
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20810
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20811
+ *
20812
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20813
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20814
+ * from, and what the detail plane's full-frame rung cuts from.
20815
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20816
+ * window, cut by the runner at uncapped native resolution.
20817
+ *
20818
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20819
+ */
20820
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20821
+ /**
20822
+ * Why a park did NOT happen. Every one is logged on the runner with
20823
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20824
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20825
+ * never a reason to retry in a loop.
20826
+ *
20827
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20828
+ * registered, past the lease bound, or the worker released it). `detail`
20829
+ * carries the runner's own miss reason.
20830
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20831
+ */
20832
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20833
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20834
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20835
+ parked: literal(true),
20836
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20837
+ nodeId: string(),
20838
+ width: number().int().positive(),
20839
+ height: number().int().positive(),
20840
+ /** JPEG bytes the parcel costs on the node. */
20841
+ bytes: number().int().nonnegative(),
20842
+ /** Whether this park replaced a parcel already held for the key. */
20843
+ replaced: boolean()
20844
+ }), object({
20845
+ parked: literal(false),
20846
+ nodeId: string(),
20847
+ reason: ParkRefusalSchema,
20848
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20849
+ handleAgeMs: number().nullable(),
20850
+ detail: string().optional()
20851
+ })]);
20852
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20853
+ var ParkedTrackFrameSchema = object({
20854
+ jpeg: string(),
20855
+ width: number().int().positive(),
20856
+ height: number().int().positive(),
20857
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20858
+ timestamp: number(),
20859
+ /** When the node stored it (the node's clock). */
20860
+ parkedAt: number()
20861
+ });
20773
20862
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20774
20863
  * originating detection, in FRAME-space coordinates. Reuses
20775
20864
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -21159,7 +21248,7 @@ var RunnerCameraConfigSchema = object({
21159
21248
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
21160
21249
  * analyzer providers) running on decoded frames in this runner.
21161
21250
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
21162
- * analytics, Frigate motion). The provider emits ProviderMotion
21251
+ * analytics). The provider emits ProviderMotion
21163
21252
  * events; the orchestrator forwards to `reportMotion`.
21164
21253
  */
21165
21254
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21401,7 +21490,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21401
21490
  className: string(),
21402
21491
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21403
21492
  sourceDeviceId: number()
21404
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21493
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21494
+ deviceId: number(),
21495
+ /** Opaque to the runner — the hub's track id. */
21496
+ trackId: string(),
21497
+ kind: ParkedFrameKindSchema,
21498
+ handle: FrameHandleSchema,
21499
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21500
+ bbox: NativeCropBboxSchema,
21501
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21502
+ maxWidth: number().int().positive().optional(),
21503
+ /** The frame instant (caller's clock) — orders parks for one key. */
21504
+ timestamp: number()
21505
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21506
+ deviceId: number(),
21507
+ trackId: string(),
21508
+ kind: ParkedFrameKindSchema
21509
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21510
+ deviceId: number(),
21511
+ trackId: string()
21512
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21405
21513
  var CameraPipelineConfigSchema = object({
21406
21514
  engine: PipelineEngineChoiceSchema.optional(),
21407
21515
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24471,8 +24579,8 @@ onStatusChanged: { data: object({
24471
24579
  /**
24472
24580
  * Runtime-state slice — every provider that registers this cap
24473
24581
  * stores the same shape under `device.runtimeState[battery]`.
24474
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24475
- * proxy, an ONVIF battery cam all read/write the same keys.
24582
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24583
+ * an ONVIF battery cam all read/write the same keys.
24476
24584
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24477
24585
  * via `device.runtimeState.getCapState('battery')` regardless of
24478
24586
  * the underlying driver.
@@ -24622,7 +24730,7 @@ var buttonCapability = {
24622
24730
  *
24623
24731
  * Implementations:
24624
24732
  * - Each camera-providing addon registers this cap natively per
24625
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24733
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24626
24734
  * - Returns a snapshot from the persisted device config blob — no
24627
24735
  * extra round-trip to the camera, no probing.
24628
24736
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26714,7 +26822,7 @@ var AvailableIntegrationTypeSchema = object({
26714
26822
  * Which integration-marker cap the addon declared, so the wizard can
26715
26823
  * branch on CAP — never on addon name. `device-adoption` integrations
26716
26824
  * (Home Assistant, …) route through the broker step (Approach A);
26717
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26825
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26718
26826
  * legacy config → discovery flow.
26719
26827
  */
26720
26828
  kind: _enum(["device-adoption", "device-provider"]),
@@ -30138,13 +30246,31 @@ var RecordingManifestSchema = object({
30138
30246
  */
30139
30247
  playbackEndpoints: array(string())
30140
30248
  });
30141
- /** Recording storage usage for one camera (bytes on disk across all its
30142
- * profiles/subtrees/locations on this node). */
30249
+ /**
30250
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30251
+ * across every profile and every resolvable location on this node.
30252
+ *
30253
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30254
+ *
30255
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30256
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30257
+ * this camera writes to, so the two can be added up and compared.
30258
+ *
30259
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30260
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30261
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30262
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30263
+ * that said otherwise, and two people read it as retention eating recent
30264
+ * footage. Residency is still reported, under `residentBytes` /
30265
+ * `residentOldestMs`, which answer a different question and say so.
30266
+ */
30143
30267
  var RecordingDeviceUsageSchema = object({
30144
30268
  deviceId: number(),
30269
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30270
+ * recordings locations. */
30145
30271
  usedBytes: number(),
30146
30272
  /**
30147
- * Start of this camera's OLDEST indexed segment, across every profile and
30273
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
30148
30274
  * location — the "Oldest footage" column in Recordings → Storage, and the
30149
30275
  * only honest answer to "is retention actually holding?" per camera.
30150
30276
  *
@@ -30154,7 +30280,24 @@ var RecordingDeviceUsageSchema = object({
30154
30280
  * (types) and the addon ship on different trains, and the addon is usually
30155
30281
  * the later of the two.
30156
30282
  */
30157
- oldestMs: number().nullable().optional()
30283
+ oldestMs: number().nullable().optional(),
30284
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30285
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30286
+ segments: number().optional(),
30287
+ /**
30288
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30289
+ * its RAM index — the live tail plus the hours a reader hydrated.
30290
+ *
30291
+ * It answers "what can be served without touching the disk", never "how much
30292
+ * footage this camera has". A UI that renders it must label it as such, and
30293
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30294
+ * it, and so does a node whose ledger could not answer.
30295
+ */
30296
+ residentBytes: number().optional(),
30297
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30298
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30299
+ * retention. `null` = nothing resident. */
30300
+ residentOldestMs: number().nullable().optional()
30158
30301
  });
30159
30302
  /** Recording storage usage + capacity for one storage location. */
30160
30303
  var RecordingLocationUsageSchema = object({
@@ -30192,6 +30335,17 @@ var RecordingStorageUsageSchema = object({
30192
30335
  totalUsedBytes: number(),
30193
30336
  devices: array(RecordingDeviceUsageSchema),
30194
30337
  /**
30338
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30339
+ * disks (D418).
30340
+ *
30341
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30342
+ * declared no ledger and the recorder REFUSED rather than answering the
30343
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30344
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30345
+ * and its rows are residency.
30346
+ */
30347
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30348
+ /**
30195
30349
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30196
30350
  * of the payload without it: the hub serves this method through a BAKED
30197
30351
  * router, so a hub whose framework train predates a change to this array
@@ -34071,7 +34225,7 @@ function toDeviceSummary(device, addonId) {
34071
34225
  };
34072
34226
  }
34073
34227
  /**
34074
- * Base class for device-provider addons (rtsp, onvif, frigate).
34228
+ * Base class for device-provider addons (rtsp, onvif).
34075
34229
  *
34076
34230
  * Provides default implementations for the common device-provider cap
34077
34231
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -38727,6 +38881,24 @@ Object.freeze({
38727
38881
  addonId: null,
38728
38882
  access: "view"
38729
38883
  },
38884
+ "pipelineRunner.getParkedTrackFrame": {
38885
+ capName: "pipeline-runner",
38886
+ capScope: "system",
38887
+ addonId: null,
38888
+ access: "view"
38889
+ },
38890
+ "pipelineRunner.parkTrackFrame": {
38891
+ capName: "pipeline-runner",
38892
+ capScope: "system",
38893
+ addonId: null,
38894
+ access: "create"
38895
+ },
38896
+ "pipelineRunner.releaseParkedTrackFrames": {
38897
+ capName: "pipeline-runner",
38898
+ capScope: "system",
38899
+ addonId: null,
38900
+ access: "create"
38901
+ },
38730
38902
  "pipelineRunner.reportMotion": {
38731
38903
  capName: "pipeline-runner",
38732
38904
  capScope: "system",
@@ -42004,6 +42176,21 @@ Object.freeze({
42004
42176
  form: "single",
42005
42177
  optional: false
42006
42178
  }],
42179
+ "pipelineRunner.getParkedTrackFrame": [{
42180
+ name: "deviceId",
42181
+ form: "single",
42182
+ optional: false
42183
+ }],
42184
+ "pipelineRunner.parkTrackFrame": [{
42185
+ name: "deviceId",
42186
+ form: "single",
42187
+ optional: false
42188
+ }],
42189
+ "pipelineRunner.releaseParkedTrackFrames": [{
42190
+ name: "deviceId",
42191
+ form: "single",
42192
+ optional: false
42193
+ }],
42007
42194
  "pipelineRunner.reportMotion": [{
42008
42195
  name: "deviceId",
42009
42196
  form: "single",
@@ -42695,7 +42882,7 @@ var PreviewTextField = string().max(200);
42695
42882
  * Whether the notification's preview is a STILL or a short animation.
42696
42883
  *
42697
42884
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
42698
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
42885
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
42699
42886
  * night reads better as three seconds of motion than as one frame of it. Both
42700
42887
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
42701
42888
  * simply applies it to a dozen frames sampled across the render and assembles
package/dist/addon.mjs CHANGED
@@ -38,7 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
38
38
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
39
39
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
40
40
  //#endregion
41
- //#region ../types/dist/event-category-CnLqLOKs.mjs
41
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
42
42
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
43
43
  EventCategory["SystemBoot"] = "system.boot";
44
44
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -630,7 +630,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
630
630
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
631
631
  */
632
632
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
633
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
634
633
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
635
634
  /**
636
635
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12851,7 +12850,7 @@ DeviceType.Camera;
12851
12850
  var SourceInfoSchema = object({
12852
12851
  /** Live dispatch key — mutable when the source system allows rename. */
12853
12852
  id: string(),
12854
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12853
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12855
12854
  system: string(),
12856
12855
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12857
12856
  * Used to detect rename when `id` changes. */
@@ -12864,7 +12863,7 @@ var SourceInfoSchema = object({
12864
12863
  /**
12865
12864
  * Build the synthetic SourceInfo every existing provider falls back to
12866
12865
  * when no upstream value has been persisted. Keeps non-migrated providers
12867
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12866
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12868
12867
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12869
12868
  * id. Real upstream identity replaces this once a provider migrates and
12870
12869
  * calls `updateSourceInfo()` with concrete values.
@@ -13543,7 +13542,7 @@ var deviceProviderCapability = {
13543
13542
  * - `device-management.router.ts` (deleted in Phase 2)
13544
13543
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13545
13544
  *
13546
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13545
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13547
13546
  * fork into separate processes but never run on remote cluster agents. Therefore:
13548
13547
  * - No nodeId routing needed — this is a pure hub singleton.
13549
13548
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17591,7 +17590,7 @@ var NcRuleInputSchema = object({
17591
17590
  * The measured seven-person arrival on device 590 spans 110 s with every
17592
17591
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17593
17592
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17594
- * 30 is Frigate's shipped value for the same decision.
17593
+ * 30 s is a widely shipped value for the same decision.
17595
17594
  *
17596
17595
  * ### What it replaces
17597
17596
  *
@@ -19673,6 +19672,13 @@ var ZoneCrossingSchema = object({
19673
19672
  /** Zone display name at crossing time (falls back to the id). */
19674
19673
  zoneName: string().optional()
19675
19674
  });
19675
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19676
+ var ZoneOverlapSchema = object({
19677
+ zoneId: string(),
19678
+ zoneName: string().optional(),
19679
+ /** Percentage of the BOX area inside the zone, 0–100. */
19680
+ overlapPct: number()
19681
+ });
19676
19682
  var ObjectEventSchema = object({
19677
19683
  ...BaseEventFields,
19678
19684
  kind: literal("object"),
@@ -19697,6 +19703,35 @@ var ObjectEventSchema = object({
19697
19703
  bbox: BoundingBoxSchema.optional(),
19698
19704
  /** Heavy JSON — omitted in slim projection. */
19699
19705
  zones: array(string()).readonly().optional(),
19706
+ /**
19707
+ * How far inside each stamped zone the box actually was, as a percentage of
19708
+ * the BOX area.
19709
+ *
19710
+ * Membership alone cannot express "at least a third of it inside", which is
19711
+ * the bar an operator argues with — and the number already existed: the
19712
+ * engine computed it, the pipeline logged it, and then discarded it. It
19713
+ * matters most on the events that carry no track, where a rule has nothing
19714
+ * else to judge by.
19715
+ */
19716
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19717
+ /**
19718
+ * Present when this event describes a detection the TRACKER refused, so it
19719
+ * has no track and never will.
19720
+ *
19721
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19722
+ * NOW?"; tracking answers a different question ("is this the same subject as
19723
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19724
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19725
+ * seconds with three different candidate ids — seven analysed frames in the
19726
+ * window, the subject in a handful of them, metres apart — and produced no
19727
+ * event at all.
19728
+ *
19729
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19730
+ * with no track and no reason is indistinguishable from a track whose media
19731
+ * went missing, and a consumer that asks this one for a best shot or a
19732
+ * history is asking for something that never existed.
19733
+ */
19734
+ spawnRefused: string().optional(),
19700
19735
  /** Omitted in slim projection. */
19701
19736
  state: TrackStateSchema.optional(),
19702
19737
  /**
@@ -20770,6 +20805,60 @@ var NativeCropResultSchema = object({
20770
20805
  */
20771
20806
  tier: _enum(["native", "ram-fullframe"]).optional()
20772
20807
  });
20808
+ /**
20809
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20810
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20811
+ *
20812
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20813
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20814
+ * from, and what the detail plane's full-frame rung cuts from.
20815
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20816
+ * window, cut by the runner at uncapped native resolution.
20817
+ *
20818
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20819
+ */
20820
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20821
+ /**
20822
+ * Why a park did NOT happen. Every one is logged on the runner with
20823
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20824
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20825
+ * never a reason to retry in a loop.
20826
+ *
20827
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20828
+ * registered, past the lease bound, or the worker released it). `detail`
20829
+ * carries the runner's own miss reason.
20830
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20831
+ */
20832
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20833
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20834
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20835
+ parked: literal(true),
20836
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20837
+ nodeId: string(),
20838
+ width: number().int().positive(),
20839
+ height: number().int().positive(),
20840
+ /** JPEG bytes the parcel costs on the node. */
20841
+ bytes: number().int().nonnegative(),
20842
+ /** Whether this park replaced a parcel already held for the key. */
20843
+ replaced: boolean()
20844
+ }), object({
20845
+ parked: literal(false),
20846
+ nodeId: string(),
20847
+ reason: ParkRefusalSchema,
20848
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20849
+ handleAgeMs: number().nullable(),
20850
+ detail: string().optional()
20851
+ })]);
20852
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20853
+ var ParkedTrackFrameSchema = object({
20854
+ jpeg: string(),
20855
+ width: number().int().positive(),
20856
+ height: number().int().positive(),
20857
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20858
+ timestamp: number(),
20859
+ /** When the node stored it (the node's clock). */
20860
+ parkedAt: number()
20861
+ });
20773
20862
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20774
20863
  * originating detection, in FRAME-space coordinates. Reuses
20775
20864
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -21159,7 +21248,7 @@ var RunnerCameraConfigSchema = object({
21159
21248
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
21160
21249
  * analyzer providers) running on decoded frames in this runner.
21161
21250
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
21162
- * analytics, Frigate motion). The provider emits ProviderMotion
21251
+ * analytics). The provider emits ProviderMotion
21163
21252
  * events; the orchestrator forwards to `reportMotion`.
21164
21253
  */
21165
21254
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21401,7 +21490,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21401
21490
  className: string(),
21402
21491
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21403
21492
  sourceDeviceId: number()
21404
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21493
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21494
+ deviceId: number(),
21495
+ /** Opaque to the runner — the hub's track id. */
21496
+ trackId: string(),
21497
+ kind: ParkedFrameKindSchema,
21498
+ handle: FrameHandleSchema,
21499
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21500
+ bbox: NativeCropBboxSchema,
21501
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21502
+ maxWidth: number().int().positive().optional(),
21503
+ /** The frame instant (caller's clock) — orders parks for one key. */
21504
+ timestamp: number()
21505
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21506
+ deviceId: number(),
21507
+ trackId: string(),
21508
+ kind: ParkedFrameKindSchema
21509
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21510
+ deviceId: number(),
21511
+ trackId: string()
21512
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21405
21513
  var CameraPipelineConfigSchema = object({
21406
21514
  engine: PipelineEngineChoiceSchema.optional(),
21407
21515
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24471,8 +24579,8 @@ onStatusChanged: { data: object({
24471
24579
  /**
24472
24580
  * Runtime-state slice — every provider that registers this cap
24473
24581
  * stores the same shape under `device.runtimeState[battery]`.
24474
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24475
- * proxy, an ONVIF battery cam all read/write the same keys.
24582
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24583
+ * an ONVIF battery cam all read/write the same keys.
24476
24584
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24477
24585
  * via `device.runtimeState.getCapState('battery')` regardless of
24478
24586
  * the underlying driver.
@@ -24622,7 +24730,7 @@ var buttonCapability = {
24622
24730
  *
24623
24731
  * Implementations:
24624
24732
  * - Each camera-providing addon registers this cap natively per
24625
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24733
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24626
24734
  * - Returns a snapshot from the persisted device config blob — no
24627
24735
  * extra round-trip to the camera, no probing.
24628
24736
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26714,7 +26822,7 @@ var AvailableIntegrationTypeSchema = object({
26714
26822
  * Which integration-marker cap the addon declared, so the wizard can
26715
26823
  * branch on CAP — never on addon name. `device-adoption` integrations
26716
26824
  * (Home Assistant, …) route through the broker step (Approach A);
26717
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26825
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26718
26826
  * legacy config → discovery flow.
26719
26827
  */
26720
26828
  kind: _enum(["device-adoption", "device-provider"]),
@@ -30138,13 +30246,31 @@ var RecordingManifestSchema = object({
30138
30246
  */
30139
30247
  playbackEndpoints: array(string())
30140
30248
  });
30141
- /** Recording storage usage for one camera (bytes on disk across all its
30142
- * profiles/subtrees/locations on this node). */
30249
+ /**
30250
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30251
+ * across every profile and every resolvable location on this node.
30252
+ *
30253
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30254
+ *
30255
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30256
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30257
+ * this camera writes to, so the two can be added up and compared.
30258
+ *
30259
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30260
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30261
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30262
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30263
+ * that said otherwise, and two people read it as retention eating recent
30264
+ * footage. Residency is still reported, under `residentBytes` /
30265
+ * `residentOldestMs`, which answer a different question and say so.
30266
+ */
30143
30267
  var RecordingDeviceUsageSchema = object({
30144
30268
  deviceId: number(),
30269
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30270
+ * recordings locations. */
30145
30271
  usedBytes: number(),
30146
30272
  /**
30147
- * Start of this camera's OLDEST indexed segment, across every profile and
30273
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
30148
30274
  * location — the "Oldest footage" column in Recordings → Storage, and the
30149
30275
  * only honest answer to "is retention actually holding?" per camera.
30150
30276
  *
@@ -30154,7 +30280,24 @@ var RecordingDeviceUsageSchema = object({
30154
30280
  * (types) and the addon ship on different trains, and the addon is usually
30155
30281
  * the later of the two.
30156
30282
  */
30157
- oldestMs: number().nullable().optional()
30283
+ oldestMs: number().nullable().optional(),
30284
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30285
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30286
+ segments: number().optional(),
30287
+ /**
30288
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30289
+ * its RAM index — the live tail plus the hours a reader hydrated.
30290
+ *
30291
+ * It answers "what can be served without touching the disk", never "how much
30292
+ * footage this camera has". A UI that renders it must label it as such, and
30293
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30294
+ * it, and so does a node whose ledger could not answer.
30295
+ */
30296
+ residentBytes: number().optional(),
30297
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30298
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30299
+ * retention. `null` = nothing resident. */
30300
+ residentOldestMs: number().nullable().optional()
30158
30301
  });
30159
30302
  /** Recording storage usage + capacity for one storage location. */
30160
30303
  var RecordingLocationUsageSchema = object({
@@ -30192,6 +30335,17 @@ var RecordingStorageUsageSchema = object({
30192
30335
  totalUsedBytes: number(),
30193
30336
  devices: array(RecordingDeviceUsageSchema),
30194
30337
  /**
30338
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30339
+ * disks (D418).
30340
+ *
30341
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30342
+ * declared no ledger and the recorder REFUSED rather than answering the
30343
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30344
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30345
+ * and its rows are residency.
30346
+ */
30347
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30348
+ /**
30195
30349
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30196
30350
  * of the payload without it: the hub serves this method through a BAKED
30197
30351
  * router, so a hub whose framework train predates a change to this array
@@ -34071,7 +34225,7 @@ function toDeviceSummary(device, addonId) {
34071
34225
  };
34072
34226
  }
34073
34227
  /**
34074
- * Base class for device-provider addons (rtsp, onvif, frigate).
34228
+ * Base class for device-provider addons (rtsp, onvif).
34075
34229
  *
34076
34230
  * Provides default implementations for the common device-provider cap
34077
34231
  * methods (`start`, `stop`, `getStatus`, `getDevices`, `supportsDiscovery`,
@@ -38727,6 +38881,24 @@ Object.freeze({
38727
38881
  addonId: null,
38728
38882
  access: "view"
38729
38883
  },
38884
+ "pipelineRunner.getParkedTrackFrame": {
38885
+ capName: "pipeline-runner",
38886
+ capScope: "system",
38887
+ addonId: null,
38888
+ access: "view"
38889
+ },
38890
+ "pipelineRunner.parkTrackFrame": {
38891
+ capName: "pipeline-runner",
38892
+ capScope: "system",
38893
+ addonId: null,
38894
+ access: "create"
38895
+ },
38896
+ "pipelineRunner.releaseParkedTrackFrames": {
38897
+ capName: "pipeline-runner",
38898
+ capScope: "system",
38899
+ addonId: null,
38900
+ access: "create"
38901
+ },
38730
38902
  "pipelineRunner.reportMotion": {
38731
38903
  capName: "pipeline-runner",
38732
38904
  capScope: "system",
@@ -42004,6 +42176,21 @@ Object.freeze({
42004
42176
  form: "single",
42005
42177
  optional: false
42006
42178
  }],
42179
+ "pipelineRunner.getParkedTrackFrame": [{
42180
+ name: "deviceId",
42181
+ form: "single",
42182
+ optional: false
42183
+ }],
42184
+ "pipelineRunner.parkTrackFrame": [{
42185
+ name: "deviceId",
42186
+ form: "single",
42187
+ optional: false
42188
+ }],
42189
+ "pipelineRunner.releaseParkedTrackFrames": [{
42190
+ name: "deviceId",
42191
+ form: "single",
42192
+ optional: false
42193
+ }],
42007
42194
  "pipelineRunner.reportMotion": [{
42008
42195
  name: "deviceId",
42009
42196
  form: "single",
@@ -42695,7 +42882,7 @@ var PreviewTextField = string().max(200);
42695
42882
  * Whether the notification's preview is a STILL or a short animation.
42696
42883
  *
42697
42884
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
42698
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
42885
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
42699
42886
  * night reads better as three seconds of motion than as one frame of it. Both
42700
42887
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
42701
42888
  * 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-import-alexa",
3
- "version": "0.2.88",
3
+ "version": "0.2.91",
4
4
  "description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
5
5
  "keywords": [
6
6
  "camstack",