@camstack/addon-export-ha-mqtt 1.1.22 → 1.1.24

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.
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  }) : target, mod));
37
37
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
38
  //#endregion
39
- //#region ../types/dist/event-category-CFZs3jI4.mjs
39
+ //#region ../types/dist/event-category-H4AVePnn.mjs
40
40
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
41
41
  EventCategory["SystemBoot"] = "system.boot";
42
42
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -186,6 +186,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
186
186
  EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
187
187
  EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
188
188
  EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
189
+ /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
190
+ * thumb is a scrub gap the recorder's keyframe backfill covers. */
191
+ EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
189
192
  EventCategory["DetectionEvent"] = "detection.event";
190
193
  EventCategory["SessionTrackNew"] = "session.track.new";
191
194
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -7269,6 +7272,24 @@ var RecordingRetentionSchema = object({
7269
7272
  maxSizeGb: number$1().min(0).optional()
7270
7273
  });
7271
7274
  /**
7275
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7276
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7277
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7278
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7279
+ *
7280
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7281
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7282
+ * preset changed over time renders every historical window at the dims it was
7283
+ * written with.
7284
+ */
7285
+ var ScrubThumbnailPresetSchema = _enum([
7286
+ "minimal",
7287
+ "low",
7288
+ "standard",
7289
+ "high",
7290
+ "max"
7291
+ ]);
7292
+ /**
7272
7293
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7273
7294
  *
7274
7295
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7305,7 +7326,14 @@ var RecordingConfigSchema = object({
7305
7326
  * derived into bands once via `migrateConfigToBands`.
7306
7327
  */
7307
7328
  bands: array(RecordingBandSchema).optional(),
7308
- retention: RecordingRetentionSchema.optional()
7329
+ retention: RecordingRetentionSchema.optional(),
7330
+ /**
7331
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7332
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7333
+ * windows only — existing sheets are immutable, and each window's index
7334
+ * carries its own tile dims so mixed-preset history renders correctly.
7335
+ */
7336
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7309
7337
  });
