@camstack/addon-terminal 0.1.94 → 0.1.97

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 +204 -17
  2. package/dist/addon.mjs +204 -17
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -31,7 +31,7 @@ let node_module = require("node:module");
31
31
  let sharp = require("sharp");
32
32
  sharp = __toESM(sharp);
33
33
  let node_http = require("node:http");
34
- //#region ../types/dist/event-category-CnLqLOKs.mjs
34
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
35
35
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
36
36
  EventCategory["SystemBoot"] = "system.boot";
37
37
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -623,7 +623,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
623
623
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
624
624
  */
625
625
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
626
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
627
626
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
628
627
  /**
629
628
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12724,7 +12723,7 @@ DeviceType.Camera;
12724
12723
  var SourceInfoSchema = object({
12725
12724
  /** Live dispatch key — mutable when the source system allows rename. */
12726
12725
  id: string(),
12727
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12726
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12728
12727
  system: string(),
12729
12728
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12730
12729
  * Used to detect rename when `id` changes. */
@@ -12737,7 +12736,7 @@ var SourceInfoSchema = object({
12737
12736
  /**
12738
12737
  * Build the synthetic SourceInfo every existing provider falls back to
12739
12738
  * when no upstream value has been persisted. Keeps non-migrated providers
12740
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12739
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12741
12740
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12742
12741
  * id. Real upstream identity replaces this once a provider migrates and
12743
12742
  * calls `updateSourceInfo()` with concrete values.
@@ -13318,7 +13317,7 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
13318
13317
  * - `device-management.router.ts` (deleted in Phase 2)
13319
13318
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13320
13319
  *
13321
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13320
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13322
13321
  * fork into separate processes but never run on remote cluster agents. Therefore:
13323
13322
  * - No nodeId routing needed — this is a pure hub singleton.
13324
13323
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17366,7 +17365,7 @@ var NcRuleInputSchema = object({
17366
17365
  * The measured seven-person arrival on device 590 spans 110 s with every
17367
17366
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17368
17367
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17369
- * 30 is Frigate's shipped value for the same decision.
17368
+ * 30 s is a widely shipped value for the same decision.
17370
17369
  *
17371
17370
  * ### What it replaces
17372
17371
  *
@@ -19448,6 +19447,13 @@ var ZoneCrossingSchema = object({
19448
19447
  /** Zone display name at crossing time (falls back to the id). */
19449
19448
  zoneName: string().optional()
19450
19449
  });
