@camstack/addon-provider-unifi 0.2.70 → 0.2.71

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/addon.js CHANGED
@@ -28964,6 +28964,287 @@ var ptzAutotrackCapability = {
28964
28964
  */
28965
28965
  durability: "session"
28966
28966
  };
28967
+ /**
28968
+ * `navigation` — a device-scoped capability that natively expresses the FULL
28969
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
28970
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
28971
+ *
28972
+ * Why a NEW cap rather than overloading `ptz`:
28973
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
28974
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
28975
+ * The two are different physical models: PTZ is absolute-position + presets,
28976
+ * navigation is momentary drive nudges + discrete robot ACTIONS
28977
+ * (dock / spot-clean / follow-pet / go-to-point / …).
28978
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
28979
+ * the reverse:
28980
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
28981
+ * / `getOptions`), and
28982
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
28983
+ * robot camera shows up in the existing PTZ control path without every
28984
+ * PTZ provider learning about robots. The mapping lives in the adapter,
28985
+ * not here (see the addon design note):
28986
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
28987
+ * ptz.stop() → navigation.stop()
28988
+ * ptz.goHome() → navigation.runAction('goHome')
28989
+ * ptz.getPresets() → navigation.listActions() (id→preset)
28990
+ * ptz.goToPreset(id) → navigation.runAction(id)
28991
+ *
28992
+ * ## Continuous drive
28993
+ *
28994
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
28995
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
28996
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
28997
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
28998
+ * coalesce them. The UI owns the cadence.
28999
+ *
29000
+ * ## The action dictionary
29001
+ *
29002
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29003
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29004
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29005
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29006
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29007
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29008
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29009
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29010
+ *
29011
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29012
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29013
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29014
+ * every device handle. A future nodedreame publish adds a typed
29015
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29016
+ * provider can then swap the raw calls for the typed methods with no change to
29017
+ * THIS contract.
29018
+ */
29019
+ /**
29020
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29021
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29022
+ * halts it.
29023
+ *
29024
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29025
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29026
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29027
+ * vector by it (drivers without proportional drive ignore it).
29028
+ *
29029
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29030
+ * axis alone; an all-undefined nudge is a no-op.
29031
+ */
29032
+ var NavigationMoveCommandSchema = object({
29033
+ pan: number().min(-1).max(1).optional(),
29034
+ tilt: number().min(-1).max(1).optional(),
29035
+ speed: number().min(0).max(1).optional()
29036
+ });
29037
+ /**
29038
+ * The enumerated discrete actions a navigation-capable robot can perform via
29039
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29040
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29041
+ * `playSound` (see the `sound` dictionary entries).
29042
+ */
29043
+ var NavigationActionIdSchema = _enum([
29044
+ "goHome",
29045
+ "locate",
29046
+ "spotClean",
29047
+ "findPet",
29048
+ "personFollow",
29049
+ "stop",
29050
+ "startClean",
29051
+ "pauseClean",
29052
+ "dockWash",
29053
+ "autoEmpty",
29054
+ "flashOn",
29055
+ "flashOff"
29056
+ ]);
29057
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29058
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29059
+ /**
29060
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29061
+ * native panel and the PTZ mimic render as a button.
29062
+ *
29063
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29064
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29065
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29066
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29067
+ * - `label` — operator-facing English label.
29068
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29069
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29070
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29071
+ * flips it from config, never by editing code.
29072
+ */
29073
+ var NavigationActionEntrySchema = object({
29074
+ id: string(),
29075
+ kind: NavigationEntryKindSchema,
29076
+ label: string(),
29077
+ icon: string(),
29078
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29079
+ soundId: number().int().optional(),
29080
+ /** Per-device feature flag — render this entry only when true. */
29081
+ enabled: boolean()
29082
+ });
29083
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29084
+ var NavigationPointSchema = object({
29085
+ x: number(),
29086
+ y: number()
29087
+ });
29088
+ /**
29089
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29090
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29091
+ * that are turned on for THIS device. Data-driven: the provider derives these
29092
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29093
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29094
+ * that are not dictionary entries.
29095
+ *
29096
+ * - `move` / `stop` — the momentary drive joystick.
29097
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29098
+ * map-coordinate plumbing is wired.
29099
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29100
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29101
+ * - `light` — the on/off fill-light toggle (works anytime).
29102
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29103
+ * camera-service control; needs an active stream).
29104
+ */
29105
+ var NavigationFeaturesSchema = object({
29106
+ move: boolean(),
29107
+ stop: boolean(),
29108
+ goToPoint: boolean(),
29109
+ runAction: boolean(),
29110
+ playSound: boolean(),
29111
+ light: boolean(),
29112
+ lightMode: boolean()
29113
+ });
29114
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29115
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29116
+ /**
29117
+ * Live navigation state so the UI can reflect what the robot is doing:
29118
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29119
+ * - `following` — person/pet follow is currently armed.
29120
+ * - `flash` — the on-camera fill light is on.
29121
+ * - `lightMode` — auto vs manual fill-light mode.
29122
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29123
+ * `lightMode === 'manual'`.
29124
+ */
29125
+ var NavigationStatusSchema = object({
29126
+ mode: _enum([
29127
+ "idle",
29128
+ "cleaning",
29129
+ "spot",
29130
+ "following",
29131
+ "goto",
29132
+ "returning",
29133
+ "paused",
29134
+ "unknown"
29135
+ ]),
29136
+ following: boolean(),
29137
+ flash: boolean(),
29138
+ lightMode: NavigationLightModeSchema,
29139
+ lightLevel: number().min(40).max(100),
29140
+ /** Ms epoch when the slice was last updated. */
29141
+ lastChangedAt: number()
29142
+ });
29143
+ /**
29144
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29145
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29146
+ * convention.
29147
+ */
29148
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29149
+ var navigationCapability = {
29150
+ name: "navigation",
29151
+ scope: "device",
29152
+ deviceNative: true,
29153
+ mode: "singleton",
29154
+ deviceTypes: [DeviceType.Camera],
29155
+ deviceConfig: { ui: {
29156
+ kind: "widget",
29157
+ widgetId: "host/navigation-panel",
29158
+ tab: "navigation",
29159
+ topTab: true,
29160
+ label: "Navigation",
29161
+ order: 0
29162
+ } },
29163
+ methods: {
29164
+ /**
29165
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29166
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29167
+ * path) works for any authenticated user, not admin-only. The UI sends
29168
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29169
+ * a single drive write WITHOUT debouncing.
29170
+ */
29171
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29172
+ /** Halt all motion immediately (zero drive vector). */
29173
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29174
+ /** Send the robot to a point on its live map. */
29175
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29176
+ /**
29177
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29178
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29179
+ */
29180
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29181
+ /**
29182
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29183
+ * unsupported action ids are rejected by the provider.
29184
+ */
29185
+ runAction: method(object({
29186
+ deviceId: number(),
29187
+ actionId: NavigationActionIdSchema
29188
+ }), _void(), { kind: "mutation" }),
29189
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29190
+ playSound: method(object({
29191
+ deviceId: number(),
29192
+ soundId: number().int()
29193
+ }), _void(), { kind: "mutation" }),
29194
+ /**
29195
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29196
+ * works anytime, no active stream required).
29197
+ */
29198
+ setLightOn: method(object({
29199
+ deviceId: number(),
29200
+ on: boolean()
29201
+ }), _void(), { kind: "mutation" }),
29202
+ /**
29203
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29204
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29205
+ * action that generally needs an active camera stream/monitor session — the
29206
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29207
+ */
29208
+ setLightMode: method(object({
29209
+ deviceId: number(),
29210
+ mode: NavigationLightModeSchema,
29211
+ level: number().min(40).max(100).optional()
29212
+ }), _void(), { kind: "mutation" }),
29213
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29214
+ setLightLevel: method(object({
29215
+ deviceId: number(),
29216
+ level: number().min(40).max(100)
29217
+ }), _void(), { kind: "mutation" }),
29218
+ /**
29219
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29220
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29221
+ * `listActions`).
29222
+ */
29223
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29224
+ },
29225
+ events: { onStatusChanged: { data: object({
29226
+ deviceId: number(),
29227
+ status: NavigationStatusSchema
29228
+ }) } },
29229
+ status: {
29230
+ schema: NavigationStatusSchema,
29231
+ kind: "push"
29232
+ },
29233
+ /**
29234
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29235
+ * for live mode / follow / flash changes.
29236
+ */
29237
+ runtimeState: NavigationRuntimeStateSchema,
29238
+ /**
29239
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29240
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29241
+ * that. The live handle re-publishes on connect.
29242
+ *
29243
+ * See `RuntimeStateDurability`. Enforced by
29244
+ * `scripts/check-runtime-state-durability.ts`.
29245
+ */
29246
+ durability: "session"
29247
+ };
28967
29248
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
28968
29249
  kind: "mutation",
