@camstack/addon-agent-ui 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.
Files changed (2) hide show
  1. package/dist/addon.js +203 -14
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
- //#region ../types/dist/event-category-CFZs3jI4.mjs
3
+ //#region ../types/dist/event-category-H4AVePnn.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -150,6 +150,9 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
150
150
  EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
151
151
  EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
152
152
  EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
153
+ /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
154
+ * thumb is a scrub gap the recorder's keyframe backfill covers. */
155
+ EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
153
156
  EventCategory["DetectionEvent"] = "detection.event";
154
157
  EventCategory["SessionTrackNew"] = "session.track.new";
155
158
  EventCategory["SessionTrackExpired"] = "session.track.expired";
@@ -7228,6 +7231,24 @@ var RecordingRetentionSchema = object({
7228
7231
  maxSizeGb: number().min(0).optional()
7229
7232
  });
7230
7233
  /**
7234
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7235
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7236
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7237
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7238
+ *
7239
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7240
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7241
+ * preset changed over time renders every historical window at the dims it was
7242
+ * written with.
7243
+ */
7244
+ var ScrubThumbnailPresetSchema = _enum([
7245
+ "minimal",
7246
+ "low",
7247
+ "standard",
7248
+ "high",
7249
+ "max"
7250
+ ]);
7251
+ /**
7231
7252
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7232
7253
  *
7233
7254
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7264,7 +7285,14 @@ var RecordingConfigSchema = object({
7264
7285
  * derived into bands once via `migrateConfigToBands`.
7265
7286
  */
7266
7287
  bands: array(RecordingBandSchema).optional(),
7267
- retention: RecordingRetentionSchema.optional()
7288
+ retention: RecordingRetentionSchema.optional(),
7289
+ /**
7290
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7291
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7292
+ * windows only — existing sheets are immutable, and each window's index
7293
+ * carries its own tile dims so mixed-preset history renders correctly.
7294
+ */
7295
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7268
7296
  });
