@camstack/addon-cloudflare 1.1.24 → 1.1.25

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.
@@ -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";
@@ -9812,7 +9815,7 @@ object({
9812
9815
  deviceId: number(),
9813
9816
  timestamp: number()
9814
9817
  });
9815
- DeviceType.Button;
9818
+ DeviceType.Button, DeviceType.Camera;
9816
9819
  /**
9817
9820
  * Enum-state sensor — a string value picked from a finite option set.
9818
9821
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -14203,6 +14206,14 @@ var ConfigEntrySchema = object({
14203
14206
  value: unknown(),
14204
14207
  description: string().optional()
14205
14208
  });
14209
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
14210
+ /** One resolved linked device — the compact projection consumers need. */
14211
+ var LinkedDeviceSchema = object({
14212
+ deviceId: number(),
14213
+ name: string(),
14214
+ location: string().nullable(),
14215
+ features: array(string())
14216
+ });
14206
14217
  var SavedDeviceRowSchema = object({
14207
14218
  /** Numeric id reserved at allocateDeviceId time. */
14208
14219
  id: number(),
@@ -14424,7 +14435,10 @@ method(object({
14424
14435
  }), _void(), {
14425
14436
  kind: "mutation",
14426
14437
  auth: "admin"
14427
- }), 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({
14438
+ }), 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({
14439
+ mode: DeviceLinkModeSchema,
14440
+ devices: array(LinkedDeviceSchema)
14441
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
14428
14442
  deviceId: number(),
14429
14443
  values: record(string(), unknown())
14430
14444
  }), object({ success: literal(true) }), {
@@ -15710,6 +15724,61 @@ var EventKindSchema = _enum([
15710
15724
  "object",
15711
15725
  "audio"
15712
15726
  ]);
15727
+ /**
15728
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
15729
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
15730
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
15731
+ */
15732
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
15733
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
15734
+ var EventKindIconSchema = _enum([
15735
+ "motion",
15736
+ "audio",
15737
+ "person",
15738
+ "vehicle",
15739
+ "animal",
15740
+ "door",
15741
+ "pir",
15742
+ "smoke",
15743
+ "water",
15744
+ "button",
15745
+ "generic"
15746
+ ]);
15747
+ var EventKindCategorySchema = _enum([
15748
+ "motion",
15749
+ "audio",
15750
+ "detection",
15751
+ "sensor",
15752
+ "custom"
15753
+ ]);
15754
+ var EventKindDescriptorSchema = object({
15755
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
15756
+ kind: string(),
15757
+ label: string(),
15758
+ /** Hex color for timeline/legend rendering. */
15759
+ color: string(),
15760
+ icon: EventKindIconSchema,
15761
+ category: EventKindCategorySchema,
15762
+ /** Which cap + device contributes this kind. For built-ins the camera
15763
+ * itself; for sensor kinds the LINKED source device. */
15764
+ source: object({
15765
+ capName: string(),
15766
+ deviceId: number()
15767
+ })
15768
+ });
15769
+ var SensorEventSchema = object({
15770
+ id: string(),
15771
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
15772
+ * yields N rows, one per camera). */
15773
+ deviceId: number(),
15774
+ /** The linked sensor device whose state changed. */
15775
+ sourceDeviceId: number(),
15776
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
15777
+ kind: string(),
15778
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
15779
+ value: record(string(), unknown()).nullable(),
15780
+ timestamp: number()
15781
+ });
15713
15782
  var TrackPositionSchema = object({
15714
15783
  x: number(),
15715
15784
  y: number(),
@@ -15723,6 +15792,30 @@ var TrackSnapshotSchema = object({
15723
15792
  mediaKey: string()
15724
15793
  });
15725
15794
  /**
15795
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
15796
+ * divided by the track's detection-frame dims), computed at persist time.
15797
+ * Absent when the frame dims were unknown when the track was persisted
15798
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
15799
+ */
15800
+ var TrackEnvelopeSchema = object({
15801
+ minX: number(),
15802
+ minY: number(),
15803
+ maxX: number(),
15804
+ maxY: number()
15805
+ });
15806
+ /**
15807
+ * Row projection for track list queries. `full` (default) returns the
15808
+ * complete Track including the frame-rate `positions[]` history and the
15809
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
15810
+ * keeps every scalar the list surfaces actually render (ids, class(es),
15811
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
15812
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
15813
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
15814
+ * `getTrack`. Mirrors the event-store `projection` convention
15815
+ * (`getObjectEvents` et al.).
15816
+ */
15817
+ var TrackProjectionSchema = _enum(["full", "slim"]);
15818
+ /**
15726
15819
  * One audio-classification label heard on the track's camera while the
15727
15820
  * track was alive, aggregated per label. An "episode" is one persisted
15728
15821
  * audio event (the confident-classification path: score ≥ the device's
@@ -15773,7 +15866,11 @@ var TrackSchema = object({
15773
15866
  /** Audio-classification labels heard on the camera during the track's
15774
15867
  * life (score ≥ device `classificationMinScore`), aggregated per label.
15775
15868
  * Absent on legacy rows / tracks with no confident audio. */
15776
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
15869
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
15870
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
15871
+ * Populated from the persisted envelope columns on historical reads;
15872
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
15873
+ envelope: TrackEnvelopeSchema.optional()
15777
15874
  });
15778
15875
  var BaseEventFields = {
15779
15876
  id: string(),
@@ -15883,11 +15980,13 @@ var MediaFileSchema = object({
15883
15980
  sizeBytes: number(),
15884
15981
  timestamp: number()
15885
15982
  });
15983
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
15984
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
15886
15985
  var DeviceEventQueryInput = object({
15887
15986
  deviceId: number(),
15888
15987
  since: number().optional(),
15889
15988
  until: number().optional(),
15890
- limit: number().int().min(1).max(5e3).default(1e3),
15989
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
15891
15990
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
15892
15991
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
15893
15992
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -15895,6 +15994,27 @@ var DeviceEventQueryInput = object({
15895
15994
  projection: _enum(["full", "slim"]).optional()
15896
15995
  });
15897
15996
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
15997
+ var RecentTracksQueryInput = object({
15998
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
15999
+ deviceIds: array(number()),
16000
+ /** Window lower bound on `lastSeen` (inclusive). */
16001
+ since: number().optional(),
16002
+ /** Window upper bound on `lastSeen` (inclusive). */
16003
+ until: number().optional(),
16004
+ /** Page size. Default 200, max 1000. */
16005
+ limit: number().int().min(1).max(1e3).default(200),
16006
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
16007
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
16008
+ cursor: string().optional(),
16009
+ /** See {@link TrackProjectionSchema}. Default `full`. */
16010
+ projection: TrackProjectionSchema.optional()
16011
+ });
16012
+ var RecentTracksPageSchema = object({
16013
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
16014
+ tracks: array(TrackSchema).readonly(),
16015
+ /** Cursor for the next page, or null when this page is the last. */
16016
+ nextCursor: string().nullable()
16017
+ });
15898
16018
  var KeyEventQueryInput = object({
15899
16019
  deviceId: number(),
15900
16020
  /** Window lower bound (track firstSeen ≥ since). */
@@ -15977,11 +16097,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15977
16097
  deviceId: number(),
15978
16098
  since: number().optional(),
15979
16099
  until: number().optional(),
15980
- limit: number().optional()
15981
- }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
15982
- kind: "mutation",
15983
- auth: "admin"
15984
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
16100
+ limit: number().optional(),
16101
+ /** Spatial filter only tracks whose trajectory intersects the zone
16102
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
16103
+ * envelope columns, then precisely tested per position. Tracks with
16104
+ * an unknown envelope (no frame dims at persist time) always match. */
16105
+ zone: TrackZoneFilterSchema.optional(),
16106
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
16107
+ * compatible — omitting the field keeps today's exact behaviour). */
16108
+ projection: TrackProjectionSchema.optional()
16109
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
16110
+ kind: "mutation",
16111
+ auth: "admin"
16112
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
16113
+ deviceId: number(),
16114
+ since: number().optional(),
16115
+ until: number().optional(),
16116
+ kinds: array(string()).optional(),
16117
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
16118
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
15985
16119
  deviceId: number(),
15986
16120
  since: number(),
15987
16121
  until: number(),
@@ -19205,7 +19339,12 @@ var RecordingStorageUsageSchema = object({
19205
19339
  /**
19206
19340
  * Result of locating footage at a wall-clock instant for one device/profile.
19207
19341
  * `segment` carries the covering segment's window; `gap` reports the forward
19208
- * nearest covered edge (`null` past the end of footage / when none exists).
19342
+ * nearest covered edge (`null` past the end of footage / when none exists)
19343
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
19344
+ * footage behind the epoch; `null` when none — optional so older providers
19345
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
19346
+ * small inter-segment cracks (durMs under-covers the span to the next
19347
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
19209
19348
  */
19210
19349
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19211
19350
  kind: literal("segment"),
@@ -19214,7 +19353,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19214
19353
  bytes: number()
19215
19354
  }), object({
19216
19355
  kind: literal("gap"),
19217
- nearestEdgeMs: number().nullable()
19356
+ nearestEdgeMs: number().nullable(),
19357
+ prevEndMs: number().nullable().optional()
19218
19358
  })]);
19219
19359
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
19220
19360
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -20783,6 +20923,12 @@ Object.freeze({
20783
20923
  addonId: null,
20784
20924
  access: "view"
20785
20925
  },
20926
+ "deviceManager.getLinkedDevices": {
20927
+ capName: "device-manager",
20928
+ capScope: "system",
20929
+ addonId: null,
20930
+ access: "view"
20931
+ },
20786
20932
  "deviceManager.getRoleDisplayDefaults": {
20787
20933
  capName: "device-manager",
20788
20934
  capScope: "system",
@@ -22337,6 +22483,12 @@ Object.freeze({
22337
22483
  addonId: null,
22338
22484
  access: "view"
22339
22485
  },
22486
+ "pipelineAnalytics.getSensorEvents": {
22487
+ capName: "pipeline-analytics",
22488
+ capScope: "device",
22489
+ addonId: null,
22490
+ access: "view"
22491
+ },
22340
22492
  "pipelineAnalytics.getTrack": {
22341
22493
  capName: "pipeline-analytics",
22342
22494
  capScope: "device",
@@ -22349,6 +22501,18 @@ Object.freeze({
22349
22501
  addonId: null,
22350
22502
  access: "view"
22351
22503
  },
22504
+ "pipelineAnalytics.listEventKinds": {
22505
+ capName: "pipeline-analytics",
22506
+ capScope: "device",
22507
+ addonId: null,
22508
+ access: "view"
22509
+ },
22510
+ "pipelineAnalytics.listRecentTracks": {
22511
+ capName: "pipeline-analytics",
22512
+ capScope: "device",
22513
+ addonId: null,
22514
+ access: "view"
22515
+ },
22352
22516
  "pipelineAnalytics.listTracks": {
22353
22517
  capName: "pipeline-analytics",
22354
22518
  capScope: "device",
@@ -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";
@@ -9812,7 +9815,7 @@ object({
9812
9815
  deviceId: number(),
9813
9816
  timestamp: number()
9814
9817
  });
9815
- DeviceType.Button;
9818
+ DeviceType.Button, DeviceType.Camera;
9816
9819
  /**
9817
9820
  * Enum-state sensor — a string value picked from a finite option set.
9818
9821
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -14203,6 +14206,14 @@ var ConfigEntrySchema = object({
14203
14206
  value: unknown(),
14204
14207
  description: string().optional()
14205
14208
  });
14209
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
14210
+ /** One resolved linked device — the compact projection consumers need. */
14211
+ var LinkedDeviceSchema = object({
14212
+ deviceId: number(),
14213
+ name: string(),
14214
+ location: string().nullable(),
14215
+ features: array(string())
14216
+ });
14206
14217
  var SavedDeviceRowSchema = object({
14207
14218
  /** Numeric id reserved at allocateDeviceId time. */
14208
14219
  id: number(),
@@ -14424,7 +14435,10 @@ method(object({
14424
14435
  }), _void(), {
14425
14436
  kind: "mutation",
14426
14437
  auth: "admin"
14427
- }), 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({
14438
+ }), 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({
14439
+ mode: DeviceLinkModeSchema,
14440
+ devices: array(LinkedDeviceSchema)
14441
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
14428
14442
  deviceId: number(),
14429
14443
  values: record(string(), unknown())
14430
14444
  }), object({ success: literal(true) }), {
@@ -15710,6 +15724,61 @@ var EventKindSchema = _enum([
15710
15724
  "object",
15711
15725
  "audio"
15712
15726
  ]);
15727
+ /**
15728
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
15729
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
15730
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
15731
+ */
15732
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
15733
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
15734
+ var EventKindIconSchema = _enum([
15735
+ "motion",
15736
+ "audio",
15737
+ "person",
15738
+ "vehicle",
15739
+ "animal",
15740
+ "door",
15741
+ "pir",
15742
+ "smoke",
15743
+ "water",
15744
+ "button",
15745
+ "generic"
15746
+ ]);
15747
+ var EventKindCategorySchema = _enum([
15748
+ "motion",
15749
+ "audio",
15750
+ "detection",
15751
+ "sensor",
15752
+ "custom"
15753
+ ]);
15754
+ var EventKindDescriptorSchema = object({
15755
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
15756
+ kind: string(),
15757
+ label: string(),
15758
+ /** Hex color for timeline/legend rendering. */
15759
+ color: string(),
15760
+ icon: EventKindIconSchema,
15761
+ category: EventKindCategorySchema,
15762
+ /** Which cap + device contributes this kind. For built-ins the camera
15763
+ * itself; for sensor kinds the LINKED source device. */
15764
+ source: object({
15765
+ capName: string(),
15766
+ deviceId: number()
15767
+ })
15768
+ });
15769
+ var SensorEventSchema = object({
15770
+ id: string(),
15771
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
15772
+ * yields N rows, one per camera). */
15773
+ deviceId: number(),
15774
+ /** The linked sensor device whose state changed. */
15775
+ sourceDeviceId: number(),
15776
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
15777
+ kind: string(),
15778
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
15779
+ value: record(string(), unknown()).nullable(),
15780
+ timestamp: number()
15781
+ });
15713
15782
  var TrackPositionSchema = object({
15714
15783
  x: number(),
15715
15784
  y: number(),
@@ -15723,6 +15792,30 @@ var TrackSnapshotSchema = object({
15723
15792
  mediaKey: string()
15724
15793
  });
15725
15794
  /**
15795
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
15796
+ * divided by the track's detection-frame dims), computed at persist time.
15797
+ * Absent when the frame dims were unknown when the track was persisted
15798
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
15799
+ */
15800
+ var TrackEnvelopeSchema = object({
15801
+ minX: number(),
15802
+ minY: number(),
15803
+ maxX: number(),
15804
+ maxY: number()
15805
+ });
15806
+ /**
15807
+ * Row projection for track list queries. `full` (default) returns the
15808
+ * complete Track including the frame-rate `positions[]` history and the
15809
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
15810
+ * keeps every scalar the list surfaces actually render (ids, class(es),
15811
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
15812
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
15813
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
15814
+ * `getTrack`. Mirrors the event-store `projection` convention
15815
+ * (`getObjectEvents` et al.).
15816
+ */
15817
+ var TrackProjectionSchema = _enum(["full", "slim"]);
15818
+ /**
15726
15819
  * One audio-classification label heard on the track's camera while the
15727
15820
  * track was alive, aggregated per label. An "episode" is one persisted
15728
15821
  * audio event (the confident-classification path: score ≥ the device's
@@ -15773,7 +15866,11 @@ var TrackSchema = object({
15773
15866
  /** Audio-classification labels heard on the camera during the track's
15774
15867
  * life (score ≥ device `classificationMinScore`), aggregated per label.
15775
15868
  * Absent on legacy rows / tracks with no confident audio. */
15776
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
15869
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
15870
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
15871
+ * Populated from the persisted envelope columns on historical reads;
15872
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
15873
+ envelope: TrackEnvelopeSchema.optional()
15777
15874
  });
15778
15875
  var BaseEventFields = {
15779
15876
  id: string(),
@@ -15883,11 +15980,13 @@ var MediaFileSchema = object({
15883
15980
  sizeBytes: number(),
15884
15981
  timestamp: number()
15885
15982
  });
15983
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
15984
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
15886
15985
  var DeviceEventQueryInput = object({
15887
15986
  deviceId: number(),
15888
15987
  since: number().optional(),
15889
15988
  until: number().optional(),
15890
- limit: number().int().min(1).max(5e3).default(1e3),
15989
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
15891
15990
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
15892
15991
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
15893
15992
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -15895,6 +15994,27 @@ var DeviceEventQueryInput = object({
15895
15994
  projection: _enum(["full", "slim"]).optional()
15896
15995
  });
15897
15996
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
15997
+ var RecentTracksQueryInput = object({
15998
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
15999
+ deviceIds: array(number()),
16000
+ /** Window lower bound on `lastSeen` (inclusive). */
16001
+ since: number().optional(),
16002
+ /** Window upper bound on `lastSeen` (inclusive). */
16003
+ until: number().optional(),
16004
+ /** Page size. Default 200, max 1000. */
16005
+ limit: number().int().min(1).max(1e3).default(200),
16006
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
16007
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
16008
+ cursor: string().optional(),
16009
+ /** See {@link TrackProjectionSchema}. Default `full`. */
16010
+ projection: TrackProjectionSchema.optional()
16011
+ });
16012
+ var RecentTracksPageSchema = object({
16013
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
16014
+ tracks: array(TrackSchema).readonly(),
16015
+ /** Cursor for the next page, or null when this page is the last. */
16016
+ nextCursor: string().nullable()
16017
+ });
15898
16018
  var KeyEventQueryInput = object({
15899
16019
  deviceId: number(),
15900
16020
  /** Window lower bound (track firstSeen ≥ since). */
@@ -15977,11 +16097,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15977
16097
  deviceId: number(),
15978
16098
  since: number().optional(),
15979
16099
  until: number().optional(),
15980
- limit: number().optional()
15981
- }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
15982
- kind: "mutation",
15983
- auth: "admin"
15984
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
16100
+ limit: number().optional(),
16101
+ /** Spatial filter only tracks whose trajectory intersects the zone
16102
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
16103
+ * envelope columns, then precisely tested per position. Tracks with
16104
+ * an unknown envelope (no frame dims at persist time) always match. */
16105
+ zone: TrackZoneFilterSchema.optional(),
16106
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
16107
+ * compatible — omitting the field keeps today's exact behaviour). */
16108
+ projection: TrackProjectionSchema.optional()
16109
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
16110
+ kind: "mutation",
16111
+ auth: "admin"
16112
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
16113
+ deviceId: number(),
16114
+ since: number().optional(),
16115
+ until: number().optional(),
16116
+ kinds: array(string()).optional(),
16117
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
16118
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
15985
16119
  deviceId: number(),
15986
16120
  since: number(),
15987
16121
  until: number(),
@@ -19205,7 +19339,12 @@ var RecordingStorageUsageSchema = object({
19205
19339
  /**
19206
19340
  * Result of locating footage at a wall-clock instant for one device/profile.
19207
19341
  * `segment` carries the covering segment's window; `gap` reports the forward
19208
- * nearest covered edge (`null` past the end of footage / when none exists).
19342
+ * nearest covered edge (`null` past the end of footage / when none exists)
19343
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
19344
+ * footage behind the epoch; `null` when none — optional so older providers
19345
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
19346
+ * small inter-segment cracks (durMs under-covers the span to the next
19347
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
19209
19348
  */
19210
19349
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19211
19350
  kind: literal("segment"),
@@ -19214,7 +19353,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19214
19353
  bytes: number()
19215
19354
  }), object({
19216
19355
  kind: literal("gap"),
19217
- nearestEdgeMs: number().nullable()
19356
+ nearestEdgeMs: number().nullable(),
19357
+ prevEndMs: number().nullable().optional()
19218
19358
  })]);
19219
19359
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
19220
19360
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -20783,6 +20923,12 @@ Object.freeze({
20783
20923
  addonId: null,
20784
20924
  access: "view"
20785
20925
  },
20926
+ "deviceManager.getLinkedDevices": {
20927
+ capName: "device-manager",
20928
+ capScope: "system",
20929
+ addonId: null,
20930
+ access: "view"
20931
+ },
20786
20932
  "deviceManager.getRoleDisplayDefaults": {
20787
20933
  capName: "device-manager",
20788
20934
  capScope: "system",
@@ -22337,6 +22483,12 @@ Object.freeze({
22337
22483
  addonId: null,
22338
22484
  access: "view"
22339
22485
  },
22486
+ "pipelineAnalytics.getSensorEvents": {
22487
+ capName: "pipeline-analytics",
22488
+ capScope: "device",
22489
+ addonId: null,
22490
+ access: "view"
22491
+ },
22340
22492
  "pipelineAnalytics.getTrack": {
22341
22493
  capName: "pipeline-analytics",
22342
22494
  capScope: "device",
@@ -22349,6 +22501,18 @@ Object.freeze({
22349
22501
  addonId: null,
22350
22502
  access: "view"
22351
22503
  },
22504
+ "pipelineAnalytics.listEventKinds": {
22505
+ capName: "pipeline-analytics",
22506
+ capScope: "device",
22507
+ addonId: null,
22508
+ access: "view"
22509
+ },
22510
+ "pipelineAnalytics.listRecentTracks": {
22511
+ capName: "pipeline-analytics",
22512
+ capScope: "device",
22513
+ addonId: null,
22514
+ access: "view"
22515
+ },
22352
22516
  "pipelineAnalytics.listTracks": {
22353
22517
  capName: "pipeline-analytics",
22354
22518
  capScope: "device",
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_dist = require("../dist-DIrP1cJI.js");
24
+ const require_dist = require("../dist-OCLe9Pt1.js");
25
25
  let node_path = require("node:path");
26
26
  node_path = __toESM(node_path);
27
27
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { a as BaseAddon, c as boolean, d as number, f as object, m as EventCategory, n as defineCustomActions, o as _enum, p as string, r as networkAccessCapability, s as array, t as customAction, u as literal } from "../dist-C0q85kv6.mjs";
1
+ import { a as BaseAddon, c as boolean, d as number, f as object, m as EventCategory, n as defineCustomActions, o as _enum, p as string, r as networkAccessCapability, s as array, t as customAction, u as literal } from "../dist-B40bIXcQ.mjs";
2
2
  import * as path from "node:path";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { spawn } from "node:child_process";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("../dist-DIrP1cJI.js");
2
+ const require_dist = require("../dist-OCLe9Pt1.js");
3
3
  //#region src/turn/cloudflare-turn.ts
4
4
  /**
5
5
  * Cloudflare returns ICE servers in several flavours depending on which
@@ -1,4 +1,4 @@
1
- import { a as BaseAddon, c as boolean, d as number, f as object, i as turnProviderCapability, l as discriminatedUnion, n as defineCustomActions, p as string, t as customAction, u as literal } from "../dist-C0q85kv6.mjs";
1
+ import { a as BaseAddon, c as boolean, d as number, f as object, i as turnProviderCapability, l as discriminatedUnion, n as defineCustomActions, p as string, t as customAction, u as literal } from "../dist-B40bIXcQ.mjs";
2
2
  //#region src/turn/cloudflare-turn.ts
3
3
  /**
4
4
  * Cloudflare returns ICE servers in several flavours depending on which
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-cloudflare",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "description": "Cloudflare bundle — Tunnel (network-access) + TURN relay (turn-provider). Multi-entry npm package shipping 2 addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",