@camstack/addon-provider-unraid 0.1.9 → 0.1.10

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 +194 -14
  2. package/dist/addon.mjs +194 -14
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-CFZs3jI4.mjs
2
+ //#region ../types/dist/event-category-H4AVePnn.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -149,6 +149,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
149
149
  EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
150
150
  EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
151
151
  EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
152
+ /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
153
+ * thumb is a scrub gap the recorder's keyframe backfill covers. */
154
+ EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
152
155
  EventCategory["DetectionEvent"] = "detection.event";
153
156
  EventCategory["SessionTrackNew"] = "session.track.new";
154
157
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -10796,10 +10799,23 @@ var deviceDiscoveryCapability = {
10796
10799
  }
10797
10800
  };
10798
10801
  /**
10799
- * Doorbell button cap. Installed on a `DeviceType.Button` accessory
10800
- * with `role: DeviceRole.Doorbell`. Emits an `onPressed` event every
10801
- * time the firmware pushes a ring; status tracks the last press and
10802
- * a pressCount since start (diagnostic).
10802
+ * Doorbell button cap. Two kinds of providers coexist behind this cap
10803
+ * name (same pattern as `snapshot`):
10804
+ *
10805
+ * - **Native** providers: registered per-device by device-driver
10806
+ * addons via `ctx.registerNativeCap` — either on a
10807
+ * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
10808
+ * or directly on the camera (Reolink registers at camera level).
10809
+ * Emits an `onPressed` event every time the firmware pushes a
10810
+ * ring; status tracks the last press and a pressCount since start
10811
+ * (diagnostic).
10812
+ *
10813
+ * - **Wrapper** provider: the `virtual-doorbell` system builtin
10814
+ * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
10815
+ * device (contact / switch / event-emitter …) into a doorbell for
10816
+ * a camera. `defaultActive: false` — the operator explicitly binds
10817
+ * it per camera in the device-bindings UI, then picks the source
10818
+ * device + trigger in the per-device settings.
10803
10819
  *
10804
10820
  * The DeviceEventPropagator re-emits `onPressed` on the camera parent
10805
10821
  * — subscribers listening at the camera level receive ring events
@@ -10820,7 +10836,10 @@ var doorbellCapability = {
10820
10836
  scope: "device",
10821
10837
  deviceNative: true,
10822
10838
  mode: "singleton",
10823
- deviceTypes: [DeviceType.Button],
10839
+ kind: "wrapper",
10840
+ defaultActive: false,
10841
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
10842
+ exposesDeviceSettings: true,
10824
10843
  methods: {},
10825
10844
  events: {
10826
10845
  /**
@@ -17172,6 +17191,14 @@ var ConfigEntrySchema = object({
17172
17191
  value: unknown(),
17173
17192
  description: string().optional()
17174
17193
  });
17194
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
17195
+ /** One resolved linked device — the compact projection consumers need. */
17196
+ var LinkedDeviceSchema = object({
17197
+ deviceId: number(),
17198
+ name: string(),
17199
+ location: string().nullable(),
17200
+ features: array(string())
17201
+ });
17175
17202
  var SavedDeviceRowSchema = object({
17176
17203
  /** Numeric id reserved at allocateDeviceId time. */
17177
17204
  id: number(),
@@ -17393,7 +17420,10 @@ method(object({
17393
17420
  }), _void(), {
17394
17421
  kind: "mutation",
17395
17422
  auth: "admin"
17396
- }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
17423
+ }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
17424
+ mode: DeviceLinkModeSchema,
17425
+ devices: array(LinkedDeviceSchema)
17426
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
17397
17427
  deviceId: number(),
17398
17428
  values: record(string(), unknown())
17399
17429
  }), object({ success: literal(true) }), {
@@ -18662,6 +18692,61 @@ var EventKindSchema = _enum([
18662
18692
  "object",
18663
18693
  "audio"
18664
18694
  ]);
18695
+ /**
18696
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
18697
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
18698
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
18699
+ */
18700
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
18701
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
18702
+ var EventKindIconSchema = _enum([
18703
+ "motion",
18704
+ "audio",
18705
+ "person",
18706
+ "vehicle",
18707
+ "animal",
18708
+ "door",
18709
+ "pir",
18710
+ "smoke",
18711
+ "water",
18712
+ "button",
18713
+ "generic"
18714
+ ]);
18715
+ var EventKindCategorySchema = _enum([
18716
+ "motion",
18717
+ "audio",
18718
+ "detection",
18719
+ "sensor",
18720
+ "custom"
18721
+ ]);
18722
+ var EventKindDescriptorSchema = object({
18723
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
18724
+ kind: string(),
18725
+ label: string(),
18726
+ /** Hex color for timeline/legend rendering. */
18727
+ color: string(),
18728
+ icon: EventKindIconSchema,
18729
+ category: EventKindCategorySchema,
18730
+ /** Which cap + device contributes this kind. For built-ins the camera
18731
+ * itself; for sensor kinds the LINKED source device. */
18732
+ source: object({
18733
+ capName: string(),
18734
+ deviceId: number()
18735
+ })
18736
+ });
18737
+ var SensorEventSchema = object({
18738
+ id: string(),
18739
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
18740
+ * yields N rows, one per camera). */
18741
+ deviceId: number(),
18742
+ /** The linked sensor device whose state changed. */
18743
+ sourceDeviceId: number(),
18744
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
18745
+ kind: string(),
18746
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
18747
+ value: record(string(), unknown()).nullable(),
18748
+ timestamp: number()
18749
+ });
18665
18750
  var TrackPositionSchema = object({
18666
18751
  x: number(),
18667
18752
  y: number(),
@@ -18675,6 +18760,30 @@ var TrackSnapshotSchema = object({
18675
18760
  mediaKey: string()
18676
18761
  });
18677
18762
  /**
18763
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
18764
+ * divided by the track's detection-frame dims), computed at persist time.
18765
+ * Absent when the frame dims were unknown when the track was persisted
18766
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
18767
+ */
18768
+ var TrackEnvelopeSchema = object({
18769
+ minX: number(),
18770
+ minY: number(),
18771
+ maxX: number(),
18772
+ maxY: number()
18773
+ });
18774
+ /**
18775
+ * Row projection for track list queries. `full` (default) returns the
18776
+ * complete Track including the frame-rate `positions[]` history and the
18777
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
18778
+ * keeps every scalar the list surfaces actually render (ids, class(es),
18779
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
18780
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
18781
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
18782
+ * `getTrack`. Mirrors the event-store `projection` convention
18783
+ * (`getObjectEvents` et al.).
18784
+ */
18785
+ var TrackProjectionSchema = _enum(["full", "slim"]);
18786
+ /**
18678
18787
  * One audio-classification label heard on the track's camera while the
18679
18788
  * track was alive, aggregated per label. An "episode" is one persisted
18680
18789
  * audio event (the confident-classification path: score ≥ the device's
@@ -18725,7 +18834,11 @@ var TrackSchema = object({
18725
18834
  /** Audio-classification labels heard on the camera during the track's
18726
18835
  * life (score ≥ device `classificationMinScore`), aggregated per label.
18727
18836
  * Absent on legacy rows / tracks with no confident audio. */
18728
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
18837
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
18838
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
18839
+ * Populated from the persisted envelope columns on historical reads;
18840
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
18841
+ envelope: TrackEnvelopeSchema.optional()
18729
18842
  });