28969
29250
  auth: "admin"
@@ -32239,6 +32520,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32239
32520
  motionTrigger: motionTriggerCapability,
32240
32521
  motionZones: motionZonesCapability,
32241
32522
  nativeObjectDetection: nativeObjectDetectionCapability,
32523
+ navigation: navigationCapability,
32242
32524
  networkLink: networkLinkCapability,
32243
32525
  notifier: notifierCapability,
32244
32526
  numericSensor: numericSensorCapability,
@@ -36093,6 +36375,66 @@ Object.freeze({
36093
36375
  addonId: null,
36094
36376
  access: "create"
36095
36377
  },
36378
+ "navigation.getFeatures": {
36379
+ capName: "navigation",
36380
+ capScope: "device",
36381
+ addonId: null,
36382
+ access: "view"
36383
+ },
36384
+ "navigation.goToPoint": {
36385
+ capName: "navigation",
36386
+ capScope: "device",
36387
+ addonId: null,
36388
+ access: "create"
36389
+ },
36390
+ "navigation.listActions": {
36391
+ capName: "navigation",
36392
+ capScope: "device",
36393
+ addonId: null,
36394
+ access: "view"
36395
+ },
36396
+ "navigation.move": {
36397
+ capName: "navigation",
36398
+ capScope: "device",
36399
+ addonId: null,
36400
+ access: "create"
36401
+ },
36402
+ "navigation.playSound": {
36403
+ capName: "navigation",
36404
+ capScope: "device",
36405
+ addonId: null,
36406
+ access: "create"
36407
+ },
36408
+ "navigation.runAction": {
36409
+ capName: "navigation",
36410
+ capScope: "device",
36411
+ addonId: null,
36412
+ access: "create"
36413
+ },
36414
+ "navigation.setLightLevel": {
36415
+ capName: "navigation",
36416
+ capScope: "device",
36417
+ addonId: null,
36418
+ access: "create"
36419
+ },
36420
+ "navigation.setLightMode": {
36421
+ capName: "navigation",
36422
+ capScope: "device",
36423
+ addonId: null,
36424
+ access: "create"
36425
+ },
36426
+ "navigation.setLightOn": {
36427
+ capName: "navigation",
36428
+ capScope: "device",
36429
+ addonId: null,
36430
+ access: "create"
36431
+ },
36432
+ "navigation.stop": {
36433
+ capName: "navigation",
36434
+ capScope: "device",
36435
+ addonId: null,
36436
+ access: "create"
36437
+ },
36096
36438
  "networkAccess.getEndpoint": {
36097
36439
  capName: "network-access",
36098
36440
  capScope: "system",
@@ -40188,6 +40530,56 @@ Object.freeze({
40188
40530
  form: "single",
40189
40531
  optional: false
40190
40532
  }],
40533
+ "navigation.getFeatures": [{
40534
+ name: "deviceId",
40535
+ form: "single",
40536
+ optional: false
40537
+ }],
40538
+ "navigation.goToPoint": [{
40539
+ name: "deviceId",
40540
+ form: "single",
40541
+ optional: false
40542
+ }],
40543
+ "navigation.listActions": [{
40544
+ name: "deviceId",
40545
+ form: "single",
40546
+ optional: false
40547
+ }],
40548
+ "navigation.move": [{
40549
+ name: "deviceId",
40550
+ form: "single",
40551
+ optional: false
40552
+ }],
40553
+ "navigation.playSound": [{
40554
+ name: "deviceId",
40555
+ form: "single",
40556
+ optional: false
40557
+ }],
40558
+ "navigation.runAction": [{
40559
+ name: "deviceId",
40560
+ form: "single",
40561
+ optional: false
40562
+ }],
40563
+ "navigation.setLightLevel": [{
40564
+ name: "deviceId",
40565
+ form: "single",
40566
+ optional: false
40567
+ }],
40568
+ "navigation.setLightMode": [{
40569
+ name: "deviceId",
40570
+ form: "single",
40571
+ optional: false
40572
+ }],
40573
+ "navigation.setLightOn": [{
40574
+ name: "deviceId",
40575
+ form: "single",
40576
+ optional: false
40577
+ }],
40578
+ "navigation.stop": [{
40579
+ name: "deviceId",
40580
+ form: "single",
40581
+ optional: false
40582
+ }],
40191
40583
  "networkQuality.getDeviceStats": [{
40192
40584
  name: "deviceId",
40193
40585
  form: "single",
package/dist/addon.mjs CHANGED
@@ -28963,6 +28963,287 @@ var ptzAutotrackCapability = {
28963
28963
  */
28964
28964
  durability: "session"
28965
28965
  };
28966
+ /**
28967
+ * `navigation` — a device-scoped capability that natively expresses the FULL
28968
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
28969
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
28970
+ *
28971
+ * Why a NEW cap rather than overloading `ptz`:
28972
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
28973
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
28974
+ * The two are different physical models: PTZ is absolute-position + presets,
28975
+ * navigation is momentary drive nudges + discrete robot ACTIONS
28976
+ * (dock / spot-clean / follow-pet / go-to-point / …).
28977
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
28978
+ * the reverse:
28979
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
28980
+ * / `getOptions`), and
28981
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
28982
+ * robot camera shows up in the existing PTZ control path without every
28983
+ * PTZ provider learning about robots. The mapping lives in the adapter,
28984
+ * not here (see the addon design note):
28985
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
28986
+ * ptz.stop() → navigation.stop()
28987
+ * ptz.goHome() → navigation.runAction('goHome')
28988
+ * ptz.getPresets() → navigation.listActions() (id→preset)
28989
+ * ptz.goToPreset(id) → navigation.runAction(id)
28990
+ *
28991
+ * ## Continuous drive
28992
+ *
28993
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
28994
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
28995
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
28996
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
28997
+ * coalesce them. The UI owns the cadence.
28998
+ *
28999
+ * ## The action dictionary
29000
+ *
29001
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29002
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29003
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29004
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29005
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29006
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29007
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29008
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29009
+ *
29010
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29011
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29012
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29013
+ * every device handle. A future nodedreame publish adds a typed
29014
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29015
+ * provider can then swap the raw calls for the typed methods with no change to
29016
+ * THIS contract.
29017
+ */
29018
+ /**
29019
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29020
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29021
+ * halts it.
29022
+ *
29023
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29024
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29025
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29026
+ * vector by it (drivers without proportional drive ignore it).
29027
+ *
29028
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29029
+ * axis alone; an all-undefined nudge is a no-op.
29030
+ */
29031
+ var NavigationMoveCommandSchema = object({
29032
+ pan: number().min(-1).max(1).optional(),
29033
+ tilt: number().min(-1).max(1).optional(),
29034
+ speed: number().min(0).max(1).optional()
29035
+ });
29036
+ /**
29037
+ * The enumerated discrete actions a navigation-capable robot can perform via
29038
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29039
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29040
+ * `playSound` (see the `sound` dictionary entries).
29041
+ */
29042
+ var NavigationActionIdSchema = _enum([
29043
+ "goHome",
29044
+ "locate",
29045
+ "spotClean",
29046
+ "findPet",
29047
+ "personFollow",
29048
+ "stop",
29049
+ "startClean",
29050
+ "pauseClean",
29051
+ "dockWash",
29052
+ "autoEmpty",
29053
+ "flashOn",
29054
+ "flashOff"
29055
+ ]);
29056
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29057
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29058
+ /**
29059
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29060
+ * native panel and the PTZ mimic render as a button.
29061
+ *
29062
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29063
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29064
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29065
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29066
+ * - `label` — operator-facing English label.
29067
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29068
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29069
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29070
+ * flips it from config, never by editing code.
29071
+ */
29072
+ var NavigationActionEntrySchema = object({
29073
+ id: string(),
29074
+ kind: NavigationEntryKindSchema,
29075
+ label: string(),
29076
+ icon: string(),
29077
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29078
+ soundId: number().int().optional(),
29079
+ /** Per-device feature flag — render this entry only when true. */
29080
+ enabled: boolean()
29081
+ });
29082
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29083
+ var NavigationPointSchema = object({
29084
+ x: number(),
29085
+ y: number()
29086
+ });
29087
+ /**
29088
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29089
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29090
+ * that are turned on for THIS device. Data-driven: the provider derives these
29091
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29092
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29093
+ * that are not dictionary entries.
29094
+ *
29095
+ * - `move` / `stop` — the momentary drive joystick.
29096
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29097
+ * map-coordinate plumbing is wired.
29098
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29099
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29100
+ * - `light` — the on/off fill-light toggle (works anytime).
29101
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29102
+ * camera-service control; needs an active stream).
29103
+ */
29104
+ var NavigationFeaturesSchema = object({
29105
+ move: boolean(),
29106
+ stop: boolean(),
29107
+ goToPoint: boolean(),
29108
+ runAction: boolean(),
29109
+ playSound: boolean(),
29110
+ light: boolean(),
29111
+ lightMode: boolean()
29112
+ });
29113
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29114
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29115
+ /**
29116
+ * Live navigation state so the UI can reflect what the robot is doing:
29117
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29118
+ * - `following` — person/pet follow is currently armed.
29119
+ * - `flash` — the on-camera fill light is on.
29120
+ * - `lightMode` — auto vs manual fill-light mode.
29121
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29122
+ * `lightMode === 'manual'`.
29123
+ */
29124
+ var NavigationStatusSchema = object({
29125
+ mode: _enum([
29126
+ "idle",
29127
+ "cleaning",
29128
+ "spot",
29129
+ "following",
29130
+ "goto",
29131
+ "returning",
29132
+ "paused",
29133
+ "unknown"
29134
+ ]),
29135
+ following: boolean(),
29136
+ flash: boolean(),
29137
+ lightMode: NavigationLightModeSchema,
29138
+ lightLevel: number().min(40).max(100),
29139
+ /** Ms epoch when the slice was last updated. */
29140
+ lastChangedAt: number()
29141
+ });
29142
+ /**
29143
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29144
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29145
+ * convention.
29146
+ */
29147
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29148
+ var navigationCapability = {
29149
+ name: "navigation",
29150
+ scope: "device",
29151
+ deviceNative: true,
29152
+ mode: "singleton",
29153
+ deviceTypes: [DeviceType.Camera],
29154
+ deviceConfig: { ui: {
29155
+ kind: "widget",
29156
+ widgetId: "host/navigation-panel",
29157
+ tab: "navigation",
29158
+ topTab: true,
29159
+ label: "Navigation",
29160
+ order: 0
29161
+ } },
29162
+ methods: {
29163
+ /**
29164
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29165
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29166
+ * path) works for any authenticated user, not admin-only. The UI sends
29167
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29168
+ * a single drive write WITHOUT debouncing.
29169
+ */
29170
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29171
+ /** Halt all motion immediately (zero drive vector). */
29172
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29173
+ /** Send the robot to a point on its live map. */
29174
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29175
+ /**
29176
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29177
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29178
+ */
29179
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29180
+ /**
29181
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29182
+ * unsupported action ids are rejected by the provider.
29183
+ */
29184
+ runAction: method(object({
29185
+ deviceId: number(),
29186
+ actionId: NavigationActionIdSchema
29187
+ }), _void(), { kind: "mutation" }),
29188
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29189
+ playSound: method(object({
29190
+ deviceId: number(),
29191
+ soundId: number().int()
29192
+ }), _void(), { kind: "mutation" }),
29193
+ /**
29194
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29195
+ * works anytime, no active stream required).
29196
+ */
29197
+ setLightOn: method(object({
29198
+ deviceId: number(),
29199
+ on: boolean()
29200
+ }), _void(), { kind: "mutation" }),
29201
+ /**
29202
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29203
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29204
+ * action that generally needs an active camera stream/monitor session — the
29205
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29206
+ */
29207
+ setLightMode: method(object({
29208
+ deviceId: number(),
29209
+ mode: NavigationLightModeSchema,
29210
+ level: number().min(40).max(100).optional()
29211
+ }), _void(), { kind: "mutation" }),
29212
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29213
+ setLightLevel: method(object({
29214
+ deviceId: number(),
29215
+ level: number().min(40).max(100)
29216
+ }), _void(), { kind: "mutation" }),
29217
+ /**
29218
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29219
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29220
+ * `listActions`).
29221
+ */
29222
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29223
+ },
29224
+ events: { onStatusChanged: { data: object({
29225
+ deviceId: number(),
29226
+ status: NavigationStatusSchema
29227
+ }) } },
29228
+ status: {
29229
+ schema: NavigationStatusSchema,
29230
+ kind: "push"
29231
+ },
29232
+ /**
29233
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29234
+ * for live mode / follow / flash changes.
29235
+ */
29236
+ runtimeState: NavigationRuntimeStateSchema,
29237
+ /**
29238
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29239
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29240
+ * that. The live handle re-publishes on connect.
29241
+ *
29242
+ * See `RuntimeStateDurability`. Enforced by
29243
+ * `scripts/check-runtime-state-durability.ts`.
29244
+ */
29245
+ durability: "session"
29246
+ };
28966
29247
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
28967
29248
  kind: "mutation",
28968
29249
  auth: "admin"
@@ -32238,6 +32519,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32238
32519
  motionTrigger: motionTriggerCapability,
32239
32520
  motionZones: motionZonesCapability,
32240
32521
  nativeObjectDetection: nativeObjectDetectionCapability,
32522
+ navigation: navigationCapability,
32241
32523
  networkLink: networkLinkCapability,
32242
32524
  notifier: notifierCapability,
32243
32525
  numericSensor: numericSensorCapability,
@@ -36092,6 +36374,66 @@ Object.freeze({
36092
36374
  addonId: null,
36093
36375
  access: "create"
36094
36376
  },
36377
+ "navigation.getFeatures": {
36378
+ capName: "navigation",
36379
+ capScope: "device",
36380
+ addonId: null,
36381
+ access: "view"
36382
+ },
36383
+ "navigation.goToPoint": {
36384
+ capName: "navigation",
36385
+ capScope: "device",
36386
+ addonId: null,
36387
+ access: "create"
36388
+ },
36389
+ "navigation.listActions": {
36390
+ capName: "navigation",
36391
+ capScope: "device",
36392
+ addonId: null,
36393
+ access: "view"
36394
+ },
36395
+ "navigation.move": {
36396
+ capName: "navigation",
36397
+ capScope: "device",
36398
+ addonId: null,
36399
+ access: "create"
36400
+ },
36401
+ "navigation.playSound": {
36402
+ capName: "navigation",
36403
+ capScope: "device",
36404
+ addonId: null,
36405
+ access: "create"
36406
+ },
36407
+ "navigation.runAction": {
36408
+ capName: "navigation",
36409
+ capScope: "device",
36410
+ addonId: null,
36411
+ access: "create"
36412
+ },
36413
+ "navigation.setLightLevel": {
36414
+ capName: "navigation",
36415
+ capScope: "device",
36416
+ addonId: null,
36417
+ access: "create"
36418
+ },
36419
+ "navigation.setLightMode": {
36420
+ capName: "navigation",
36421
+ capScope: "device",
36422
+ addonId: null,
36423
+ access: "create"
36424
+ },
36425
+ "navigation.setLightOn": {
36426
+ capName: "navigation",
36427
+ capScope: "device",
36428
+ addonId: null,
36429
+ access: "create"
36430
+ },
36431
+ "navigation.stop": {
36432
+ capName: "navigation",
36433
+ capScope: "device",
36434
+ addonId: null,
36435
+ access: "create"
36436
+ },
36095
36437
  "networkAccess.getEndpoint": {
36096
36438
  capName: "network-access",
36097
36439
  capScope: "system",
@@ -40187,6 +40529,56 @@ Object.freeze({
40187
40529
  form: "single",
40188
40530
  optional: false
40189
40531
  }],
40532
+ "navigation.getFeatures": [{
40533
+ name: "deviceId",
40534
+ form: "single",
40535
+ optional: false
40536
+ }],
40537
+ "navigation.goToPoint": [{
40538
+ name: "deviceId",
40539
+ form: "single",
40540
+ optional: false
40541
+ }],
40542
+ "navigation.listActions": [{
40543
+ name: "deviceId",
40544
+ form: "single",
40545
+ optional: false
40546
+ }],
40547
+ "navigation.move": [{
40548
+ name: "deviceId",
40549
+ form: "single",
40550
+ optional: false
40551
+ }],
40552
+ "navigation.playSound": [{
40553
+ name: "deviceId",
40554
+ form: "single",
40555
+ optional: false
40556
+ }],
40557
+ "navigation.runAction": [{
40558
+ name: "deviceId",
40559
+ form: "single",
40560
+ optional: false
40561
+ }],
40562
+ "navigation.setLightLevel": [{
40563
+ name: "deviceId",
40564
+ form: "single",
40565
+ optional: false
40566
+ }],
40567
+ "navigation.setLightMode": [{
40568
+ name: "deviceId",
40569
+ form: "single",
40570
+ optional: false
40571
+ }],
40572
+ "navigation.setLightOn": [{
40573
+ name: "deviceId",
40574
+ form: "single",
40575
+ optional: false
40576
+ }],
40577
+ "navigation.stop": [{
40578
+ name: "deviceId",
40579
+ form: "single",
40580
+ optional: false
40581
+ }],
40190
40582
  "networkQuality.getDeviceStats": [{
40191
40583
  name: "deviceId",
40192
40584
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-unifi",
3
- "version": "0.2.70",
3
+ "version": "0.2.71",
4
4
  "description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
5
5
  "keywords": [
6
6
  "camstack",