@camstack/addon-tailscale 1.1.23 → 1.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  enumerable: true
25
25
  }) : target, mod));
26
26
  //#endregion
27
- const require_dist = require("../dist-B9u_59gc.js");
27
+ const require_dist = require("../dist-DBIyLTIA.js");
28
28
  let node_child_process = require("node:child_process");
29
29
  let node_util = require("node:util");
30
30
  let node_fs = require("node:fs");
@@ -1,4 +1,4 @@
1
- import { i as EventCategory, n as networkAccessCapability, r as BaseAddon, t as meshNetworkCapability } from "../dist-BvokuPmb.mjs";
1
+ import { i as EventCategory, n as networkAccessCapability, r as BaseAddon, t as meshNetworkCapability } from "../dist-BIsh2UNX.mjs";
2
2
  import { execFile, spawn } from "node:child_process";
3
3
  import { promisify } from "node:util";
4
4
  import * as fs from "node:fs";
@@ -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
@@ -14182,6 +14210,14 @@ var ConfigEntrySchema = object({
14182
14210
  value: unknown(),
14183
14211
  description: string().optional()
14184
14212
  });
14213
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
14214
+ /** One resolved linked device — the compact projection consumers need. */
14215
+ var LinkedDeviceSchema = object({
14216
+ deviceId: number(),
14217
+ name: string(),
14218
+ location: string().nullable(),
14219
+ features: array(string())
14220
+ });
14185
14221
  var SavedDeviceRowSchema = object({
14186
14222
  /** Numeric id reserved at allocateDeviceId time. */
14187
14223
  id: number(),
@@ -14403,7 +14439,10 @@ method(object({
14403
14439
  }), _void(), {
14404
14440
  kind: "mutation",
14405
14441
  auth: "admin"
14406
- }), 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({
14442
+ }), 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({
14443
+ mode: DeviceLinkModeSchema,
14444
+ devices: array(LinkedDeviceSchema)
14445
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
14407
14446
  deviceId: number(),
14408
14447
  values: record(string(), unknown())
14409
14448
  }), object({ success: literal(true) }), {
@@ -15689,6 +15728,61 @@ var EventKindSchema = _enum([
15689
15728
  "object",
15690
15729
  "audio"
15691
15730
  ]);
15731
+ /**
15732
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
15733
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
15734
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
15735
+ */
15736
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
15737
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
15738
+ var EventKindIconSchema = _enum([
15739
+ "motion",
15740
+ "audio",
15741
+ "person",
15742
+ "vehicle",
15743
+ "animal",
15744
+ "door",
15745
+ "pir",
15746
+ "smoke",
15747
+ "water",
15748
+ "button",
15749
+ "generic"
15750
+ ]);
15751
+ var EventKindCategorySchema = _enum([
15752
+ "motion",
15753
+ "audio",
15754
+ "detection",
15755
+ "sensor",
15756
+ "custom"
15757
+ ]);
15758
+ var EventKindDescriptorSchema = object({
15759
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
15760
+ kind: string(),
15761
+ label: string(),
15762
+ /** Hex color for timeline/legend rendering. */
15763
+ color: string(),
15764
+ icon: EventKindIconSchema,
15765
+ category: EventKindCategorySchema,
15766
+ /** Which cap + device contributes this kind. For built-ins the camera
15767
+ * itself; for sensor kinds the LINKED source device. */
15768
+ source: object({
15769
+ capName: string(),
15770
+ deviceId: number()
15771
+ })
15772
+ });
15773
+ var SensorEventSchema = object({
15774
+ id: string(),
15775
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
15776
+ * yields N rows, one per camera). */
15777
+ deviceId: number(),
15778
+ /** The linked sensor device whose state changed. */
15779
+ sourceDeviceId: number(),
15780
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
15781
+ kind: string(),
15782
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
15783
+ value: record(string(), unknown()).nullable(),
15784
+ timestamp: number()
15785
+ });
15692
15786
  var TrackPositionSchema = object({
15693
15787
  x: number(),
15694
15788
  y: number(),
@@ -15702,6 +15796,30 @@ var TrackSnapshotSchema = object({
15702
15796
  mediaKey: string()
15703
15797
  });
15704
15798
  /**
15799
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
15800
+ * divided by the track's detection-frame dims), computed at persist time.
15801
+ * Absent when the frame dims were unknown when the track was persisted
15802
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
15803
+ */
15804
+ var TrackEnvelopeSchema = object({
15805
+ minX: number(),
15806
+ minY: number(),
15807
+ maxX: number(),
15808
+ maxY: number()
15809
+ });
15810
+ /**
15811
+ * Row projection for track list queries. `full` (default) returns the
15812
+ * complete Track including the frame-rate `positions[]` history and the
15813
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
15814
+ * keeps every scalar the list surfaces actually render (ids, class(es),
15815
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
15816
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
15817
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
15818
+ * `getTrack`. Mirrors the event-store `projection` convention
15819
+ * (`getObjectEvents` et al.).
15820
+ */
15821
+ var TrackProjectionSchema = _enum(["full", "slim"]);
15822
+ /**
15705
15823
  * One audio-classification label heard on the track's camera while the
15706
15824
  * track was alive, aggregated per label. An "episode" is one persisted
15707
15825
  * audio event (the confident-classification path: score ≥ the device's
@@ -15752,7 +15870,11 @@ var TrackSchema = object({
15752
15870
  /** Audio-classification labels heard on the camera during the track's
15753
15871
  * life (score ≥ device `classificationMinScore`), aggregated per label.
15754
15872
  * Absent on legacy rows / tracks with no confident audio. */
15755
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
15873
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
15874
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
15875
+ * Populated from the persisted envelope columns on historical reads;
15876
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
15877
+ envelope: TrackEnvelopeSchema.optional()
15756
15878
  });
15757
15879
  var BaseEventFields = {
15758
15880
  id: string(),
@@ -15862,11 +15984,13 @@ var MediaFileSchema = object({
15862
15984
  sizeBytes: number(),
15863
15985
  timestamp: number()
15864
15986
  });
15987
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
15988
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
15865
15989
  var DeviceEventQueryInput = object({
15866
15990
  deviceId: number(),
15867
15991
  since: number().optional(),
15868
15992
  until: number().optional(),
15869
- limit: number().int().min(1).max(5e3).default(1e3),
15993
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
15870
15994
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
15871
15995
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
15872
15996
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -15874,6 +15998,27 @@ var DeviceEventQueryInput = object({
15874
15998
  projection: _enum(["full", "slim"]).optional()
15875
15999
  });
15876
16000
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
16001
+ var RecentTracksQueryInput = object({
16002
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
16003
+ deviceIds: array(number()),
16004
+ /** Window lower bound on `lastSeen` (inclusive). */
16005
+ since: number().optional(),
16006
+ /** Window upper bound on `lastSeen` (inclusive). */
16007
+ until: number().optional(),
16008
+ /** Page size. Default 200, max 1000. */
16009
+ limit: number().int().min(1).max(1e3).default(200),
16010
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
16011
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
16012
+ cursor: string().optional(),
16013
+ /** See {@link TrackProjectionSchema}. Default `full`. */
16014
+ projection: TrackProjectionSchema.optional()
16015
+ });
16016
+ var RecentTracksPageSchema = object({
16017
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
16018
+ tracks: array(TrackSchema).readonly(),
16019
+ /** Cursor for the next page, or null when this page is the last. */
16020
+ nextCursor: string().nullable()
16021
+ });
15877
16022
  var KeyEventQueryInput = object({
15878
16023
  deviceId: number(),
15879
16024
  /** Window lower bound (track firstSeen ≥ since). */
@@ -15956,11 +16101,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15956
16101
  deviceId: number(),
15957
16102
  since: number().optional(),
15958
16103
  until: number().optional(),
15959
- limit: number().optional()
15960
- }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
15961
- kind: "mutation",
15962
- auth: "admin"
15963
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
16104
+ limit: number().optional(),
16105
+ /** Spatial filter only tracks whose trajectory intersects the zone
16106
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
16107
+ * envelope columns, then precisely tested per position. Tracks with
16108
+ * an unknown envelope (no frame dims at persist time) always match. */
16109
+ zone: TrackZoneFilterSchema.optional(),
16110
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
16111
+ * compatible — omitting the field keeps today's exact behaviour). */
16112
+ projection: TrackProjectionSchema.optional()
16113
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
16114
+ kind: "mutation",
16115
+ auth: "admin"
16116
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
16117
+ deviceId: number(),
16118
+ since: number().optional(),
16119
+ until: number().optional(),
16120
+ kinds: array(string()).optional(),
16121
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
16122
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
15964
16123
  deviceId: number(),
15965
16124
  since: number(),
15966
16125
  until: number(),
@@ -19222,7 +19381,12 @@ var RecordingStorageUsageSchema = object({
19222
19381
  /**
19223
19382
  * Result of locating footage at a wall-clock instant for one device/profile.
19224
19383
  * `segment` carries the covering segment's window; `gap` reports the forward
19225
- * nearest covered edge (`null` past the end of footage / when none exists).
19384
+ * nearest covered edge (`null` past the end of footage / when none exists)
19385
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
19386
+ * footage behind the epoch; `null` when none — optional so older providers
19387
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
19388
+ * small inter-segment cracks (durMs under-covers the span to the next
19389
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
19226
19390
  */
19227
19391
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19228
19392
  kind: literal("segment"),
@@ -19231,7 +19395,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19231
19395
  bytes: number()
19232
19396
  }), object({
19233
19397
  kind: literal("gap"),
19234
- nearestEdgeMs: number().nullable()
19398
+ nearestEdgeMs: number().nullable(),
19399
+ prevEndMs: number().nullable().optional()
19235
19400
  })]);
19236
19401
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
19237
19402
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -20800,6 +20965,12 @@ Object.freeze({
20800
20965
  addonId: null,
20801
20966
  access: "view"
20802
20967
  },
20968
+ "deviceManager.getLinkedDevices": {
20969
+ capName: "device-manager",
20970
+ capScope: "system",
20971
+ addonId: null,
20972
+ access: "view"
20973
+ },
20803
20974
  "deviceManager.getRoleDisplayDefaults": {
20804
20975
  capName: "device-manager",
20805
20976
  capScope: "system",
@@ -22354,6 +22525,12 @@ Object.freeze({
22354
22525
  addonId: null,
22355
22526
  access: "view"
22356
22527
  },
22528
+ "pipelineAnalytics.getSensorEvents": {
22529
+ capName: "pipeline-analytics",
22530
+ capScope: "device",
22531
+ addonId: null,
22532
+ access: "view"
22533
+ },
22357
22534
  "pipelineAnalytics.getTrack": {
22358
22535
  capName: "pipeline-analytics",
22359
22536
  capScope: "device",
@@ -22366,6 +22543,18 @@ Object.freeze({
22366
22543
  addonId: null,
22367
22544
  access: "view"
22368
22545
  },
22546
+ "pipelineAnalytics.listEventKinds": {
22547
+ capName: "pipeline-analytics",
22548
+ capScope: "device",
22549
+ addonId: null,
22550
+ access: "view"
22551
+ },
22552
+ "pipelineAnalytics.listRecentTracks": {
22553
+ capName: "pipeline-analytics",
22554
+ capScope: "device",
22555
+ addonId: null,
22556
+ access: "view"
22557
+ },
22369
22558
  "pipelineAnalytics.listTracks": {
22370
22559
  capName: "pipeline-analytics",
22371
22560
  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
@@ -14182,6 +14210,14 @@ var ConfigEntrySchema = object({
14182
14210
  value: unknown(),
14183
14211
  description: string().optional()
14184
14212
  });
14213
+ var DeviceLinkModeSchema = _enum(["auto", "manual"]);
14214
+ /** One resolved linked device — the compact projection consumers need. */
14215
+ var LinkedDeviceSchema = object({
14216
+ deviceId: number(),
14217
+ name: string(),
14218
+ location: string().nullable(),
14219
+ features: array(string())
14220
+ });
14185
14221
  var SavedDeviceRowSchema = object({
14186
14222
  /** Numeric id reserved at allocateDeviceId time. */
14187
14223
  id: number(),
@@ -14403,7 +14439,10 @@ method(object({
14403
14439
  }), _void(), {
14404
14440
  kind: "mutation",
14405
14441
  auth: "admin"
14406
- }), 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({
14442
+ }), 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({
14443
+ mode: DeviceLinkModeSchema,
14444
+ devices: array(LinkedDeviceSchema)
14445
+ })), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
14407
14446
  deviceId: number(),
14408
14447
  values: record(string(), unknown())
14409
14448
  }), object({ success: literal(true) }), {
@@ -15689,6 +15728,61 @@ var EventKindSchema = _enum([
15689
15728
  "object",
15690
15729
  "audio"
15691
15730
  ]);
15731
+ /**
15732
+ * Spatial filter for `listTracks` — the rect + polygon variants of the shared
15733
+ * MaskShape vocabulary (see `mask-shape.ts`). Coordinates are NORMALIZED 0..1
15734
+ * of the camera frame (top-left origin), matching the drawing-plane editor.
15735
+ */
15736
+ var TrackZoneFilterSchema = discriminatedUnion("kind", [MaskRectShapeSchema, MaskPolygonShapeSchema]);
15737
+ /** Closed icon vocabulary so clients render a known glyph per kind. */
15738
+ var EventKindIconSchema = _enum([
15739
+ "motion",
15740
+ "audio",
15741
+ "person",
15742
+ "vehicle",
15743
+ "animal",
15744
+ "door",
15745
+ "pir",
15746
+ "smoke",
15747
+ "water",
15748
+ "button",
15749
+ "generic"
15750
+ ]);
15751
+ var EventKindCategorySchema = _enum([
15752
+ "motion",
15753
+ "audio",
15754
+ "detection",
15755
+ "sensor",
15756
+ "custom"
15757
+ ]);
15758
+ var EventKindDescriptorSchema = object({
15759
+ /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
15760
+ kind: string(),
15761
+ label: string(),
15762
+ /** Hex color for timeline/legend rendering. */
15763
+ color: string(),
15764
+ icon: EventKindIconSchema,
15765
+ category: EventKindCategorySchema,
15766
+ /** Which cap + device contributes this kind. For built-ins the camera
15767
+ * itself; for sensor kinds the LINKED source device. */
15768
+ source: object({
15769
+ capName: string(),
15770
+ deviceId: number()
15771
+ })
15772
+ });
15773
+ var SensorEventSchema = object({
15774
+ id: string(),
15775
+ /** The CAMERA the event is attributed to (a sensor linked to N cameras
15776
+ * yields N rows, one per camera). */
15777
+ deviceId: number(),
15778
+ /** The linked sensor device whose state changed. */
15779
+ sourceDeviceId: number(),
15780
+ /** Event kind id — matches an `EventKindDescriptor.kind`. */
15781
+ kind: string(),
15782
+ /** Snapshot of the sensor cap's runtime-state slice at the change. */
15783
+ value: record(string(), unknown()).nullable(),
15784
+ timestamp: number()
15785
+ });
15692
15786
  var TrackPositionSchema = object({
15693
15787
  x: number(),
15694
15788
  y: number(),
@@ -15702,6 +15796,30 @@ var TrackSnapshotSchema = object({
15702
15796
  mediaKey: string()
15703
15797
  });
15704
15798
  /**
15799
+ * Normalized 0..1 trajectory envelope (min/max over every position bbox,
15800
+ * divided by the track's detection-frame dims), computed at persist time.
15801
+ * Absent when the frame dims were unknown when the track was persisted
15802
+ * (legacy rows / dims-less sources) and on active (in-RAM) tracks.
15803
+ */
15804
+ var TrackEnvelopeSchema = object({
15805
+ minX: number(),
15806
+ minY: number(),
15807
+ maxX: number(),
15808
+ maxY: number()
15809
+ });
15810
+ /**
15811
+ * Row projection for track list queries. `full` (default) returns the
15812
+ * complete Track including the frame-rate `positions[]` history and the
15813
+ * `snapshots[]` references — megabytes across a page of tracks. `slim`
15814
+ * keeps every scalar the list surfaces actually render (ids, class(es),
15815
+ * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
15816
+ * zonesVisited, bestEventId, envelope) and returns `positions` /
15817
+ * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
15818
+ * `getTrack`. Mirrors the event-store `projection` convention
15819
+ * (`getObjectEvents` et al.).
15820
+ */
15821
+ var TrackProjectionSchema = _enum(["full", "slim"]);
15822
+ /**
15705
15823
  * One audio-classification label heard on the track's camera while the
15706
15824
  * track was alive, aggregated per label. An "episode" is one persisted
15707
15825
  * audio event (the confident-classification path: score ≥ the device's
@@ -15752,7 +15870,11 @@ var TrackSchema = object({
15752
15870
  /** Audio-classification labels heard on the camera during the track's
15753
15871
  * life (score ≥ device `classificationMinScore`), aggregated per label.
15754
15872
  * Absent on legacy rows / tracks with no confident audio. */
15755
- audioLabels: array(TrackAudioLabelSchema).readonly().optional()
15873
+ audioLabels: array(TrackAudioLabelSchema).readonly().optional(),
15874
+ /** Normalized 0..1 trajectory envelope (see {@link TrackEnvelopeSchema}).
15875
+ * Populated from the persisted envelope columns on historical reads;
15876
+ * absent on legacy rows, dims-less tracks and active (in-RAM) tracks. */
15877
+ envelope: TrackEnvelopeSchema.optional()
15756
15878
  });
15757
15879
  var BaseEventFields = {
15758
15880
  id: string(),
@@ -15862,11 +15984,13 @@ var MediaFileSchema = object({
15862
15984
  sizeBytes: number(),
15863
15985
  timestamp: number()
15864
15986
  });
15987
+ var DEFAULT_EVENT_QUERY_LIMIT = 1e3;
15988
+ var MAX_EVENT_QUERY_LIMIT = 5e3;
15865
15989
  var DeviceEventQueryInput = object({
15866
15990
  deviceId: number(),
15867
15991
  since: number().optional(),
15868
15992
  until: number().optional(),
15869
- limit: number().int().min(1).max(5e3).default(1e3),
15993
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT),
15870
15994
  /** `slim` drops heavy JSON fields (regions/bbox/zones) and carries an
15871
15995
  * optional `mediaUrl` (populated by B5). `full` (default) keeps today's
15872
15996
  * exact behaviour. Callers may omit this field — the store defaults to
@@ -15874,6 +15998,27 @@ var DeviceEventQueryInput = object({
15874
15998
  projection: _enum(["full", "slim"]).optional()
15875
15999
  });
15876
16000
  var ObjectEventQueryInput = DeviceEventQueryInput.extend({ classFilter: string().optional() });
16001
+ var RecentTracksQueryInput = object({
16002
+ /** Devices to merge. An empty array yields `{ tracks: [], nextCursor: null }`. */
16003
+ deviceIds: array(number()),
16004
+ /** Window lower bound on `lastSeen` (inclusive). */
16005
+ since: number().optional(),
16006
+ /** Window upper bound on `lastSeen` (inclusive). */
16007
+ until: number().optional(),
16008
+ /** Page size. Default 200, max 1000. */
16009
+ limit: number().int().min(1).max(1e3).default(200),
16010
+ /** Opaque continuation cursor from a previous page's `nextCursor`.
16011
+ * Encodes the (lastSeen, trackId) sort position — treat as opaque. */
16012
+ cursor: string().optional(),
16013
+ /** See {@link TrackProjectionSchema}. Default `full`. */
16014
+ projection: TrackProjectionSchema.optional()
16015
+ });
16016
+ var RecentTracksPageSchema = object({
16017
+ /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
16018
+ tracks: array(TrackSchema).readonly(),
16019
+ /** Cursor for the next page, or null when this page is the last. */
16020
+ nextCursor: string().nullable()
16021
+ });
15877
16022
  var KeyEventQueryInput = object({
15878
16023
  deviceId: number(),
15879
16024
  /** Window lower bound (track firstSeen ≥ since). */
@@ -15956,11 +16101,25 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15956
16101
  deviceId: number(),
15957
16102
  since: number().optional(),
15958
16103
  until: number().optional(),
15959
- limit: number().optional()
15960
- }), array(TrackSchema).readonly()), method(object({ deviceId: number() }), _void(), {
15961
- kind: "mutation",
15962
- auth: "admin"
15963
- }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
16104
+ limit: number().optional(),
16105
+ /** Spatial filter only tracks whose trajectory intersects the zone
16106
+ * (normalized 0..1 rect or polygon). SQL-prefiltered on the persisted
16107
+ * envelope columns, then precisely tested per position. Tracks with
16108
+ * an unknown envelope (no frame dims at persist time) always match. */
16109
+ zone: TrackZoneFilterSchema.optional(),
16110
+ /** See {@link TrackProjectionSchema}. Default `full` (backward
16111
+ * compatible — omitting the field keeps today's exact behaviour). */
16112
+ projection: TrackProjectionSchema.optional()
16113
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
16114
+ kind: "mutation",
16115
+ auth: "admin"
16116
+ }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({
16117
+ deviceId: number(),
16118
+ since: number().optional(),
16119
+ until: number().optional(),
16120
+ kinds: array(string()).optional(),
16121
+ limit: number().int().min(1).max(MAX_EVENT_QUERY_LIMIT).default(DEFAULT_EVENT_QUERY_LIMIT)
16122
+ }), array(SensorEventSchema).readonly()), method(KeyEventQueryInput, array(KeyEventSchema).readonly()), method(object({
15964
16123
  deviceId: number(),
15965
16124
  since: number(),
15966
16125
  until: number(),
@@ -19222,7 +19381,12 @@ var RecordingStorageUsageSchema = object({
19222
19381
  /**
19223
19382
  * Result of locating footage at a wall-clock instant for one device/profile.
19224
19383
  * `segment` carries the covering segment's window; `gap` reports the forward
19225
- * nearest covered edge (`null` past the end of footage / when none exists).
19384
+ * nearest covered edge (`null` past the end of footage / when none exists)
19385
+ * and the backward covered edge `prevEndMs` (exclusive end of the nearest
19386
+ * footage behind the epoch; `null` when none — optional so older providers
19387
+ * that omit it stay valid). `prevEndMs` lets a backward frame-step hop the
19388
+ * small inter-segment cracks (durMs under-covers the span to the next
19389
+ * startMs by ~11-17 ms) instead of no-opping at a segment head.
19226
19390
  */
19227
19391
  var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19228
19392
  kind: literal("segment"),
@@ -19231,7 +19395,8 @@ var LocateSegmentResultSchema = discriminatedUnion("kind", [object({
19231
19395
  bytes: number()
19232
19396
  }), object({
19233
19397
  kind: literal("gap"),
19234
- nearestEdgeMs: number().nullable()
19398
+ nearestEdgeMs: number().nullable(),
19399
+ prevEndMs: number().nullable().optional()
19235
19400
  })]);
19236
19401
  /** Raw bytes of one finalized footage segment (read off disk on the recording node). */
19237
19402
  var ReadSegmentBytesResultSchema = object({ data: _instanceof(Uint8Array) });
@@ -20800,6 +20965,12 @@ Object.freeze({
20800
20965
  addonId: null,
20801
20966
  access: "view"
20802
20967
  },
20968
+ "deviceManager.getLinkedDevices": {
20969
+ capName: "device-manager",
20970
+ capScope: "system",
20971
+ addonId: null,
20972
+ access: "view"
20973
+ },
20803
20974
  "deviceManager.getRoleDisplayDefaults": {
20804
20975
  capName: "device-manager",
20805
20976
  capScope: "system",
@@ -22354,6 +22525,12 @@ Object.freeze({
22354
22525
  addonId: null,
22355
22526
  access: "view"
22356
22527
  },
22528
+ "pipelineAnalytics.getSensorEvents": {
22529
+ capName: "pipeline-analytics",
22530
+ capScope: "device",
22531
+ addonId: null,
22532
+ access: "view"
22533
+ },
22357
22534
  "pipelineAnalytics.getTrack": {
22358
22535
  capName: "pipeline-analytics",
22359
22536
  capScope: "device",
@@ -22366,6 +22543,18 @@ Object.freeze({
22366
22543
  addonId: null,
22367
22544
  access: "view"
22368
22545
  },
22546
+ "pipelineAnalytics.listEventKinds": {
22547
+ capName: "pipeline-analytics",
22548
+ capScope: "device",
22549
+ addonId: null,
22550
+ access: "view"
22551
+ },
22552
+ "pipelineAnalytics.listRecentTracks": {
22553
+ capName: "pipeline-analytics",
22554
+ capScope: "device",
22555
+ addonId: null,
22556
+ access: "view"
22557
+ },
22369
22558
  "pipelineAnalytics.listTracks": {
22370
22559
  capName: "pipeline-analytics",
22371
22560
  capScope: "device",
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-B9u_59gc.js");
5
+ const require_dist = require("../dist-DBIyLTIA.js");
6
6
  let node_child_process = require("node:child_process");
7
7
  let node_util = require("node:util");
8
8
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { i as EventCategory, n as networkAccessCapability, r as BaseAddon } from "../dist-BvokuPmb.mjs";
1
+ import { i as EventCategory, n as networkAccessCapability, r as BaseAddon } from "../dist-BIsh2UNX.mjs";
2
2
  import { execFile } from "node:child_process";
3
3
  import { promisify } from "node:util";
4
4
  import { randomUUID } from "node:crypto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-tailscale",
3
- "version": "1.1.23",
3
+ "version": "1.1.25",
4
4
  "description": "Tailscale bundle for CamStack — joins the host to a tailnet (client) and exposes the hub via Serve/Funnel (ingress). Multi-entry npm package shipping 2 addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",