@camera.ui/sdk 0.0.21 → 0.0.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.
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  type CameraType = 'camera' | 'doorbell';
7
7
  /**
8
8
  * Detection zone intersection type.
9
- * - `intersect`: Trigger when object touches the zone boundary
9
+ * - `intersect`: Trigger when object overlaps the zone at all
10
10
  * - `contain`: Trigger only when object is fully inside the zone
11
11
  */
12
12
  type ZoneType = 'intersect' | 'contain';
@@ -67,9 +67,14 @@ type MotionResolution = 'low' | 'medium' | 'high';
67
67
  */
68
68
  type VideoStreamingMode = 'auto' | 'webrtc' | 'mse' | 'webrtc/tcp';
69
69
  /**
70
- * Camera aspect ratio for UI display.
70
+ * Built-in aspect ratio presets offered as quick picks in the UI.
71
71
  */
72
- type CameraAspectRatio = '16:9' | '9:16' | '8:3' | '4:3' | '1:1';
72
+ type CameraAspectRatioPreset = '16:9' | '9:16' | '8:3' | '4:3' | '1:1';
73
+ /**
74
+ * Camera aspect ratio for UI display. One of the presets, or any custom
75
+ * `width:height` ratio (validated as `W:H` on the server).
76
+ */
77
+ type CameraAspectRatio = CameraAspectRatioPreset | `${number}:${number}`;
73
78
  /**
74
79
  * Line crossing direction filter.
75
80
  * - `both`: Trigger on crossings in either direction
@@ -108,7 +113,7 @@ interface CameraInputSettings {
108
113
  useForSnapshot: boolean;
109
114
  /** Keep connection always active */
110
115
  hotMode: boolean;
111
- /** Preload stream on startup */
116
+ /** Keep a keyframe cache for this source, so the view opens faster. Use `hotMode` to keep the stream connected. */
112
117
  preload: boolean;
113
118
  /** Strip the audio track from this source (defaults to false) */
114
119
  muted?: boolean;
@@ -469,7 +474,7 @@ interface JsonBaseSchemaWithoutCallbacks<T extends string | string[] | number |
469
474
  interface JsonBaseSchema<T extends string | string[] | number | number[] | boolean | boolean[] = any> extends JsonBaseSchemaWithoutCallbacks<T> {
470
475
  /** Whether to persist this field to storage */
471
476
  store?: boolean;
472
- /** Callback when value changes */
477
+ /** Callback after a write. `setValue` fires it whether or not the value changed; `setConfig` fires it only for keys that changed. */
473
478
  onSet?: (newValue: any, oldValue: any) => Promise<void>;
474
479
  /** Callback to get computed value */
475
480
  onGet?: () => Promise<any>;
@@ -707,8 +712,9 @@ interface DeviceStorage<T extends Record<string, any> = Record<string, any>> {
707
712
  /**
708
713
  * Get a configuration value.
709
714
  *
710
- * Resolves in order: the schema's `onGet` callback (if any), then the stored
711
- * value, then the schema default, then the provided default.
715
+ * If the schema declares an `onGet` callback, its result is returned as-is,
716
+ * with no fallback. Otherwise resolves in order: the stored value, then the
717
+ * schema default, then the provided default.
712
718
  *
713
719
  * @param key - Configuration key
714
720
  *
@@ -924,7 +930,7 @@ interface ModelSpec {
924
930
  input: VideoInputSpec;
925
931
  /** Labels emitted by an upstream object detector that activate this detector (e.g. `['person']` for face detection). */
926
932
  triggerLabels: DetectionLabel[];
927
- /** Embedding model identifier for face recognition. */
933
+ /** Embedding model identifier. Required for face recognition and for CLIP: embeddings are stored and matched under this id. */
928
934
  embeddingModel?: string;
929
935
  }
930
936
  /**
@@ -1461,8 +1467,9 @@ declare abstract class FaceDetectorSensor<TStorage extends object = Record<strin
1461
1467
  /** Declares the expected input dimensions and trigger labels. The backend scales frames to match. */
1462
1468
  abstract get modelSpec(): ModelSpec;
1463
1469
  /**
1464
- * Detect faces in batch. Each frame is a pre-cropped, pre-scaled person
1465
- * region produced by the upstream object detector. Must return exactly one
1470
+ * Detect faces in batch. Each frame is pre-scaled to `modelSpec.input`:
1471
+ * normally a person region cropped by the upstream object detector, but the
1472
+ * whole scene when no decoded frame is available. Must return exactly one
1466
1473
  * FaceResult per input frame, in the same order.
1467
1474
  */
1468
1475
  abstract detectFaces(frames: VideoFrameData[]): Promise<FaceResult[]>;
@@ -2114,7 +2121,7 @@ declare class MotionSensor<TStorage extends object = Record<string, any>> extend
2114
2121
  }
