@camstack/addon-cloudflare 1.1.24 → 1.1.26

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";
@@ -7217,6 +7220,24 @@ var RecordingRetentionSchema = object({
7217
7220
  maxSizeGb: number().min(0).optional()
7218
7221
  });
7219
7222
  /**
7223
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7224
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7225
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7226
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7227
+ *
7228
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7229
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7230
+ * preset changed over time renders every historical window at the dims it was
7231
+ * written with.
7232
+ */
7233
+ var ScrubThumbnailPresetSchema = _enum([
7234
+ "minimal",
7235
+ "low",
7236
+ "standard",
7237
+ "high",
7238
+ "max"
7239
+ ]);
7240
+ /**
7220
7241
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7221
7242
  *
7222
7243
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7253,7 +7274,14 @@ var RecordingConfigSchema = object({
7253
7274
  * derived into bands once via `migrateConfigToBands`.
7254
7275
  */
7255
7276
  bands: array(RecordingBandSchema).optional(),
7256
- retention: RecordingRetentionSchema.optional()
7277
+ retention: RecordingRetentionSchema.optional(),
7278
+ /**
7279
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7280
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7281
+ * windows only — existing sheets are immutable, and each window's index
7282
+ * carries its own tile dims so mixed-preset history renders correctly.
7283
+ */
7284
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7257
7285
  });