7310
7338
  /**
7311
7339
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -9864,7 +9892,7 @@ object({
9864
9892
  deviceId: number$1(),
9865
9893
  timestamp: number$1()
9866
9894
  });
9867
- DeviceType.Button;
9895
+ DeviceType.Button, DeviceType.Camera;
9868
9896
  /**
9869
9897
  * Enum-state sensor — a string value picked from a finite option set.
9870
9898
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -14259,6 +14287,14 @@ var ConfigEntrySchema = object({
14259
14287
  value: unknown(),
14260
14288
  description: string().optional()
14261
14289
  });
14290
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
14291
+ /** One resolved linked device — the compact projection consumers need. */
14292
+ var LinkedDeviceSchema = object({
14293
+ deviceId: number$1(),
14294
+ name: string(),
14295
+ location: string().nullable(),
14296
+ features: array(string())
14297
+ });
14262
14298
  var SavedDeviceRowSchema = object({
14263
14299
  /** Numeric id reserved at allocateDeviceId time. */
14264
14300
  id: number$1(),
@@ -14480,7 +14516,10 @@ method(object({
14480
14516
  }), _void(), {
14481
14517
  kind: "mutation",
14482
14518
  auth: "admin"
14483
- }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number$1() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number$1() }), array(DeviceInfoSchema)), method(object({ deviceId: number$1() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number$1() }), array(ConfigEntrySchema)), method(object({ deviceId: number$1() }), ConfigUISchemaOutput), method(object({
14519
+ }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number$1() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number$1() }), array(DeviceInfoSchema)), method(object({ deviceId: number$1() }), object({
14520
+ mode: DeviceLinkModeSchema,
14521
+ devices: array(LinkedDeviceSchema)
14522
+ })), method(object({ deviceId: number$1() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number$1() }), array(ConfigEntrySchema)), method(object({ deviceId: number$1() }), ConfigUISchemaOutput), method(object({
14484
14523
  deviceId: number$1(),
14485
14524
  values: record(string(), unknown())
14486
14525
  }), object({ success: literal(true) }), {
@@ -15749,6 +15788,61 @@ var EventKindSchema = _enum([
15749
15788
  "object",
15750
15789
  "audio"
15751
15790
  ]);
15791
+ /**
15792
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
15793
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
15794
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
15795
+ */
15796
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
15797
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
15798
+ var EventKindIconSchema = _enum([
15799
+ "motion",
15800
+ "audio",
15801
+ "person",
15802
+ "vehicle",
15803
+ "animal",
15804
+ "door",
15805
+ "pir",
15806
+ "smoke",
15807
+ "water",
15808
+ "button",
15809
+ "generic"
15810
+ ]);
15811
+ var EventKindCategorySchema = _enum([
15812
+ "motion",
15813
+ "audio",
15814
+ "detection",
15815
+ "sensor",
15816
+ "custom"
15817
+ ]);
15818
+ var EventKindDescriptorSchema = object({
15819
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
15820
+ kind: string(),
15821
+ label: string(),
15822
+ /** Hex color for timeline/legend rendering. */
15823
+ color: string(),
15824
+ icon: EventKindIconSchema,
15825
+ category: EventKindCategorySchema,
15826
+ /** Which cap + device contributes this kind. For built-ins the camera
15827
+ * itself; for sensor kinds the LINKED source device. */
15828
+ source: object({
15829
+ capName: string(),
15830
+ deviceId: number$1()
15831
+ })
15832
+ });
15833
+ var SensorEventSchema = object({
15834
+ id: string(),
15835
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
15836
+ * yields N rows, one per camera). */
15837
+ deviceId: number$1(),
15838
+ /** The linked sensor device whose state changed. */
15839
+ sourceDeviceId: number$1(),
15840
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
15841
+ kind: string(),
15842
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
15843
+ value: record(string(), unknown()).nullable(),
15844
+ timestamp: number$1()
15845
+ });
15752
15846
  var TrackPositionSchema = object({
15753
15847
  x: number$1(),
15754
15848
  y: number$1(),
@@ -15762,6 +15856,30 @@ var TrackSnapshotSchema = object({
15762
15856
  mediaKey: string()
15763
15857
  });
15764
15858
  /**
15859
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
15860
+ * divided by the track's detection-frame dims), computed at persist time.
15861
+ * Absent when the frame dims were unknown when the track was persisted
15862
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
15863
+ */
15864
+ var TrackEnvelopeSchema = object({
15865
+ minX: number$1(),
15866
+ minY: number$1(),
15867
+ maxX: number$1(),
15868
+ maxY: number$1()
15869
+ });
15870
+ /**
15871
+ * Row projection for track list queries. `full` (default) returns the
15872
+ * complete Track including the frame-rate `positions[]` history and the
15873
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
15874
+ * keeps every scalar the list surfaces actually render (ids, class(es),
15875
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
15876
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
15877
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
15878
+ * `getTrack`. Mirrors the event-store `projection` convention
15879
+ * (`getObjectEvents` et al.).
15880
+ */
15881
+ var TrackProjectionSchema = _enum(["full", "slim"]);
15882
+ /**
15765
15883
  * One audio-classification label heard on the track's camera while the
15766
15884
  * track was alive, aggregated per label. An "episode" is one persisted
15767
15885
  * audio event (the confident-classification path: score ≥ the device's
@@ -15812,7 +15930,11 @@ var TrackSchema = object({
15812
15930
  /** Audio-classification labels heard on the camera during the track's
15813
15931
  * life (score ≥ device `classificationMinScore`), aggregated per label.
15814
15932
  * Absent on legacy rows / tracks with no confident audio. */
15815
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
15933
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
15934
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
15935
+ * Populated from the persisted envelope columns on historical reads;
15936
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
15937
+ envelope: TrackEnvelopeSchema.optional()
15816
15938
  });
15817
15939
  var BaseEventFields = {
15818
15940
  id: string(),
@@ -15922,11 +16044,13 @@ var MediaFileSchema = object({
15922
16044
  sizeBytes: number$1(),
15923
16045
  timestamp: number$1()
15924
16046
  });
16047
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
16048
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
15925
16049
  var DeviceEventQueryInput = object({
15926
16050
  deviceId: number$1(),
15927
16051
  since: number$1().optional(),
15928
16052
  until: number$1().optional(),
15929
- limit: number$1().int().min(1).max(5e3).default(1e3),
16053
+ limit: number$1().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
15930
16054
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
15931
16055
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
15932
16056
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -15934,6 +16058,27 @@ var DeviceEventQueryInput = object({
15934
16058
  projection: _enum(["full", "slim"]).optional()
15935
16059
  });
15936
16060
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
16061
+ var RecentTracksQueryInput = object({
16062
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
16063
+ deviceIds: array(number$1()),
16064
+ /** Window lower bound on `lastSeen` (inclusive). */
16065
+ since: number$1().optional(),
16066
+ /** Window upper bound on `lastSeen` (inclusive). */
16067
+ until: number$1().optional(),
16068
+ /** Page size. Default 200, max 1000. */
16069
+ limit: number$1().int().min(1).max(1e3).default(200),
16070
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
16071
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
16072
+ cursor: string().optional(),
16073
+ /** See {@link TrackProjectionSchema}. Default `full`. */
16074
+ projection: TrackProjectionSchema.optional()
16075
+ });
16076
+ var RecentTracksPageSchema = object({
16077
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
16078
+ tracks: array(TrackSchema).readonly(),
16079
+ /** Cursor for the next page, or null when this page is the last. */
16080
+ nextCursor: string().nullable()
16081
+ });
15937
16082
  var KeyEventQueryInput = object({
15938
16083
  deviceId: number$1(),
15939
16084
  /** Window lower bound (track firstSeen ≥ since). */
@@ -16016,11 +16161,25 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
16016
16161
  deviceId: number$1(),
16017
16162
  since: number$1().optional(),
16018
16163
  until: number$1().optional(),
16019
- limit: number$1().optional()
16020
- }), array(TrackSchema).readonly()), method(object({ deviceId: number$1() }), _void(), {
16021
- kind: "mutation",
16022
- auth: "admin"
16023
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
16164
+ limit: number$1().optional(),
16165
+ /** Spatial filter only tracks whose trajectory intersects the zone
16166
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
16167
+ * envelope columns, then precisely tested per position. Tracks with
16168
+ * an unknown envelope (no frame dims at persist time) always match. */
16169
+ zone: TrackZoneFilterSchema.optional(),
16170
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
16171
+ * compatible — omitting the field keeps today's exact behaviour). */
16172
+ projection: TrackProjectionSchema.optional()
16173
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number$1() }), _void(), {
16174
+ kind: "mutation",
16175
+ auth: "admin"
16176
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number$1() }), array(EventKindDescriptorSchema).readonly()), method(object({
16177
+ deviceId: number$1(),
16178
+ since: number$1().optional(),
16179
+ until: number$1().optional(),
16180
+ kinds: array(string()).optional(),
16181
+ limit: number$1().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
16182
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
16024
16183
  deviceId: number$1(),
16025
16184
  since: number$1(),
16026
16185
  until: number$1(),
@@ -19221,7 +19380,12 @@ var RecordingStorageUsageSchema = object({
19221
19380
  /**
19222
19381
  * Result of locating footage at a wall-clock instant for one device/profile.
19223
19382
  * `segment` carries the covering segment's window; `gap` reports the forward
19224
- * nearest covered edge (`null` past the end of footage / when none exists).
19383
+ * nearest covered edge (`null` past the end of footage / when none exists)
19384
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
19385
+ * footage behind the epoch; `null` when none — optional so older providers
19386
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
19387
+ * small inter-segment cracks (durMs under-covers the span to the next
19388
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
19225
19389
  */
19226
19390
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19227
19391
  kind: literal("segment"),
@@ -19230,7 +19394,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19230
19394
  bytes: number$1()
19231
19395
  }), object({
19232
19396
  kind: literal("gap"),
19233
- nearestEdgeMs: number$1().nullable()
19397
+ nearestEdgeMs: number$1().nullable(),
19398
+ prevEndMs: number$1().nullable().optional()
19234
19399
  })]);
19235
19400
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
19236
19401
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -20799,6 +20964,12 @@ Object.freeze({
20799
20964
  addonId: null,
20800
20965
  access: "view"
20801
20966
  },
20967
+ "deviceManager.getLinkedDevices": {
20968
+ capName: "device-manager",
20969
+ capScope: "system",
20970
+ addonId: null,
20971
+ access: "view"
20972
+ },
20802
20973
  "deviceManager.getRoleDisplayDefaults": {
20803
20974
  capName: "device-manager",
20804
20975
  capScope: "system",
@@ -22353,6 +22524,12 @@ Object.freeze({
22353
22524
  addonId: null,
22354
22525
  access: "view"
22355
22526
  },
22527
+ "pipelineAnalytics.getSensorEvents": {
22528
+ capName: "pipeline-analytics",
22529
+ capScope: "device",
22530
+ addonId: null,
22531
+ access: "view"
22532
+ },
22356
22533
  "pipelineAnalytics.getTrack": {
22357
22534
  capName: "pipeline-analytics",
22358
22535
  capScope: "device",
@@ -22365,6 +22542,18 @@ Object.freeze({
22365
22542
  addonId: null,
22366
22543
  access: "view"
22367
22544
  },
22545
+ "pipelineAnalytics.listEventKinds": {
22546
+ capName: "pipeline-analytics",
22547
+ capScope: "device",
22548
+ addonId: null,
22549
+ access: "view"
22550
+ },
22551
+ "pipelineAnalytics.listRecentTracks": {
22552
+ capName: "pipeline-analytics",
22553
+ capScope: "device",
22554
+ addonId: null,
22555
+ access: "view"
22556
+ },
22368
22557
  "pipelineAnalytics.listTracks": {
22369
22558
  capName: "pipeline-analytics",
22370
22559
  capScope: "device",
@@ -34,7 +34,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
36
36
  //#endregion
37
- //#region ../types/dist/event-category-CFZs3jI4.mjs
37
+ //#region ../types/dist/event-category-H4AVePnn.mjs
38
38
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
39
39
  EventCategory["SystemBoot"] = "system.boot";
40
40
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -184,6 +184,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
184
184
  EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
185
185
  EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
186
186
  EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
187
+ /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
188
+ * thumb is a scrub gap the recorder's keyframe backfill covers. */
189
+ EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
187
190
  EventCategory["DetectionEvent"] = "detection.event";
188
191
  EventCategory["SessionTrackNew"] = "session.track.new";
189
192
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -7267,6 +7270,24 @@ var RecordingRetentionSchema = object({
7267
7270
  maxSizeGb: number$1().min(0).optional()
7268
7271
  });
7269
7272
  /**
7273
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7274
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7275
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7276
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7277
+ *
7278
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7279
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7280
+ * preset changed over time renders every historical window at the dims it was
7281
+ * written with.
7282
+ */
7283
+ var ScrubThumbnailPresetSchema = _enum([
7284
+ "minimal",
7285
+ "low",
7286
+ "standard",
7287
+ "high",
7288
+ "max"
7289
+ ]);
7290
+ /**
7270
7291
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7271
7292
  *
7272
7293
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7303,7 +7324,14 @@ var RecordingConfigSchema = object({
7303
7324
  * derived into bands once via `migrateConfigToBands`.
7304
7325
  */
7305
7326
  bands: array(RecordingBandSchema).optional(),
7306
- retention: RecordingRetentionSchema.optional()
7327
+ retention: RecordingRetentionSchema.optional(),
7328
+ /**
7329
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7330
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7331
+ * windows only — existing sheets are immutable, and each window's index
7332
+ * carries its own tile dims so mixed-preset history renders correctly.
7333
+ */
7334
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7307
7335
  });
7308
7336
  /**
7309
7337
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -9862,7 +9890,7 @@ object({
9862
9890
  deviceId: number$1(),
9863
9891
  timestamp: number$1()
9864
9892
  });
9865
- DeviceType.Button;
9893
+ DeviceType.Button, DeviceType.Camera;
9866
9894
  /**
9867
9895
  * Enum-state sensor — a string value picked from a finite option set.
9868
9896
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -14257,6 +14285,14 @@ var ConfigEntrySchema = object({
14257
14285
  value: unknown(),
14258
14286
  description: string().optional()
14259
14287
  });
14288
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
14289
+ /** One resolved linked device — the compact projection consumers need. */
14290
+ var LinkedDeviceSchema = object({
14291
+ deviceId: number$1(),
14292
+ name: string(),
14293
+ location: string().nullable(),
14294
+ features: array(string())
14295
+ });
14260
14296
  var SavedDeviceRowSchema = object({
14261
14297
  /** Numeric id reserved at allocateDeviceId time. */
14262
14298
  id: number$1(),
@@ -14478,7 +14514,10 @@ method(object({
14478
14514
  }), _void(), {
14479
14515
  kind: "mutation",
14480
14516
  auth: "admin"
14481
- }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number$1() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number$1() }), array(DeviceInfoSchema)), method(object({ deviceId: number$1() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number$1() }), array(ConfigEntrySchema)), method(object({ deviceId: number$1() }), ConfigUISchemaOutput), method(object({
14517
+ }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number$1() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number$1() }), array(DeviceInfoSchema)), method(object({ deviceId: number$1() }), object({
14518
+ mode: DeviceLinkModeSchema,
14519
+ devices: array(LinkedDeviceSchema)
14520
+ })), method(object({ deviceId: number$1() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number$1() }), array(ConfigEntrySchema)), method(object({ deviceId: number$1() }), ConfigUISchemaOutput), method(object({
14482
14521
  deviceId: number$1(),
14483
14522
  values: record(string(), unknown())
14484
14523
  }), object({ success: literal(true) }), {
@@ -15747,6 +15786,61 @@ var EventKindSchema = _enum([
15747
15786
  "object",
15748
15787
  "audio"
15749
15788
  ]);
15789
+ /**
15790
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
15791
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
15792
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
15793
+ */
15794
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
15795
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
15796
+ var EventKindIconSchema = _enum([
15797
+ "motion",
15798
+ "audio",
15799
+ "person",
15800
+ "vehicle",
15801
+ "animal",
15802
+ "door",
15803
+ "pir",
15804
+ "smoke",
15805
+ "water",
15806
+ "button",
15807
+ "generic"
15808
+ ]);
15809
+ var EventKindCategorySchema = _enum([
15810
+ "motion",
15811
+ "audio",
15812
+ "detection",
15813
+ "sensor",
15814
+ "custom"
15815
+ ]);
15816
+ var EventKindDescriptorSchema = object({
15817
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
15818
+ kind: string(),
15819
+ label: string(),
15820
+ /** Hex color for timeline/legend rendering. */
15821
+ color: string(),
15822
+ icon: EventKindIconSchema,
15823
+ category: EventKindCategorySchema,
15824
+ /** Which cap + device contributes this kind. For built-ins the camera
15825
+ * itself; for sensor kinds the LINKED source device. */
15826
+ source: object({
15827
+ capName: string(),
15828
+ deviceId: number$1()
15829
+ })
15830
+ });
15831
+ var SensorEventSchema = object({
15832
+ id: string(),
15833
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
15834
+ * yields N rows, one per camera). */
15835
+ deviceId: number$1(),
15836
+ /** The linked sensor device whose state changed. */
15837
+ sourceDeviceId: number$1(),
15838
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
15839
+ kind: string(),
15840
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
15841
+ value: record(string(), unknown()).nullable(),
15842
+ timestamp: number$1()
15843
+ });
15750
15844
  var TrackPositionSchema = object({
15751
15845
  x: number$1(),
15752
15846
  y: number$1(),
@@ -15760,6 +15854,30 @@ var TrackSnapshotSchema = object({
15760
15854
  mediaKey: string()
15761
15855
  });
15762
15856
  /**
15857
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
15858
+ * divided by the track's detection-frame dims), computed at persist time.
15859
+ * Absent when the frame dims were unknown when the track was persisted
15860
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
15861
+ */
15862
+ var TrackEnvelopeSchema = object({
15863
+ minX: number$1(),
15864
+ minY: number$1(),
15865
+ maxX: number$1(),
15866
+ maxY: number$1()
15867
+ });
15868
+ /**
15869
+ * Row projection for track list queries. `full` (default) returns the
15870
+ * complete Track including the frame-rate `positions[]` history and the
15871
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
15872
+ * keeps every scalar the list surfaces actually render (ids, class(es),
15873
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
15874
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
15875
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
15876
+ * `getTrack`. Mirrors the event-store `projection` convention
15877
+ * (`getObjectEvents` et al.).
15878
+ */
15879
+ var TrackProjectionSchema = _enum(["full", "slim"]);
15880
+ /**
15763
15881
  * One audio-classification label heard on the track's camera while the
15764
15882
  * track was alive, aggregated per label. An "episode" is one persisted
15765
15883
  * audio event (the confident-classification path: score ≥ the device's
@@ -15810,7 +15928,11 @@ var TrackSchema = object({
15810
15928
  /** Audio-classification labels heard on the camera during the track's
15811
15929
  * life (score ≥ device `classificationMinScore`), aggregated per label.
15812
15930
  * Absent on legacy rows / tracks with no confident audio. */
15813
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
15931
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
15932
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
15933
+ * Populated from the persisted envelope columns on historical reads;
15934
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
15935
+ envelope: TrackEnvelopeSchema.optional()
15814
15936
  });
15815
15937
  var BaseEventFields = {
15816
15938
  id: string(),
@@ -15920,11 +16042,13 @@ var MediaFileSchema = object({
15920
16042
  sizeBytes: number$1(),
15921
16043
  timestamp: number$1()
15922
16044
  });
16045
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
16046
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
15923
16047
  var DeviceEventQueryInput = object({
15924
16048
  deviceId: number$1(),
15925
16049
  since: number$1().optional(),
15926
16050
  until: number$1().optional(),
15927
- limit: number$1().int().min(1).max(5e3).default(1e3),
16051
+ limit: number$1().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
15928
16052
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
15929
16053
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
15930
16054
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -15932,6 +16056,27 @@ var DeviceEventQueryInput = object({
15932
16056
  projection: _enum(["full", "slim"]).optional()
15933
16057
  });
15934
16058
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
16059
+ var RecentTracksQueryInput = object({
16060
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
16061
+ deviceIds: array(number$1()),
16062
+ /** Window lower bound on `lastSeen` (inclusive). */
16063
+ since: number$1().optional(),
16064
+ /** Window upper bound on `lastSeen` (inclusive). */
16065
+ until: number$1().optional(),
16066
+ /** Page size. Default 200, max 1000. */
16067
+ limit: number$1().int().min(1).max(1e3).default(200),
16068
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
16069
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
16070
+ cursor: string().optional(),
16071
+ /** See {@link TrackProjectionSchema}. Default `full`. */
16072
+ projection: TrackProjectionSchema.optional()
16073
+ });
16074
+ var RecentTracksPageSchema = object({
16075
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
16076
+ tracks: array(TrackSchema).readonly(),
16077
+ /** Cursor for the next page, or null when this page is the last. */
16078
+ nextCursor: string().nullable()
16079
+ });
15935
16080
  var KeyEventQueryInput = object({
15936
16081
  deviceId: number$1(),
15937
16082
  /** Window lower bound (track firstSeen ≥ since). */
@@ -16014,11 +16159,25 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
16014
16159
  deviceId: number$1(),
16015
16160
  since: number$1().optional(),
16016
16161
  until: number$1().optional(),
16017
- limit: number$1().optional()
16018
- }), array(TrackSchema).readonly()), method(object({ deviceId: number$1() }), _void(), {
16019
- kind: "mutation",
16020
- auth: "admin"
16021
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
16162
+ limit: number$1().optional(),
16163
+ /** Spatial filter only tracks whose trajectory intersects the zone
16164
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
16165
+ * envelope columns, then precisely tested per position. Tracks with
16166
+ * an unknown envelope (no frame dims at persist time) always match. */
16167
+ zone: TrackZoneFilterSchema.optional(),
16168
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
16169
+ * compatible — omitting the field keeps today's exact behaviour). */
16170
+ projection: TrackProjectionSchema.optional()
16171
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number$1() }), _void(), {
16172
+ kind: "mutation",
16173
+ auth: "admin"
16174
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number$1() }), array(EventKindDescriptorSchema).readonly()), method(object({
16175
+ deviceId: number$1(),
16176
+ since: number$1().optional(),
16177
+ until: number$1().optional(),
16178
+ kinds: array(string()).optional(),
16179
+ limit: number$1().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
16180
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
16022
16181
  deviceId: number$1(),
16023
16182
  since: number$1(),
16024
16183
  until: number$1(),
@@ -19219,7 +19378,12 @@ var RecordingStorageUsageSchema = object({
19219
19378
  /**
19220
19379
  * Result of locating footage at a wall-clock instant for one device/profile.
19221
19380
  * `segment` carries the covering segment's window; `gap` reports the forward
19222
- * nearest covered edge (`null` past the end of footage / when none exists).
19381
+ * nearest covered edge (`null` past the end of footage / when none exists)
19382
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
19383
+ * footage behind the epoch; `null` when none — optional so older providers
19384
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
19385
+ * small inter-segment cracks (durMs under-covers the span to the next
19386
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
19223
19387
  */
19224
19388
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19225
19389
  kind: literal("segment"),
@@ -19228,7 +19392,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19228
19392
  bytes: number$1()
19229
19393
  }), object({
19230
19394
  kind: literal("gap"),
19231
- nearestEdgeMs: number$1().nullable()
19395
+ nearestEdgeMs: number$1().nullable(),
19396
+ prevEndMs: number$1().nullable().optional()
19232
19397
  })]);
19233
19398
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
19234
19399
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -20797,6 +20962,12 @@ Object.freeze({
20797
20962
  addonId: null,
20798
20963
  access: "view"
20799
20964
  },
20965
+ "deviceManager.getLinkedDevices": {
20966
+ capName: "device-manager",
20967
+ capScope: "system",
20968
+ addonId: null,
20969
+ access: "view"
20970
+ },
20800
20971
  "deviceManager.getRoleDisplayDefaults": {
20801
20972
  capName: "device-manager",
20802
20973
  capScope: "system",
@@ -22351,6 +22522,12 @@ Object.freeze({
22351
22522
  addonId: null,
22352
22523
  access: "view"
22353
22524
  },
22525
+ "pipelineAnalytics.getSensorEvents": {
22526
+ capName: "pipeline-analytics",
22527
+ capScope: "device",
22528
+ addonId: null,
22529
+ access: "view"
22530
+ },
22354
22531
  "pipelineAnalytics.getTrack": {
22355
22532
  capName: "pipeline-analytics",
22356
22533
  capScope: "device",
@@ -22363,6 +22540,18 @@ Object.freeze({
22363
22540
  addonId: null,
22364
22541
  access: "view"
22365
22542
  },
22543
+ "pipelineAnalytics.listEventKinds": {
22544
+ capName: "pipeline-analytics",
22545
+ capScope: "device",
22546
+ addonId: null,
22547
+ access: "view"
22548
+ },
22549
+ "pipelineAnalytics.listRecentTracks": {
22550
+ capName: "pipeline-analytics",
22551
+ capScope: "device",
22552
+ addonId: null,
22553
+ access: "view"
22554
+ },
22366
22555
  "pipelineAnalytics.listTracks": {
22367
22556
  capName: "pipeline-analytics",
22368
22557
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-ha-mqtt",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "description": "HomeAssistant MQTT discovery exporter for CamStack devices. Publishes discovery topics so HA auto-creates entities for exposed cameras/switches/intercoms/sensors.",
5
5
  "keywords": [
6
6
  "camstack",