19450
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19451
+ var ZoneOverlapSchema = object({
19452
+ zoneId: string(),
19453
+ zoneName: string().optional(),
19454
+ /** Percentage of the BOX area inside the zone, 0–100. */
19455
+ overlapPct: number()
19456
+ });
19451
19457
  var ObjectEventSchema = object({
19452
19458
  ...BaseEventFields,
19453
19459
  kind: literal("object"),
@@ -19472,6 +19478,35 @@ var ObjectEventSchema = object({
19472
19478
  bbox: BoundingBoxSchema.optional(),
19473
19479
  /** Heavy JSON — omitted in slim projection. */
19474
19480
  zones: array(string()).readonly().optional(),
19481
+ /**
19482
+ * How far inside each stamped zone the box actually was, as a percentage of
19483
+ * the BOX area.
19484
+ *
19485
+ * Membership alone cannot express "at least a third of it inside", which is
19486
+ * the bar an operator argues with — and the number already existed: the
19487
+ * engine computed it, the pipeline logged it, and then discarded it. It
19488
+ * matters most on the events that carry no track, where a rule has nothing
19489
+ * else to judge by.
19490
+ */
19491
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19492
+ /**
19493
+ * Present when this event describes a detection the TRACKER refused, so it
19494
+ * has no track and never will.
19495
+ *
19496
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19497
+ * NOW?"; tracking answers a different question ("is this the same subject as
19498
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19499
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19500
+ * seconds with three different candidate ids — seven analysed frames in the
19501
+ * window, the subject in a handful of them, metres apart — and produced no
19502
+ * event at all.
19503
+ *
19504
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19505
+ * with no track and no reason is indistinguishable from a track whose media
19506
+ * went missing, and a consumer that asks this one for a best shot or a
19507
+ * history is asking for something that never existed.
19508
+ */
19509
+ spawnRefused: string().optional(),
19475
19510
  /** Omitted in slim projection. */
19476
19511
  state: TrackStateSchema.optional(),
19477
19512
  /**
@@ -20545,6 +20580,60 @@ var NativeCropResultSchema = object({
20545
20580
  */
20546
20581
  tier: _enum(["native", "ram-fullframe"]).optional()
20547
20582
  });
20583
+ /**
20584
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20585
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20586
+ *
20587
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20588
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20589
+ * from, and what the detail plane's full-frame rung cuts from.
20590
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20591
+ * window, cut by the runner at uncapped native resolution.
20592
+ *
20593
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20594
+ */
20595
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20596
+ /**
20597
+ * Why a park did NOT happen. Every one is logged on the runner with
20598
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20599
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20600
+ * never a reason to retry in a loop.
20601
+ *
20602
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20603
+ * registered, past the lease bound, or the worker released it). `detail`
20604
+ * carries the runner's own miss reason.
20605
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20606
+ */
20607
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20608
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20609
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20610
+ parked: literal(true),
20611
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20612
+ nodeId: string(),
20613
+ width: number().int().positive(),
20614
+ height: number().int().positive(),
20615
+ /** JPEG bytes the parcel costs on the node. */
20616
+ bytes: number().int().nonnegative(),
20617
+ /** Whether this park replaced a parcel already held for the key. */
20618
+ replaced: boolean()
20619
+ }), object({
20620
+ parked: literal(false),
20621
+ nodeId: string(),
20622
+ reason: ParkRefusalSchema,
20623
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20624
+ handleAgeMs: number().nullable(),
20625
+ detail: string().optional()
20626
+ })]);
20627
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20628
+ var ParkedTrackFrameSchema = object({
20629
+ jpeg: string(),
20630
+ width: number().int().positive(),
20631
+ height: number().int().positive(),
20632
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20633
+ timestamp: number(),
20634
+ /** When the node stored it (the node's clock). */
20635
+ parkedAt: number()
20636
+ });
20548
20637
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20549
20638
  * originating detection, in FRAME-space coordinates. Reuses
20550
20639
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20934,7 +21023,7 @@ var RunnerCameraConfigSchema = object({
20934
21023
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20935
21024
  * analyzer providers) running on decoded frames in this runner.
20936
21025
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20937
- * analytics, Frigate motion). The provider emits ProviderMotion
21026
+ * analytics). The provider emits ProviderMotion
20938
21027
  * events; the orchestrator forwards to `reportMotion`.
20939
21028
  */
20940
21029
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21176,7 +21265,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21176
21265
  className: string(),
21177
21266
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21178
21267
  sourceDeviceId: number()