7269
7297
  /**
7270
7298
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -9823,7 +9851,7 @@ object({
9823
9851
  deviceId: number(),
9824
9852
  timestamp: number()
9825
9853
  });
9826
- DeviceType.Button;
9854
+ DeviceType.Button, DeviceType.Camera;
9827
9855
  /**
9828
9856
  * Enum-state sensor — a string value picked from a finite option set.
9829
9857
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -14193,6 +14221,14 @@ var ConfigEntrySchema = object({
14193
14221
  value: unknown(),
14194
14222
  description: string().optional()
14195
14223
  });
14224
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
14225
+ /** One resolved linked device — the compact projection consumers need. */
14226
+ var LinkedDeviceSchema = object({
14227
+ deviceId: number(),
14228
+ name: string(),
14229
+ location: string().nullable(),
14230
+ features: array(string())
14231
+ });
14196
14232
  var SavedDeviceRowSchema = object({
14197
14233
  /** Numeric id reserved at allocateDeviceId time. */
14198
14234
  id: number(),
@@ -14414,7 +14450,10 @@ method(object({
14414
14450
  }), _void(), {
14415
14451
  kind: "mutation",
14416
14452
  auth: "admin"
14417
- }), 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({
14453
+ }), 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({
14454
+ mode: DeviceLinkModeSchema,
14455
+ devices: array(LinkedDeviceSchema)
14456
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
14418
14457
  deviceId: number(),
14419
14458
  values: record(string(), unknown())
14420
14459
  }), object({ success: literal(true) }), {
@@ -15683,6 +15722,61 @@ var EventKindSchema = _enum([
15683
15722
  "object",
15684
15723
  "audio"
15685
15724
  ]);
15725
+ /**
15726
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
15727
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
15728
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
15729
+ */
15730
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
15731
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
15732
+ var EventKindIconSchema = _enum([
15733
+ "motion",
15734
+ "audio",
15735
+ "person",
15736
+ "vehicle",
15737
+ "animal",
15738
+ "door",
15739
+ "pir",
15740
+ "smoke",
15741
+ "water",
15742
+ "button",
15743
+ "generic"
15744
+ ]);
15745
+ var EventKindCategorySchema = _enum([
15746
+ "motion",
15747
+ "audio",
15748
+ "detection",
15749
+ "sensor",
15750
+ "custom"
15751
+ ]);
15752
+ var EventKindDescriptorSchema = object({
15753
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
15754
+ kind: string(),
15755
+ label: string(),
15756
+ /** Hex color for timeline/legend rendering. */
15757
+ color: string(),
15758
+ icon: EventKindIconSchema,
15759
+ category: EventKindCategorySchema,
15760
+ /** Which cap + device contributes this kind. For built-ins the camera
15761
+ * itself; for sensor kinds the LINKED source device. */
15762
+ source: object({
15763
+ capName: string(),
15764
+ deviceId: number()
15765
+ })
15766
+ });
15767
+ var SensorEventSchema = object({
15768
+ id: string(),
15769
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
15770
+ * yields N rows, one per camera). */
15771
+ deviceId: number(),
15772
+ /** The linked sensor device whose state changed. */
15773
+ sourceDeviceId: number(),
15774
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
15775
+ kind: string(),
15776
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
15777
+ value: record(string(), unknown()).nullable(),
15778
+ timestamp: number()
15779
+ });
15686
15780
  var TrackPositionSchema = object({
15687
15781
  x: number(),
15688
15782
  y: number(),
@@ -15696,6 +15790,30 @@ var TrackSnapshotSchema = object({
15696
15790
  mediaKey: string()
15697
15791
  });
15698
15792
  /**
15793
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
15794
+ * divided by the track's detection-frame dims), computed at persist time.
15795
+ * Absent when the frame dims were unknown when the track was persisted
15796
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
15797
+ */
15798
+ var TrackEnvelopeSchema = object({
15799
+ minX: number(),
15800
+ minY: number(),
15801
+ maxX: number(),
15802
+ maxY: number()
15803
+ });
15804
+ /**
15805
+ * Row projection for track list queries. `full` (default) returns the
15806
+ * complete Track including the frame-rate `positions[]` history and the
15807
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
15808
+ * keeps every scalar the list surfaces actually render (ids, class(es),
15809
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
15810
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
15811
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
15812
+ * `getTrack`. Mirrors the event-store `projection` convention
15813
+ * (`getObjectEvents` et al.).
15814
+ */
15815
+ var TrackProjectionSchema = _enum(["full", "slim"]);
15816
+ /**
15699
15817
  * One audio-classification label heard on the track's camera while the
15700
15818
  * track was alive, aggregated per label. An "episode" is one persisted
15701
15819
  * audio event (the confident-classification path: score ≥ the device's
@@ -15746,7 +15864,11 @@ var TrackSchema = object({
15746
15864
  /** Audio-classification labels heard on the camera during the track's
15747
15865
  * life (score ≥ device `classificationMinScore`), aggregated per label.
15748
15866
  * Absent on legacy rows / tracks with no confident audio. */
15749
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
15867
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
15868
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
15869
+ * Populated from the persisted envelope columns on historical reads;
15870
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
15871
+ envelope: TrackEnvelopeSchema.optional()
15750
15872
  });
15751
15873
  var BaseEventFields = {
15752
15874
  id: string(),
@@ -15856,11 +15978,13 @@ var MediaFileSchema = object({
15856
15978
  sizeBytes: number(),
15857
15979
  timestamp: number()
15858
15980
  });
15981
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
15982
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
15859
15983
  var DeviceEventQueryInput = object({
15860
15984
  deviceId: number(),
15861
15985
  since: number().optional(),
15862
15986
  until: number().optional(),
15863
- limit: number().int().min(1).max(5e3).default(1e3),
15987
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
15864
15988
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
15865
15989
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
15866
15990
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -15868,6 +15992,27 @@ var DeviceEventQueryInput = object({
15868
15992
  projection: _enum(["full", "slim"]).optional()
15869
15993
  });
15870
15994
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
15995
+ var RecentTracksQueryInput = object({
15996
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
15997
+ deviceIds: array(number()),
15998
+ /** Window lower bound on `lastSeen` (inclusive). */
15999
+ since: number().optional(),
16000
+ /** Window upper bound on `lastSeen` (inclusive). */
16001
+ until: number().optional(),
16002
+ /** Page size. Default 200, max 1000. */
16003
+ limit: number().int().min(1).max(1e3).default(200),
16004
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
16005
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
16006
+ cursor: string().optional(),
16007
+ /** See {@link TrackProjectionSchema}. Default `full`. */
16008
+ projection: TrackProjectionSchema.optional()
16009
+ });
16010
+ var RecentTracksPageSchema = object({
16011
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
16012
+ tracks: array(TrackSchema).readonly(),
16013
+ /** Cursor for the next page, or null when this page is the last. */
16014
+ nextCursor: string().nullable()
16015
+ });
15871
16016
  var KeyEventQueryInput = object({
15872
16017
  deviceId: number(),
15873
16018
  /** Window lower bound (track firstSeen ≥ since). */
@@ -15950,11 +16095,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15950
16095
  deviceId: number(),
15951
16096
  since: number().optional(),
15952
16097
  until: number().optional(),
15953
- limit: number().optional()
15954
- }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
15955
- kind: "mutation",
15956
- auth: "admin"
15957
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
16098
+ limit: number().optional(),
16099
+ /** Spatial filter only tracks whose trajectory intersects the zone
16100
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
16101
+ * envelope columns, then precisely tested per position. Tracks with
16102
+ * an unknown envelope (no frame dims at persist time) always match. */
16103
+ zone: TrackZoneFilterSchema.optional(),
16104
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
16105
+ * compatible — omitting the field keeps today's exact behaviour). */
16106
+ projection: TrackProjectionSchema.optional()
16107
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
16108
+ kind: "mutation",
16109
+ auth: "admin"
16110
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
16111
+ deviceId: number(),
16112
+ since: number().optional(),
16113
+ until: number().optional(),
16114
+ kinds: array(string()).optional(),
16115
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
16116
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
15958
16117
  deviceId: number(),
15959
16118
  since: number(),
15960
16119
  until: number(),
@@ -19155,7 +19314,12 @@ var RecordingStorageUsageSchema = object({
19155
19314
  /**
19156
19315
  * Result of locating footage at a wall-clock instant for one device/profile.
19157
19316
  * `segment` carries the covering segment's window; `gap` reports the forward
19158
- * nearest covered edge (`null` past the end of footage / when none exists).
19317
+ * nearest covered edge (`null` past the end of footage / when none exists)
19318
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
19319
+ * footage behind the epoch; `null` when none — optional so older providers
19320
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
19321
+ * small inter-segment cracks (durMs under-covers the span to the next
19322
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
19159
19323
  */
19160
19324
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19161
19325
  kind: literal("segment"),
@@ -19164,7 +19328,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19164
19328
  bytes: number()
19165
19329
  }), object({
19166
19330
  kind: literal("gap"),
19167
- nearestEdgeMs: number().nullable()
19331
+ nearestEdgeMs: number().nullable(),
19332
+ prevEndMs: number().nullable().optional()
19168
19333
  })]);
19169
19334
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
19170
19335
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -20733,6 +20898,12 @@ Object.freeze({
20733
20898
  addonId: null,
20734
20899
  access: "view"
20735
20900
  },
20901
+ "deviceManager.getLinkedDevices": {
20902
+ capName: "device-manager",
20903
+ capScope: "system",
20904
+ addonId: null,
20905
+ access: "view"
20906
+ },
20736
20907
  "deviceManager.getRoleDisplayDefaults": {
20737
20908
  capName: "device-manager",
20738
20909
  capScope: "system",
@@ -22287,6 +22458,12 @@ Object.freeze({
22287
22458
  addonId: null,
22288
22459
  access: "view"
22289
22460
  },
22461
+ "pipelineAnalytics.getSensorEvents": {
22462
+ capName: "pipeline-analytics",
22463
+ capScope: "device",
22464
+ addonId: null,
22465
+ access: "view"
22466
+ },
22290
22467
  "pipelineAnalytics.getTrack": {
22291
22468
  capName: "pipeline-analytics",
22292
22469
  capScope: "device",
@@ -22299,6 +22476,18 @@ Object.freeze({
22299
22476
  addonId: null,
22300
22477
  access: "view"
22301
22478
  },
22479
+ "pipelineAnalytics.listEventKinds": {
22480
+ capName: "pipeline-analytics",
22481
+ capScope: "device",
22482
+ addonId: null,
22483
+ access: "view"
22484
+ },
22485
+ "pipelineAnalytics.listRecentTracks": {
22486
+ capName: "pipeline-analytics",
22487
+ capScope: "device",
22488
+ addonId: null,
22489
+ access: "view"
22490
+ },
22302
22491
  "pipelineAnalytics.listTracks": {
22303
22492
  capName: "pipeline-analytics",
22304
22493
  capScope: "device",
@@ -24306,7 +24495,7 @@ var AgentUIAddon = class extends BaseAddon {
24306
24495
  capability: adminUiCapability,
24307
24496
  provider: {
24308
24497
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
24309
- getVersion: async () => ({ version: "1.1.24" })
24498
+ getVersion: async () => ({ version: "1.1.26" })
24310
24499
  }
24311
24500
  }];
24312
24501
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.1.24",
3
+ "version": "1.1.26",
4
4
  "description": "CamStack Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",