7258
7286
  /**
7259
7287
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -9812,7 +9840,7 @@ object({
9812
9840
  deviceId: number(),
9813
9841
  timestamp: number()
9814
9842
  });
9815
- DeviceType.Button;
9843
+ DeviceType.Button, DeviceType.Camera;
9816
9844
  /**
9817
9845
  * Enum-state sensor — a string value picked from a finite option set.
9818
9846
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -14203,6 +14231,14 @@ var ConfigEntrySchema = object({
14203
14231
  value: unknown(),
14204
14232
  description: string().optional()
14205
14233
  });
14234
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
14235
+ /** One resolved linked device — the compact projection consumers need. */
14236
+ var LinkedDeviceSchema = object({
14237
+ deviceId: number(),
14238
+ name: string(),
14239
+ location: string().nullable(),
14240
+ features: array(string())
14241
+ });
14206
14242
  var SavedDeviceRowSchema = object({
14207
14243
  /** Numeric id reserved at allocateDeviceId time. */
14208
14244
  id: number(),
@@ -14424,7 +14460,10 @@ method(object({
14424
14460
  }), _void(), {
14425
14461
  kind: "mutation",
14426
14462
  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({
14463
+ }), 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({
14464
+ mode: DeviceLinkModeSchema,
14465
+ devices: array(LinkedDeviceSchema)
14466
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
14428
14467
  deviceId: number(),
14429
14468
  values: record(string(), unknown())
14430
14469
  }), object({ success: literal(true) }), {
@@ -15710,6 +15749,61 @@ var EventKindSchema = _enum([
15710
15749
  "object",
15711
15750
  "audio"
15712
15751
  ]);
15752
+ /**
15753
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
15754
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
15755
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
15756
+ */
15757
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
15758
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
15759
+ var EventKindIconSchema = _enum([
15760
+ "motion",
15761
+ "audio",
15762
+ "person",
15763
+ "vehicle",
15764
+ "animal",
15765
+ "door",
15766
+ "pir",
15767
+ "smoke",
15768
+ "water",
15769
+ "button",
15770
+ "generic"
15771
+ ]);
15772
+ var EventKindCategorySchema = _enum([
15773
+ "motion",
15774
+ "audio",
15775
+ "detection",
15776
+ "sensor",
15777
+ "custom"
15778
+ ]);
15779
+ var EventKindDescriptorSchema = object({
15780
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
15781
+ kind: string(),
15782
+ label: string(),
15783
+ /** Hex color for timeline/legend rendering. */
15784
+ color: string(),
15785
+ icon: EventKindIconSchema,
15786
+ category: EventKindCategorySchema,
15787
+ /** Which cap + device contributes this kind. For built-ins the camera
15788
+ * itself; for sensor kinds the LINKED source device. */
15789
+ source: object({
15790
+ capName: string(),
15791
+ deviceId: number()
15792
+ })
15793
+ });
15794
+ var SensorEventSchema = object({
15795
+ id: string(),
15796
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
15797
+ * yields N rows, one per camera). */
15798
+ deviceId: number(),
15799
+ /** The linked sensor device whose state changed. */
15800
+ sourceDeviceId: number(),
15801
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
15802
+ kind: string(),
15803
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
15804
+ value: record(string(), unknown()).nullable(),
15805
+ timestamp: number()
15806
+ });
15713
15807
  var TrackPositionSchema = object({
15714
15808
  x: number(),
15715
15809
  y: number(),
@@ -15723,6 +15817,30 @@ var TrackSnapshotSchema = object({
15723
15817
  mediaKey: string()
15724
15818
  });
15725
15819
  /**
15820
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
15821
+ * divided by the track's detection-frame dims), computed at persist time.
15822
+ * Absent when the frame dims were unknown when the track was persisted
15823
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
15824
+ */
15825
+ var TrackEnvelopeSchema = object({
15826
+ minX: number(),
15827
+ minY: number(),
15828
+ maxX: number(),
15829
+ maxY: number()
15830
+ });
15831
+ /**
15832
+ * Row projection for track list queries. `full` (default) returns the
15833
+ * complete Track including the frame-rate `positions[]` history and the
15834
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
15835
+ * keeps every scalar the list surfaces actually render (ids, class(es),
15836
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
15837
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
15838
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
15839
+ * `getTrack`. Mirrors the event-store `projection` convention
15840
+ * (`getObjectEvents` et al.).
15841
+ */
15842
+ var TrackProjectionSchema = _enum(["full", "slim"]);
15843
+ /**
15726
15844
  * One audio-classification label heard on the track's camera while the
15727
15845
  * track was alive, aggregated per label. An "episode" is one persisted
15728
15846
  * audio event (the confident-classification path: score ≥ the device's
@@ -15773,7 +15891,11 @@ var TrackSchema = object({
15773
15891
  /** Audio-classification labels heard on the camera during the track's
15774
15892
  * life (score ≥ device `classificationMinScore`), aggregated per label.
15775
15893
  * Absent on legacy rows / tracks with no confident audio. */
15776
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
15894
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
15895
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
15896
+ * Populated from the persisted envelope columns on historical reads;
15897
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
15898
+ envelope: TrackEnvelopeSchema.optional()
15777
15899
  });
15778
15900
  var BaseEventFields = {
15779
15901
  id: string(),
@@ -15883,11 +16005,13 @@ var MediaFileSchema = object({
15883
16005
  sizeBytes: number(),
15884
16006
  timestamp: number()
15885
16007
  });
16008
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
16009
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
15886
16010
  var DeviceEventQueryInput = object({
15887
16011
  deviceId: number(),
15888
16012
  since: number().optional(),
15889
16013
  until: number().optional(),
15890
- limit: number().int().min(1).max(5e3).default(1e3),
16014
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
15891
16015
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
15892
16016
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
15893
16017
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -15895,6 +16019,27 @@ var DeviceEventQueryInput = object({
15895
16019
  projection: _enum(["full", "slim"]).optional()
15896
16020
  });
15897
16021
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
16022
+ var RecentTracksQueryInput = object({
16023
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
16024
+ deviceIds: array(number()),
16025
+ /** Window lower bound on `lastSeen` (inclusive). */
16026
+ since: number().optional(),
16027
+ /** Window upper bound on `lastSeen` (inclusive). */
16028
+ until: number().optional(),
16029
+ /** Page size. Default 200, max 1000. */
16030
+ limit: number().int().min(1).max(1e3).default(200),
16031
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
16032
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
16033
+ cursor: string().optional(),
16034
+ /** See {@link TrackProjectionSchema}. Default `full`. */
16035
+ projection: TrackProjectionSchema.optional()
16036
+ });
16037
+ var RecentTracksPageSchema = object({
16038
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
16039
+ tracks: array(TrackSchema).readonly(),
16040
+ /** Cursor for the next page, or null when this page is the last. */
16041
+ nextCursor: string().nullable()
16042
+ });
15898
16043
  var KeyEventQueryInput = object({
15899
16044
  deviceId: number(),
15900
16045
  /** Window lower bound (track firstSeen ≥ since). */
@@ -15977,11 +16122,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15977
16122
  deviceId: number(),
15978
16123
  since: number().optional(),
15979
16124
  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({
16125
+ limit: number().optional(),
16126
+ /** Spatial filter only tracks whose trajectory intersects the zone
16127
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
16128
+ * envelope columns, then precisely tested per position. Tracks with
16129
+ * an unknown envelope (no frame dims at persist time) always match. */
16130
+ zone: TrackZoneFilterSchema.optional(),
16131
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
16132
+ * compatible — omitting the field keeps today's exact behaviour). */
16133
+ projection: TrackProjectionSchema.optional()
16134
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
16135
+ kind: "mutation",
16136
+ auth: "admin"
16137
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
16138
+ deviceId: number(),
16139
+ since: number().optional(),
16140
+ until: number().optional(),
16141
+ kinds: array(string()).optional(),
16142
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
16143
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
15985
16144
  deviceId: number(),
15986
16145
  since: number(),
15987
16146
  until: number(),
@@ -19205,7 +19364,12 @@ var RecordingStorageUsageSchema = object({
19205
19364
  /**
19206
19365
  * Result of locating footage at a wall-clock instant for one device/profile.
19207
19366
  * `segment` carries the covering segment's window; `gap` reports the forward
19208
- * nearest covered edge (`null` past the end of footage / when none exists).
19367
+ * nearest covered edge (`null` past the end of footage / when none exists)
19368
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
19369
+ * footage behind the epoch; `null` when none — optional so older providers
19370
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
19371
+ * small inter-segment cracks (durMs under-covers the span to the next
19372
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
19209
19373
  */
19210
19374
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19211
19375
  kind: literal("segment"),
@@ -19214,7 +19378,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19214
19378
  bytes: number()
19215
19379
  }), object({
19216
19380
  kind: literal("gap"),
19217
- nearestEdgeMs: number().nullable()
19381
+ nearestEdgeMs: number().nullable(),
19382
+ prevEndMs: number().nullable().optional()
19218
19383
  })]);
19219
19384
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
19220
19385
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -20783,6 +20948,12 @@ Object.freeze({
20783
20948
  addonId: null,
20784
20949
  access: "view"
20785
20950
  },
20951
+ "deviceManager.getLinkedDevices": {
20952
+ capName: "device-manager",
20953
+ capScope: "system",
20954
+ addonId: null,
20955
+ access: "view"
20956
+ },
20786
20957
  "deviceManager.getRoleDisplayDefaults": {
20787
20958
  capName: "device-manager",
20788
20959
  capScope: "system",
@@ -22337,6 +22508,12 @@ Object.freeze({
22337
22508
  addonId: null,
22338
22509
  access: "view"
22339
22510
  },
22511
+ "pipelineAnalytics.getSensorEvents": {
22512
+ capName: "pipeline-analytics",
22513
+ capScope: "device",
22514
+ addonId: null,
22515
+ access: "view"
22516
+ },
22340
22517
  "pipelineAnalytics.getTrack": {
22341
22518
  capName: "pipeline-analytics",
22342
22519
  capScope: "device",
@@ -22349,6 +22526,18 @@ Object.freeze({
22349
22526
  addonId: null,
22350
22527
  access: "view"
22351
22528
  },
22529
+ "pipelineAnalytics.listEventKinds": {
22530
+ capName: "pipeline-analytics",
22531
+ capScope: "device",
22532
+ addonId: null,
22533
+ access: "view"
22534
+ },
22535
+ "pipelineAnalytics.listRecentTracks": {
22536
+ capName: "pipeline-analytics",
22537
+ capScope: "device",
22538
+ addonId: null,
22539
+ access: "view"
22540
+ },
22352
22541
  "pipelineAnalytics.listTracks": {
22353
22542
  capName: "pipeline-analytics",
22354
22543
  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";
@@ -7217,6 +7220,24 @@ var RecordingRetentionSchema = object({
7217
7220
  maxSizeGb: number().min(0).optional()
7218
7221
  });
7219
7222
  /**
7223
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7224
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7225
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7226
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7227
+ *
7228
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7229
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7230
+ * preset changed over time renders every historical window at the dims it was
7231
+ * written with.
7232
+ */
7233
+ var ScrubThumbnailPresetSchema = _enum([
7234
+ "minimal",
7235
+ "low",
7236
+ "standard",
7237
+ "high",
7238
+ "max"
7239
+ ]);
7240
+ /**
7220
7241
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7221
7242
  *
7222
7243
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7253,7 +7274,14 @@ var RecordingConfigSchema = object({
7253
7274
  * derived into bands once via `migrateConfigToBands`.
7254
7275
  */
7255
7276
  bands: array(RecordingBandSchema).optional(),
7256
- retention: RecordingRetentionSchema.optional()
7277
+ retention: RecordingRetentionSchema.optional(),
7278
+ /**
7279
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7280
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7281
+ * windows only — existing sheets are immutable, and each window's index
7282
+ * carries its own tile dims so mixed-preset history renders correctly.
7283
+ */
7284
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7257
7285
  });
7258
7286
  /**
7259
7287
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -9812,7 +9840,7 @@ object({
9812
9840
  deviceId: number(),
9813
9841
  timestamp: number()
9814
9842
  });
9815
- DeviceType.Button;
9843
+ DeviceType.Button, DeviceType.Camera;
9816
9844
  /**
9817
9845
  * Enum-state sensor — a string value picked from a finite option set.
9818
9846
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -14203,6 +14231,14 @@ var ConfigEntrySchema = object({
14203
14231
  value: unknown(),
14204
14232
  description: string().optional()
14205
14233
  });
14234
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
14235
+ /** One resolved linked device — the compact projection consumers need. */
14236
+ var LinkedDeviceSchema = object({
14237
+ deviceId: number(),
14238
+ name: string(),
14239
+ location: string().nullable(),
14240
+ features: array(string())
14241
+ });
14206
14242
  var SavedDeviceRowSchema = object({
14207
14243
  /** Numeric id reserved at allocateDeviceId time. */
14208
14244
  id: number(),
@@ -14424,7 +14460,10 @@ method(object({
14424
14460
  }), _void(), {
14425
14461
  kind: "mutation",
14426
14462
  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({
14463
+ }), 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({
14464
+ mode: DeviceLinkModeSchema,
14465
+ devices: array(LinkedDeviceSchema)
14466
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
14428
14467
  deviceId: number(),
14429
14468
  values: record(string(), unknown())
14430
14469
  }), object({ success: literal(true) }), {
@@ -15710,6 +15749,61 @@ var EventKindSchema = _enum([
15710
15749
  "object",
15711
15750
  "audio"
15712
15751
  ]);
15752
+ /**
15753
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
15754
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
15755
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
15756
+ */
15757
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
15758
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
15759
+ var EventKindIconSchema = _enum([
15760
+ "motion",
15761
+ "audio",
15762
+ "person",
15763
+ "vehicle",
15764
+ "animal",
15765
+ "door",
15766
+ "pir",
15767
+ "smoke",
15768
+ "water",
15769
+ "button",
15770
+ "generic"
15771
+ ]);
15772
+ var EventKindCategorySchema = _enum([
15773
+ "motion",
15774
+ "audio",
15775
+ "detection",
15776
+ "sensor",
15777
+ "custom"
15778
+ ]);
15779
+ var EventKindDescriptorSchema = object({
15780
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
15781
+ kind: string(),
15782
+ label: string(),
15783
+ /** Hex color for timeline/legend rendering. */
15784
+ color: string(),
15785
+ icon: EventKindIconSchema,
15786
+ category: EventKindCategorySchema,
15787
+ /** Which cap + device contributes this kind. For built-ins the camera
15788
+ * itself; for sensor kinds the LINKED source device. */
15789
+ source: object({
15790
+ capName: string(),
15791
+ deviceId: number()
15792
+ })
15793
+ });
15794
+ var SensorEventSchema = object({
15795
+ id: string(),
15796
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
15797
+ * yields N rows, one per camera). */
15798
+ deviceId: number(),
15799
+ /** The linked sensor device whose state changed. */
15800
+ sourceDeviceId: number(),
15801
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
15802
+ kind: string(),
15803
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
15804
+ value: record(string(), unknown()).nullable(),
15805
+ timestamp: number()
15806
+ });
15713
15807
  var TrackPositionSchema = object({
15714
15808
  x: number(),
15715
15809
  y: number(),
@@ -15723,6 +15817,30 @@ var TrackSnapshotSchema = object({
15723
15817
  mediaKey: string()
15724
15818
  });
15725
15819
  /**
15820
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
15821
+ * divided by the track's detection-frame dims), computed at persist time.
15822
+ * Absent when the frame dims were unknown when the track was persisted
15823
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
15824
+ */
15825
+ var TrackEnvelopeSchema = object({
15826
+ minX: number(),
15827
+ minY: number(),
15828
+ maxX: number(),
15829
+ maxY: number()
15830
+ });
15831
+ /**
15832
+ * Row projection for track list queries. `full` (default) returns the
15833
+ * complete Track including the frame-rate `positions[]` history and the
15834
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
15835
+ * keeps every scalar the list surfaces actually render (ids, class(es),
15836
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
15837
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
15838
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
15839
+ * `getTrack`. Mirrors the event-store `projection` convention
15840
+ * (`getObjectEvents` et al.).
15841
+ */
15842
+ var TrackProjectionSchema = _enum(["full", "slim"]);
15843
+ /**
15726
15844
  * One audio-classification label heard on the track's camera while the
15727
15845
  * track was alive, aggregated per label. An "episode" is one persisted
15728
15846
  * audio event (the confident-classification path: score ≥ the device's
@@ -15773,7 +15891,11 @@ var TrackSchema = object({
15773
15891
  /** Audio-classification labels heard on the camera during the track's
15774
15892
  * life (score ≥ device `classificationMinScore`), aggregated per label.
15775
15893
  * Absent on legacy rows / tracks with no confident audio. */
15776
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
15894
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
15895
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
15896
+ * Populated from the persisted envelope columns on historical reads;
15897
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
15898
+ envelope: TrackEnvelopeSchema.optional()
15777
15899
  });
15778
15900
  var BaseEventFields = {
15779
15901
  id: string(),
@@ -15883,11 +16005,13 @@ var MediaFileSchema = object({
15883
16005
  sizeBytes: number(),
15884
16006
  timestamp: number()
15885
16007
  });
16008
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
16009
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
15886
16010
  var DeviceEventQueryInput = object({
15887
16011
  deviceId: number(),
15888
16012
  since: number().optional(),
15889
16013
  until: number().optional(),
15890
- limit: number().int().min(1).max(5e3).default(1e3),
16014
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
15891
16015
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
15892
16016
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
15893
16017
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -15895,6 +16019,27 @@ var DeviceEventQueryInput = object({
15895
16019
  projection: _enum(["full", "slim"]).optional()
15896
16020
  });
15897
16021
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
16022
+ var RecentTracksQueryInput = object({
16023
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
16024
+ deviceIds: array(number()),
16025
+ /** Window lower bound on `lastSeen` (inclusive). */
16026
+ since: number().optional(),
16027
+ /** Window upper bound on `lastSeen` (inclusive). */
16028
+ until: number().optional(),
16029
+ /** Page size. Default 200, max 1000. */
16030
+ limit: number().int().min(1).max(1e3).default(200),
16031
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
16032
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
16033
+ cursor: string().optional(),
16034
+ /** See {@link TrackProjectionSchema}. Default `full`. */
16035
+ projection: TrackProjectionSchema.optional()
16036
+ });
16037
+ var RecentTracksPageSchema = object({
16038
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
16039
+ tracks: array(TrackSchema).readonly(),
16040
+ /** Cursor for the next page, or null when this page is the last. */
16041
+ nextCursor: string().nullable()
16042
+ });
15898
16043
  var KeyEventQueryInput = object({
15899
16044
  deviceId: number(),
15900
16045
  /** Window lower bound (track firstSeen ≥ since). */
@@ -15977,11 +16122,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15977
16122
  deviceId: number(),
15978
16123
  since: number().optional(),
15979
16124
  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({
16125
+ limit: number().optional(),
16126
+ /** Spatial filter only tracks whose trajectory intersects the zone
16127
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
16128
+ * envelope columns, then precisely tested per position. Tracks with
16129
+ * an unknown envelope (no frame dims at persist time) always match. */
16130
+ zone: TrackZoneFilterSchema.optional(),
16131
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
16132
+ * compatible — omitting the field keeps today's exact behaviour). */
16133
+ projection: TrackProjectionSchema.optional()
16134
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
16135
+ kind: "mutation",
16136
+ auth: "admin"
16137
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
16138
+ deviceId: number(),
16139
+ since: number().optional(),
16140
+ until: number().optional(),
16141
+ kinds: array(string()).optional(),
16142
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
16143
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
15985
16144
  deviceId: number(),
15986
16145
  since: number(),
15987
16146
  until: number(),
@@ -19205,7 +19364,12 @@ var RecordingStorageUsageSchema = object({
19205
19364
  /**
19206
19365
  * Result of locating footage at a wall-clock instant for one device/profile.
19207
19366
  * `segment` carries the covering segment's window; `gap` reports the forward
19208
- * nearest covered edge (`null` past the end of footage / when none exists).
19367
+ * nearest covered edge (`null` past the end of footage / when none exists)
19368
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
19369
+ * footage behind the epoch; `null` when none — optional so older providers
19370
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
19371
+ * small inter-segment cracks (durMs under-covers the span to the next
19372
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
19209
19373
  */
19210
19374
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19211
19375
  kind: literal("segment"),
@@ -19214,7 +19378,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19214
19378
  bytes: number()
19215
19379
  }), object({
19216
19380
  kind: literal("gap"),
19217
- nearestEdgeMs: number().nullable()
19381
+ nearestEdgeMs: number().nullable(),
19382
+ prevEndMs: number().nullable().optional()
19218
19383
  })]);
19219
19384
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
19220
19385
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -20783,6 +20948,12 @@ Object.freeze({
20783
20948
  addonId: null,
20784
20949
  access: "view"
20785
20950
  },
20951
+ "deviceManager.getLinkedDevices": {
20952
+ capName: "device-manager",
20953
+ capScope: "system",
20954
+ addonId: null,
20955
+ access: "view"
20956
+ },
20786
20957
  "deviceManager.getRoleDisplayDefaults": {
20787
20958
  capName: "device-manager",
20788
20959
  capScope: "system",
@@ -22337,6 +22508,12 @@ Object.freeze({
22337
22508
  addonId: null,
22338
22509
  access: "view"
22339
22510
  },
22511
+ "pipelineAnalytics.getSensorEvents": {
22512
+ capName: "pipeline-analytics",
22513
+ capScope: "device",
22514
+ addonId: null,
22515
+ access: "view"
22516
+ },
22340
22517
  "pipelineAnalytics.getTrack": {
22341
22518
  capName: "pipeline-analytics",
22342
22519
  capScope: "device",
@@ -22349,6 +22526,18 @@ Object.freeze({
22349
22526
  addonId: null,
22350
22527
  access: "view"
22351
22528
  },
22529
+ "pipelineAnalytics.listEventKinds": {
22530
+ capName: "pipeline-analytics",
22531
+ capScope: "device",
22532
+ addonId: null,
22533
+ access: "view"
22534
+ },
22535
+ "pipelineAnalytics.listRecentTracks": {
22536
+ capName: "pipeline-analytics",
22537
+ capScope: "device",
22538
+ addonId: null,
22539
+ access: "view"
22540
+ },
22352
22541
  "pipelineAnalytics.listTracks": {
22353
22542
  capName: "pipeline-analytics",
22354
22543
  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-BLJdubxu.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-CUb5-XFg.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-BLJdubxu.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-CUb5-XFg.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.26",
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",