21179
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21268
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21269
+ deviceId: number(),
21270
+ /** Opaque to the runner — the hub's track id. */
21271
+ trackId: string(),
21272
+ kind: ParkedFrameKindSchema,
21273
+ handle: FrameHandleSchema,
21274
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21275
+ bbox: NativeCropBboxSchema,
21276
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21277
+ maxWidth: number().int().positive().optional(),
21278
+ /** The frame instant (caller's clock) — orders parks for one key. */
21279
+ timestamp: number()
21280
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21281
+ deviceId: number(),
21282
+ trackId: string(),
21283
+ kind: ParkedFrameKindSchema
21284
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21285
+ deviceId: number(),
21286
+ trackId: string()
21287
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21180
21288
  var CameraPipelineConfigSchema = object({
21181
21289
  engine: PipelineEngineChoiceSchema.optional(),
21182
21290
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24394,8 +24502,8 @@ onStatusChanged: { data: object({
24394
24502
  /**
24395
24503
  * Runtime-state slice — every provider that registers this cap
24396
24504
  * stores the same shape under `device.runtimeState[battery]`.
24397
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24398
- * proxy, an ONVIF battery cam all read/write the same keys.
24505
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24506
+ * an ONVIF battery cam all read/write the same keys.
24399
24507
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24400
24508
  * via `device.runtimeState.getCapState('battery')` regardless of
24401
24509
  * the underlying driver.
@@ -24528,7 +24636,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24528
24636
  *
24529
24637
  * Implementations:
24530
24638
  * - Each camera-providing addon registers this cap natively per
24531
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24639
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24532
24640
  * - Returns a snapshot from the persisted device config blob — no
24533
24641
  * extra round-trip to the camera, no probing.
24534
24642
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26620,7 +26728,7 @@ var AvailableIntegrationTypeSchema = object({
26620
26728
  * Which integration-marker cap the addon declared, so the wizard can
26621
26729
  * branch on CAP — never on addon name. `device-adoption` integrations
26622
26730
  * (Home Assistant, …) route through the broker step (Approach A);
26623
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26731
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26624
26732
  * legacy config → discovery flow.
26625
26733
  */
26626
26734
  kind: _enum(["device-adoption", "device-provider"]),
@@ -30044,13 +30152,31 @@ var RecordingManifestSchema = object({
30044
30152
  */
30045
30153
  playbackEndpoints: array(string())
30046
30154
  });
30047
- /** Recording storage usage for one camera (bytes on disk across all its
30048
- * profiles/subtrees/locations on this node). */
30155
+ /**
30156
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30157
+ * across every profile and every resolvable location on this node.
30158
+ *
30159
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30160
+ *
30161
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30162
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30163
+ * this camera writes to, so the two can be added up and compared.
30164
+ *
30165
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30166
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30167
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30168
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30169
+ * that said otherwise, and two people read it as retention eating recent
30170
+ * footage. Residency is still reported, under `residentBytes` /
30171
+ * `residentOldestMs`, which answer a different question and say so.
30172
+ */
30049
30173
  var RecordingDeviceUsageSchema = object({
30050
30174
  deviceId: number(),
30175
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30176
+ * recordings locations. */
30051
30177
  usedBytes: number(),
30052
30178
  /**
30053
- * Start of this camera's OLDEST indexed segment, across every profile and
30179
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
30054
30180
  * location — the "Oldest footage" column in Recordings → Storage, and the
30055
30181
  * only honest answer to "is retention actually holding?" per camera.
30056
30182
  *
@@ -30060,7 +30186,24 @@ var RecordingDeviceUsageSchema = object({
30060
30186
  * (types) and the addon ship on different trains, and the addon is usually
30061
30187
  * the later of the two.
30062
30188
  */
30063
- oldestMs: number().nullable().optional()
30189
+ oldestMs: number().nullable().optional(),
30190
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30191
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30192
+ segments: number().optional(),
30193
+ /**
30194
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30195
+ * its RAM index — the live tail plus the hours a reader hydrated.
30196
+ *
30197
+ * It answers "what can be served without touching the disk", never "how much
30198
+ * footage this camera has". A UI that renders it must label it as such, and
30199
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30200
+ * it, and so does a node whose ledger could not answer.
30201
+ */
30202
+ residentBytes: number().optional(),
30203
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30204
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30205
+ * retention. `null` = nothing resident. */
30206
+ residentOldestMs: number().nullable().optional()
30064
30207
  });
30065
30208
  /** Recording storage usage + capacity for one storage location. */
30066
30209
  var RecordingLocationUsageSchema = object({
@@ -30098,6 +30241,17 @@ var RecordingStorageUsageSchema = object({
30098
30241
  totalUsedBytes: number(),
30099
30242
  devices: array(RecordingDeviceUsageSchema),
30100
30243
  /**
30244
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30245
+ * disks (D418).
30246
+ *
30247
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30248
+ * declared no ledger and the recorder REFUSED rather than answering the
30249
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30250
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30251
+ * and its rows are residency.
30252
+ */
30253
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30254
+ /**
30101
30255
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30102
30256
  * of the payload without it: the hub serves this method through a BAKED
30103
30257
  * router, so a hub whose framework train predates a change to this array
@@ -38215,6 +38369,24 @@ Object.freeze({
38215
38369
  addonId: null,
38216
38370
  access: "view"
38217
38371
  },
38372
+ "pipelineRunner.getParkedTrackFrame": {
38373
+ capName: "pipeline-runner",
38374
+ capScope: "system",
38375
+ addonId: null,
38376
+ access: "view"
38377
+ },
38378
+ "pipelineRunner.parkTrackFrame": {
38379
+ capName: "pipeline-runner",
38380
+ capScope: "system",
38381
+ addonId: null,
38382
+ access: "create"
38383
+ },
38384
+ "pipelineRunner.releaseParkedTrackFrames": {
38385
+ capName: "pipeline-runner",
38386
+ capScope: "system",
38387
+ addonId: null,
38388
+ access: "create"
38389
+ },
38218
38390
  "pipelineRunner.reportMotion": {
38219
38391
  capName: "pipeline-runner",
38220
38392
  capScope: "system",
@@ -41492,6 +41664,21 @@ Object.freeze({
41492
41664
  form: "single",
41493
41665
  optional: false
41494
41666
  }],
41667
+ "pipelineRunner.getParkedTrackFrame": [{
41668
+ name: "deviceId",
41669
+ form: "single",
41670
+ optional: false
41671
+ }],
41672
+ "pipelineRunner.parkTrackFrame": [{
41673
+ name: "deviceId",
41674
+ form: "single",
41675
+ optional: false
41676
+ }],
41677
+ "pipelineRunner.releaseParkedTrackFrames": [{
41678
+ name: "deviceId",
41679
+ form: "single",
41680
+ optional: false
41681
+ }],
41495
41682
  "pipelineRunner.reportMotion": [{
41496
41683
  name: "deviceId",
41497
41684
  form: "single",
@@ -42183,7 +42370,7 @@ var PreviewTextField = string().max(200);
42183
42370
  * Whether the notification's preview is a STILL or a short animation.
42184
42371
  *
42185
42372
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
42186
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
42373
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
42187
42374
  * night reads better as three seconds of motion than as one frame of it. Both
42188
42375
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
42189
42376
  * simply applies it to a dozen frames sampled across the render and assembles
package/dist/addon.mjs CHANGED
@@ -8,7 +8,7 @@ import { createServer } from "node:http";
8
8
  //#region \0rolldown/runtime.js
9
9
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
10
10
  //#endregion
11
- //#region ../types/dist/event-category-CnLqLOKs.mjs
11
+ //#region ../types/dist/event-category-DAXzJeTX.mjs
12
12
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
13
13
  EventCategory["SystemBoot"] = "system.boot";
14
14
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -600,7 +600,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
600
600
  * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
601
601
  */
602
602
  EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
603
- EventCategory["FrigateLiveEvent"] = "frigate.live-event";
604
603
  EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
605
604
  /**
606
605
  * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
@@ -12701,7 +12700,7 @@ DeviceType.Camera;
12701
12700
  var SourceInfoSchema = object({
12702
12701
  /** Live dispatch key — mutable when the source system allows rename. */
12703
12702
  id: string(),
12704
- /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'frigate'. */
12703
+ /** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
12705
12704
  system: string(),
12706
12705
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
12707
12706
  * Used to detect rename when `id` changes. */
@@ -12714,7 +12713,7 @@ var SourceInfoSchema = object({
12714
12713
  /**
12715
12714
  * Build the synthetic SourceInfo every existing provider falls back to
12716
12715
  * when no upstream value has been persisted. Keeps non-migrated providers
12717
- * (Reolink / Hikvision / ONVIF / Frigate / RTSP) functional without code
12716
+ * (Reolink / Hikvision / ONVIF / RTSP) functional without code
12718
12717
  * changes — `id` reuses the CamStack stableId, `system` reuses the addon
12719
12718
  * id. Real upstream identity replaces this once a provider migrates and
12720
12719
  * calls `updateSourceInfo()` with concrete values.
@@ -13295,7 +13294,7 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
13295
13294
  * - `device-management.router.ts` (deleted in Phase 2)
13296
13295
  * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
13297
13296
  *
13298
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
13297
+ * All device provider addons (rtsp, onvif, …) are hub-local: they may
13299
13298
  * fork into separate processes but never run on remote cluster agents. Therefore:
13300
13299
  * - No nodeId routing needed — this is a pure hub singleton.
13301
13300
  * - The hub's DeviceRegistry is the single source of truth for all live devices.
@@ -17343,7 +17342,7 @@ var NcRuleInputSchema = object({
17343
17342
  * The measured seven-person arrival on device 590 spans 110 s with every
17344
17343
  * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
17345
17344
  * idle cutoff holds it as one and ends it when the arrival actually ends.
17346
- * 30 is Frigate's shipped value for the same decision.
17345
+ * 30 s is a widely shipped value for the same decision.
17347
17346
  *
17348
17347
  * ### What it replaces
17349
17348
  *
@@ -19425,6 +19424,13 @@ var ZoneCrossingSchema = object({
19425
19424
  /** Zone display name at crossing time (falls back to the id). */
19426
19425
  zoneName: string().optional()
19427
19426
  });
19427
+ /** One zone a box was stamped with, and how much of the BOX fell inside it. */
19428
+ var ZoneOverlapSchema = object({
19429
+ zoneId: string(),
19430
+ zoneName: string().optional(),
19431
+ /** Percentage of the BOX area inside the zone, 0–100. */
19432
+ overlapPct: number()
19433
+ });
19428
19434
  var ObjectEventSchema = object({
19429
19435
  ...BaseEventFields,
19430
19436
  kind: literal("object"),
@@ -19449,6 +19455,35 @@ var ObjectEventSchema = object({
19449
19455
  bbox: BoundingBoxSchema.optional(),
19450
19456
  /** Heavy JSON — omitted in slim projection. */
19451
19457
  zones: array(string()).readonly().optional(),
19458
+ /**
19459
+ * How far inside each stamped zone the box actually was, as a percentage of
19460
+ * the BOX area.
19461
+ *
19462
+ * Membership alone cannot express "at least a third of it inside", which is
19463
+ * the bar an operator argues with — and the number already existed: the
19464
+ * engine computed it, the pipeline logged it, and then discarded it. It
19465
+ * matters most on the events that carry no track, where a rule has nothing
19466
+ * else to judge by.
19467
+ */
19468
+ zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
19469
+ /**
19470
+ * Present when this event describes a detection the TRACKER refused, so it
19471
+ * has no track and never will.
19472
+ *
19473
+ * A zone-scoped immediate rule asks "is there an animal in the flowerbed
19474
+ * NOW?"; tracking answers a different question ("is this the same subject as
19475
+ * before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
19476
+ * dog at 0.7729, 100% inside a watched zone, was refused three times in six
19477
+ * seconds with three different candidate ids — seven analysed frames in the
19478
+ * window, the subject in a handful of them, metres apart — and produced no
19479
+ * event at all.
19480
+ *
19481
+ * It is NAMED rather than merely implied by a missing `trackId`: an event
19482
+ * with no track and no reason is indistinguishable from a track whose media
19483
+ * went missing, and a consumer that asks this one for a best shot or a
19484
+ * history is asking for something that never existed.
19485
+ */
19486
+ spawnRefused: string().optional(),
19452
19487
  /** Omitted in slim projection. */
19453
19488
  state: TrackStateSchema.optional(),
19454
19489
  /**
@@ -20522,6 +20557,60 @@ var NativeCropResultSchema = object({
20522
20557
  */
20523
20558
  tier: _enum(["native", "ram-fullframe"]).optional()
20524
20559
  });
20560
+ /**
20561
+ * What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
20562
+ * kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
20563
+ *
20564
+ * - `keyFrame` — the track's clean best FULL frame at native width (capped by
20565
+ * the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
20566
+ * from, and what the detail plane's full-frame rung cuts from.
20567
+ * - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
20568
+ * window, cut by the runner at uncapped native resolution.
20569
+ *
20570
+ * The runner never interprets `trackId`; it is an opaque key the hub owns.
20571
+ */
20572
+ var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
20573
+ /**
20574
+ * Why a park did NOT happen. Every one is logged on the runner with
20575
+ * `tags: { deviceId }` and the handle's measured age, because a handle already
20576
+ * gone at park time IS the defect the 150–500 ms window exists to prevent —
20577
+ * never a reason to retry in a loop.
20578
+ *
20579
+ * - `handle-gone` — the native surface no longer resolves this handle (never
20580
+ * registered, past the lease bound, or the worker released it). `detail`
20581
+ * carries the runner's own miss reason.
20582
+ * - `encode-failed` — pixels resolved and the JPEG encode threw.
20583
+ */
20584
+ var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
20585
+ /** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
20586
+ var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
20587
+ parked: literal(true),
20588
+ /** The node holding the parcel — what a later retrieval must be pinned to. */
20589
+ nodeId: string(),
20590
+ width: number().int().positive(),
20591
+ height: number().int().positive(),
20592
+ /** JPEG bytes the parcel costs on the node. */
20593
+ bytes: number().int().nonnegative(),
20594
+ /** Whether this park replaced a parcel already held for the key. */
20595
+ replaced: boolean()
20596
+ }), object({
20597
+ parked: literal(false),
20598
+ nodeId: string(),
20599
+ reason: ParkRefusalSchema,
20600
+ /** Age of the handle at the park, on the runner's clock; null if unknown. */
20601
+ handleAgeMs: number().nullable(),
20602
+ detail: string().optional()
20603
+ })]);
20604
+ /** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
20605
+ var ParkedTrackFrameSchema = object({
20606
+ jpeg: string(),
20607
+ width: number().int().positive(),
20608
+ height: number().int().positive(),
20609
+ /** The frame instant the parcel shows (the caller's clock, echoed back). */
20610
+ timestamp: number(),
20611
+ /** When the node stored it (the node's clock). */
20612
+ parkedAt: number()
20613
+ });
20525
20614
  /** Parent detection context passed to `runDetailSubtree` — the crop's
20526
20615
  * originating detection, in FRAME-space coordinates. Reuses
20527
20616
  * `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
@@ -20911,7 +21000,7 @@ var RunnerCameraConfigSchema = object({
20911
21000
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
20912
21001
  * analyzer providers) running on decoded frames in this runner.
20913
21002
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
20914
- * analytics, Frigate motion). The provider emits ProviderMotion
21003
+ * analytics). The provider emits ProviderMotion
20915
21004
  * events; the orchestrator forwards to `reportMotion`.
20916
21005
  */
20917
21006
  motionSources: MotionSourcesSchema.default(["analyzer"]),
@@ -21153,7 +21242,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
21153
21242
  className: string(),
21154
21243
  /** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
21155
21244
  sourceDeviceId: number()
21156
- }), RunStatelessStepResultSchema, { kind: "mutation" });
21245
+ }), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
21246
+ deviceId: number(),
21247
+ /** Opaque to the runner — the hub's track id. */
21248
+ trackId: string(),
21249
+ kind: ParkedFrameKindSchema,
21250
+ handle: FrameHandleSchema,
21251
+ /** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
21252
+ bbox: NativeCropBboxSchema,
21253
+ /** Width cap for a full-frame park (the `keyFrame` native cap). */
21254
+ maxWidth: number().int().positive().optional(),
21255
+ /** The frame instant (caller's clock) — orders parks for one key. */
21256
+ timestamp: number()
21257
+ }), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
21258
+ deviceId: number(),
21259
+ trackId: string(),
21260
+ kind: ParkedFrameKindSchema
21261
+ }), ParkedTrackFrameSchema.nullable()), method(object({
21262
+ deviceId: number(),
21263
+ trackId: string()
21264
+ }), object({ released: number().int().nonnegative() }), { kind: "mutation" });
21157
21265
  var CameraPipelineConfigSchema = object({
21158
21266
  engine: PipelineEngineChoiceSchema.optional(),
21159
21267
  steps: array(PipelineStepInputSchema).readonly(),
@@ -24371,8 +24479,8 @@ onStatusChanged: { data: object({
24371
24479
  /**
24372
24480
  * Runtime-state slice — every provider that registers this cap
24373
24481
  * stores the same shape under `device.runtimeState[battery]`.
24374
- * Cross-provider uniformity: a Reolink Argus, a Frigate sensor
24375
- * proxy, an ONVIF battery cam all read/write the same keys.
24482
+ * Cross-provider uniformity: a Reolink Argus, a sensor proxy,
24483
+ * an ONVIF battery cam all read/write the same keys.
24376
24484
  * Consumers (BatteryBadge, snapshot wrapper sleep gate) read once
24377
24485
  * via `device.runtimeState.getCapState('battery')` regardless of
24378
24486
  * the underlying driver.
@@ -24505,7 +24613,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
24505
24613
  *
24506
24614
  * Implementations:
24507
24615
  * - Each camera-providing addon registers this cap natively per
24508
- * device (Reolink, Hikvision, RTSP, Frigate, ONVIF self).
24616
+ * device (Reolink, Hikvision, RTSP, ONVIF self).
24509
24617
  * - Returns a snapshot from the persisted device config blob — no
24510
24618
  * extra round-trip to the camera, no probing.
24511
24619
  * - The cap is admin-only (`auth: 'admin'`) — credentials must not
@@ -26597,7 +26705,7 @@ var AvailableIntegrationTypeSchema = object({
26597
26705
  * Which integration-marker cap the addon declared, so the wizard can
26598
26706
  * branch on CAP — never on addon name. `device-adoption` integrations
26599
26707
  * (Home Assistant, …) route through the broker step (Approach A);
26600
- * `device-provider` integrations (Reolink/Frigate/ONVIF) keep the
26708
+ * `device-provider` integrations (Reolink/ONVIF) keep the
26601
26709
  * legacy config → discovery flow.
26602
26710
  */
26603
26711
  kind: _enum(["device-adoption", "device-provider"]),
@@ -30021,13 +30129,31 @@ var RecordingManifestSchema = object({
30021
30129
  */
30022
30130
  playbackEndpoints: array(string())
30023
30131
  });
30024
- /** Recording storage usage for one camera (bytes on disk across all its
30025
- * profiles/subtrees/locations on this node). */
30132
+ /**
30133
+ * Recording storage usage for one camera — what the ARCHIVE holds for it,
30134
+ * across every profile and every resolvable location on this node.
30135
+ *
30136
+ * ## Archive vs residency, which is the whole point of this shape (D418)
30137
+ *
30138
+ * `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
30139
+ * the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
30140
+ * this camera writes to, so the two can be added up and compared.
30141
+ *
30142
+ * They were not always. Until D418 this row came from the recorder's in-RAM
30143
+ * `RecordingIndex`, which since D287 holds only the live tail plus the hours
30144
+ * somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
30145
+ * 60.5 GB and "oldest: three hours ago" on the same page as the volume row
30146
+ * that said otherwise, and two people read it as retention eating recent
30147
+ * footage. Residency is still reported, under `residentBytes` /
30148
+ * `residentOldestMs`, which answer a different question and say so.
30149
+ */
30026
30150
  var RecordingDeviceUsageSchema = object({
30027
30151
  deviceId: number(),
30152
+ /** Bytes the ARCHIVE holds for this camera on this node's resolvable
30153
+ * recordings locations. */
30028
30154
  usedBytes: number(),
30029
30155
  /**
30030
- * Start of this camera's OLDEST indexed segment, across every profile and
30156
+ * Start of this camera's OLDEST ARCHIVED segment, across every profile and
30031
30157
  * location — the "Oldest footage" column in Recordings → Storage, and the
30032
30158
  * only honest answer to "is retention actually holding?" per camera.
30033
30159
  *
@@ -30037,7 +30163,24 @@ var RecordingDeviceUsageSchema = object({
30037
30163
  * (types) and the addon ship on different trains, and the addon is usually
30038
30164
  * the later of the two.
30039
30165
  */
30040
- oldestMs: number().nullable().optional()
30166
+ oldestMs: number().nullable().optional(),
30167
+ /** Segments the archive holds for this camera — the "M" beside `usedBytes`.
30168
+ * OPTIONAL for the same train-skew reason as `oldestMs`. */
30169
+ segments: number().optional(),
30170
+ /**
30171
+ * RESIDENCY, not the archive: bytes the recorder process currently holds in
30172
+ * its RAM index — the live tail plus the hours a reader hydrated.
30173
+ *
30174
+ * It answers "what can be served without touching the disk", never "how much
30175
+ * footage this camera has". A UI that renders it must label it as such, and
30176
+ * must never total it as storage. OPTIONAL: a recorder predating D418 omits
30177
+ * it, and so does a node whose ledger could not answer.
30178
+ */
30179
+ residentBytes: number().optional(),
30180
+ /** The residency counterpart of `oldestMs` — the oldest segment currently in
30181
+ * RAM, which on a healthy recorder is minutes ago and means nothing about
30182
+ * retention. `null` = nothing resident. */
30183
+ residentOldestMs: number().nullable().optional()
30041
30184
  });
30042
30185
  /** Recording storage usage + capacity for one storage location. */
30043
30186
  var RecordingLocationUsageSchema = object({
@@ -30075,6 +30218,17 @@ var RecordingStorageUsageSchema = object({
30075
30218
  totalUsedBytes: number(),
30076
30219
  devices: array(RecordingDeviceUsageSchema),
30077
30220
  /**
30221
+ * WHERE `devices[]` came from, so an empty table is never mistaken for empty
30222
+ * disks (D418).
30223
+ *
30224
+ * `archive` = the durable hour ledger answered. `unavailable` = this node
30225
+ * declared no ledger and the recorder REFUSED rather than answering the
30226
+ * question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
30227
+ * zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
30228
+ * and its rows are residency.
30229
+ */
30230
+ devicesRead: _enum(["archive", "unavailable"]).optional(),
30231
+ /**
30078
30232
  * Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
30079
30233
  * of the payload without it: the hub serves this method through a BAKED
30080
30234
  * router, so a hub whose framework train predates a change to this array
@@ -38192,6 +38346,24 @@ Object.freeze({
38192
38346
  addonId: null,
38193
38347
  access: "view"
38194
38348
  },
38349
+ "pipelineRunner.getParkedTrackFrame": {
38350
+ capName: "pipeline-runner",
38351
+ capScope: "system",
38352
+ addonId: null,
38353
+ access: "view"
38354
+ },
38355
+ "pipelineRunner.parkTrackFrame": {
38356
+ capName: "pipeline-runner",
38357
+ capScope: "system",
38358
+ addonId: null,
38359
+ access: "create"
38360
+ },
38361
+ "pipelineRunner.releaseParkedTrackFrames": {
38362
+ capName: "pipeline-runner",
38363
+ capScope: "system",
38364
+ addonId: null,
38365
+ access: "create"
38366
+ },
38195
38367
  "pipelineRunner.reportMotion": {
38196
38368
  capName: "pipeline-runner",
38197
38369
  capScope: "system",
@@ -41469,6 +41641,21 @@ Object.freeze({
41469
41641
  form: "single",
41470
41642
  optional: false
41471
41643
  }],
41644
+ "pipelineRunner.getParkedTrackFrame": [{
41645
+ name: "deviceId",
41646
+ form: "single",
41647
+ optional: false
41648
+ }],
41649
+ "pipelineRunner.parkTrackFrame": [{
41650
+ name: "deviceId",
41651
+ form: "single",
41652
+ optional: false
41653
+ }],
41654
+ "pipelineRunner.releaseParkedTrackFrames": [{
41655
+ name: "deviceId",
41656
+ form: "single",
41657
+ optional: false
41658
+ }],
41472
41659
  "pipelineRunner.reportMotion": [{
41473
41660
  name: "deviceId",
41474
41661
  form: "single",
@@ -42160,7 +42347,7 @@ var PreviewTextField = string().max(200);
42160
42347
  * Whether the notification's preview is a STILL or a short animation.
42161
42348
  *
42162
42349
  * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
42163
- * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
42350
+ * rule)"* — the other rules already offer an animated preview, and a ten-hour
42164
42351
  * night reads better as three seconds of motion than as one frame of it. Both
42165
42352
  * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
42166
42353
  * 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-terminal",
3
- "version": "0.1.94",
3
+ "version": "0.1.97",
4
4
  "description": "Interactive terminal sessions (pty + xterm) as a CamStack addon",
5
5
  "keywords": [
6
6
  "camstack",