2115
2122
  /** Return type for {@link MotionDetectorSensor.detectMotion}. */
2116
2123
  interface MotionResult {
2117
- /** Whether motion is detected in this frame. */
2124
+ /** Whether motion is detected in this frame. Ignored by the backend, which re-derives it from the detections. */
2118
2125
  detected: boolean;
2119
2126
  /** Detections emitted for this frame. */
2120
2127
  detections: Detection[];
@@ -2123,7 +2130,9 @@ interface MotionResult {
2123
2130
  * Motion detector that receives video frames from the backend pipeline.
2124
2131
  * Extend this class and implement {@link detectMotion} to analyze frames
2125
2132
  * for motion. The backend calls `detectMotion()` at the configured frame
2126
- * interval and applies the returned result to the sensor.
2133
+ * interval, zone-filters the returned detections and applies them.
2134
+ * `detected` is re-derived from the surviving detections, so a result with
2135
+ * no detections reports no motion.
2127
2136
  */
2128
2137
  declare abstract class MotionDetectorSensor<TStorage extends object = Record<string, any>> extends MotionSensor<TStorage> {
2129
2138
  _requiresFrames: boolean;
@@ -2464,12 +2473,13 @@ declare class PTZControl<TStorage extends object = Record<string, any>> extends
2464
2473
  * Continuous-move command. Override to drive hardware and call
2465
2474
  * `await super.setVelocity(value)` after success to sync the SDK state.
2466
2475
  *
2467
- * @param value - Per-axis speeds in `[-1, 1]`, or `undefined` to stop.
2476
+ * @param value - Per-axis speeds in `[-1, 1]`. Stop is zero on every axis.
2477
+ * `undefined` is ignored and the published `velocity` keeps its last value.
2468
2478
  *
2469
2479
  * @example
2470
2480
  * ```ts
2471
2481
  * await ptz.setVelocity({ panSpeed: 0.5, tiltSpeed: 0, zoomSpeed: 0 });
2472
- * await ptz.setVelocity(undefined); // stop
2482
+ * await ptz.setVelocity({ panSpeed: 0, tiltSpeed: 0, zoomSpeed: 0 }); // stop
2473
2483
  * ```
2474
2484
  */
2475
2485
  setVelocity(value: PTZDirection | undefined): Promise<void>;
@@ -2492,7 +2502,8 @@ declare class PTZControl<TStorage extends object = Record<string, any>> extends
2492
2502
  * Preset-move command. Override to drive hardware and call
2493
2503
  * `await super.setTargetPreset(value)` after success to sync the SDK state.
2494
2504
  *
2495
- * @param value - Preset name to move to, or `undefined` to clear.
2505
+ * @param value - Preset name to move to. `undefined` is ignored and the
2506
+ * published `targetPreset` keeps its last value.
2496
2507
  *
2497
2508
  * @example
2498
2509
  * ```ts
@@ -2535,7 +2546,7 @@ declare class PTZControl<TStorage extends object = Record<string, any>> extends
2535
2546
  * Cross-process consumer entry point. Dispatches writable properties
2536
2547
  * to semantic methods so plugin overrides (hardware actions) are honored.
2537
2548
  * `moving` and `presets` are observed/discovered state and not externally writable;
2538
- * only `Position`, `Velocity`, and `TargetPreset` may be set.
2549
+ * only `Position`, `Velocity`, `TargetPreset`, and `RelativeMove` may be set.
2539
2550
  *
2540
2551
  * @param property - Property name to write.
2541
2552
  *
@@ -3133,7 +3144,7 @@ declare abstract class Sensor<TProperties extends object, TStorage extends objec
3133
3144
  /**
3134
3145
  * Get a read-only snapshot of all property values.
3135
3146
  *
3136
- * @returns Frozen view of every property currently held by the sensor.
3147
+ * @returns Shallow copy of every property currently held by the sensor.
3137
3148
  *
3138
3149
  * @example
3139
3150
  * ```ts
@@ -3214,8 +3225,9 @@ declare abstract class Sensor<TProperties extends object, TStorage extends objec
3214
3225
  * override can safely access `this.cameraId`, `this.storage`, and publish
3215
3226
  * properties via the semantic helper methods.
3216
3227
  *
3217
- * Errors thrown here are caught and logged they will NOT break assignment
3218
- * bookkeeping. If your work can fail, handle it inside the override.
3228
+ * Errors thrown here are caught and swallowed, not logged. They will NOT
3229
+ * break assignment bookkeeping, but nothing surfaces them either. If your
3230
+ * work can fail, handle it inside the override.
3219
3231
  *
3220
3232
  * Paired 1:1 with `onDeassigned` — for every `onAssigned` call there is
3221
3233
  * exactly one matching `onDeassigned` later (on deassignment or cleanup).
@@ -3356,7 +3368,7 @@ interface DetectionLine {
3356
3368
  }
3357
3369
  /**
3358
3370
  * Detection zone configuration.
3359
- * Defines areas for detection filtering or privacy masking.
3371
+ * Defines areas that restrict or drop detections.
3360
3372
  */
3361
3373
  interface DetectionZone {
3362
3374
  /** Zone display name */
@@ -3369,7 +3381,7 @@ interface DetectionZone {
3369
3381
  filter: ZoneFilter;
3370
3382
  /** Labels to filter (empty = all labels) */
3371
3383
  labels: DetectionLabel[];
3372
- /** Whether this is a privacy mask (blur/block area) */
3384
+ /** Whether this is an ignore zone: detections fully inside it are dropped. */
3373
3385
  isPrivacyMask: boolean;
3374
3386
  /** Zone display color (hex) */
3375
3387
  color: string;
@@ -3387,7 +3399,7 @@ interface MotionDetectionSettings {
3387
3399
  * Object detection settings.
3388
3400
  */
3389
3401
  interface ObjectDetectionSettings {
3390
- /** Minimum confidence threshold (0-1) */
3402
+ /** Minimum confidence threshold (0.3 - 1.0) */
3391
3403
  confidence: number;
3392
3404
  /** Suppress events from objects that stay stationary across events (e.g. parked cars). Defaults to true. */
3393
3405
  suppressStatic?: boolean;
@@ -3422,11 +3434,11 @@ interface PtzAutotrackSettings {
3422
3434
  */
3423
3435
  trackingSpeed: number;
3424
3436
  /**
3425
- * Motion prediction: aim this many detection-frames ahead along the target's
3426
- * measured velocity so a moving target is followed without lag. 0 disables
3427
- * prediction. Range 0 - 6.
3437
+ * Motion prediction: aim this many milliseconds ahead along the target's
3438
+ * measured velocity, covering the time the camera needs to move and settle.
3439
+ * 0 disables prediction. Range 0 - 4000.
3428
3440
  */
3429
- leadFrames: number;
3441
+ leadMs: number;
3430
3442
  /**
3431
3443
  * Camera pan-rate calibration — assumed pan travel at full motor speed, in
3432
3444
  * normalized frame-widths per second. Lower it if the camera stops short of
@@ -3919,7 +3931,7 @@ interface CameraInput {
3919
3931
  useForSnapshot: boolean;
3920
3932
  /** Keep connection always active */
3921
3933
  hotMode: boolean;
3922
- /** Preload stream on startup */
3934
+ /** Keep a keyframe cache for this source, so the view opens faster. Use `hotMode` to keep the stream connected. */
3923
3935
  preload: boolean;
3924
3936
  /** Strip the audio track from this source (defaults to false) */
3925
3937
  muted?: boolean;
@@ -4089,7 +4101,6 @@ interface Camera extends BaseCamera {
4089
4101
  * the host) and emits a log entry at the corresponding severity:
4090
4102
  *
4091
4103
  * - log: general informational message (default level).
4092
- * - info: same as log; informational message.
4093
4104
  * - warn: potential problem that does not stop execution.
4094
4105
  * - error: a failure or unexpected condition.
4095
4106
  * - success: confirmation of a completed operation.
@@ -4161,7 +4172,7 @@ interface EventDetection {
4161
4172
  maxCount: number;
4162
4173
  /** Bounding box of the highest-confidence detection (normalized 0–1) */
4163
4174
  box?: BoundingBox;
4164
- /** Best-selected JPEG thumbnail crop. Only present on 'end' events. */
4175
+ /** Best-selected JPEG thumbnail crop. Only present on 'segment-start' and 'segment-end' messages, and omitted when it is the same image as the segment thumbnail. */
4165
4176
  thumbnail?: Uint8Array;
4166
4177
  /** Object tracker ID (links this detection across frames) */
4167
4178
  trackId?: number;
@@ -4178,7 +4189,7 @@ interface EventAttribute {
4178
4189
  label: string;
4179
4190
  /** Detection confidence (0-1) */
4180
4191
  confidence?: number;
4181
- /** Best-selected JPEG thumbnail crop. Only present on 'end' events. */
4192
+ /** Best-selected JPEG thumbnail crop. Present on 'segment-start' and 'segment-end' messages, and on 'segment-update' for unknown faces. */
4182
4193
  thumbnail?: Uint8Array;
4183
4194
  /** Face embedding vector for unknown face persistence. Only present for face attributes. */
4184
4195
  embedding?: number[];
@@ -4199,7 +4210,7 @@ interface EventSegment {
4199
4210
  firstSeen: number;
4200
4211
  /** Segment end time (Unix ms) */
4201
4212
  lastSeen: number;
4202
- /** Best-selected JPEG scene thumbnail for this segment. Only present on 'end' events. */
4213
+ /** Best-selected JPEG scene thumbnail for this segment. Only present on 'segment-start' and 'segment-end' messages, plus once on a 'segment-update' if the start message had none. */
4203
4214
  thumbnail?: Uint8Array;
4204
4215
  /** Object detections in this segment */
4205
4216
  detections: EventDetection[];
@@ -4455,17 +4466,17 @@ interface CameraDevice {
4455
4466
  * @param sensorId - ID of sensor to remove
4456
4467
  */
4457
4468
  removeSensor(sensorId: string): Promise<void>;
4458
- /** Observable for sensor additions. Emits { sensorId, sensorType } when a sensor from another plugin is added. */
4469
+ /** Observable for sensor additions. Emits for this plugin's own sensors and for other plugins' sensors whose type is listed in `contract.consumes`, also when such a sensor is activated for this camera. */
4459
4470
  readonly onSensorAdded: Observable<{
4460
4471
  sensorId: string;
4461
4472
  sensorType: SensorType;
4462
4473
  }>;
4463
- /** Observable for sensor removals. Emits { sensorId, sensorType } when a sensor from another plugin is removed. */
4474
+ /** Observable for sensor removals. Emits for this plugin's own sensors and for other plugins' sensors on this camera, also when a sensor is deactivated for this camera. */
4464
4475
  readonly onSensorRemoved: Observable<{
4465
4476
  sensorId: string;
4466
4477
  sensorType: SensorType;
4467
4478
  }>;
4468
- /** Observable for detection events (start/update/end). Thumbnails in segments are only populated on 'end' events. */
4479
+ /** Observable for detection events (start/update/end/segment-*). Segments are only present on 'segment-*' messages; thumbnails are populated on 'segment-start' and 'segment-end'. */
4469
4480
  readonly onDetectionEvent: Observable<{
4470
4481
  type: DetectionEventType;
4471
4482
  event: DetectionEvent;
@@ -4991,9 +5002,10 @@ interface Notification {
4991
5002
  */
4992
5003
  severity?: Severity;
4993
5004
  /**
4994
- * Collapse-key for dedup at both manager and notifier level (e.g.
4995
- * 'motion:cam-1' — multiple events with the same tag inside the throttle
4996
- * window collapse into one notification on the device).
5005
+ * Collapse-key (e.g. 'motion:cam-1'). The host uses it to replace an older
5006
+ * entry with the same tag in the in-app notification list. Delivery is not
5007
+ * throttled: every publish is sent. Notifiers may map it to a platform
5008
+ * collapse-id.
4997
5009
  */
4998
5010
  tag?: string;
4999
5011
  /** Optional inline JPEG attached to the notification. */
@@ -5324,9 +5336,8 @@ type PluginInterfaces = Partial<MotionDetectionInterface & ObjectDetectionInterf
5324
5336
 
5325
5337
  /**
5326
5338
  * Core manager event payload.
5327
- * Emitted when a core system event occurs (e.g. cloud account changes,
5328
- * remote-server availability, plugin lifecycle changes). Subscribe via
5329
- * `coreManager.onEvent` to react to system-level state changes.
5339
+ * The host currently publishes one event type, 'cloudAccountChanged'.
5340
+ * Subscribe via `coreManager.onEvent` to react to it.
5330
5341
  */
5331
5342
  interface CoreManagerEvent {
5332
5343
  /** Event type identifier (e.g. 'cloudAccountChanged'). */
@@ -5338,8 +5349,8 @@ interface CoreManagerEvent {
5338
5349
  * Core manager interface for system-level operations.
5339
5350
  *
5340
5351
  * Provides access to cross-cutting services like the FFmpeg binary path,
5341
- * server addresses, HMAC signing for cloud requests, inter-plugin lookup,
5342
- * and a stream of core system events.
5352
+ * server addresses, the cloud server id, inter-plugin lookup, and a stream
5353
+ * of core system events.
5343
5354
  *
5344
5355
  * Accessed via `api.coreManager` in plugins.
5345
5356
  *
@@ -5386,7 +5397,9 @@ interface CoreManager {
5386
5397
  */
5387
5398
  getCloudServerId(): Promise<string>;
5388
5399
  /**
5389
- * Get all active plugins that implement a specific interface.
5400
+ * Get all installed, enabled plugins that implement a specific interface.
5401
+ * Plugins the admin disabled are excluded. A returned plugin may still be
5402
+ * starting up or may have crashed, so a call into one can fail.
5390
5403
  *
5391
5404
  * @param interfaceName - Name of the plugin interface (e.g., 'ClipDetection')
5392
5405
  *
@@ -5835,4 +5848,4 @@ interface OAuthClientCredentialsCapable extends OAuthCapable {
5835
5848
  }
5836
5849
 
5837
5850
  export { API_EVENT, AudioDetectorSensor, AudioProperty, AudioSensor, BASE_AUDIO_LABELS, BasePlugin, BatteryCapability, BatteryInfo, BatteryProperty, BehaviorSubject, ChargingState, ClassifierDetectorSensor, ClassifierProperty, ClassifierSensor, ClipDetectorSensor, ContactProperty, ContactSensor, DETECTION_ATTRIBUTES, DETECTION_LABELS, Disposable, DoorbellProperty, DoorbellTrigger, EVENT_TRIGGER_TYPES, FaceDetectorSensor, FaceProperty, FaceSensor, GarageControl, GarageProperty, GarageState, HumidityInfo, HumidityProperty, LeakProperty, LeakSensor, LicensePlateDetectorSensor, LicensePlateProperty, LicensePlateSensor, LightCapability, LightControl, LightProperty, LockControl, LockProperty, LockState, MotionDetectorSensor, MotionProperty, MotionSensor, ObjectDetectorSensor, ObjectProperty, ObjectSensor, Observable, OccupancyProperty, OccupancySensor, PTZCapability, PTZControl, PTZProperty, PluginCapability, PluginInterface, PluginRole, RING_AUTO_RESET_MS, ReplaySubject, RtpPacket, SecuritySystem, SecuritySystemProperty, SecuritySystemState, Sensor, SensorCategory, SensorType, Severity, SirenCapability, SirenControl, SirenProperty, SmokeProperty, SmokeSensor, Subject, SwitchControl, SwitchProperty, TemperatureInfo, TemperatureProperty, canCreateCameras, canProvideSensorsToAnyCameras, distinctUntilChanged, filter, firstValueFrom, getContractValidationErrors, hasCapability, hasInterface, isHub, map, mergeMap, pairwise, share, validateContractConsistency };
5838
- export type { AssignedPlugin, AudioCodec, AudioCodecProperties, AudioDetectionInterface, AudioDetectionPluginResponse, AudioDetectionSettings, AudioFFmpegCodec, AudioFrameData, AudioInputSpec, AudioLabel, AudioMetadata, AudioModelSpec, AudioResult, AudioSensorLike, AudioSensorProperties, AudioStreamInfo, BaseAudioLabel, BaseCamera, BaseCameraConfig, BatteryInfoLike, BatteryInfoProperties, BoundingBox, Camera, CameraAspectRatio, CameraConfig, CameraConfigInputSettings, CameraDetectionSettings, CameraDevice, CameraDeviceSource, CameraFrameWorkerSettings, CameraImplementation, CameraInformation, CameraInput, CameraPluginInfo, CameraRole, CameraSource, CameraType, CameraUiSettings, ClassifierDetection, ClassifierDetectionInterface, ClassifierDetectionPluginResponse, ClassifierResult, ClassifierSensorLike, ClassifierSensorProperties, ClipDetectionInterface, ClipDetectionPluginResponse, ClipEmbedding, ClipResult, ClipTextEmbeddingResult, ContactSensorLike, ContactSensorProperties, CoreManager, CoreManagerEvent, CreateDownloadOptions, CreateStreamDownloadOptions, Detection, DetectionAttribute, DetectionEvent, DetectionEventState, DetectionEventType, DetectionLabel, DetectionLine, DetectionZone, DeviceManager, DeviceStorage, DiscoveredCamera, DiscoveryProvider, DoorbellTriggerLike, DoorbellTriggerProperties, DownloadCleanup, DownloadManager, DownloadToken, EventAttribute, EventDescription, EventDetection, EventSegment, EventTrigger, EventTriggerType, FMTPInfo, FaceDetection, FaceDetectionInterface, FaceDetectionPluginResponse, FaceResult, FaceSensorLike, FaceSensorProperties, Fmp4Session, Fmp4SessionOptions, FormSubmitResponse, FormSubmitSchema, GarageControlLike, GarageControlProperties, Go2RtcRTSPSource, Go2RtcSnapshotSource, Go2RtcWSSource, HardwareAcceleration, HumidityInfoLike, HumidityInfoProperties, ImageMetadata, JsonArraySchema, JsonBaseSchema, JsonBaseSchemaWithoutCallbacks, JsonBooleanSchema, JsonEnumSchema, JsonFactorySchema, JsonNumberSchema, JsonSchema, JsonSchemaArray, JsonSchemaArrayWithoutCallbacks, JsonSchemaBoolean, JsonSchemaBooleanWithoutCallbacks, JsonSchemaButton, JsonSchemaEnum, JsonSchemaEnumWithoutCallbacks, JsonSchemaNumber, JsonSchemaNumberWithoutCallbacks, JsonSchemaString, JsonSchemaStringWithoutCallbacks, JsonSchemaSubmit, JsonSchemaType, JsonSchemaWithoutCallbacks, JsonSchemaWithoutKey, JsonStringSchema, LeakSensorLike, LeakSensorProperties, LicensePlateDetection, LicensePlateDetectionInterface, LicensePlateDetectionPluginResponse, LicensePlateResult, LicensePlateSensorLike, LicensePlateSensorProperties, LightControlLike, LightControlProperties, LineDirection, LockControlLike, LockControlProperties, LoggerService, ModelSpec, MotionDetectionInterface, MotionDetectionPluginResponse, MotionDetectionSettings, MotionResolution, MotionResult, MotionSensorLike, MotionSensorProperties, Notification, NotificationManager, NotifierDevice, NotifierInterface, OAuthAuthCodeFlowCapable, OAuthCapable, OAuthClientCredentialsCapable, OAuthDeviceFlowCapable, OAuthMetadata, OAuthProviderConfig, OAuthProviderDeclaration, OAuthState, OAuthStatus, ObjectDetectionInterface, ObjectDetectionPluginResponse, ObjectDetectionSettings, ObjectModelSpec, ObjectResult, ObjectSensorLike, ObjectSensorProperties, OccupancySensorLike, OccupancySensorProperties, OperatorFn, PTZControlLike, PTZControlProperties, PTZDirection, PTZPosition, PTZRelativeMove, PluginAPI, PluginAssignments, PluginConfig, PluginContract, PluginInfo, PluginInterfaces, Point, ProbeAudioCodec, ProbeConfig, ProbeStream, PropertyChangeOf, PtzAutotrackSettings, PythonVersion, RTPInfo, RTSPAudioCodec, RTSPUrlOptions, RtpSession, RtpSessionBackchannelOptions, RtpSessionOptions, SchemaCondition, SchemaConditionOperator, SchemaConfig, SecuritySystemLike, SecuritySystemProperties, SensorCapability, SensorLike, SensorPropertyType, SensorTriggerRef, SensorTriggerSettings, SirenControlLike, SirenControlProperties, SmokeSensorLike, SmokeSensorProperties, SnapshotInterface, SnapshotSettings, SnapshotUrlOptions, StreamDirection, StreamUrls, StreamingInterface, StreamingRole, SwitchControlLike, SwitchControlProperties, TemperatureInfoLike, TemperatureInfoProperties, ToastMessage, TrackedDetection, VideoCodec, VideoCodecProperties, VideoFFmpegCodec, VideoFrameData, VideoInputSpec, VideoStreamInfo, VideoStreamingMode, ZoneFilter, ZoneType };
5851
+ export type { AssignedPlugin, AudioCodec, AudioCodecProperties, AudioDetectionInterface, AudioDetectionPluginResponse, AudioDetectionSettings, AudioFFmpegCodec, AudioFrameData, AudioInputSpec, AudioLabel, AudioMetadata, AudioModelSpec, AudioResult, AudioSensorLike, AudioSensorProperties, AudioStreamInfo, BaseAudioLabel, BaseCamera, BaseCameraConfig, BatteryInfoLike, BatteryInfoProperties, BoundingBox, Camera, CameraAspectRatio, CameraAspectRatioPreset, CameraConfig, CameraConfigInputSettings, CameraDetectionSettings, CameraDevice, CameraDeviceSource, CameraFrameWorkerSettings, CameraImplementation, CameraInformation, CameraInput, CameraPluginInfo, CameraRole, CameraSource, CameraType, CameraUiSettings, ClassifierDetection, ClassifierDetectionInterface, ClassifierDetectionPluginResponse, ClassifierResult, ClassifierSensorLike, ClassifierSensorProperties, ClipDetectionInterface, ClipDetectionPluginResponse, ClipEmbedding, ClipResult, ClipTextEmbeddingResult, ContactSensorLike, ContactSensorProperties, CoreManager, CoreManagerEvent, CreateDownloadOptions, CreateStreamDownloadOptions, Detection, DetectionAttribute, DetectionEvent, DetectionEventState, DetectionEventType, DetectionLabel, DetectionLine, DetectionZone, DeviceManager, DeviceStorage, DiscoveredCamera, DiscoveryProvider, DoorbellTriggerLike, DoorbellTriggerProperties, DownloadCleanup, DownloadManager, DownloadToken, EventAttribute, EventDescription, EventDetection, EventSegment, EventTrigger, EventTriggerType, FMTPInfo, FaceDetection, FaceDetectionInterface, FaceDetectionPluginResponse, FaceResult, FaceSensorLike, FaceSensorProperties, Fmp4Session, Fmp4SessionOptions, FormSubmitResponse, FormSubmitSchema, GarageControlLike, GarageControlProperties, Go2RtcRTSPSource, Go2RtcSnapshotSource, Go2RtcWSSource, HardwareAcceleration, HumidityInfoLike, HumidityInfoProperties, ImageMetadata, JsonArraySchema, JsonBaseSchema, JsonBaseSchemaWithoutCallbacks, JsonBooleanSchema, JsonEnumSchema, JsonFactorySchema, JsonNumberSchema, JsonSchema, JsonSchemaArray, JsonSchemaArrayWithoutCallbacks, JsonSchemaBoolean, JsonSchemaBooleanWithoutCallbacks, JsonSchemaButton, JsonSchemaEnum, JsonSchemaEnumWithoutCallbacks, JsonSchemaNumber, JsonSchemaNumberWithoutCallbacks, JsonSchemaString, JsonSchemaStringWithoutCallbacks, JsonSchemaSubmit, JsonSchemaType, JsonSchemaWithoutCallbacks, JsonSchemaWithoutKey, JsonStringSchema, LeakSensorLike, LeakSensorProperties, LicensePlateDetection, LicensePlateDetectionInterface, LicensePlateDetectionPluginResponse, LicensePlateResult, LicensePlateSensorLike, LicensePlateSensorProperties, LightControlLike, LightControlProperties, LineDirection, LockControlLike, LockControlProperties, LoggerService, ModelSpec, MotionDetectionInterface, MotionDetectionPluginResponse, MotionDetectionSettings, MotionResolution, MotionResult, MotionSensorLike, MotionSensorProperties, Notification, NotificationManager, NotifierDevice, NotifierInterface, OAuthAuthCodeFlowCapable, OAuthCapable, OAuthClientCredentialsCapable, OAuthDeviceFlowCapable, OAuthMetadata, OAuthProviderConfig, OAuthProviderDeclaration, OAuthState, OAuthStatus, ObjectDetectionInterface, ObjectDetectionPluginResponse, ObjectDetectionSettings, ObjectModelSpec, ObjectResult, ObjectSensorLike, ObjectSensorProperties, OccupancySensorLike, OccupancySensorProperties, OperatorFn, PTZControlLike, PTZControlProperties, PTZDirection, PTZPosition, PTZRelativeMove, PluginAPI, PluginAssignments, PluginConfig, PluginContract, PluginInfo, PluginInterfaces, Point, ProbeAudioCodec, ProbeConfig, ProbeStream, PropertyChangeOf, PtzAutotrackSettings, PythonVersion, RTPInfo, RTSPAudioCodec, RTSPUrlOptions, RtpSession, RtpSessionBackchannelOptions, RtpSessionOptions, SchemaCondition, SchemaConditionOperator, SchemaConfig, SecuritySystemLike, SecuritySystemProperties, SensorCapability, SensorLike, SensorPropertyType, SensorTriggerRef, SensorTriggerSettings, SirenControlLike, SirenControlProperties, SmokeSensorLike, SmokeSensorProperties, SnapshotInterface, SnapshotSettings, SnapshotUrlOptions, StreamDirection, StreamUrls, StreamingInterface, StreamingRole, SwitchControlLike, SwitchControlProperties, TemperatureInfoLike, TemperatureInfoProperties, ToastMessage, TrackedDetection, VideoCodec, VideoCodecProperties, VideoFFmpegCodec, VideoFrameData, VideoInputSpec, VideoStreamInfo, VideoStreamingMode, ZoneFilter, ZoneType };
@@ -45,7 +45,7 @@ interface ModelSpec {
45
45
  input: VideoInputSpec;
46
46
  /** Labels emitted by an upstream object detector that activate this detector (e.g. `['person']` for face detection). */
47
47
  triggerLabels: DetectionLabel[];
48
- /** Embedding model identifier for face recognition. */
48
+ /** Embedding model identifier. Required for face recognition and for CLIP: embeddings are stored and matched under this id. */
49
49
  embeddingModel?: string;
50
50
  }
51
51
 
@@ -608,7 +608,7 @@ interface CameraInputSettings {
608
608
  useForSnapshot: boolean;
609
609
  /** Keep connection always active */
610
610
  hotMode: boolean;
611
- /** Preload stream on startup */
611
+ /** Keep a keyframe cache for this source, so the view opens faster. Use `hotMode` to keep the stream connected. */
612
612
  preload: boolean;
613
613
  /** Strip the audio track from this source (defaults to false) */
614
614
  muted?: boolean;
@@ -732,7 +732,7 @@ interface EventDetection {
732
732
  maxCount: number;
733
733
  /** Bounding box of the highest-confidence detection (normalized 0–1) */
734
734
  box?: BoundingBox;
735
- /** Best-selected JPEG thumbnail crop. Only present on 'end' events. */
735
+ /** Best-selected JPEG thumbnail crop. Only present on 'segment-start' and 'segment-end' messages, and omitted when it is the same image as the segment thumbnail. */
736
736
  thumbnail?: Uint8Array;
737
737
  /** Object tracker ID (links this detection across frames) */
738
738
  trackId?: number;
@@ -749,7 +749,7 @@ interface EventAttribute {
749
749
  label: string;
750
750
  /** Detection confidence (0-1) */
751
751
  confidence?: number;
752
- /** Best-selected JPEG thumbnail crop. Only present on 'end' events. */
752
+ /** Best-selected JPEG thumbnail crop. Present on 'segment-start' and 'segment-end' messages, and on 'segment-update' for unknown faces. */
753
753
  thumbnail?: Uint8Array;
754
754
  /** Face embedding vector for unknown face persistence. Only present for face attributes. */
755
755
  embedding?: number[];
@@ -770,7 +770,7 @@ interface EventSegment {
770
770
  firstSeen: number;
771
771
  /** Segment end time (Unix ms) */
772
772
  lastSeen: number;
773
- /** Best-selected JPEG scene thumbnail for this segment. Only present on 'end' events. */
773
+ /** Best-selected JPEG scene thumbnail for this segment. Only present on 'segment-start' and 'segment-end' messages, plus once on a 'segment-update' if the start message had none. */
774
774
  thumbnail?: Uint8Array;
775
775
  /** Object detections in this segment */
776
776
  detections: EventDetection[];
@@ -179,7 +179,7 @@ export class Sensor {
179
179
  /**
180
180
  * Get a read-only snapshot of all property values.
181
181
  *
182
- * @returns Frozen view of every property currently held by the sensor.
182
+ * @returns Shallow copy of every property currently held by the sensor.
183
183
  *
184
184
  * @example
185
185
  * ```ts
@@ -305,8 +305,9 @@ export class Sensor {
305
305
  * override can safely access `this.cameraId`, `this.storage`, and publish
306
306
  * properties via the semantic helper methods.
307
307
  *
308
- * Errors thrown here are caught and logged they will NOT break assignment
309
- * bookkeeping. If your work can fail, handle it inside the override.
308
+ * Errors thrown here are caught and swallowed, not logged. They will NOT
309
+ * break assignment bookkeeping, but nothing surfaces them either. If your
310
+ * work can fail, handle it inside the override.
310
311
  *
311
312
  * Paired 1:1 with `onDeassigned` — for every `onAssigned` call there is
312
313
  * exactly one matching `onDeassigned` later (on deassignment or cleanup).
@@ -111,7 +111,9 @@ export class MotionSensor extends Sensor {
111
111
  * Motion detector that receives video frames from the backend pipeline.
112
112
  * Extend this class and implement {@link detectMotion} to analyze frames
113
113
  * for motion. The backend calls `detectMotion()` at the configured frame
114
- * interval and applies the returned result to the sensor.
114
+ * interval, zone-filters the returned detections and applies them.
115
+ * `detected` is re-derived from the surviving detections, so a result with
116
+ * no detections reports no motion.
115
117
  */
116
118
  export class MotionDetectorSensor extends MotionSensor {
117
119
  _requiresFrames = true;
@@ -90,12 +90,13 @@ export class PTZControl extends Sensor {
90
90
  * Continuous-move command. Override to drive hardware and call
91
91
  * `await super.setVelocity(value)` after success to sync the SDK state.
92
92
  *
93
- * @param value - Per-axis speeds in `[-1, 1]`, or `undefined` to stop.
93
+ * @param value - Per-axis speeds in `[-1, 1]`. Stop is zero on every axis.
94
+ * `undefined` is ignored and the published `velocity` keeps its last value.
94
95
  *
95
96
  * @example
96
97
  * ```ts
97
98
  * await ptz.setVelocity({ panSpeed: 0.5, tiltSpeed: 0, zoomSpeed: 0 });
98
- * await ptz.setVelocity(undefined); // stop
99
+ * await ptz.setVelocity({ panSpeed: 0, tiltSpeed: 0, zoomSpeed: 0 }); // stop
99
100
  * ```
100
101
  */
101
102
  async setVelocity(value) {
@@ -122,7 +123,8 @@ export class PTZControl extends Sensor {
122
123
  * Preset-move command. Override to drive hardware and call
123
124
  * `await super.setTargetPreset(value)` after success to sync the SDK state.
124
125
  *
125
- * @param value - Preset name to move to, or `undefined` to clear.
126
+ * @param value - Preset name to move to. `undefined` is ignored and the
127
+ * published `targetPreset` keeps its last value.
126
128
  *
127
129
  * @example
128
130
  * ```ts
@@ -173,7 +175,7 @@ export class PTZControl extends Sensor {
173
175
  * Cross-process consumer entry point. Dispatches writable properties
174
176
  * to semantic methods so plugin overrides (hardware actions) are honored.
175
177
  * `moving` and `presets` are observed/discovered state and not externally writable;
176
- * only `Position`, `Velocity`, and `TargetPreset` may be set.
178
+ * only `Position`, `Velocity`, `TargetPreset`, and `RelativeMove` may be set.
177
179
  *
178
180
  * @param property - Property name to write.
179
181
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/sdk",
3
- "version": "0.0.21",
3
+ "version": "0.0.24",
4
4
  "description": "camera.ui sdk",
5
5
  "exports": {
6
6
  ".": {