18730
18843
  var BaseEventFields = {
18731
18844
  id: string(),
@@ -18835,11 +18948,13 @@ var MediaFileSchema = object({
18835
18948
  sizeBytes: number(),
18836
18949
  timestamp: number()
18837
18950
  });
18951
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
18952
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
18838
18953
  var DeviceEventQueryInput = object({
18839
18954
  deviceId: number(),
18840
18955
  since: number().optional(),
18841
18956
  until: number().optional(),
18842
- limit: number().int().min(1).max(5e3).default(1e3),
18957
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
18843
18958
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
18844
18959
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
18845
18960
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -18847,6 +18962,27 @@ var DeviceEventQueryInput = object({
18847
18962
  projection: _enum(["full", "slim"]).optional()
18848
18963
  });
18849
18964
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
18965
+ var RecentTracksQueryInput = object({
18966
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
18967
+ deviceIds: array(number()),
18968
+ /** Window lower bound on `lastSeen` (inclusive). */
18969
+ since: number().optional(),
18970
+ /** Window upper bound on `lastSeen` (inclusive). */
18971
+ until: number().optional(),
18972
+ /** Page size. Default 200, max 1000. */
18973
+ limit: number().int().min(1).max(1e3).default(200),
18974
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
18975
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
18976
+ cursor: string().optional(),
18977
+ /** See {@link TrackProjectionSchema}. Default `full`. */
18978
+ projection: TrackProjectionSchema.optional()
18979
+ });
18980
+ var RecentTracksPageSchema = object({
18981
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
18982
+ tracks: array(TrackSchema).readonly(),
18983
+ /** Cursor for the next page, or null when this page is the last. */
18984
+ nextCursor: string().nullable()
18985
+ });
18850
18986
  var KeyEventQueryInput = object({
18851
18987
  deviceId: number(),
18852
18988
  /** Window lower bound (track firstSeen ≥ since). */
@@ -18929,11 +19065,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18929
19065
  deviceId: number(),
18930
19066
  since: number().optional(),
18931
19067
  until: number().optional(),
18932
- limit: number().optional()
18933
- }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
19068
+ limit: number().optional(),
19069
+ /** Spatial filter only tracks whose trajectory intersects the zone
19070
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
19071
+ * envelope columns, then precisely tested per position. Tracks with
19072
+ * an unknown envelope (no frame dims at persist time) always match. */
19073
+ zone: TrackZoneFilterSchema.optional(),
19074
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
19075
+ * compatible — omitting the field keeps today's exact behaviour). */
19076
+ projection: TrackProjectionSchema.optional()
19077
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
18934
19078
  kind: "mutation",
18935
19079
  auth: "admin"
18936
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19080
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
19081
+ deviceId: number(),
19082
+ since: number().optional(),
19083
+ until: number().optional(),
19084
+ kinds: array(string()).optional(),
19085
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19086
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
18937
19087
  deviceId: number(),
18938
19088
  since: number(),
18939
19089
  until: number(),
@@ -22151,7 +22301,12 @@ var RecordingStorageUsageSchema = object({
22151
22301
  /**
22152
22302
  * Result of locating footage at a wall-clock instant for one device/profile.
22153
22303
  * `segment` carries the covering segment's window; `gap` reports the forward
22154
- * nearest covered edge (`null` past the end of footage / when none exists).
22304
+ * nearest covered edge (`null` past the end of footage / when none exists)
22305
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
22306
+ * footage behind the epoch; `null` when none — optional so older providers
22307
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
22308
+ * small inter-segment cracks (durMs under-covers the span to the next
22309
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
22155
22310
  */
22156
22311
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
22157
22312
  kind: literal("segment"),
@@ -22160,7 +22315,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
22160
22315
  bytes: number()
22161
22316
  }), object({
22162
22317
  kind: literal("gap"),
22163
- nearestEdgeMs: number().nullable()
22318
+ nearestEdgeMs: number().nullable(),
22319
+ prevEndMs: number().nullable().optional()
22164
22320
  })]);
22165
22321
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
22166
22322
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -23729,6 +23885,12 @@ Object.freeze({
23729
23885
  addonId: null,
23730
23886
  access: "view"
23731
23887
  },
23888
+ "deviceManager.getLinkedDevices": {
23889
+ capName: "device-manager",
23890
+ capScope: "system",
23891
+ addonId: null,
23892
+ access: "view"
23893
+ },
23732
23894
  "deviceManager.getRoleDisplayDefaults": {
23733
23895
  capName: "device-manager",
23734
23896
  capScope: "system",
@@ -25283,6 +25445,12 @@ Object.freeze({
25283
25445
  addonId: null,
25284
25446
  access: "view"
25285
25447
  },
25448
+ "pipelineAnalytics.getSensorEvents": {
25449
+ capName: "pipeline-analytics",
25450
+ capScope: "device",
25451
+ addonId: null,
25452
+ access: "view"
25453
+ },
25286
25454
  "pipelineAnalytics.getTrack": {
25287
25455
  capName: "pipeline-analytics",
25288
25456
  capScope: "device",
@@ -25295,6 +25463,18 @@ Object.freeze({
25295
25463
  addonId: null,
25296
25464
  access: "view"
25297
25465
  },
25466
+ "pipelineAnalytics.listEventKinds": {
25467
+ capName: "pipeline-analytics",
25468
+ capScope: "device",
25469
+ addonId: null,
25470
+ access: "view"
25471
+ },
25472
+ "pipelineAnalytics.listRecentTracks": {
25473
+ capName: "pipeline-analytics",
25474
+ capScope: "device",
25475
+ addonId: null,
25476
+ access: "view"
25477
+ },
25298
25478
  "pipelineAnalytics.listTracks": {
25299
25479
  capName: "pipeline-analytics",
25300
25480
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-CFZs3jI4.mjs
1
+ //#region ../types/dist/event-category-H4AVePnn.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -148,6 +148,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
148
148
  EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
149
149
  EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
150
150
  EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
151
+ /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
152
+ * thumb is a scrub gap the recorder's keyframe backfill covers. */
153
+ EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
151
154
  EventCategory["DetectionEvent"] = "detection.event";
152
155
  EventCategory["SessionTrackNew"] = "session.track.new";
153
156
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -10795,10 +10798,23 @@ var deviceDiscoveryCapability = {
10795
10798
  }
10796
10799
  };
10797
10800
  /**
10798
- * Doorbell button cap. Installed on a `DeviceType.Button` accessory
10799
- * with `role: DeviceRole.Doorbell`. Emits an `onPressed` event every
10800
- * time the firmware pushes a ring; status tracks the last press and
10801
- * a pressCount since start (diagnostic).
10801
+ * Doorbell button cap. Two kinds of providers coexist behind this cap
10802
+ * name (same pattern as `snapshot`):
10803
+ *
10804
+ * - **Native** providers: registered per-device by device-driver
10805
+ * addons via `ctx.registerNativeCap` — either on a
10806
+ * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
10807
+ * or directly on the camera (Reolink registers at camera level).
10808
+ * Emits an `onPressed` event every time the firmware pushes a
10809
+ * ring; status tracks the last press and a pressCount since start
10810
+ * (diagnostic).
10811
+ *
10812
+ * - **Wrapper** provider: the `virtual-doorbell` system builtin
10813
+ * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
10814
+ * device (contact / switch / event-emitter …) into a doorbell for
10815
+ * a camera. `defaultActive: false` — the operator explicitly binds
10816
+ * it per camera in the device-bindings UI, then picks the source
10817
+ * device + trigger in the per-device settings.
10802
10818
  *
10803
10819
  * The DeviceEventPropagator re-emits `onPressed` on the camera parent
10804
10820
  * — subscribers listening at the camera level receive ring events
@@ -10819,7 +10835,10 @@ var doorbellCapability = {
10819
10835
  scope: "device",
10820
10836
  deviceNative: true,
10821
10837
  mode: "singleton",
10822
- deviceTypes: [DeviceType.Button],
10838
+ kind: "wrapper",
10839
+ defaultActive: false,
10840
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
10841
+ exposesDeviceSettings: true,
10823
10842
  methods: {},
10824
10843
  events: {
10825
10844
  /**
@@ -17171,6 +17190,14 @@ var ConfigEntrySchema = object({
17171
17190
  value: unknown(),
17172
17191
  description: string().optional()
17173
17192
  });
17193
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
17194
+ /** One resolved linked device — the compact projection consumers need. */
17195
+ var LinkedDeviceSchema = object({
17196
+ deviceId: number(),
17197
+ name: string(),
17198
+ location: string().nullable(),
17199
+ features: array(string())
17200
+ });
17174
17201
  var SavedDeviceRowSchema = object({
17175
17202
  /** Numeric id reserved at allocateDeviceId time. */
17176
17203
  id: number(),
@@ -17392,7 +17419,10 @@ method(object({
17392
17419
  }), _void(), {
17393
17420
  kind: "mutation",
17394
17421
  auth: "admin"
17395
- }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
17422
+ }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
17423
+ mode: DeviceLinkModeSchema,
17424
+ devices: array(LinkedDeviceSchema)
17425
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
17396
17426
  deviceId: number(),
17397
17427
  values: record(string(), unknown())
17398
17428
  }), object({ success: literal(true) }), {
@@ -18661,6 +18691,61 @@ var EventKindSchema = _enum([
18661
18691
  "object",
18662
18692
  "audio"
18663
18693
  ]);
18694
+ /**
18695
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
18696
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
18697
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
18698
+ */
18699
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
18700
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
18701
+ var EventKindIconSchema = _enum([
18702
+ "motion",
18703
+ "audio",
18704
+ "person",
18705
+ "vehicle",
18706
+ "animal",
18707
+ "door",
18708
+ "pir",
18709
+ "smoke",
18710
+ "water",
18711
+ "button",
18712
+ "generic"
18713
+ ]);
18714
+ var EventKindCategorySchema = _enum([
18715
+ "motion",
18716
+ "audio",
18717
+ "detection",
18718
+ "sensor",
18719
+ "custom"
18720
+ ]);
18721
+ var EventKindDescriptorSchema = object({
18722
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
18723
+ kind: string(),
18724
+ label: string(),
18725
+ /** Hex color for timeline/legend rendering. */
18726
+ color: string(),
18727
+ icon: EventKindIconSchema,
18728
+ category: EventKindCategorySchema,
18729
+ /** Which cap + device contributes this kind. For built-ins the camera
18730
+ * itself; for sensor kinds the LINKED source device. */
18731
+ source: object({
18732
+ capName: string(),
18733
+ deviceId: number()
18734
+ })
18735
+ });
18736
+ var SensorEventSchema = object({
18737
+ id: string(),
18738
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
18739
+ * yields N rows, one per camera). */
18740
+ deviceId: number(),
18741
+ /** The linked sensor device whose state changed. */
18742
+ sourceDeviceId: number(),
18743
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
18744
+ kind: string(),
18745
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
18746
+ value: record(string(), unknown()).nullable(),
18747
+ timestamp: number()
18748
+ });
18664
18749
  var TrackPositionSchema = object({
18665
18750
  x: number(),
18666
18751
  y: number(),
@@ -18674,6 +18759,30 @@ var TrackSnapshotSchema = object({
18674
18759
  mediaKey: string()
18675
18760
  });
18676
18761
  /**
18762
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
18763
+ * divided by the track's detection-frame dims), computed at persist time.
18764
+ * Absent when the frame dims were unknown when the track was persisted
18765
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
18766
+ */
18767
+ var TrackEnvelopeSchema = object({
18768
+ minX: number(),
18769
+ minY: number(),
18770
+ maxX: number(),
18771
+ maxY: number()
18772
+ });
18773
+ /**
18774
+ * Row projection for track list queries. `full` (default) returns the
18775
+ * complete Track including the frame-rate `positions[]` history and the
18776
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
18777
+ * keeps every scalar the list surfaces actually render (ids, class(es),
18778
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
18779
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
18780
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
18781
+ * `getTrack`. Mirrors the event-store `projection` convention
18782
+ * (`getObjectEvents` et al.).
18783
+ */
18784
+ var TrackProjectionSchema = _enum(["full", "slim"]);
18785
+ /**
18677
18786
  * One audio-classification label heard on the track's camera while the
18678
18787
  * track was alive, aggregated per label. An "episode" is one persisted
18679
18788
  * audio event (the confident-classification path: score ≥ the device's
@@ -18724,7 +18833,11 @@ var TrackSchema = object({
18724
18833
  /** Audio-classification labels heard on the camera during the track's
18725
18834
  * life (score ≥ device `classificationMinScore`), aggregated per label.
18726
18835
  * Absent on legacy rows / tracks with no confident audio. */
18727
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
18836
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
18837
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
18838
+ * Populated from the persisted envelope columns on historical reads;
18839
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
18840
+ envelope: TrackEnvelopeSchema.optional()
18728
18841
  });
18729
18842
  var BaseEventFields = {
18730
18843
  id: string(),
@@ -18834,11 +18947,13 @@ var MediaFileSchema = object({
18834
18947
  sizeBytes: number(),
18835
18948
  timestamp: number()
18836
18949
  });
18950
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
18951
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
18837
18952
  var DeviceEventQueryInput = object({
18838
18953
  deviceId: number(),
18839
18954
  since: number().optional(),
18840
18955
  until: number().optional(),
18841
- limit: number().int().min(1).max(5e3).default(1e3),
18956
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
18842
18957
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
18843
18958
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
18844
18959
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -18846,6 +18961,27 @@ var DeviceEventQueryInput = object({
18846
18961
  projection: _enum(["full", "slim"]).optional()
18847
18962
  });
18848
18963
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
18964
+ var RecentTracksQueryInput = object({
18965
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
18966
+ deviceIds: array(number()),
18967
+ /** Window lower bound on `lastSeen` (inclusive). */
18968
+ since: number().optional(),
18969
+ /** Window upper bound on `lastSeen` (inclusive). */
18970
+ until: number().optional(),
18971
+ /** Page size. Default 200, max 1000. */
18972
+ limit: number().int().min(1).max(1e3).default(200),
18973
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
18974
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
18975
+ cursor: string().optional(),
18976
+ /** See {@link TrackProjectionSchema}. Default `full`. */
18977
+ projection: TrackProjectionSchema.optional()
18978
+ });
18979
+ var RecentTracksPageSchema = object({
18980
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
18981
+ tracks: array(TrackSchema).readonly(),
18982
+ /** Cursor for the next page, or null when this page is the last. */
18983
+ nextCursor: string().nullable()
18984
+ });
18849
18985
  var KeyEventQueryInput = object({
18850
18986
  deviceId: number(),
18851
18987
  /** Window lower bound (track firstSeen ≥ since). */
@@ -18928,11 +19064,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18928
19064
  deviceId: number(),
18929
19065
  since: number().optional(),
18930
19066
  until: number().optional(),
18931
- limit: number().optional()
18932
- }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
19067
+ limit: number().optional(),
19068
+ /** Spatial filter only tracks whose trajectory intersects the zone
19069
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
19070
+ * envelope columns, then precisely tested per position. Tracks with
19071
+ * an unknown envelope (no frame dims at persist time) always match. */
19072
+ zone: TrackZoneFilterSchema.optional(),
19073
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
19074
+ * compatible — omitting the field keeps today's exact behaviour). */
19075
+ projection: TrackProjectionSchema.optional()
19076
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
18933
19077
  kind: "mutation",
18934
19078
  auth: "admin"
18935
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19079
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
19080
+ deviceId: number(),
19081
+ since: number().optional(),
19082
+ until: number().optional(),
19083
+ kinds: array(string()).optional(),
19084
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19085
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
18936
19086
  deviceId: number(),
18937
19087
  since: number(),
18938
19088
  until: number(),
@@ -22150,7 +22300,12 @@ var RecordingStorageUsageSchema = object({
22150
22300
  /**
22151
22301
  * Result of locating footage at a wall-clock instant for one device/profile.
22152
22302
  * `segment` carries the covering segment's window; `gap` reports the forward
22153
- * nearest covered edge (`null` past the end of footage / when none exists).
22303
+ * nearest covered edge (`null` past the end of footage / when none exists)
22304
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
22305
+ * footage behind the epoch; `null` when none — optional so older providers
22306
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
22307
+ * small inter-segment cracks (durMs under-covers the span to the next
22308
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
22154
22309
  */
22155
22310
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
22156
22311
  kind: literal("segment"),
@@ -22159,7 +22314,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
22159
22314
  bytes: number()
22160
22315
  }), object({
22161
22316
  kind: literal("gap"),
22162
- nearestEdgeMs: number().nullable()
22317
+ nearestEdgeMs: number().nullable(),
22318
+ prevEndMs: number().nullable().optional()
22163
22319
  })]);
22164
22320
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
22165
22321
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -23728,6 +23884,12 @@ Object.freeze({
23728
23884
  addonId: null,
23729
23885
  access: "view"
23730
23886
  },
23887
+ "deviceManager.getLinkedDevices": {
23888
+ capName: "device-manager",
23889
+ capScope: "system",
23890
+ addonId: null,
23891
+ access: "view"
23892
+ },
23731
23893
  "deviceManager.getRoleDisplayDefaults": {
23732
23894
  capName: "device-manager",
23733
23895
  capScope: "system",
@@ -25282,6 +25444,12 @@ Object.freeze({
25282
25444
  addonId: null,
25283
25445
  access: "view"
25284
25446
  },
25447
+ "pipelineAnalytics.getSensorEvents": {
25448
+ capName: "pipeline-analytics",
25449
+ capScope: "device",
25450
+ addonId: null,
25451
+ access: "view"
25452
+ },
25285
25453
  "pipelineAnalytics.getTrack": {
25286
25454
  capName: "pipeline-analytics",
25287
25455
  capScope: "device",
@@ -25294,6 +25462,18 @@ Object.freeze({
25294
25462
  addonId: null,
25295
25463
  access: "view"
25296
25464
  },
25465
+ "pipelineAnalytics.listEventKinds": {
25466
+ capName: "pipeline-analytics",
25467
+ capScope: "device",
25468
+ addonId: null,
25469
+ access: "view"
25470
+ },
25471
+ "pipelineAnalytics.listRecentTracks": {
25472
+ capName: "pipeline-analytics",
25473
+ capScope: "device",
25474
+ addonId: null,
25475
+ access: "view"
25476
+ },
25297
25477
  "pipelineAnalytics.listTracks": {
25298
25478
  capName: "pipeline-analytics",
25299
25479
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-unraid",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Unraid device-provider addon for CamStack — one Container per Unraid instance fanning out array, disk, docker and notification entities",
5
5
  "keywords": [
6
6
  "camstack",