@camstack/addon-provider-dreame 0.1.29 → 0.1.30

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
@@ -37,7 +37,7 @@ let crypto$1 = require("crypto");
37
37
  let events = require("events");
38
38
  let zlib = require("zlib");
39
39
  zlib = __toESM(zlib, 1);
40
- //#region ../types/dist/event-category-CFZs3jI4.mjs
40
+ //#region ../types/dist/event-category-H4AVePnn.mjs
41
41
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
42
42
  EventCategory["SystemBoot"] = "system.boot";
43
43
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -187,6 +187,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
187
187
  EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
188
188
  EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
189
189
  EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
190
+ /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
191
+ * thumb is a scrub gap the recorder's keyframe backfill covers. */
192
+ EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
190
193
  EventCategory["DetectionEvent"] = "detection.event";
191
194
  EventCategory["SessionTrackNew"] = "session.track.new";
192
195
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -10834,10 +10837,23 @@ var deviceDiscoveryCapability = {
10834
10837
  }
10835
10838
  };
10836
10839
  /**
10837
- * Doorbell button cap. Installed on a `DeviceType.Button` accessory
10838
- * with `role: DeviceRole.Doorbell`. Emits an `onPressed` event every
10839
- * time the firmware pushes a ring; status tracks the last press and
10840
- * a pressCount since start (diagnostic).
10840
+ * Doorbell button cap. Two kinds of providers coexist behind this cap
10841
+ * name (same pattern as `snapshot`):
10842
+ *
10843
+ * - **Native** providers: registered per-device by device-driver
10844
+ * addons via `ctx.registerNativeCap` — either on a
10845
+ * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
10846
+ * or directly on the camera (Reolink registers at camera level).
10847
+ * Emits an `onPressed` event every time the firmware pushes a
10848
+ * ring; status tracks the last press and a pressCount since start
10849
+ * (diagnostic).
10850
+ *
10851
+ * - **Wrapper** provider: the `virtual-doorbell` system builtin
10852
+ * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
10853
+ * device (contact / switch / event-emitter …) into a doorbell for
10854
+ * a camera. `defaultActive: false` — the operator explicitly binds
10855
+ * it per camera in the device-bindings UI, then picks the source
10856
+ * device + trigger in the per-device settings.
10841
10857
  *
10842
10858
  * The DeviceEventPropagator re-emits `onPressed` on the camera parent
10843
10859
  * — subscribers listening at the camera level receive ring events
@@ -10858,7 +10874,10 @@ var doorbellCapability = {
10858
10874
  scope: "device",
10859
10875
  deviceNative: true,
10860
10876
  mode: "singleton",
10861
- deviceTypes: [DeviceType.Button],
10877
+ kind: "wrapper",
10878
+ defaultActive: false,
10879
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
10880
+ exposesDeviceSettings: true,
10862
10881
  methods: {},
10863
10882
  events: {
10864
10883
  /**
@@ -17227,6 +17246,14 @@ var ConfigEntrySchema = object({
17227
17246
  value: unknown(),
17228
17247
  description: string().optional()
17229
17248
  });
17249
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
17250
+ /** One resolved linked device — the compact projection consumers need. */
17251
+ var LinkedDeviceSchema = object({
17252
+ deviceId: number(),
17253
+ name: string(),
17254
+ location: string().nullable(),
17255
+ features: array(string())
17256
+ });
17230
17257
  var SavedDeviceRowSchema = object({
17231
17258
  /** Numeric id reserved at allocateDeviceId time. */
17232
17259
  id: number(),
@@ -17448,7 +17475,10 @@ method(object({
17448
17475
  }), _void(), {
17449
17476
  kind: "mutation",
17450
17477
  auth: "admin"
17451
- }), 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({
17478
+ }), 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({
17479
+ mode: DeviceLinkModeSchema,
17480
+ devices: array(LinkedDeviceSchema)
17481
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
17452
17482
  deviceId: number(),
17453
17483
  values: record(string(), unknown())
17454
17484
  }), object({ success: literal(true) }), {
@@ -18717,6 +18747,61 @@ var EventKindSchema = _enum([
18717
18747
  "object",
18718
18748
  "audio"
18719
18749
  ]);
18750
+ /**
18751
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
18752
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
18753
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
18754
+ */
18755
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
18756
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
18757
+ var EventKindIconSchema = _enum([
18758
+ "motion",
18759
+ "audio",
18760
+ "person",
18761
+ "vehicle",
18762
+ "animal",
18763
+ "door",
18764
+ "pir",
18765
+ "smoke",
18766
+ "water",
18767
+ "button",
18768
+ "generic"
18769
+ ]);
18770
+ var EventKindCategorySchema = _enum([
18771
+ "motion",
18772
+ "audio",
18773
+ "detection",
18774
+ "sensor",
18775
+ "custom"
18776
+ ]);
18777
+ var EventKindDescriptorSchema = object({
18778
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
18779
+ kind: string(),
18780
+ label: string(),
18781
+ /** Hex color for timeline/legend rendering. */
18782
+ color: string(),
18783
+ icon: EventKindIconSchema,
18784
+ category: EventKindCategorySchema,
18785
+ /** Which cap + device contributes this kind. For built-ins the camera
18786
+ * itself; for sensor kinds the LINKED source device. */
18787
+ source: object({
18788
+ capName: string(),
18789
+ deviceId: number()
18790
+ })
18791
+ });
18792
+ var SensorEventSchema = object({
18793
+ id: string(),
18794
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
18795
+ * yields N rows, one per camera). */
18796
+ deviceId: number(),
18797
+ /** The linked sensor device whose state changed. */
18798
+ sourceDeviceId: number(),
18799
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
18800
+ kind: string(),
18801
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
18802
+ value: record(string(), unknown()).nullable(),
18803
+ timestamp: number()
18804
+ });
18720
18805
  var TrackPositionSchema = object({
18721
18806
  x: number(),
18722
18807
  y: number(),
@@ -18730,6 +18815,30 @@ var TrackSnapshotSchema = object({
18730
18815
  mediaKey: string()
18731
18816
  });
18732
18817
  /**
18818
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
18819
+ * divided by the track's detection-frame dims), computed at persist time.
18820
+ * Absent when the frame dims were unknown when the track was persisted
18821
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
18822
+ */
18823
+ var TrackEnvelopeSchema = object({
18824
+ minX: number(),
18825
+ minY: number(),
18826
+ maxX: number(),
18827
+ maxY: number()
18828
+ });
18829
+ /**
18830
+ * Row projection for track list queries. `full` (default) returns the
18831
+ * complete Track including the frame-rate `positions[]` history and the
18832
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
18833
+ * keeps every scalar the list surfaces actually render (ids, class(es),
18834
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
18835
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
18836
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
18837
+ * `getTrack`. Mirrors the event-store `projection` convention
18838
+ * (`getObjectEvents` et al.).
18839
+ */
18840
+ var TrackProjectionSchema = _enum(["full", "slim"]);
18841
+ /**
18733
18842
  * One audio-classification label heard on the track's camera while the
18734
18843
  * track was alive, aggregated per label. An "episode" is one persisted
18735
18844
  * audio event (the confident-classification path: score ≥ the device's
@@ -18780,7 +18889,11 @@ var TrackSchema = object({
18780
18889
  /** Audio-classification labels heard on the camera during the track's
18781
18890
  * life (score ≥ device `classificationMinScore`), aggregated per label.
18782
18891
  * Absent on legacy rows / tracks with no confident audio. */
18783
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
18892
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
18893
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
18894
+ * Populated from the persisted envelope columns on historical reads;
18895
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
18896
+ envelope: TrackEnvelopeSchema.optional()
18784
18897
  });
18785
18898
  var BaseEventFields = {
18786
18899
  id: string(),
@@ -18890,11 +19003,13 @@ var MediaFileSchema = object({
18890
19003
  sizeBytes: number(),
18891
19004
  timestamp: number()
18892
19005
  });
19006
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
19007
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
18893
19008
  var DeviceEventQueryInput = object({
18894
19009
  deviceId: number(),
18895
19010
  since: number().optional(),
18896
19011
  until: number().optional(),
18897
- limit: number().int().min(1).max(5e3).default(1e3),
19012
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
18898
19013
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
18899
19014
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
18900
19015
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -18902,6 +19017,27 @@ var DeviceEventQueryInput = object({
18902
19017
  projection: _enum(["full", "slim"]).optional()
18903
19018
  });
18904
19019
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
19020
+ var RecentTracksQueryInput = object({
19021
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
19022
+ deviceIds: array(number()),
19023
+ /** Window lower bound on `lastSeen` (inclusive). */
19024
+ since: number().optional(),
19025
+ /** Window upper bound on `lastSeen` (inclusive). */
19026
+ until: number().optional(),
19027
+ /** Page size. Default 200, max 1000. */
19028
+ limit: number().int().min(1).max(1e3).default(200),
19029
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
19030
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
19031
+ cursor: string().optional(),
19032
+ /** See {@link TrackProjectionSchema}. Default `full`. */
19033
+ projection: TrackProjectionSchema.optional()
19034
+ });
19035
+ var RecentTracksPageSchema = object({
19036
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19037
+ tracks: array(TrackSchema).readonly(),
19038
+ /** Cursor for the next page, or null when this page is the last. */
19039
+ nextCursor: string().nullable()
19040
+ });
18905
19041
  var KeyEventQueryInput = object({
18906
19042
  deviceId: number(),
18907
19043
  /** Window lower bound (track firstSeen ≥ since). */
@@ -18984,11 +19120,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18984
19120
  deviceId: number(),
18985
19121
  since: number().optional(),
18986
19122
  until: number().optional(),
18987
- limit: number().optional()
18988
- }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
19123
+ limit: number().optional(),
19124
+ /** Spatial filter only tracks whose trajectory intersects the zone
19125
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
19126
+ * envelope columns, then precisely tested per position. Tracks with
19127
+ * an unknown envelope (no frame dims at persist time) always match. */
19128
+ zone: TrackZoneFilterSchema.optional(),
19129
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
19130
+ * compatible — omitting the field keeps today's exact behaviour). */
19131
+ projection: TrackProjectionSchema.optional()
19132
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
18989
19133
  kind: "mutation",
18990
19134
  auth: "admin"
18991
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19135
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
19136
+ deviceId: number(),
19137
+ since: number().optional(),
19138
+ until: number().optional(),
19139
+ kinds: array(string()).optional(),
19140
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19141
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
18992
19142
  deviceId: number(),
18993
19143
  since: number(),
18994
19144
  until: number(),
@@ -22206,7 +22356,12 @@ var RecordingStorageUsageSchema = object({
22206
22356
  /**
22207
22357
  * Result of locating footage at a wall-clock instant for one device/profile.
22208
22358
  * `segment` carries the covering segment's window; `gap` reports the forward
22209
- * nearest covered edge (`null` past the end of footage / when none exists).
22359
+ * nearest covered edge (`null` past the end of footage / when none exists)
22360
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
22361
+ * footage behind the epoch; `null` when none — optional so older providers
22362
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
22363
+ * small inter-segment cracks (durMs under-covers the span to the next
22364
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
22210
22365
  */
22211
22366
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
22212
22367
  kind: literal("segment"),
@@ -22215,7 +22370,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
22215
22370
  bytes: number()
22216
22371
  }), object({
22217
22372
  kind: literal("gap"),
22218
- nearestEdgeMs: number().nullable()
22373
+ nearestEdgeMs: number().nullable(),
22374
+ prevEndMs: number().nullable().optional()
22219
22375
  })]);
22220
22376
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
22221
22377
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -23784,6 +23940,12 @@ Object.freeze({
23784
23940
  addonId: null,
23785
23941
  access: "view"
23786
23942
  },
23943
+ "deviceManager.getLinkedDevices": {
23944
+ capName: "device-manager",
23945
+ capScope: "system",
23946
+ addonId: null,
23947
+ access: "view"
23948
+ },
23787
23949
  "deviceManager.getRoleDisplayDefaults": {
23788
23950
  capName: "device-manager",
23789
23951
  capScope: "system",
@@ -25338,6 +25500,12 @@ Object.freeze({
25338
25500
  addonId: null,
25339
25501
  access: "view"
25340
25502
  },
25503
+ "pipelineAnalytics.getSensorEvents": {
25504
+ capName: "pipeline-analytics",
25505
+ capScope: "device",
25506
+ addonId: null,
25507
+ access: "view"
25508
+ },
25341
25509
  "pipelineAnalytics.getTrack": {
25342
25510
  capName: "pipeline-analytics",
25343
25511
  capScope: "device",
@@ -25350,6 +25518,18 @@ Object.freeze({
25350
25518
  addonId: null,
25351
25519
  access: "view"
25352
25520
  },
25521
+ "pipelineAnalytics.listEventKinds": {
25522
+ capName: "pipeline-analytics",
25523
+ capScope: "device",
25524
+ addonId: null,
25525
+ access: "view"
25526
+ },
25527
+ "pipelineAnalytics.listRecentTracks": {
25528
+ capName: "pipeline-analytics",
25529
+ capScope: "device",
25530
+ addonId: null,
25531
+ access: "view"
25532
+ },
25353
25533
  "pipelineAnalytics.listTracks": {
25354
25534
  capName: "pipeline-analytics",
25355
25535
  capScope: "device",
package/dist/addon.mjs CHANGED
@@ -37,7 +37,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
37
37
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
38
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
39
39
  //#endregion
40
- //#region ../types/dist/event-category-CFZs3jI4.mjs
40
+ //#region ../types/dist/event-category-H4AVePnn.mjs
41
41
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
42
42
  EventCategory["SystemBoot"] = "system.boot";
43
43
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -187,6 +187,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
187
187
  EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
188
188
  EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
189
189
  EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
190
+ /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
191
+ * thumb is a scrub gap the recorder's keyframe backfill covers. */
192
+ EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
190
193
  EventCategory["DetectionEvent"] = "detection.event";
191
194
  EventCategory["SessionTrackNew"] = "session.track.new";
192
195
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -10834,10 +10837,23 @@ var deviceDiscoveryCapability = {
10834
10837
  }
10835
10838
  };
10836
10839
  /**
10837
- * Doorbell button cap. Installed on a `DeviceType.Button` accessory
10838
- * with `role: DeviceRole.Doorbell`. Emits an `onPressed` event every
10839
- * time the firmware pushes a ring; status tracks the last press and
10840
- * a pressCount since start (diagnostic).
10840
+ * Doorbell button cap. Two kinds of providers coexist behind this cap
10841
+ * name (same pattern as `snapshot`):
10842
+ *
10843
+ * - **Native** providers: registered per-device by device-driver
10844
+ * addons via `ctx.registerNativeCap` — either on a
10845
+ * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
10846
+ * or directly on the camera (Reolink registers at camera level).
10847
+ * Emits an `onPressed` event every time the firmware pushes a
10848
+ * ring; status tracks the last press and a pressCount since start
10849
+ * (diagnostic).
10850
+ *
10851
+ * - **Wrapper** provider: the `virtual-doorbell` system builtin
10852
+ * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
10853
+ * device (contact / switch / event-emitter …) into a doorbell for
10854
+ * a camera. `defaultActive: false` — the operator explicitly binds
10855
+ * it per camera in the device-bindings UI, then picks the source
10856
+ * device + trigger in the per-device settings.
10841
10857
  *
10842
10858
  * The DeviceEventPropagator re-emits `onPressed` on the camera parent
10843
10859
  * — subscribers listening at the camera level receive ring events
@@ -10858,7 +10874,10 @@ var doorbellCapability = {
10858
10874
  scope: "device",
10859
10875
  deviceNative: true,
10860
10876
  mode: "singleton",
10861
- deviceTypes: [DeviceType.Button],
10877
+ kind: "wrapper",
10878
+ defaultActive: false,
10879
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
10880
+ exposesDeviceSettings: true,
10862
10881
  methods: {},
10863
10882
  events: {
10864
10883
  /**
@@ -17227,6 +17246,14 @@ var ConfigEntrySchema = object({
17227
17246
  value: unknown(),
17228
17247
  description: string().optional()
17229
17248
  });
17249
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
17250
+ /** One resolved linked device — the compact projection consumers need. */
17251
+ var LinkedDeviceSchema = object({
17252
+ deviceId: number(),
17253
+ name: string(),
17254
+ location: string().nullable(),
17255
+ features: array(string())
17256
+ });
17230
17257
  var SavedDeviceRowSchema = object({
17231
17258
  /** Numeric id reserved at allocateDeviceId time. */
17232
17259
  id: number(),
@@ -17448,7 +17475,10 @@ method(object({
17448
17475
  }), _void(), {
17449
17476
  kind: "mutation",
17450
17477
  auth: "admin"
17451
- }), 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({
17478
+ }), 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({
17479
+ mode: DeviceLinkModeSchema,
17480
+ devices: array(LinkedDeviceSchema)
17481
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
17452
17482
  deviceId: number(),
17453
17483
  values: record(string(), unknown())
17454
17484
  }), object({ success: literal(true) }), {
@@ -18717,6 +18747,61 @@ var EventKindSchema = _enum([
18717
18747
  "object",
18718
18748
  "audio"
18719
18749
  ]);
18750
+ /**
18751
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
18752
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
18753
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
18754
+ */
18755
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
18756
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
18757
+ var EventKindIconSchema = _enum([
18758
+ "motion",
18759
+ "audio",
18760
+ "person",
18761
+ "vehicle",
18762
+ "animal",
18763
+ "door",
18764
+ "pir",
18765
+ "smoke",
18766
+ "water",
18767
+ "button",
18768
+ "generic"
18769
+ ]);
18770
+ var EventKindCategorySchema = _enum([
18771
+ "motion",
18772
+ "audio",
18773
+ "detection",
18774
+ "sensor",
18775
+ "custom"
18776
+ ]);
18777
+ var EventKindDescriptorSchema = object({
18778
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
18779
+ kind: string(),
18780
+ label: string(),
18781
+ /** Hex color for timeline/legend rendering. */
18782
+ color: string(),
18783
+ icon: EventKindIconSchema,
18784
+ category: EventKindCategorySchema,
18785
+ /** Which cap + device contributes this kind. For built-ins the camera
18786
+ * itself; for sensor kinds the LINKED source device. */
18787
+ source: object({
18788
+ capName: string(),
18789
+ deviceId: number()
18790
+ })
18791
+ });
18792
+ var SensorEventSchema = object({
18793
+ id: string(),
18794
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
18795
+ * yields N rows, one per camera). */
18796
+ deviceId: number(),
18797
+ /** The linked sensor device whose state changed. */
18798
+ sourceDeviceId: number(),
18799
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
18800
+ kind: string(),
18801
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
18802
+ value: record(string(), unknown()).nullable(),
18803
+ timestamp: number()
18804
+ });
18720
18805
  var TrackPositionSchema = object({
18721
18806
  x: number(),
18722
18807
  y: number(),
@@ -18730,6 +18815,30 @@ var TrackSnapshotSchema = object({
18730
18815
  mediaKey: string()
18731
18816
  });
18732
18817
  /**
18818
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
18819
+ * divided by the track's detection-frame dims), computed at persist time.
18820
+ * Absent when the frame dims were unknown when the track was persisted
18821
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
18822
+ */
18823
+ var TrackEnvelopeSchema = object({
18824
+ minX: number(),
18825
+ minY: number(),
18826
+ maxX: number(),
18827
+ maxY: number()
18828
+ });
18829
+ /**
18830
+ * Row projection for track list queries. `full` (default) returns the
18831
+ * complete Track including the frame-rate `positions[]` history and the
18832
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
18833
+ * keeps every scalar the list surfaces actually render (ids, class(es),
18834
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
18835
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
18836
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
18837
+ * `getTrack`. Mirrors the event-store `projection` convention
18838
+ * (`getObjectEvents` et al.).
18839
+ */
18840
+ var TrackProjectionSchema = _enum(["full", "slim"]);
18841
+ /**
18733
18842
  * One audio-classification label heard on the track's camera while the
18734
18843
  * track was alive, aggregated per label. An "episode" is one persisted
18735
18844
  * audio event (the confident-classification path: score ≥ the device's
@@ -18780,7 +18889,11 @@ var TrackSchema = object({
18780
18889
  /** Audio-classification labels heard on the camera during the track's
18781
18890
  * life (score ≥ device `classificationMinScore`), aggregated per label.
18782
18891
  * Absent on legacy rows / tracks with no confident audio. */
18783
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
18892
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
18893
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
18894
+ * Populated from the persisted envelope columns on historical reads;
18895
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
18896
+ envelope: TrackEnvelopeSchema.optional()
18784
18897
  });
18785
18898
  var BaseEventFields = {
18786
18899
  id: string(),
@@ -18890,11 +19003,13 @@ var MediaFileSchema = object({
18890
19003
  sizeBytes: number(),
18891
19004
  timestamp: number()
18892
19005
  });
19006
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
19007
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
18893
19008
  var DeviceEventQueryInput = object({
18894
19009
  deviceId: number(),
18895
19010
  since: number().optional(),
18896
19011
  until: number().optional(),
18897
- limit: number().int().min(1).max(5e3).default(1e3),
19012
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
18898
19013
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
18899
19014
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
18900
19015
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -18902,6 +19017,27 @@ var DeviceEventQueryInput = object({
18902
19017
  projection: _enum(["full", "slim"]).optional()
18903
19018
  });
18904
19019
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
19020
+ var RecentTracksQueryInput = object({
19021
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
19022
+ deviceIds: array(number()),
19023
+ /** Window lower bound on `lastSeen` (inclusive). */
19024
+ since: number().optional(),
19025
+ /** Window upper bound on `lastSeen` (inclusive). */
19026
+ until: number().optional(),
19027
+ /** Page size. Default 200, max 1000. */
19028
+ limit: number().int().min(1).max(1e3).default(200),
19029
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
19030
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
19031
+ cursor: string().optional(),
19032
+ /** See {@link TrackProjectionSchema}. Default `full`. */
19033
+ projection: TrackProjectionSchema.optional()
19034
+ });
19035
+ var RecentTracksPageSchema = object({
19036
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19037
+ tracks: array(TrackSchema).readonly(),
19038
+ /** Cursor for the next page, or null when this page is the last. */
19039
+ nextCursor: string().nullable()
19040
+ });
18905
19041
  var KeyEventQueryInput = object({
18906
19042
  deviceId: number(),
18907
19043
  /** Window lower bound (track firstSeen ≥ since). */
@@ -18984,11 +19120,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18984
19120
  deviceId: number(),
18985
19121
  since: number().optional(),
18986
19122
  until: number().optional(),
18987
- limit: number().optional()
18988
- }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
19123
+ limit: number().optional(),
19124
+ /** Spatial filter only tracks whose trajectory intersects the zone
19125
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
19126
+ * envelope columns, then precisely tested per position. Tracks with
19127
+ * an unknown envelope (no frame dims at persist time) always match. */
19128
+ zone: TrackZoneFilterSchema.optional(),
19129
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
19130
+ * compatible — omitting the field keeps today's exact behaviour). */
19131
+ projection: TrackProjectionSchema.optional()
19132
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
18989
19133
  kind: "mutation",
18990
19134
  auth: "admin"
18991
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
19135
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
19136
+ deviceId: number(),
19137
+ since: number().optional(),
19138
+ until: number().optional(),
19139
+ kinds: array(string()).optional(),
19140
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
19141
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
18992
19142
  deviceId: number(),
18993
19143
  since: number(),
18994
19144
  until: number(),
@@ -22206,7 +22356,12 @@ var RecordingStorageUsageSchema = object({
22206
22356
  /**
22207
22357
  * Result of locating footage at a wall-clock instant for one device/profile.
22208
22358
  * `segment` carries the covering segment's window; `gap` reports the forward
22209
- * nearest covered edge (`null` past the end of footage / when none exists).
22359
+ * nearest covered edge (`null` past the end of footage / when none exists)
22360
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
22361
+ * footage behind the epoch; `null` when none — optional so older providers
22362
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
22363
+ * small inter-segment cracks (durMs under-covers the span to the next
22364
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
22210
22365
  */
22211
22366
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
22212
22367
  kind: literal("segment"),
@@ -22215,7 +22370,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
22215
22370
  bytes: number()
22216
22371
  }), object({
22217
22372
  kind: literal("gap"),
22218
- nearestEdgeMs: number().nullable()
22373
+ nearestEdgeMs: number().nullable(),
22374
+ prevEndMs: number().nullable().optional()
22219
22375
  })]);
22220
22376
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
22221
22377
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -23784,6 +23940,12 @@ Object.freeze({
23784
23940
  addonId: null,
23785
23941
  access: "view"
23786
23942
  },
23943
+ "deviceManager.getLinkedDevices": {
23944
+ capName: "device-manager",
23945
+ capScope: "system",
23946
+ addonId: null,
23947
+ access: "view"
23948
+ },
23787
23949
  "deviceManager.getRoleDisplayDefaults": {
23788
23950
  capName: "device-manager",
23789
23951
  capScope: "system",
@@ -25338,6 +25500,12 @@ Object.freeze({
25338
25500
  addonId: null,
25339
25501
  access: "view"
25340
25502
  },
25503
+ "pipelineAnalytics.getSensorEvents": {
25504
+ capName: "pipeline-analytics",
25505
+ capScope: "device",
25506
+ addonId: null,
25507
+ access: "view"
25508
+ },
25341
25509
  "pipelineAnalytics.getTrack": {
25342
25510
  capName: "pipeline-analytics",
25343
25511
  capScope: "device",
@@ -25350,6 +25518,18 @@ Object.freeze({
25350
25518
  addonId: null,
25351
25519
  access: "view"
25352
25520
  },
25521
+ "pipelineAnalytics.listEventKinds": {
25522
+ capName: "pipeline-analytics",
25523
+ capScope: "device",
25524
+ addonId: null,
25525
+ access: "view"
25526
+ },
25527
+ "pipelineAnalytics.listRecentTracks": {
25528
+ capName: "pipeline-analytics",
25529
+ capScope: "device",
25530
+ addonId: null,
25531
+ access: "view"
25532
+ },
25353
25533
  "pipelineAnalytics.listTracks": {
25354
25534
  capName: "pipeline-analytics",
25355
25535
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-dreame",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Dreame robot-vacuum / lawn-mower device-provider addon for CamStack — wraps the @apocaliss92/nodedreame Dreamehome cloud client",
5
5
  "keywords": [
6
6
  "camstack",