@camstack/addon-import-alexa 0.2.69 → 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
@@ -5445,6 +5445,12 @@ Object.fromEntries([
5445
5445
  icon: "move",
5446
5446
  order: 40
5447
5447
  },
5448
+ {
5449
+ id: "navigation",
5450
+ label: "Navigation",
5451
+ icon: "compass",
5452
+ order: 41
5453
+ },
5448
5454
  {
5449
5455
  id: "consumables",
5450
5456
  label: "Consumables",
@@ -29207,6 +29213,287 @@ var ptzAutotrackCapability = {
29207
29213
  */
29208
29214
  durability: "session"
29209
29215
  };
29216
+ /**
29217
+ * `navigation` — a device-scoped capability that natively expresses the FULL
29218
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
29219
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
29220
+ *
29221
+ * Why a NEW cap rather than overloading `ptz`:
29222
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29223
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29224
+ * The two are different physical models: PTZ is absolute-position + presets,
29225
+ * navigation is momentary drive nudges + discrete robot ACTIONS
29226
+ * (dock / spot-clean / follow-pet / go-to-point / …).
29227
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29228
+ * the reverse:
29229
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
29230
+ * / `getOptions`), and
29231
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29232
+ * robot camera shows up in the existing PTZ control path without every
29233
+ * PTZ provider learning about robots. The mapping lives in the adapter,
29234
+ * not here (see the addon design note):
29235
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29236
+ * ptz.stop() → navigation.stop()
29237
+ * ptz.goHome() → navigation.runAction('goHome')
29238
+ * ptz.getPresets() → navigation.listActions() (id→preset)
29239
+ * ptz.goToPreset(id) → navigation.runAction(id)
29240
+ *
29241
+ * ## Continuous drive
29242
+ *
29243
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29244
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29245
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29246
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29247
+ * coalesce them. The UI owns the cadence.
29248
+ *
29249
+ * ## The action dictionary
29250
+ *
29251
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29252
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29253
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29254
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29255
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29256
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29257
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29258
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29259
+ *
29260
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29261
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29262
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29263
+ * every device handle. A future nodedreame publish adds a typed
29264
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29265
+ * provider can then swap the raw calls for the typed methods with no change to
29266
+ * THIS contract.
29267
+ */
29268
+ /**
29269
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29270
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29271
+ * halts it.
29272
+ *
29273
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29274
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29275
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29276
+ * vector by it (drivers without proportional drive ignore it).
29277
+ *
29278
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29279
+ * axis alone; an all-undefined nudge is a no-op.
29280
+ */
29281
+ var NavigationMoveCommandSchema = object({
29282
+ pan: number().min(-1).max(1).optional(),
29283
+ tilt: number().min(-1).max(1).optional(),
29284
+ speed: number().min(0).max(1).optional()
29285
+ });
29286
+ /**
29287
+ * The enumerated discrete actions a navigation-capable robot can perform via
29288
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29289
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29290
+ * `playSound` (see the `sound` dictionary entries).
29291
+ */
29292
+ var NavigationActionIdSchema = _enum([
29293
+ "goHome",
29294
+ "locate",
29295
+ "spotClean",
29296
+ "findPet",
29297
+ "personFollow",
29298
+ "stop",
29299
+ "startClean",
29300
+ "pauseClean",
29301
+ "dockWash",
29302
+ "autoEmpty",
29303
+ "flashOn",
29304
+ "flashOff"
29305
+ ]);
29306
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29307
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29308
+ /**
29309
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29310
+ * native panel and the PTZ mimic render as a button.
29311
+ *
29312
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29313
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29314
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29315
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29316
+ * - `label` — operator-facing English label.
29317
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29318
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29319
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29320
+ * flips it from config, never by editing code.
29321
+ */
29322
+ var NavigationActionEntrySchema = object({
29323
+ id: string(),
29324
+ kind: NavigationEntryKindSchema,
29325
+ label: string(),
29326
+ icon: string(),
29327
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29328
+ soundId: number().int().optional(),
29329
+ /** Per-device feature flag — render this entry only when true. */
29330
+ enabled: boolean()
29331
+ });
29332
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29333
+ var NavigationPointSchema = object({
29334
+ x: number(),
29335
+ y: number()
29336
+ });
29337
+ /**
29338
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29339
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29340
+ * that are turned on for THIS device. Data-driven: the provider derives these
29341
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29342
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29343
+ * that are not dictionary entries.
29344
+ *
29345
+ * - `move` / `stop` — the momentary drive joystick.
29346
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29347
+ * map-coordinate plumbing is wired.
29348
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29349
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29350
+ * - `light` — the on/off fill-light toggle (works anytime).
29351
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29352
+ * camera-service control; needs an active stream).
29353
+ */
29354
+ var NavigationFeaturesSchema = object({
29355
+ move: boolean(),
29356
+ stop: boolean(),
29357
+ goToPoint: boolean(),
29358
+ runAction: boolean(),
29359
+ playSound: boolean(),
29360
+ light: boolean(),
29361
+ lightMode: boolean()
29362
+ });
29363
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29364
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29365
+ /**
29366
+ * Live navigation state so the UI can reflect what the robot is doing:
29367
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29368
+ * - `following` — person/pet follow is currently armed.
29369
+ * - `flash` — the on-camera fill light is on.
29370
+ * - `lightMode` — auto vs manual fill-light mode.
29371
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29372
+ * `lightMode === 'manual'`.
29373
+ */
29374
+ var NavigationStatusSchema = object({
29375
+ mode: _enum([
29376
+ "idle",
29377
+ "cleaning",
29378
+ "spot",
29379
+ "following",
29380
+ "goto",
29381
+ "returning",
29382
+ "paused",
29383
+ "unknown"
29384
+ ]),
29385
+ following: boolean(),
29386
+ flash: boolean(),
29387
+ lightMode: NavigationLightModeSchema,
29388
+ lightLevel: number().min(40).max(100),
29389
+ /** Ms epoch when the slice was last updated. */
29390
+ lastChangedAt: number()
29391
+ });
29392
+ /**
29393
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29394
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29395
+ * convention.
29396
+ */
29397
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29398
+ var navigationCapability = {
29399
+ name: "navigation",
29400
+ scope: "device",
29401
+ deviceNative: true,
29402
+ mode: "singleton",
29403
+ deviceTypes: [DeviceType.Camera],
29404
+ deviceConfig: { ui: {
29405
+ kind: "widget",
29406
+ widgetId: "host/navigation-panel",
29407
+ tab: "navigation",
29408
+ topTab: true,
29409
+ label: "Navigation",
29410
+ order: 0
29411
+ } },
29412
+ methods: {
29413
+ /**
29414
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29415
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29416
+ * path) works for any authenticated user, not admin-only. The UI sends
29417
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29418
+ * a single drive write WITHOUT debouncing.
29419
+ */
29420
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29421
+ /** Halt all motion immediately (zero drive vector). */
29422
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29423
+ /** Send the robot to a point on its live map. */
29424
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29425
+ /**
29426
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29427
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29428
+ */
29429
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29430
+ /**
29431
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29432
+ * unsupported action ids are rejected by the provider.
29433
+ */
29434
+ runAction: method(object({
29435
+ deviceId: number(),
29436
+ actionId: NavigationActionIdSchema
29437
+ }), _void(), { kind: "mutation" }),
29438
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29439
+ playSound: method(object({
29440
+ deviceId: number(),
29441
+ soundId: number().int()
29442
+ }), _void(), { kind: "mutation" }),
29443
+ /**
29444
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29445
+ * works anytime, no active stream required).
29446
+ */
29447
+ setLightOn: method(object({
29448
+ deviceId: number(),
29449
+ on: boolean()
29450
+ }), _void(), { kind: "mutation" }),
29451
+ /**
29452
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29453
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29454
+ * action that generally needs an active camera stream/monitor session — the
29455
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29456
+ */
29457
+ setLightMode: method(object({
29458
+ deviceId: number(),
29459
+ mode: NavigationLightModeSchema,
29460
+ level: number().min(40).max(100).optional()
29461
+ }), _void(), { kind: "mutation" }),
29462
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29463
+ setLightLevel: method(object({
29464
+ deviceId: number(),
29465
+ level: number().min(40).max(100)
29466
+ }), _void(), { kind: "mutation" }),
29467
+ /**
29468
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29469
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29470
+ * `listActions`).
29471
+ */
29472
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29473
+ },
29474
+ events: { onStatusChanged: { data: object({
29475
+ deviceId: number(),
29476
+ status: NavigationStatusSchema
29477
+ }) } },
29478
+ status: {
29479
+ schema: NavigationStatusSchema,
29480
+ kind: "push"
29481
+ },
29482
+ /**
29483
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29484
+ * for live mode / follow / flash changes.
29485
+ */
29486
+ runtimeState: NavigationRuntimeStateSchema,
29487
+ /**
29488
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29489
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29490
+ * that. The live handle re-publishes on connect.
29491
+ *
29492
+ * See `RuntimeStateDurability`. Enforced by
29493
+ * `scripts/check-runtime-state-durability.ts`.
29494
+ */
29495
+ durability: "session"
29496
+ };
29210
29497
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29211
29498
  kind: "mutation",
29212
29499
  auth: "admin"
@@ -32482,6 +32769,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32482
32769
  motionTrigger: motionTriggerCapability,
32483
32770
  motionZones: motionZonesCapability,
32484
32771
  nativeObjectDetection: nativeObjectDetectionCapability,
32772
+ navigation: navigationCapability,
32485
32773
  networkLink: networkLinkCapability,
32486
32774
  notifier: notifierCapability,
32487
32775
  numericSensor: numericSensorCapability,
@@ -36336,6 +36624,66 @@ Object.freeze({
36336
36624
  addonId: null,
36337
36625
  access: "create"
36338
36626
  },
36627
+ "navigation.getFeatures": {
36628
+ capName: "navigation",
36629
+ capScope: "device",
36630
+ addonId: null,
36631
+ access: "view"
36632
+ },
36633
+ "navigation.goToPoint": {
36634
+ capName: "navigation",
36635
+ capScope: "device",
36636
+ addonId: null,
36637
+ access: "create"
36638
+ },
36639
+ "navigation.listActions": {
36640
+ capName: "navigation",
36641
+ capScope: "device",
36642
+ addonId: null,
36643
+ access: "view"
36644
+ },
36645
+ "navigation.move": {
36646
+ capName: "navigation",
36647
+ capScope: "device",
36648
+ addonId: null,
36649
+ access: "create"
36650
+ },
36651
+ "navigation.playSound": {
36652
+ capName: "navigation",
36653
+ capScope: "device",
36654
+ addonId: null,
36655
+ access: "create"
36656
+ },
36657
+ "navigation.runAction": {
36658
+ capName: "navigation",
36659
+ capScope: "device",
36660
+ addonId: null,
36661
+ access: "create"
36662
+ },
36663
+ "navigation.setLightLevel": {
36664
+ capName: "navigation",
36665
+ capScope: "device",
36666
+ addonId: null,
36667
+ access: "create"
36668
+ },
36669
+ "navigation.setLightMode": {
36670
+ capName: "navigation",
36671
+ capScope: "device",
36672
+ addonId: null,
36673
+ access: "create"
36674
+ },
36675
+ "navigation.setLightOn": {
36676
+ capName: "navigation",
36677
+ capScope: "device",
36678
+ addonId: null,
36679
+ access: "create"
36680
+ },
36681
+ "navigation.stop": {
36682
+ capName: "navigation",
36683
+ capScope: "device",
36684
+ addonId: null,
36685
+ access: "create"
36686
+ },
36339
36687
  "networkAccess.getEndpoint": {
36340
36688
  capName: "network-access",
36341
36689
  capScope: "system",
@@ -40431,6 +40779,56 @@ Object.freeze({
40431
40779
  form: "single",
40432
40780
  optional: false
40433
40781
  }],
40782
+ "navigation.getFeatures": [{
40783
+ name: "deviceId",
40784
+ form: "single",
40785
+ optional: false
40786
+ }],
40787
+ "navigation.goToPoint": [{
40788
+ name: "deviceId",
40789
+ form: "single",
40790
+ optional: false
40791
+ }],
40792
+ "navigation.listActions": [{
40793
+ name: "deviceId",
40794
+ form: "single",
40795
+ optional: false
40796
+ }],
40797
+ "navigation.move": [{
40798
+ name: "deviceId",
40799
+ form: "single",
40800
+ optional: false
40801
+ }],
40802
+ "navigation.playSound": [{
40803
+ name: "deviceId",
40804
+ form: "single",
40805
+ optional: false
40806
+ }],
40807
+ "navigation.runAction": [{
40808
+ name: "deviceId",
40809
+ form: "single",
40810
+ optional: false
40811
+ }],
40812
+ "navigation.setLightLevel": [{
40813
+ name: "deviceId",
40814
+ form: "single",
40815
+ optional: false
40816
+ }],
40817
+ "navigation.setLightMode": [{
40818
+ name: "deviceId",
40819
+ form: "single",
40820
+ optional: false
40821
+ }],
40822
+ "navigation.setLightOn": [{
40823
+ name: "deviceId",
40824
+ form: "single",
40825
+ optional: false
40826
+ }],
40827
+ "navigation.stop": [{
40828
+ name: "deviceId",
40829
+ form: "single",
40830
+ optional: false
40831
+ }],
40434
40832
  "networkQuality.getDeviceStats": [{
40435
40833
  name: "deviceId",
40436
40834
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5445,6 +5445,12 @@ Object.fromEntries([
5445
5445
  icon: "move",
5446
5446
  order: 40
5447
5447
  },
5448
+ {
5449
+ id: "navigation",
5450
+ label: "Navigation",
5451
+ icon: "compass",
5452
+ order: 41
5453
+ },
5448
5454
  {
5449
5455
  id: "consumables",
5450
5456
  label: "Consumables",
@@ -29207,6 +29213,287 @@ var ptzAutotrackCapability = {
29207
29213
  */
29208
29214
  durability: "session"
29209
29215
  };
29216
+ /**
29217
+ * `navigation` — a device-scoped capability that natively expresses the FULL
29218
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
29219
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
29220
+ *
29221
+ * Why a NEW cap rather than overloading `ptz`:
29222
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29223
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29224
+ * The two are different physical models: PTZ is absolute-position + presets,
29225
+ * navigation is momentary drive nudges + discrete robot ACTIONS
29226
+ * (dock / spot-clean / follow-pet / go-to-point / …).
29227
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29228
+ * the reverse:
29229
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
29230
+ * / `getOptions`), and
29231
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29232
+ * robot camera shows up in the existing PTZ control path without every
29233
+ * PTZ provider learning about robots. The mapping lives in the adapter,
29234
+ * not here (see the addon design note):
29235
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29236
+ * ptz.stop() → navigation.stop()
29237
+ * ptz.goHome() → navigation.runAction('goHome')
29238
+ * ptz.getPresets() → navigation.listActions() (id→preset)
29239
+ * ptz.goToPreset(id) → navigation.runAction(id)
29240
+ *
29241
+ * ## Continuous drive
29242
+ *
29243
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29244
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29245
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29246
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29247
+ * coalesce them. The UI owns the cadence.
29248
+ *
29249
+ * ## The action dictionary
29250
+ *
29251
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29252
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29253
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29254
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29255
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29256
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29257
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29258
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29259
+ *
29260
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29261
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29262
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29263
+ * every device handle. A future nodedreame publish adds a typed
29264
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29265
+ * provider can then swap the raw calls for the typed methods with no change to
29266
+ * THIS contract.
29267
+ */
29268
+ /**
29269
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29270
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29271
+ * halts it.
29272
+ *
29273
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29274
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29275
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29276
+ * vector by it (drivers without proportional drive ignore it).
29277
+ *
29278
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29279
+ * axis alone; an all-undefined nudge is a no-op.
29280
+ */
29281
+ var NavigationMoveCommandSchema = object({
29282
+ pan: number().min(-1).max(1).optional(),
29283
+ tilt: number().min(-1).max(1).optional(),
29284
+ speed: number().min(0).max(1).optional()
29285
+ });
29286
+ /**
29287
+ * The enumerated discrete actions a navigation-capable robot can perform via
29288
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29289
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29290
+ * `playSound` (see the `sound` dictionary entries).
29291
+ */
29292
+ var NavigationActionIdSchema = _enum([
29293
+ "goHome",
29294
+ "locate",
29295
+ "spotClean",
29296
+ "findPet",
29297
+ "personFollow",
29298
+ "stop",
29299
+ "startClean",
29300
+ "pauseClean",
29301
+ "dockWash",
29302
+ "autoEmpty",
29303
+ "flashOn",
29304
+ "flashOff"
29305
+ ]);
29306
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29307
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29308
+ /**
29309
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29310
+ * native panel and the PTZ mimic render as a button.
29311
+ *
29312
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29313
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29314
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29315
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29316
+ * - `label` — operator-facing English label.
29317
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29318
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29319
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29320
+ * flips it from config, never by editing code.
29321
+ */
29322
+ var NavigationActionEntrySchema = object({
29323
+ id: string(),
29324
+ kind: NavigationEntryKindSchema,
29325
+ label: string(),
29326
+ icon: string(),
29327
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29328
+ soundId: number().int().optional(),
29329
+ /** Per-device feature flag — render this entry only when true. */
29330
+ enabled: boolean()
29331
+ });
29332
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29333
+ var NavigationPointSchema = object({
29334
+ x: number(),
29335
+ y: number()
29336
+ });
29337
+ /**
29338
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29339
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29340
+ * that are turned on for THIS device. Data-driven: the provider derives these
29341
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29342
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29343
+ * that are not dictionary entries.
29344
+ *
29345
+ * - `move` / `stop` — the momentary drive joystick.
29346
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29347
+ * map-coordinate plumbing is wired.
29348
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29349
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29350
+ * - `light` — the on/off fill-light toggle (works anytime).
29351
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29352
+ * camera-service control; needs an active stream).
29353
+ */
29354
+ var NavigationFeaturesSchema = object({
29355
+ move: boolean(),
29356
+ stop: boolean(),
29357
+ goToPoint: boolean(),
29358
+ runAction: boolean(),
29359
+ playSound: boolean(),
29360
+ light: boolean(),
29361
+ lightMode: boolean()
29362
+ });
29363
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29364
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29365
+ /**
29366
+ * Live navigation state so the UI can reflect what the robot is doing:
29367
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29368
+ * - `following` — person/pet follow is currently armed.
29369
+ * - `flash` — the on-camera fill light is on.
29370
+ * - `lightMode` — auto vs manual fill-light mode.
29371
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29372
+ * `lightMode === 'manual'`.
29373
+ */
29374
+ var NavigationStatusSchema = object({
29375
+ mode: _enum([
29376
+ "idle",
29377
+ "cleaning",
29378
+ "spot",
29379
+ "following",
29380
+ "goto",
29381
+ "returning",
29382
+ "paused",
29383
+ "unknown"
29384
+ ]),
29385
+ following: boolean(),
29386
+ flash: boolean(),
29387
+ lightMode: NavigationLightModeSchema,
29388
+ lightLevel: number().min(40).max(100),
29389
+ /** Ms epoch when the slice was last updated. */
29390
+ lastChangedAt: number()
29391
+ });
29392
+ /**
29393
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29394
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29395
+ * convention.
29396
+ */
29397
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29398
+ var navigationCapability = {
29399
+ name: "navigation",
29400
+ scope: "device",
29401
+ deviceNative: true,
29402
+ mode: "singleton",
29403
+ deviceTypes: [DeviceType.Camera],
29404
+ deviceConfig: { ui: {
29405
+ kind: "widget",
29406
+ widgetId: "host/navigation-panel",
29407
+ tab: "navigation",
29408
+ topTab: true,
29409
+ label: "Navigation",
29410
+ order: 0
29411
+ } },
29412
+ methods: {
29413
+ /**
29414
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29415
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29416
+ * path) works for any authenticated user, not admin-only. The UI sends
29417
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29418
+ * a single drive write WITHOUT debouncing.
29419
+ */
29420
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29421
+ /** Halt all motion immediately (zero drive vector). */
29422
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29423
+ /** Send the robot to a point on its live map. */
29424
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29425
+ /**
29426
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29427
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29428
+ */
29429
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29430
+ /**
29431
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29432
+ * unsupported action ids are rejected by the provider.
29433
+ */
29434
+ runAction: method(object({
29435
+ deviceId: number(),
29436
+ actionId: NavigationActionIdSchema
29437
+ }), _void(), { kind: "mutation" }),
29438
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29439
+ playSound: method(object({
29440
+ deviceId: number(),
29441
+ soundId: number().int()
29442
+ }), _void(), { kind: "mutation" }),
29443
+ /**
29444
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29445
+ * works anytime, no active stream required).
29446
+ */
29447
+ setLightOn: method(object({
29448
+ deviceId: number(),
29449
+ on: boolean()
29450
+ }), _void(), { kind: "mutation" }),
29451
+ /**
29452
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29453
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29454
+ * action that generally needs an active camera stream/monitor session — the
29455
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29456
+ */
29457
+ setLightMode: method(object({
29458
+ deviceId: number(),
29459
+ mode: NavigationLightModeSchema,
29460
+ level: number().min(40).max(100).optional()
29461
+ }), _void(), { kind: "mutation" }),
29462
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29463
+ setLightLevel: method(object({
29464
+ deviceId: number(),
29465
+ level: number().min(40).max(100)
29466
+ }), _void(), { kind: "mutation" }),
29467
+ /**
29468
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29469
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29470
+ * `listActions`).
29471
+ */
29472
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29473
+ },
29474
+ events: { onStatusChanged: { data: object({
29475
+ deviceId: number(),
29476
+ status: NavigationStatusSchema
29477
+ }) } },
29478
+ status: {
29479
+ schema: NavigationStatusSchema,
29480
+ kind: "push"
29481
+ },
29482
+ /**
29483
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29484
+ * for live mode / follow / flash changes.
29485
+ */
29486
+ runtimeState: NavigationRuntimeStateSchema,
29487
+ /**
29488
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29489
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29490
+ * that. The live handle re-publishes on connect.
29491
+ *
29492
+ * See `RuntimeStateDurability`. Enforced by
29493
+ * `scripts/check-runtime-state-durability.ts`.
29494
+ */
29495
+ durability: "session"
29496
+ };
29210
29497
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29211
29498
  kind: "mutation",
29212
29499
  auth: "admin"
@@ -32482,6 +32769,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32482
32769
  motionTrigger: motionTriggerCapability,
32483
32770
  motionZones: motionZonesCapability,
32484
32771
  nativeObjectDetection: nativeObjectDetectionCapability,
32772
+ navigation: navigationCapability,
32485
32773
  networkLink: networkLinkCapability,
32486
32774
  notifier: notifierCapability,
32487
32775
  numericSensor: numericSensorCapability,
@@ -36336,6 +36624,66 @@ Object.freeze({
36336
36624
  addonId: null,
36337
36625
  access: "create"
36338
36626
  },
36627
+ "navigation.getFeatures": {
36628
+ capName: "navigation",
36629
+ capScope: "device",
36630
+ addonId: null,
36631
+ access: "view"
36632
+ },
36633
+ "navigation.goToPoint": {
36634
+ capName: "navigation",
36635
+ capScope: "device",
36636
+ addonId: null,
36637
+ access: "create"
36638
+ },
36639
+ "navigation.listActions": {
36640
+ capName: "navigation",
36641
+ capScope: "device",
36642
+ addonId: null,
36643
+ access: "view"
36644
+ },
36645
+ "navigation.move": {
36646
+ capName: "navigation",
36647
+ capScope: "device",
36648
+ addonId: null,
36649
+ access: "create"
36650
+ },
36651
+ "navigation.playSound": {
36652
+ capName: "navigation",
36653
+ capScope: "device",
36654
+ addonId: null,
36655
+ access: "create"
36656
+ },
36657
+ "navigation.runAction": {
36658
+ capName: "navigation",
36659
+ capScope: "device",
36660
+ addonId: null,
36661
+ access: "create"
36662
+ },
36663
+ "navigation.setLightLevel": {
36664
+ capName: "navigation",
36665
+ capScope: "device",
36666
+ addonId: null,
36667
+ access: "create"
36668
+ },
36669
+ "navigation.setLightMode": {
36670
+ capName: "navigation",
36671
+ capScope: "device",
36672
+ addonId: null,
36673
+ access: "create"
36674
+ },
36675
+ "navigation.setLightOn": {
36676
+ capName: "navigation",
36677
+ capScope: "device",
36678
+ addonId: null,
36679
+ access: "create"
36680
+ },
36681
+ "navigation.stop": {
36682
+ capName: "navigation",
36683
+ capScope: "device",
36684
+ addonId: null,
36685
+ access: "create"
36686
+ },
36339
36687
  "networkAccess.getEndpoint": {
36340
36688
  capName: "network-access",
36341
36689
  capScope: "system",
@@ -40431,6 +40779,56 @@ Object.freeze({
40431
40779
  form: "single",
40432
40780
  optional: false
40433
40781
  }],
40782
+ "navigation.getFeatures": [{
40783
+ name: "deviceId",
40784
+ form: "single",
40785
+ optional: false
40786
+ }],
40787
+ "navigation.goToPoint": [{
40788
+ name: "deviceId",
40789
+ form: "single",
40790
+ optional: false
40791
+ }],
40792
+ "navigation.listActions": [{
40793
+ name: "deviceId",
40794
+ form: "single",
40795
+ optional: false
40796
+ }],
40797
+ "navigation.move": [{
40798
+ name: "deviceId",
40799
+ form: "single",
40800
+ optional: false
40801
+ }],
40802
+ "navigation.playSound": [{
40803
+ name: "deviceId",
40804
+ form: "single",
40805
+ optional: false
40806
+ }],
40807
+ "navigation.runAction": [{
40808
+ name: "deviceId",
40809
+ form: "single",
40810
+ optional: false
40811
+ }],
40812
+ "navigation.setLightLevel": [{
40813
+ name: "deviceId",
40814
+ form: "single",
40815
+ optional: false
40816
+ }],
40817
+ "navigation.setLightMode": [{
40818
+ name: "deviceId",
40819
+ form: "single",
40820
+ optional: false
40821
+ }],
40822
+ "navigation.setLightOn": [{
40823
+ name: "deviceId",
40824
+ form: "single",
40825
+ optional: false
40826
+ }],
40827
+ "navigation.stop": [{
40828
+ name: "deviceId",
40829
+ form: "single",
40830
+ optional: false
40831
+ }],
40434
40832
  "networkQuality.getDeviceStats": [{
40435
40833
  name: "deviceId",
40436
40834
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-import-alexa",
3
- "version": "0.2.69",
3
+ "version": "0.2.71",
4
4
  "description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
5
5
  "keywords": [
6
6
  "camstack",