@camstack/addon-provider-dreo 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
@@ -29008,6 +29008,287 @@ var ptzAutotrackCapability = {
29008
29008
  */
29009
29009
  durability: "session"
29010
29010
  };
29011
+ /**
29012
+ * `navigation` — a device-scoped capability that natively expresses the FULL
29013
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
29014
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
29015
+ *
29016
+ * Why a NEW cap rather than overloading `ptz`:
29017
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29018
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29019
+ * The two are different physical models: PTZ is absolute-position + presets,
29020
+ * navigation is momentary drive nudges + discrete robot ACTIONS
29021
+ * (dock / spot-clean / follow-pet / go-to-point / …).
29022
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29023
+ * the reverse:
29024
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
29025
+ * / `getOptions`), and
29026
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29027
+ * robot camera shows up in the existing PTZ control path without every
29028
+ * PTZ provider learning about robots. The mapping lives in the adapter,
29029
+ * not here (see the addon design note):
29030
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29031
+ * ptz.stop() → navigation.stop()
29032
+ * ptz.goHome() → navigation.runAction('goHome')
29033
+ * ptz.getPresets() → navigation.listActions() (id→preset)
29034
+ * ptz.goToPreset(id) → navigation.runAction(id)
29035
+ *
29036
+ * ## Continuous drive
29037
+ *
29038
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29039
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29040
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29041
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29042
+ * coalesce them. The UI owns the cadence.
29043
+ *
29044
+ * ## The action dictionary
29045
+ *
29046
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29047
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29048
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29049
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29050
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29051
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29052
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29053
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29054
+ *
29055
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29056
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29057
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29058
+ * every device handle. A future nodedreame publish adds a typed
29059
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29060
+ * provider can then swap the raw calls for the typed methods with no change to
29061
+ * THIS contract.
29062
+ */
29063
+ /**
29064
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29065
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29066
+ * halts it.
29067
+ *
29068
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29069
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29070
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29071
+ * vector by it (drivers without proportional drive ignore it).
29072
+ *
29073
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29074
+ * axis alone; an all-undefined nudge is a no-op.
29075
+ */
29076
+ var NavigationMoveCommandSchema = object({
29077
+ pan: number().min(-1).max(1).optional(),
29078
+ tilt: number().min(-1).max(1).optional(),
29079
+ speed: number().min(0).max(1).optional()
29080
+ });
29081
+ /**
29082
+ * The enumerated discrete actions a navigation-capable robot can perform via
29083
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29084
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29085
+ * `playSound` (see the `sound` dictionary entries).
29086
+ */
29087
+ var NavigationActionIdSchema = _enum([
29088
+ "goHome",
29089
+ "locate",
29090
+ "spotClean",
29091
+ "findPet",
29092
+ "personFollow",
29093
+ "stop",
29094
+ "startClean",
29095
+ "pauseClean",
29096
+ "dockWash",
29097
+ "autoEmpty",
29098
+ "flashOn",
29099
+ "flashOff"
29100
+ ]);
29101
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29102
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29103
+ /**
29104
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29105
+ * native panel and the PTZ mimic render as a button.
29106
+ *
29107
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29108
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29109
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29110
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29111
+ * - `label` — operator-facing English label.
29112
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29113
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29114
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29115
+ * flips it from config, never by editing code.
29116
+ */
29117
+ var NavigationActionEntrySchema = object({
29118
+ id: string(),
29119
+ kind: NavigationEntryKindSchema,
29120
+ label: string(),
29121
+ icon: string(),
29122
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29123
+ soundId: number().int().optional(),
29124
+ /** Per-device feature flag — render this entry only when true. */
29125
+ enabled: boolean()
29126
+ });
29127
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29128
+ var NavigationPointSchema = object({
29129
+ x: number(),
29130
+ y: number()
29131
+ });
29132
+ /**
29133
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29134
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29135
+ * that are turned on for THIS device. Data-driven: the provider derives these
29136
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29137
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29138
+ * that are not dictionary entries.
29139
+ *
29140
+ * - `move` / `stop` — the momentary drive joystick.
29141
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29142
+ * map-coordinate plumbing is wired.
29143
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29144
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29145
+ * - `light` — the on/off fill-light toggle (works anytime).
29146
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29147
+ * camera-service control; needs an active stream).
29148
+ */
29149
+ var NavigationFeaturesSchema = object({
29150
+ move: boolean(),
29151
+ stop: boolean(),
29152
+ goToPoint: boolean(),
29153
+ runAction: boolean(),
29154
+ playSound: boolean(),
29155
+ light: boolean(),
29156
+ lightMode: boolean()
29157
+ });
29158
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29159
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29160
+ /**
29161
+ * Live navigation state so the UI can reflect what the robot is doing:
29162
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29163
+ * - `following` — person/pet follow is currently armed.
29164
+ * - `flash` — the on-camera fill light is on.
29165
+ * - `lightMode` — auto vs manual fill-light mode.
29166
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29167
+ * `lightMode === 'manual'`.
29168
+ */
29169
+ var NavigationStatusSchema = object({
29170
+ mode: _enum([
29171
+ "idle",
29172
+ "cleaning",
29173
+ "spot",
29174
+ "following",
29175
+ "goto",
29176
+ "returning",
29177
+ "paused",
29178
+ "unknown"
29179
+ ]),
29180
+ following: boolean(),
29181
+ flash: boolean(),
29182
+ lightMode: NavigationLightModeSchema,
29183
+ lightLevel: number().min(40).max(100),
29184
+ /** Ms epoch when the slice was last updated. */
29185
+ lastChangedAt: number()
29186
+ });
29187
+ /**
29188
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29189
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29190
+ * convention.
29191
+ */
29192
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29193
+ var navigationCapability = {
29194
+ name: "navigation",
29195
+ scope: "device",
29196
+ deviceNative: true,
29197
+ mode: "singleton",
29198
+ deviceTypes: [DeviceType.Camera],
29199
+ deviceConfig: { ui: {
29200
+ kind: "widget",
29201
+ widgetId: "host/navigation-panel",
29202
+ tab: "navigation",
29203
+ topTab: true,
29204
+ label: "Navigation",
29205
+ order: 0
29206
+ } },
29207
+ methods: {
29208
+ /**
29209
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29210
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29211
+ * path) works for any authenticated user, not admin-only. The UI sends
29212
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29213
+ * a single drive write WITHOUT debouncing.
29214
+ */
29215
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29216
+ /** Halt all motion immediately (zero drive vector). */
29217
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29218
+ /** Send the robot to a point on its live map. */
29219
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29220
+ /**
29221
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29222
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29223
+ */
29224
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29225
+ /**
29226
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29227
+ * unsupported action ids are rejected by the provider.
29228
+ */
29229
+ runAction: method(object({
29230
+ deviceId: number(),
29231
+ actionId: NavigationActionIdSchema
29232
+ }), _void(), { kind: "mutation" }),
29233
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29234
+ playSound: method(object({
29235
+ deviceId: number(),
29236
+ soundId: number().int()
29237
+ }), _void(), { kind: "mutation" }),
29238
+ /**
29239
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29240
+ * works anytime, no active stream required).
29241
+ */
29242
+ setLightOn: method(object({
29243
+ deviceId: number(),
29244
+ on: boolean()
29245
+ }), _void(), { kind: "mutation" }),
29246
+ /**
29247
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29248
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29249
+ * action that generally needs an active camera stream/monitor session — the
29250
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29251
+ */
29252
+ setLightMode: method(object({
29253
+ deviceId: number(),
29254
+ mode: NavigationLightModeSchema,
29255
+ level: number().min(40).max(100).optional()
29256
+ }), _void(), { kind: "mutation" }),
29257
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29258
+ setLightLevel: method(object({
29259
+ deviceId: number(),
29260
+ level: number().min(40).max(100)
29261
+ }), _void(), { kind: "mutation" }),
29262
+ /**
29263
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29264
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29265
+ * `listActions`).
29266
+ */
29267
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29268
+ },
29269
+ events: { onStatusChanged: { data: object({
29270
+ deviceId: number(),
29271
+ status: NavigationStatusSchema
29272
+ }) } },
29273
+ status: {
29274
+ schema: NavigationStatusSchema,
29275
+ kind: "push"
29276
+ },
29277
+ /**
29278
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29279
+ * for live mode / follow / flash changes.
29280
+ */
29281
+ runtimeState: NavigationRuntimeStateSchema,
29282
+ /**
29283
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29284
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29285
+ * that. The live handle re-publishes on connect.
29286
+ *
29287
+ * See `RuntimeStateDurability`. Enforced by
29288
+ * `scripts/check-runtime-state-durability.ts`.
29289
+ */
29290
+ durability: "session"
29291
+ };
29011
29292
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29012
29293
  kind: "mutation",
