@camstack/addon-provider-wyze 0.2.74 → 0.2.76

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
@@ -5438,6 +5438,12 @@ Object.fromEntries([
5438
5438
  icon: "move",
5439
5439
  order: 40
5440
5440
  },
5441
+ {
5442
+ id: "navigation",
5443
+ label: "Navigation",
5444
+ icon: "compass",
5445
+ order: 41
5446
+ },
5441
5447
  {
5442
5448
  id: "consumables",
5443
5449
  label: "Consumables",
@@ -29108,6 +29114,287 @@ var ptzAutotrackCapability = {
29108
29114
  */
29109
29115
  durability: "session"
29110
29116
  };
29117
+ /**
29118
+ * `navigation` — a device-scoped capability that natively expresses the FULL
29119
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
29120
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
29121
+ *
29122
+ * Why a NEW cap rather than overloading `ptz`:
29123
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29124
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29125
+ * The two are different physical models: PTZ is absolute-position + presets,
29126
+ * navigation is momentary drive nudges + discrete robot ACTIONS
29127
+ * (dock / spot-clean / follow-pet / go-to-point / …).
29128
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29129
+ * the reverse:
29130
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
29131
+ * / `getOptions`), and
29132
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29133
+ * robot camera shows up in the existing PTZ control path without every
29134
+ * PTZ provider learning about robots. The mapping lives in the adapter,
29135
+ * not here (see the addon design note):
29136
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29137
+ * ptz.stop() → navigation.stop()
29138
+ * ptz.goHome() → navigation.runAction('goHome')
29139
+ * ptz.getPresets() → navigation.listActions() (id→preset)
29140
+ * ptz.goToPreset(id) → navigation.runAction(id)
29141
+ *
29142
+ * ## Continuous drive
29143
+ *
29144
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29145
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29146
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29147
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29148
+ * coalesce them. The UI owns the cadence.
29149
+ *
29150
+ * ## The action dictionary
29151
+ *
29152
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29153
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29154
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29155
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29156
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29157
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29158
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29159
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29160
+ *
29161
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29162
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29163
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29164
+ * every device handle. A future nodedreame publish adds a typed
29165
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29166
+ * provider can then swap the raw calls for the typed methods with no change to
29167
+ * THIS contract.
29168
+ */
29169
+ /**
29170
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29171
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29172
+ * halts it.
29173
+ *
29174
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29175
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29176
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29177
+ * vector by it (drivers without proportional drive ignore it).
29178
+ *
29179
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29180
+ * axis alone; an all-undefined nudge is a no-op.
29181
+ */
29182
+ var NavigationMoveCommandSchema = object({
29183
+ pan: number().min(-1).max(1).optional(),
29184
+ tilt: number().min(-1).max(1).optional(),
29185
+ speed: number().min(0).max(1).optional()
29186
+ });
29187
+ /**
29188
+ * The enumerated discrete actions a navigation-capable robot can perform via
29189
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29190
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29191
+ * `playSound` (see the `sound` dictionary entries).
29192
+ */
29193
+ var NavigationActionIdSchema = _enum([
29194
+ "goHome",
29195
+ "locate",
29196
+ "spotClean",
29197
+ "findPet",
29198
+ "personFollow",
29199
+ "stop",
29200
+ "startClean",
29201
+ "pauseClean",
29202
+ "dockWash",
29203
+ "autoEmpty",
29204
+ "flashOn",
29205
+ "flashOff"
29206
+ ]);
29207
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29208
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29209
+ /**
29210
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29211
+ * native panel and the PTZ mimic render as a button.
29212
+ *
29213
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29214
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29215
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29216
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29217
+ * - `label` — operator-facing English label.
29218
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29219
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29220
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29221
+ * flips it from config, never by editing code.
29222
+ */
29223
+ var NavigationActionEntrySchema = object({
29224
+ id: string(),
29225
+ kind: NavigationEntryKindSchema,
29226
+ label: string(),
29227
+ icon: string(),
29228
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29229
+ soundId: number().int().optional(),
29230
+ /** Per-device feature flag — render this entry only when true. */
29231
+ enabled: boolean()
29232
+ });
29233
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29234
+ var NavigationPointSchema = object({
29235
+ x: number(),
29236
+ y: number()
29237
+ });
29238
+ /**
29239
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29240
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29241
+ * that are turned on for THIS device. Data-driven: the provider derives these
29242
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29243
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29244
+ * that are not dictionary entries.
29245
+ *
29246
+ * - `move` / `stop` — the momentary drive joystick.
29247
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29248
+ * map-coordinate plumbing is wired.
29249
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29250
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29251
+ * - `light` — the on/off fill-light toggle (works anytime).
29252
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29253
+ * camera-service control; needs an active stream).
29254
+ */
29255
+ var NavigationFeaturesSchema = object({
29256
+ move: boolean(),
29257
+ stop: boolean(),
29258
+ goToPoint: boolean(),
29259
+ runAction: boolean(),
29260
+ playSound: boolean(),
29261
+ light: boolean(),
29262
+ lightMode: boolean()
29263
+ });
29264
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29265
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29266
+ /**
29267
+ * Live navigation state so the UI can reflect what the robot is doing:
29268
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29269
+ * - `following` — person/pet follow is currently armed.
29270
+ * - `flash` — the on-camera fill light is on.
29271
+ * - `lightMode` — auto vs manual fill-light mode.
29272
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29273
+ * `lightMode === 'manual'`.
29274
+ */
29275
+ var NavigationStatusSchema = object({
29276
+ mode: _enum([
29277
+ "idle",
29278
+ "cleaning",
29279
+ "spot",
29280
+ "following",
29281
+ "goto",
29282
+ "returning",
29283
+ "paused",
29284
+ "unknown"
29285
+ ]),
29286
+ following: boolean(),
29287
+ flash: boolean(),
29288
+ lightMode: NavigationLightModeSchema,
29289
+ lightLevel: number().min(40).max(100),
29290
+ /** Ms epoch when the slice was last updated. */
29291
+ lastChangedAt: number()
29292
+ });
29293
+ /**
29294
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29295
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29296
+ * convention.
29297
+ */
29298
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29299
+ var navigationCapability = {
29300
+ name: "navigation",
29301
+ scope: "device",
29302
+ deviceNative: true,
29303
+ mode: "singleton",
29304
+ deviceTypes: [DeviceType.Camera],
29305
+ deviceConfig: { ui: {
29306
+ kind: "widget",
29307
+ widgetId: "host/navigation-panel",
29308
+ tab: "navigation",
29309
+ topTab: true,
29310
+ label: "Navigation",
29311
+ order: 0
29312
+ } },
29313
+ methods: {
29314
+ /**
29315
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29316
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29317
+ * path) works for any authenticated user, not admin-only. The UI sends
29318
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29319
+ * a single drive write WITHOUT debouncing.
29320
+ */
29321
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29322
+ /** Halt all motion immediately (zero drive vector). */
29323
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29324
+ /** Send the robot to a point on its live map. */
29325
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29326
+ /**
29327
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29328
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29329
+ */
29330
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29331
+ /**
29332
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29333
+ * unsupported action ids are rejected by the provider.
29334
+ */
29335
+ runAction: method(object({
29336
+ deviceId: number(),
29337
+ actionId: NavigationActionIdSchema
29338
+ }), _void(), { kind: "mutation" }),
29339
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29340
+ playSound: method(object({
29341
+ deviceId: number(),
29342
+ soundId: number().int()
29343
+ }), _void(), { kind: "mutation" }),
29344
+ /**
29345
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29346
+ * works anytime, no active stream required).
29347
+ */
29348
+ setLightOn: method(object({
29349
+ deviceId: number(),
29350
+ on: boolean()
29351
+ }), _void(), { kind: "mutation" }),
29352
+ /**
29353
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29354
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29355
+ * action that generally needs an active camera stream/monitor session — the
29356
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29357
+ */
29358
+ setLightMode: method(object({
29359
+ deviceId: number(),
29360
+ mode: NavigationLightModeSchema,
29361
+ level: number().min(40).max(100).optional()
29362
+ }), _void(), { kind: "mutation" }),
29363
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29364
+ setLightLevel: method(object({
29365
+ deviceId: number(),
29366
+ level: number().min(40).max(100)
29367
+ }), _void(), { kind: "mutation" }),
29368
+ /**
29369
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29370
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29371
+ * `listActions`).
29372
+ */
29373
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29374
+ },
29375
+ events: { onStatusChanged: { data: object({
29376
+ deviceId: number(),
29377
+ status: NavigationStatusSchema
29378
+ }) } },
29379
+ status: {
29380
+ schema: NavigationStatusSchema,
29381
+ kind: "push"
29382
+ },
29383
+ /**
29384
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29385
+ * for live mode / follow / flash changes.
29386
+ */
29387
+ runtimeState: NavigationRuntimeStateSchema,
29388
+ /**
29389
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29390
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29391
+ * that. The live handle re-publishes on connect.
29392
+ *
29393
+ * See `RuntimeStateDurability`. Enforced by
29394
+ * `scripts/check-runtime-state-durability.ts`.
29395
+ */
29396
+ durability: "session"
29397
+ };
29111
29398
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29112
29399
  kind: "mutation",
29113
29400
  auth: "admin"
@@ -32383,6 +32670,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32383
32670
  motionTrigger: motionTriggerCapability,
32384
32671
  motionZones: motionZonesCapability,
32385
32672
  nativeObjectDetection: nativeObjectDetectionCapability,
32673
+ navigation: navigationCapability,
32386
32674
  networkLink: networkLinkCapability,
32387
32675
  notifier: notifierCapability,
32388
32676
  numericSensor: numericSensorCapability,
@@ -36237,6 +36525,66 @@ Object.freeze({
36237
36525
  addonId: null,
36238
36526
  access: "create"
36239
36527
  },
36528
+ "navigation.getFeatures": {
36529
+ capName: "navigation",
36530
+ capScope: "device",
36531
+ addonId: null,
36532
+ access: "view"
36533
+ },
36534
+ "navigation.goToPoint": {
36535
+ capName: "navigation",
36536
+ capScope: "device",
36537
+ addonId: null,
36538
+ access: "create"
36539
+ },
36540
+ "navigation.listActions": {
36541
+ capName: "navigation",
36542
+ capScope: "device",
36543
+ addonId: null,
36544
+ access: "view"
36545
+ },
36546
+ "navigation.move": {
36547
+ capName: "navigation",
36548
+ capScope: "device",
36549
+ addonId: null,
36550
+ access: "create"
36551
+ },
36552
+ "navigation.playSound": {
36553
+ capName: "navigation",
36554
+ capScope: "device",
36555
+ addonId: null,
36556
+ access: "create"
36557
+ },
36558
+ "navigation.runAction": {
36559
+ capName: "navigation",
36560
+ capScope: "device",
36561
+ addonId: null,
36562
+ access: "create"
36563
+ },
36564
+ "navigation.setLightLevel": {
36565
+ capName: "navigation",
36566
+ capScope: "device",
36567
+ addonId: null,
36568
+ access: "create"
36569
+ },
36570
+ "navigation.setLightMode": {
36571
+ capName: "navigation",
36572
+ capScope: "device",
36573
+ addonId: null,
36574
+ access: "create"
36575
+ },
36576
+ "navigation.setLightOn": {
36577
+ capName: "navigation",
36578
+ capScope: "device",
36579
+ addonId: null,
36580
+ access: "create"
36581
+ },
36582
+ "navigation.stop": {
36583
+ capName: "navigation",
36584
+ capScope: "device",
36585
+ addonId: null,
36586
+ access: "create"
36587
+ },
36240
36588
  "networkAccess.getEndpoint": {
36241
36589
  capName: "network-access",
36242
36590
  capScope: "system",
@@ -40332,6 +40680,56 @@ Object.freeze({
40332
40680
  form: "single",
40333
40681
  optional: false
40334
40682
  }],
40683
+ "navigation.getFeatures": [{
40684
+ name: "deviceId",
40685
+ form: "single",
40686
+ optional: false
40687
+ }],
40688
+ "navigation.goToPoint": [{
40689
+ name: "deviceId",
40690
+ form: "single",
40691
+ optional: false
40692
+ }],
40693
+ "navigation.listActions": [{
40694
+ name: "deviceId",
40695
+ form: "single",
40696
+ optional: false
40697
+ }],
40698
+ "navigation.move": [{
40699
+ name: "deviceId",
40700
+ form: "single",
40701
+ optional: false
40702
+ }],
40703
+ "navigation.playSound": [{
40704
+ name: "deviceId",
40705
+ form: "single",
40706
+ optional: false
40707
+ }],
40708
+ "navigation.runAction": [{
40709
+ name: "deviceId",
40710
+ form: "single",
40711
+ optional: false
40712
+ }],
40713
+ "navigation.setLightLevel": [{
40714
+ name: "deviceId",
40715
+ form: "single",
40716
+ optional: false
40717
+ }],
40718
+ "navigation.setLightMode": [{
40719
+ name: "deviceId",
40720
+ form: "single",
40721
+ optional: false
40722
+ }],
40723
+ "navigation.setLightOn": [{
40724
+ name: "deviceId",
40725
+ form: "single",
40726
+ optional: false
40727
+ }],
40728
+ "navigation.stop": [{
40729
+ name: "deviceId",
40730
+ form: "single",
40731
+ optional: false
40732
+ }],
40335
40733
  "networkQuality.getDeviceStats": [{
40336
40734
  name: "deviceId",
40337
40735
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5417,6 +5417,12 @@ Object.fromEntries([
5417
5417
  icon: "move",
5418
5418
  order: 40
5419
5419
  },
5420
+ {
5421
+ id: "navigation",
5422
+ label: "Navigation",
5423
+ icon: "compass",
5424
+ order: 41
5425
+ },
5420
5426
  {
5421
5427
  id: "consumables",
5422
5428
  label: "Consumables",
@@ -29087,6 +29093,287 @@ var ptzAutotrackCapability = {
29087
29093
  */
29088
29094
  durability: "session"
29089
29095
  };
29096
+ /**
29097
+ * `navigation` — a device-scoped capability that natively expresses the FULL
29098
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
29099
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
29100
+ *
29101
+ * Why a NEW cap rather than overloading `ptz`:
29102
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29103
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29104
+ * The two are different physical models: PTZ is absolute-position + presets,
29105
+ * navigation is momentary drive nudges + discrete robot ACTIONS
29106
+ * (dock / spot-clean / follow-pet / go-to-point / …).
29107
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29108
+ * the reverse:
29109
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
29110
+ * / `getOptions`), and
29111
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29112
+ * robot camera shows up in the existing PTZ control path without every
29113
+ * PTZ provider learning about robots. The mapping lives in the adapter,
29114
+ * not here (see the addon design note):
29115
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29116
+ * ptz.stop() → navigation.stop()
29117
+ * ptz.goHome() → navigation.runAction('goHome')
29118
+ * ptz.getPresets() → navigation.listActions() (id→preset)
29119
+ * ptz.goToPreset(id) → navigation.runAction(id)
29120
+ *
29121
+ * ## Continuous drive
29122
+ *
29123
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29124
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29125
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29126
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29127
+ * coalesce them. The UI owns the cadence.
29128
+ *
29129
+ * ## The action dictionary
29130
+ *
29131
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29132
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29133
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29134
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29135
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29136
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29137
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29138
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29139
+ *
29140
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29141
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29142
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29143
+ * every device handle. A future nodedreame publish adds a typed
29144
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29145
+ * provider can then swap the raw calls for the typed methods with no change to
29146
+ * THIS contract.
29147
+ */
29148
+ /**
29149
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29150
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29151
+ * halts it.
29152
+ *
29153
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29154
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29155
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29156
+ * vector by it (drivers without proportional drive ignore it).
29157
+ *
29158
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29159
+ * axis alone; an all-undefined nudge is a no-op.
29160
+ */
29161
+ var NavigationMoveCommandSchema = object({
29162
+ pan: number().min(-1).max(1).optional(),
29163
+ tilt: number().min(-1).max(1).optional(),
29164
+ speed: number().min(0).max(1).optional()
29165
+ });
29166
+ /**
29167
+ * The enumerated discrete actions a navigation-capable robot can perform via
29168
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29169
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29170
+ * `playSound` (see the `sound` dictionary entries).
29171
+ */
29172
+ var NavigationActionIdSchema = _enum([
29173
+ "goHome",
29174
+ "locate",
29175
+ "spotClean",
29176
+ "findPet",
29177
+ "personFollow",
29178
+ "stop",
29179
+ "startClean",
29180
+ "pauseClean",
29181
+ "dockWash",
29182
+ "autoEmpty",
29183
+ "flashOn",
29184
+ "flashOff"
29185
+ ]);
29186
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29187
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29188
+ /**
29189
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29190
+ * native panel and the PTZ mimic render as a button.
29191
+ *
29192
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29193
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29194
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29195
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29196
+ * - `label` — operator-facing English label.
29197
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29198
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29199
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29200
+ * flips it from config, never by editing code.
29201
+ */
29202
+ var NavigationActionEntrySchema = object({
29203
+ id: string(),
29204
+ kind: NavigationEntryKindSchema,
29205
+ label: string(),
29206
+ icon: string(),
29207
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29208
+ soundId: number().int().optional(),
29209
+ /** Per-device feature flag — render this entry only when true. */
29210
+ enabled: boolean()
29211
+ });
29212
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29213
+ var NavigationPointSchema = object({
29214
+ x: number(),
29215
+ y: number()
29216
+ });
29217
+ /**
29218
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29219
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29220
+ * that are turned on for THIS device. Data-driven: the provider derives these
29221
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29222
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29223
+ * that are not dictionary entries.
29224
+ *
29225
+ * - `move` / `stop` — the momentary drive joystick.
29226
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29227
+ * map-coordinate plumbing is wired.
29228
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29229
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29230
+ * - `light` — the on/off fill-light toggle (works anytime).
29231
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29232
+ * camera-service control; needs an active stream).
29233
+ */
29234
+ var NavigationFeaturesSchema = object({
29235
+ move: boolean(),
29236
+ stop: boolean(),
29237
+ goToPoint: boolean(),
29238
+ runAction: boolean(),
29239
+ playSound: boolean(),
29240
+ light: boolean(),
29241
+ lightMode: boolean()
29242
+ });
29243
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29244
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29245
+ /**
29246
+ * Live navigation state so the UI can reflect what the robot is doing:
29247
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29248
+ * - `following` — person/pet follow is currently armed.
29249
+ * - `flash` — the on-camera fill light is on.
29250
+ * - `lightMode` — auto vs manual fill-light mode.
29251
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29252
+ * `lightMode === 'manual'`.
29253
+ */
29254
+ var NavigationStatusSchema = object({
29255
+ mode: _enum([
29256
+ "idle",
29257
+ "cleaning",
29258
+ "spot",
29259
+ "following",
29260
+ "goto",
29261
+ "returning",
29262
+ "paused",
29263
+ "unknown"
29264
+ ]),
29265
+ following: boolean(),
29266
+ flash: boolean(),
29267
+ lightMode: NavigationLightModeSchema,
29268
+ lightLevel: number().min(40).max(100),
29269
+ /** Ms epoch when the slice was last updated. */
29270
+ lastChangedAt: number()
29271
+ });
29272
+ /**
29273
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29274
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29275
+ * convention.
29276
+ */
29277
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29278
+ var navigationCapability = {
29279
+ name: "navigation",
29280
+ scope: "device",
29281
+ deviceNative: true,
29282
+ mode: "singleton",
29283
+ deviceTypes: [DeviceType.Camera],
29284
+ deviceConfig: { ui: {
29285
+ kind: "widget",
29286
+ widgetId: "host/navigation-panel",
29287
+ tab: "navigation",
29288
+ topTab: true,
29289
+ label: "Navigation",
29290
+ order: 0
29291
+ } },
29292
+ methods: {
29293
+ /**
29294
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29295
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29296
+ * path) works for any authenticated user, not admin-only. The UI sends
29297
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29298
+ * a single drive write WITHOUT debouncing.
29299
+ */
29300
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29301
+ /** Halt all motion immediately (zero drive vector). */
29302
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29303
+ /** Send the robot to a point on its live map. */
29304
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29305
+ /**
29306
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29307
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29308
+ */
29309
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29310
+ /**
29311
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29312
+ * unsupported action ids are rejected by the provider.
29313
+ */
29314
+ runAction: method(object({
29315
+ deviceId: number(),
29316
+ actionId: NavigationActionIdSchema
29317
+ }), _void(), { kind: "mutation" }),
29318
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29319
+ playSound: method(object({
29320
+ deviceId: number(),
29321
+ soundId: number().int()
29322
+ }), _void(), { kind: "mutation" }),
29323
+ /**
29324
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29325
+ * works anytime, no active stream required).
29326
+ */
29327
+ setLightOn: method(object({
29328
+ deviceId: number(),
29329
+ on: boolean()
29330
+ }), _void(), { kind: "mutation" }),
29331
+ /**
29332
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29333
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29334
+ * action that generally needs an active camera stream/monitor session — the
29335
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29336
+ */
29337
+ setLightMode: method(object({
29338
+ deviceId: number(),
29339
+ mode: NavigationLightModeSchema,
29340
+ level: number().min(40).max(100).optional()
29341
+ }), _void(), { kind: "mutation" }),
29342
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29343
+ setLightLevel: method(object({
29344
+ deviceId: number(),
29345
+ level: number().min(40).max(100)
29346
+ }), _void(), { kind: "mutation" }),
29347
+ /**
29348
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29349
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29350
+ * `listActions`).
29351
+ */
29352
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29353
+ },
29354
+ events: { onStatusChanged: { data: object({
29355
+ deviceId: number(),
29356
+ status: NavigationStatusSchema
29357
+ }) } },
29358
+ status: {
29359
+ schema: NavigationStatusSchema,
29360
+ kind: "push"
29361
+ },
29362
+ /**
29363
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29364
+ * for live mode / follow / flash changes.
29365
+ */
29366
+ runtimeState: NavigationRuntimeStateSchema,
29367
+ /**
29368
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29369
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29370
+ * that. The live handle re-publishes on connect.
29371
+ *
29372
+ * See `RuntimeStateDurability`. Enforced by
29373
+ * `scripts/check-runtime-state-durability.ts`.
29374
+ */
29375
+ durability: "session"
29376
+ };
29090
29377
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29091
29378
  kind: "mutation",
29092
29379
  auth: "admin"
@@ -32362,6 +32649,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32362
32649
  motionTrigger: motionTriggerCapability,
32363
32650
  motionZones: motionZonesCapability,
32364
32651
  nativeObjectDetection: nativeObjectDetectionCapability,
32652
+ navigation: navigationCapability,
32365
32653
  networkLink: networkLinkCapability,
32366
32654
  notifier: notifierCapability,
32367
32655
  numericSensor: numericSensorCapability,
@@ -36216,6 +36504,66 @@ Object.freeze({
36216
36504
  addonId: null,
36217
36505
  access: "create"
36218
36506
  },
36507
+ "navigation.getFeatures": {
36508
+ capName: "navigation",
36509
+ capScope: "device",
36510
+ addonId: null,
36511
+ access: "view"
36512
+ },
36513
+ "navigation.goToPoint": {
36514
+ capName: "navigation",
36515
+ capScope: "device",
36516
+ addonId: null,
36517
+ access: "create"
36518
+ },
36519
+ "navigation.listActions": {
36520
+ capName: "navigation",
36521
+ capScope: "device",
36522
+ addonId: null,
36523
+ access: "view"
36524
+ },
36525
+ "navigation.move": {
36526
+ capName: "navigation",
36527
+ capScope: "device",
36528
+ addonId: null,
36529
+ access: "create"
36530
+ },
36531
+ "navigation.playSound": {
36532
+ capName: "navigation",
36533
+ capScope: "device",
36534
+ addonId: null,
36535
+ access: "create"
36536
+ },
36537
+ "navigation.runAction": {
36538
+ capName: "navigation",
36539
+ capScope: "device",
36540
+ addonId: null,
36541
+ access: "create"
36542
+ },
36543
+ "navigation.setLightLevel": {
36544
+ capName: "navigation",
36545
+ capScope: "device",
36546
+ addonId: null,
36547
+ access: "create"
36548
+ },
36549
+ "navigation.setLightMode": {
36550
+ capName: "navigation",
36551
+ capScope: "device",
36552
+ addonId: null,
36553
+ access: "create"
36554
+ },
36555
+ "navigation.setLightOn": {
36556
+ capName: "navigation",
36557
+ capScope: "device",
36558
+ addonId: null,
36559
+ access: "create"
36560
+ },
36561
+ "navigation.stop": {
36562
+ capName: "navigation",
36563
+ capScope: "device",
36564
+ addonId: null,
36565
+ access: "create"
36566
+ },
36219
36567
  "networkAccess.getEndpoint": {
36220
36568
  capName: "network-access",
36221
36569
  capScope: "system",
@@ -40311,6 +40659,56 @@ Object.freeze({
40311
40659
  form: "single",
40312
40660
  optional: false
40313
40661
  }],
40662
+ "navigation.getFeatures": [{
40663
+ name: "deviceId",
40664
+ form: "single",
40665
+ optional: false
40666
+ }],
40667
+ "navigation.goToPoint": [{
40668
+ name: "deviceId",
40669
+ form: "single",
40670
+ optional: false
40671
+ }],
40672
+ "navigation.listActions": [{
40673
+ name: "deviceId",
40674
+ form: "single",
40675
+ optional: false
40676
+ }],
40677
+ "navigation.move": [{
40678
+ name: "deviceId",
40679
+ form: "single",
40680
+ optional: false
40681
+ }],
40682
+ "navigation.playSound": [{
40683
+ name: "deviceId",
40684
+ form: "single",
40685
+ optional: false
40686
+ }],
40687
+ "navigation.runAction": [{
40688
+ name: "deviceId",
40689
+ form: "single",
40690
+ optional: false
40691
+ }],
40692
+ "navigation.setLightLevel": [{
40693
+ name: "deviceId",
40694
+ form: "single",
40695
+ optional: false
40696
+ }],
40697
+ "navigation.setLightMode": [{
40698
+ name: "deviceId",
40699
+ form: "single",
40700
+ optional: false
40701
+ }],
40702
+ "navigation.setLightOn": [{
40703
+ name: "deviceId",
40704
+ form: "single",
40705
+ optional: false
40706
+ }],
40707
+ "navigation.stop": [{
40708
+ name: "deviceId",
40709
+ form: "single",
40710
+ optional: false
40711
+ }],
40314
40712
  "networkQuality.getDeviceStats": [{
40315
40713
  name: "deviceId",
40316
40714
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-wyze",
3
- "version": "0.2.74",
3
+ "version": "0.2.76",
4
4
  "description": "Wyze camera device-provider addon for CamStack — wraps the @apocaliss92/wyze-bridge-js P2P/DTLS client, feeding the stream-broker via the pull-rfc4571 lazy-publish path (a structural twin of addon-provider-reolink)",
5
5
  "keywords": [
6
6
  "camstack",