29013
29294
  auth: "admin"
@@ -32283,6 +32564,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32283
32564
  motionTrigger: motionTriggerCapability,
32284
32565
  motionZones: motionZonesCapability,
32285
32566
  nativeObjectDetection: nativeObjectDetectionCapability,
32567
+ navigation: navigationCapability,
32286
32568
  networkLink: networkLinkCapability,
32287
32569
  notifier: notifierCapability,
32288
32570
  numericSensor: numericSensorCapability,
@@ -36137,6 +36419,66 @@ Object.freeze({
36137
36419
  addonId: null,
36138
36420
  access: "create"
36139
36421
  },
36422
+ "navigation.getFeatures": {
36423
+ capName: "navigation",
36424
+ capScope: "device",
36425
+ addonId: null,
36426
+ access: "view"
36427
+ },
36428
+ "navigation.goToPoint": {
36429
+ capName: "navigation",
36430
+ capScope: "device",
36431
+ addonId: null,
36432
+ access: "create"
36433
+ },
36434
+ "navigation.listActions": {
36435
+ capName: "navigation",
36436
+ capScope: "device",
36437
+ addonId: null,
36438
+ access: "view"
36439
+ },
36440
+ "navigation.move": {
36441
+ capName: "navigation",
36442
+ capScope: "device",
36443
+ addonId: null,
36444
+ access: "create"
36445
+ },
36446
+ "navigation.playSound": {
36447
+ capName: "navigation",
36448
+ capScope: "device",
36449
+ addonId: null,
36450
+ access: "create"
36451
+ },
36452
+ "navigation.runAction": {
36453
+ capName: "navigation",
36454
+ capScope: "device",
36455
+ addonId: null,
36456
+ access: "create"
36457
+ },
36458
+ "navigation.setLightLevel": {
36459
+ capName: "navigation",
36460
+ capScope: "device",
36461
+ addonId: null,
36462
+ access: "create"
36463
+ },
36464
+ "navigation.setLightMode": {
36465
+ capName: "navigation",
36466
+ capScope: "device",
36467
+ addonId: null,
36468
+ access: "create"
36469
+ },
36470
+ "navigation.setLightOn": {
36471
+ capName: "navigation",
36472
+ capScope: "device",
36473
+ addonId: null,
36474
+ access: "create"
36475
+ },
36476
+ "navigation.stop": {
36477
+ capName: "navigation",
36478
+ capScope: "device",
36479
+ addonId: null,
36480
+ access: "create"
36481
+ },
36140
36482
  "networkAccess.getEndpoint": {
36141
36483
  capName: "network-access",
36142
36484
  capScope: "system",
@@ -40232,6 +40574,56 @@ Object.freeze({
40232
40574
  form: "single",
40233
40575
  optional: false
40234
40576
  }],
40577
+ "navigation.getFeatures": [{
40578
+ name: "deviceId",
40579
+ form: "single",
40580
+ optional: false
40581
+ }],
40582
+ "navigation.goToPoint": [{
40583
+ name: "deviceId",
40584
+ form: "single",
40585
+ optional: false
40586
+ }],
40587
+ "navigation.listActions": [{
40588
+ name: "deviceId",
40589
+ form: "single",
40590
+ optional: false
40591
+ }],
40592
+ "navigation.move": [{
40593
+ name: "deviceId",
40594
+ form: "single",
40595
+ optional: false
40596
+ }],
40597
+ "navigation.playSound": [{
40598
+ name: "deviceId",
40599
+ form: "single",
40600
+ optional: false
40601
+ }],
40602
+ "navigation.runAction": [{
40603
+ name: "deviceId",
40604
+ form: "single",
40605
+ optional: false
40606
+ }],
40607
+ "navigation.setLightLevel": [{
40608
+ name: "deviceId",
40609
+ form: "single",
40610
+ optional: false
40611
+ }],
40612
+ "navigation.setLightMode": [{
40613
+ name: "deviceId",
40614
+ form: "single",
40615
+ optional: false
40616
+ }],
40617
+ "navigation.setLightOn": [{
40618
+ name: "deviceId",
40619
+ form: "single",
40620
+ optional: false
40621
+ }],
40622
+ "navigation.stop": [{
40623
+ name: "deviceId",
40624
+ form: "single",
40625
+ optional: false
40626
+ }],
40235
40627
  "networkQuality.getDeviceStats": [{
40236
40628
  name: "deviceId",
40237
40629
  form: "single",
package/dist/addon.mjs CHANGED
@@ -29009,6 +29009,287 @@ var ptzAutotrackCapability = {
29009
29009
  */
29010
29010
  durability: "session"
29011
29011
  };
29012
+ /**
29013
+ * `navigation` — a device-scoped capability that natively expresses the FULL
29014
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
29015
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
29016
+ *
29017
+ * Why a NEW cap rather than overloading `ptz`:
29018
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29019
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29020
+ * The two are different physical models: PTZ is absolute-position + presets,
29021
+ * navigation is momentary drive nudges + discrete robot ACTIONS
29022
+ * (dock / spot-clean / follow-pet / go-to-point / …).
29023
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29024
+ * the reverse:
29025
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
29026
+ * / `getOptions`), and
29027
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29028
+ * robot camera shows up in the existing PTZ control path without every
29029
+ * PTZ provider learning about robots. The mapping lives in the adapter,
29030
+ * not here (see the addon design note):
29031
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29032
+ * ptz.stop() → navigation.stop()
29033
+ * ptz.goHome() → navigation.runAction('goHome')
29034
+ * ptz.getPresets() → navigation.listActions() (id→preset)
29035
+ * ptz.goToPreset(id) → navigation.runAction(id)
29036
+ *
29037
+ * ## Continuous drive
29038
+ *
29039
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29040
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29041
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29042
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29043
+ * coalesce them. The UI owns the cadence.
29044
+ *
29045
+ * ## The action dictionary
29046
+ *
29047
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29048
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29049
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29050
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29051
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29052
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29053
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29054
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29055
+ *
29056
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29057
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29058
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29059
+ * every device handle. A future nodedreame publish adds a typed
29060
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29061
+ * provider can then swap the raw calls for the typed methods with no change to
29062
+ * THIS contract.
29063
+ */
29064
+ /**
29065
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29066
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29067
+ * halts it.
29068
+ *
29069
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29070
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29071
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29072
+ * vector by it (drivers without proportional drive ignore it).
29073
+ *
29074
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29075
+ * axis alone; an all-undefined nudge is a no-op.
29076
+ */
29077
+ var NavigationMoveCommandSchema = object({
29078
+ pan: number().min(-1).max(1).optional(),
29079
+ tilt: number().min(-1).max(1).optional(),
29080
+ speed: number().min(0).max(1).optional()
29081
+ });
29082
+ /**
29083
+ * The enumerated discrete actions a navigation-capable robot can perform via
29084
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29085
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29086
+ * `playSound` (see the `sound` dictionary entries).
29087
+ */
29088
+ var NavigationActionIdSchema = _enum([
29089
+ "goHome",
29090
+ "locate",
29091
+ "spotClean",
29092
+ "findPet",
29093
+ "personFollow",
29094
+ "stop",
29095
+ "startClean",
29096
+ "pauseClean",
29097
+ "dockWash",
29098
+ "autoEmpty",
29099
+ "flashOn",
29100
+ "flashOff"
29101
+ ]);
29102
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29103
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29104
+ /**
29105
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29106
+ * native panel and the PTZ mimic render as a button.
29107
+ *
29108
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29109
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29110
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29111
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29112
+ * - `label` — operator-facing English label.
29113
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29114
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29115
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29116
+ * flips it from config, never by editing code.
29117
+ */
29118
+ var NavigationActionEntrySchema = object({
29119
+ id: string(),
29120
+ kind: NavigationEntryKindSchema,
29121
+ label: string(),
29122
+ icon: string(),
29123
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29124
+ soundId: number().int().optional(),
29125
+ /** Per-device feature flag — render this entry only when true. */
29126
+ enabled: boolean()
29127
+ });
29128
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29129
+ var NavigationPointSchema = object({
29130
+ x: number(),
29131
+ y: number()
29132
+ });
29133
+ /**
29134
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29135
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29136
+ * that are turned on for THIS device. Data-driven: the provider derives these
29137
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29138
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29139
+ * that are not dictionary entries.
29140
+ *
29141
+ * - `move` / `stop` — the momentary drive joystick.
29142
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29143
+ * map-coordinate plumbing is wired.
29144
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29145
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29146
+ * - `light` — the on/off fill-light toggle (works anytime).
29147
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29148
+ * camera-service control; needs an active stream).
29149
+ */
29150
+ var NavigationFeaturesSchema = object({
29151
+ move: boolean(),
29152
+ stop: boolean(),
29153
+ goToPoint: boolean(),
29154
+ runAction: boolean(),
29155
+ playSound: boolean(),
29156
+ light: boolean(),
29157
+ lightMode: boolean()
29158
+ });
29159
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29160
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29161
+ /**
29162
+ * Live navigation state so the UI can reflect what the robot is doing:
29163
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29164
+ * - `following` — person/pet follow is currently armed.
29165
+ * - `flash` — the on-camera fill light is on.
29166
+ * - `lightMode` — auto vs manual fill-light mode.
29167
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29168
+ * `lightMode === 'manual'`.
29169
+ */
29170
+ var NavigationStatusSchema = object({
29171
+ mode: _enum([
29172
+ "idle",
29173
+ "cleaning",
29174
+ "spot",
29175
+ "following",
29176
+ "goto",
29177
+ "returning",
29178
+ "paused",
29179
+ "unknown"
29180
+ ]),
29181
+ following: boolean(),
29182
+ flash: boolean(),
29183
+ lightMode: NavigationLightModeSchema,
29184
+ lightLevel: number().min(40).max(100),
29185
+ /** Ms epoch when the slice was last updated. */
29186
+ lastChangedAt: number()
29187
+ });
29188
+ /**
29189
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29190
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29191
+ * convention.
29192
+ */
29193
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29194
+ var navigationCapability = {
29195
+ name: "navigation",
29196
+ scope: "device",
29197
+ deviceNative: true,
29198
+ mode: "singleton",
29199
+ deviceTypes: [DeviceType.Camera],
29200
+ deviceConfig: { ui: {
29201
+ kind: "widget",
29202
+ widgetId: "host/navigation-panel",
29203
+ tab: "navigation",
29204
+ topTab: true,
29205
+ label: "Navigation",
29206
+ order: 0
29207
+ } },
29208
+ methods: {
29209
+ /**
29210
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29211
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29212
+ * path) works for any authenticated user, not admin-only. The UI sends
29213
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29214
+ * a single drive write WITHOUT debouncing.
29215
+ */
29216
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29217
+ /** Halt all motion immediately (zero drive vector). */
29218
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29219
+ /** Send the robot to a point on its live map. */
29220
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29221
+ /**
29222
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29223
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29224
+ */
29225
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29226
+ /**
29227
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29228
+ * unsupported action ids are rejected by the provider.
29229
+ */
29230
+ runAction: method(object({
29231
+ deviceId: number(),
29232
+ actionId: NavigationActionIdSchema
29233
+ }), _void(), { kind: "mutation" }),
29234
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29235
+ playSound: method(object({
29236
+ deviceId: number(),
29237
+ soundId: number().int()
29238
+ }), _void(), { kind: "mutation" }),
29239
+ /**
29240
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29241
+ * works anytime, no active stream required).
29242
+ */
29243
+ setLightOn: method(object({
29244
+ deviceId: number(),
29245
+ on: boolean()
29246
+ }), _void(), { kind: "mutation" }),
29247
+ /**
29248
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29249
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29250
+ * action that generally needs an active camera stream/monitor session — the
29251
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29252
+ */
29253
+ setLightMode: method(object({
29254
+ deviceId: number(),
29255
+ mode: NavigationLightModeSchema,
29256
+ level: number().min(40).max(100).optional()
29257
+ }), _void(), { kind: "mutation" }),
29258
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29259
+ setLightLevel: method(object({
29260
+ deviceId: number(),
29261
+ level: number().min(40).max(100)
29262
+ }), _void(), { kind: "mutation" }),
29263
+ /**
29264
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29265
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29266
+ * `listActions`).
29267
+ */
29268
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29269
+ },
29270
+ events: { onStatusChanged: { data: object({
29271
+ deviceId: number(),
29272
+ status: NavigationStatusSchema
29273
+ }) } },
29274
+ status: {
29275
+ schema: NavigationStatusSchema,
29276
+ kind: "push"
29277
+ },
29278
+ /**
29279
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29280
+ * for live mode / follow / flash changes.
29281
+ */
29282
+ runtimeState: NavigationRuntimeStateSchema,
29283
+ /**
29284
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29285
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29286
+ * that. The live handle re-publishes on connect.
29287
+ *
29288
+ * See `RuntimeStateDurability`. Enforced by
29289
+ * `scripts/check-runtime-state-durability.ts`.
29290
+ */
29291
+ durability: "session"
29292
+ };
29012
29293
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29013
29294
  kind: "mutation",
29014
29295
  auth: "admin"
@@ -32284,6 +32565,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32284
32565
  motionTrigger: motionTriggerCapability,
32285
32566
  motionZones: motionZonesCapability,
32286
32567
  nativeObjectDetection: nativeObjectDetectionCapability,
32568
+ navigation: navigationCapability,
32287
32569
  networkLink: networkLinkCapability,
32288
32570
  notifier: notifierCapability,
32289
32571
  numericSensor: numericSensorCapability,
@@ -36138,6 +36420,66 @@ Object.freeze({
36138
36420
  addonId: null,
36139
36421
  access: "create"
36140
36422
  },
36423
+ "navigation.getFeatures": {
36424
+ capName: "navigation",
36425
+ capScope: "device",
36426
+ addonId: null,
36427
+ access: "view"
36428
+ },
36429
+ "navigation.goToPoint": {
36430
+ capName: "navigation",
36431
+ capScope: "device",
36432
+ addonId: null,
36433
+ access: "create"
36434
+ },
36435
+ "navigation.listActions": {
36436
+ capName: "navigation",
36437
+ capScope: "device",
36438
+ addonId: null,
36439
+ access: "view"
36440
+ },
36441
+ "navigation.move": {
36442
+ capName: "navigation",
36443
+ capScope: "device",
36444
+ addonId: null,
36445
+ access: "create"
36446
+ },
36447
+ "navigation.playSound": {
36448
+ capName: "navigation",
36449
+ capScope: "device",
36450
+ addonId: null,
36451
+ access: "create"
36452
+ },
36453
+ "navigation.runAction": {
36454
+ capName: "navigation",
36455
+ capScope: "device",
36456
+ addonId: null,
36457
+ access: "create"
36458
+ },
36459
+ "navigation.setLightLevel": {
36460
+ capName: "navigation",
36461
+ capScope: "device",
36462
+ addonId: null,
36463
+ access: "create"
36464
+ },
36465
+ "navigation.setLightMode": {
36466
+ capName: "navigation",
36467
+ capScope: "device",
36468
+ addonId: null,
36469
+ access: "create"
36470
+ },
36471
+ "navigation.setLightOn": {
36472
+ capName: "navigation",
36473
+ capScope: "device",
36474
+ addonId: null,
36475
+ access: "create"
36476
+ },
36477
+ "navigation.stop": {
36478
+ capName: "navigation",
36479
+ capScope: "device",
36480
+ addonId: null,
36481
+ access: "create"
36482
+ },
36141
36483
  "networkAccess.getEndpoint": {
36142
36484
  capName: "network-access",
36143
36485
  capScope: "system",
@@ -40233,6 +40575,56 @@ Object.freeze({
40233
40575
  form: "single",
40234
40576
  optional: false
40235
40577
  }],
40578
+ "navigation.getFeatures": [{
40579
+ name: "deviceId",
40580
+ form: "single",
40581
+ optional: false
40582
+ }],
40583
+ "navigation.goToPoint": [{
40584
+ name: "deviceId",
40585
+ form: "single",
40586
+ optional: false
40587
+ }],
40588
+ "navigation.listActions": [{
40589
+ name: "deviceId",
40590
+ form: "single",
40591
+ optional: false
40592
+ }],
40593
+ "navigation.move": [{
40594
+ name: "deviceId",
40595
+ form: "single",
40596
+ optional: false
40597
+ }],
40598
+ "navigation.playSound": [{
40599
+ name: "deviceId",
40600
+ form: "single",
40601
+ optional: false
40602
+ }],
40603
+ "navigation.runAction": [{
40604
+ name: "deviceId",
40605
+ form: "single",
40606
+ optional: false
40607
+ }],
40608
+ "navigation.setLightLevel": [{
40609
+ name: "deviceId",
40610
+ form: "single",
40611
+ optional: false
40612
+ }],
40613
+ "navigation.setLightMode": [{
40614
+ name: "deviceId",
40615
+ form: "single",
40616
+ optional: false
40617
+ }],
40618
+ "navigation.setLightOn": [{
40619
+ name: "deviceId",
40620
+ form: "single",
40621
+ optional: false
40622
+ }],
40623
+ "navigation.stop": [{
40624
+ name: "deviceId",
40625
+ form: "single",
40626
+ optional: false
40627
+ }],
40236
40628
  "networkQuality.getDeviceStats": [{
40237
40629
  name: "deviceId",
40238
40630
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-dreo",
3
- "version": "0.2.70",
3
+ "version": "0.2.71",
4
4
  "description": "Dreo smart-device (fan / air-circulator / purifier / heater / humidifier) device-provider addon for CamStack — wraps the @apocaliss92/nodedreo Dreo cloud client (REST + WebSocket)",
5
5
  "keywords": [
6
6
  "camstack",