@camstack/addon-mqtt-broker 1.2.69 → 1.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.
@@ -44,7 +44,7 @@ let crypto$10 = __toESM(crypto$1, 1);
44
44
  crypto$1 = __toESM(crypto$1);
45
45
  let node_fs = require("node:fs");
46
46
  let node_path = require("node:path");
47
- //#region ../types/dist/event-category-BZL-fdNj.mjs
47
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
48
48
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
49
49
  EventCategory["SystemBoot"] = "system.boot";
50
50
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -416,6 +416,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
416
416
  */
417
417
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
418
418
  /**
419
+ * Cap event fired by every device that registers the `network-link`
420
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
421
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
422
+ * reading that moved.
423
+ */
424
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
425
+ /**
419
426
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
420
427
  * "wake in progress" window — between the Baichuan wake-up issue and
421
428
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -23278,6 +23285,39 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23278
23285
  deviceId: number(),
23279
23286
  status: BatteryStatusSchema
23280
23287
  });
23288
+ /**
23289
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
23290
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23291
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
23292
+ * one Home Assistant projection.
23293
+ */
23294
+ var NetworkLinkStatusSchema = object({
23295
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23296
+ type: _enum([
23297
+ "wifi",
23298
+ "ethernet",
23299
+ "cellular",
23300
+ "unknown"
23301
+ ]),
23302
+ /**
23303
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
23304
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23305
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23306
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
23307
+ * SKIP a null rather than coerce it.
23308
+ */
23309
+ signalPercent: number().min(0).max(100).nullable(),
23310
+ /** Raw received signal strength in dBm, when the firmware reports one. */
23311
+ rssiDbm: number().optional(),
23312
+ /** Network name of a wireless link, when the firmware reports it. */
23313
+ ssid: string().optional(),
23314
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23315
+ lastUpdated: number()
23316
+ });
23317
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23318
+ deviceId: number(),
23319
+ status: NetworkLinkStatusSchema
23320
+ });
23281
23321
  object({
23282
23322
  on: boolean(),
23283
23323
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -26872,6 +26912,203 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
26872
26912
  deviceId: number(),
26873
26913
  status: PtzAutotrackStatusSchema
26874
26914
  });
26915
+ /**
26916
+ * `navigation` — a device-scoped capability that natively expresses the FULL
26917
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
26918
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
26919
+ *
26920
+ * Why a NEW cap rather than overloading `ptz`:
26921
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
26922
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
26923
+ * The two are different physical models: PTZ is absolute-position + presets,
26924
+ * navigation is momentary drive nudges + discrete robot ACTIONS
26925
+ * (dock / spot-clean / follow-pet / go-to-point / …).
26926
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
26927
+ * the reverse:
26928
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
26929
+ * / `getOptions`), and
26930
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
26931
+ * robot camera shows up in the existing PTZ control path without every
26932
+ * PTZ provider learning about robots. The mapping lives in the adapter,
26933
+ * not here (see the addon design note):
26934
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
26935
+ * ptz.stop() → navigation.stop()
26936
+ * ptz.goHome() → navigation.runAction('goHome')
26937
+ * ptz.getPresets() → navigation.listActions() (id→preset)
26938
+ * ptz.goToPreset(id) → navigation.runAction(id)
26939
+ *
26940
+ * ## Continuous drive
26941
+ *
26942
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
26943
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
26944
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
26945
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
26946
+ * coalesce them. The UI owns the cadence.
26947
+ *
26948
+ * ## The action dictionary
26949
+ *
26950
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
26951
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
26952
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
26953
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
26954
+ * vendor-specific list. `kind: 'action'` entries are triggered with
26955
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
26956
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
26957
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26958
+ *
26959
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26960
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26961
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
26962
+ * every device handle. A future nodedreame publish adds a typed
26963
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
26964
+ * provider can then swap the raw calls for the typed methods with no change to
26965
+ * THIS contract.
26966
+ */
26967
+ /**
26968
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
26969
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
26970
+ * halts it.
26971
+ *
26972
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
26973
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26974
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26975
+ * vector by it (drivers without proportional drive ignore it).
26976
+ *
26977
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26978
+ * axis alone; an all-undefined nudge is a no-op.
26979
+ */
26980
+ var NavigationMoveCommandSchema = object({
26981
+ pan: number().min(-1).max(1).optional(),
26982
+ tilt: number().min(-1).max(1).optional(),
26983
+ speed: number().min(0).max(1).optional()
26984
+ });
26985
+ /**
26986
+ * The enumerated discrete actions a navigation-capable robot can perform via
26987
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26988
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26989
+ * `playSound` (see the `sound` dictionary entries).
26990
+ */
26991
+ var NavigationActionIdSchema = _enum([
26992
+ "goHome",
26993
+ "locate",
26994
+ "spotClean",
26995
+ "findPet",
26996
+ "personFollow",
26997
+ "stop",
26998
+ "startClean",
26999
+ "pauseClean",
27000
+ "dockWash",
27001
+ "autoEmpty",
27002
+ "flashOn",
27003
+ "flashOff"
27004
+ ]);
27005
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27006
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
27007
+ /**
27008
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27009
+ * native panel and the PTZ mimic render as a button.
27010
+ *
27011
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27012
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27013
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
27014
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27015
+ * - `label` — operator-facing English label.
27016
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27017
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27018
+ * PTZ render ONLY enabled entries. Data-driven: the provider
27019
+ * flips it from config, never by editing code.
27020
+ */
27021
+ var NavigationActionEntrySchema = object({
27022
+ id: string(),
27023
+ kind: NavigationEntryKindSchema,
27024
+ label: string(),
27025
+ icon: string(),
27026
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27027
+ soundId: number().int().optional(),
27028
+ /** Per-device feature flag — render this entry only when true. */
27029
+ enabled: boolean()
27030
+ });
27031
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
27032
+ var NavigationPointSchema = object({
27033
+ x: number(),
27034
+ y: number()
27035
+ });
27036
+ /**
27037
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27038
+ * The cap reports which are enabled so the UI / PTZ render only the controls
27039
+ * that are turned on for THIS device. Data-driven: the provider derives these
27040
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27041
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27042
+ * that are not dictionary entries.
27043
+ *
27044
+ * - `move` / `stop` — the momentary drive joystick.
27045
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27046
+ * map-coordinate plumbing is wired.
27047
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27048
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27049
+ * - `light` — the on/off fill-light toggle (works anytime).
27050
+ * - `lightMode` — the auto/manual selector + manual level slider (a
27051
+ * camera-service control; needs an active stream).
27052
+ */
27053
+ var NavigationFeaturesSchema = object({
27054
+ move: boolean(),
27055
+ stop: boolean(),
27056
+ goToPoint: boolean(),
27057
+ runAction: boolean(),
27058
+ playSound: boolean(),
27059
+ light: boolean(),
27060
+ lightMode: boolean()
27061
+ });
27062
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27063
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
27064
+ /**
27065
+ * Live navigation state so the UI can reflect what the robot is doing:
27066
+ * - `mode` — coarse activity (idle / cleaning / following / …).
27067
+ * - `following` — person/pet follow is currently armed.
27068
+ * - `flash` — the on-camera fill light is on.
27069
+ * - `lightMode` — auto vs manual fill-light mode.
27070
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
27071
+ * `lightMode === 'manual'`.
27072
+ */
27073
+ var NavigationStatusSchema = object({
27074
+ mode: _enum([
27075
+ "idle",
27076
+ "cleaning",
27077
+ "spot",
27078
+ "following",
27079
+ "goto",
27080
+ "returning",
27081
+ "paused",
27082
+ "unknown"
27083
+ ]),
27084
+ following: boolean(),
27085
+ flash: boolean(),
27086
+ lightMode: NavigationLightModeSchema,
27087
+ lightLevel: number().min(40).max(100),
27088
+ /** Ms epoch when the slice was last updated. */
27089
+ lastChangedAt: number()
27090
+ });
27091
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
27092
+ DeviceType.Camera, method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(NavigationActionEntrySchema)), method(object({
27093
+ deviceId: number(),
27094
+ actionId: NavigationActionIdSchema
27095
+ }), _void(), { kind: "mutation" }), method(object({
27096
+ deviceId: number(),
27097
+ soundId: number().int()
27098
+ }), _void(), { kind: "mutation" }), method(object({
27099
+ deviceId: number(),
27100
+ on: boolean()
27101
+ }), _void(), { kind: "mutation" }), method(object({
27102
+ deviceId: number(),
27103
+ mode: NavigationLightModeSchema,
27104
+ level: number().min(40).max(100).optional()
27105
+ }), _void(), { kind: "mutation" }), method(object({
27106
+ deviceId: number(),
27107
+ level: number().min(40).max(100)
27108
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27109
+ deviceId: number(),
27110
+ status: NavigationStatusSchema
27111
+ });
26875
27112
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
26876
27113
  kind: "mutation",
26877
27114
  auth: "admin"
@@ -31936,6 +32173,66 @@ Object.freeze({
31936
32173
  addonId: null,
31937
32174
  access: "create"
31938
32175
  },
32176
+ "navigation.getFeatures": {
32177
+ capName: "navigation",
32178
+ capScope: "device",
32179
+ addonId: null,
32180
+ access: "view"
32181
+ },
32182
+ "navigation.goToPoint": {
32183
+ capName: "navigation",
32184
+ capScope: "device",
32185
+ addonId: null,
32186
+ access: "create"
32187
+ },
32188
+ "navigation.listActions": {
32189
+ capName: "navigation",
32190
+ capScope: "device",
32191
+ addonId: null,
32192
+ access: "view"
32193
+ },
32194
+ "navigation.move": {
32195
+ capName: "navigation",
32196
+ capScope: "device",
32197
+ addonId: null,
32198
+ access: "create"
32199
+ },
32200
+ "navigation.playSound": {
32201
+ capName: "navigation",
32202
+ capScope: "device",
32203
+ addonId: null,
32204
+ access: "create"
32205
+ },
32206
+ "navigation.runAction": {
32207
+ capName: "navigation",
32208
+ capScope: "device",
32209
+ addonId: null,
32210
+ access: "create"
32211
+ },
32212
+ "navigation.setLightLevel": {
32213
+ capName: "navigation",
32214
+ capScope: "device",
32215
+ addonId: null,
32216
+ access: "create"
32217
+ },
32218
+ "navigation.setLightMode": {
32219
+ capName: "navigation",
32220
+ capScope: "device",
32221
+ addonId: null,
32222
+ access: "create"
32223
+ },
32224
+ "navigation.setLightOn": {
32225
+ capName: "navigation",
32226
+ capScope: "device",
32227
+ addonId: null,
32228
+ access: "create"
32229
+ },
32230
+ "navigation.stop": {
32231
+ capName: "navigation",
32232
+ capScope: "device",
32233
+ addonId: null,
32234
+ access: "create"
32235
+ },
31939
32236
  "networkAccess.getEndpoint": {
31940
32237
  capName: "network-access",
31941
32238
  capScope: "system",
@@ -36031,6 +36328,56 @@ Object.freeze({
36031
36328
  form: "single",
36032
36329
  optional: false
36033
36330
  }],
36331
+ "navigation.getFeatures": [{
36332
+ name: "deviceId",
36333
+ form: "single",
36334
+ optional: false
36335
+ }],
36336
+ "navigation.goToPoint": [{
36337
+ name: "deviceId",
36338
+ form: "single",
36339
+ optional: false
36340
+ }],
36341
+ "navigation.listActions": [{
36342
+ name: "deviceId",
36343
+ form: "single",
36344
+ optional: false
36345
+ }],
36346
+ "navigation.move": [{
36347
+ name: "deviceId",
36348
+ form: "single",
36349
+ optional: false
36350
+ }],
36351
+ "navigation.playSound": [{
36352
+ name: "deviceId",
36353
+ form: "single",
36354
+ optional: false
36355
+ }],
36356
+ "navigation.runAction": [{
36357
+ name: "deviceId",
36358
+ form: "single",
36359
+ optional: false
36360
+ }],
36361
+ "navigation.setLightLevel": [{
36362
+ name: "deviceId",
36363
+ form: "single",
36364
+ optional: false
36365
+ }],
36366
+ "navigation.setLightMode": [{
36367
+ name: "deviceId",
36368
+ form: "single",
36369
+ optional: false
36370
+ }],
36371
+ "navigation.setLightOn": [{
36372
+ name: "deviceId",
36373
+ form: "single",
36374
+ optional: false
36375
+ }],
36376
+ "navigation.stop": [{
36377
+ name: "deviceId",
36378
+ form: "single",
36379
+ optional: false
36380
+ }],
36034
36381
  "networkQuality.getDeviceStats": [{
36035
36382
  name: "deviceId",
36036
36383
  form: "single",
@@ -39,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
39
39
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40
40
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
41
41
  //#endregion
42
- //#region ../types/dist/event-category-BZL-fdNj.mjs
42
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
43
43
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
44
44
  EventCategory["SystemBoot"] = "system.boot";
45
45
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -411,6 +411,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
411
411
  */
412
412
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
413
413
  /**
414
+ * Cap event fired by every device that registers the `network-link`
415
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
416
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
417
+ * reading that moved.
418
+ */
419
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
420
+ /**
414
421
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
415
422
  * "wake in progress" window — between the Baichuan wake-up issue and
416
423
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -23273,6 +23280,39 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23273
23280
  deviceId: number(),
23274
23281
  status: BatteryStatusSchema
23275
23282
  });
23283
+ /**
23284
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
23285
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23286
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
23287
+ * one Home Assistant projection.
23288
+ */
23289
+ var NetworkLinkStatusSchema = object({
23290
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23291
+ type: _enum([
23292
+ "wifi",
23293
+ "ethernet",
23294
+ "cellular",
23295
+ "unknown"
23296
+ ]),
23297
+ /**
23298
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
23299
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23300
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23301
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
23302
+ * SKIP a null rather than coerce it.
23303
+ */
23304
+ signalPercent: number().min(0).max(100).nullable(),
23305
+ /** Raw received signal strength in dBm, when the firmware reports one. */
23306
+ rssiDbm: number().optional(),
23307
+ /** Network name of a wireless link, when the firmware reports it. */
23308
+ ssid: string().optional(),
23309
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23310
+ lastUpdated: number()
23311
+ });
23312
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23313
+ deviceId: number(),
23314
+ status: NetworkLinkStatusSchema
23315
+ });
23276
23316
  object({
23277
23317
  on: boolean(),
23278
23318
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -26867,6 +26907,203 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
26867
26907
  deviceId: number(),
26868
26908
  status: PtzAutotrackStatusSchema
26869
26909
  });
26910
+ /**
26911
+ * `navigation` — a device-scoped capability that natively expresses the FULL
26912
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
26913
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
26914
+ *
26915
+ * Why a NEW cap rather than overloading `ptz`:
26916
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
26917
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
26918
+ * The two are different physical models: PTZ is absolute-position + presets,
26919
+ * navigation is momentary drive nudges + discrete robot ACTIONS
26920
+ * (dock / spot-clean / follow-pet / go-to-point / …).
26921
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
26922
+ * the reverse:
26923
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
26924
+ * / `getOptions`), and
26925
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
26926
+ * robot camera shows up in the existing PTZ control path without every
26927
+ * PTZ provider learning about robots. The mapping lives in the adapter,
26928
+ * not here (see the addon design note):
26929
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
26930
+ * ptz.stop() → navigation.stop()
26931
+ * ptz.goHome() → navigation.runAction('goHome')
26932
+ * ptz.getPresets() → navigation.listActions() (id→preset)
26933
+ * ptz.goToPreset(id) → navigation.runAction(id)
26934
+ *
26935
+ * ## Continuous drive
26936
+ *
26937
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
26938
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
26939
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
26940
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
26941
+ * coalesce them. The UI owns the cadence.
26942
+ *
26943
+ * ## The action dictionary
26944
+ *
26945
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
26946
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
26947
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
26948
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
26949
+ * vendor-specific list. `kind: 'action'` entries are triggered with
26950
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
26951
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
26952
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26953
+ *
26954
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26955
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26956
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
26957
+ * every device handle. A future nodedreame publish adds a typed
26958
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
26959
+ * provider can then swap the raw calls for the typed methods with no change to
26960
+ * THIS contract.
26961
+ */
26962
+ /**
26963
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
26964
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
26965
+ * halts it.
26966
+ *
26967
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
26968
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26969
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26970
+ * vector by it (drivers without proportional drive ignore it).
26971
+ *
26972
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26973
+ * axis alone; an all-undefined nudge is a no-op.
26974
+ */
26975
+ var NavigationMoveCommandSchema = object({
26976
+ pan: number().min(-1).max(1).optional(),
26977
+ tilt: number().min(-1).max(1).optional(),
26978
+ speed: number().min(0).max(1).optional()
26979
+ });
26980
+ /**
26981
+ * The enumerated discrete actions a navigation-capable robot can perform via
26982
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26983
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26984
+ * `playSound` (see the `sound` dictionary entries).
26985
+ */
26986
+ var NavigationActionIdSchema = _enum([
26987
+ "goHome",
26988
+ "locate",
26989
+ "spotClean",
26990
+ "findPet",
26991
+ "personFollow",
26992
+ "stop",
26993
+ "startClean",
26994
+ "pauseClean",
26995
+ "dockWash",
26996
+ "autoEmpty",
26997
+ "flashOn",
26998
+ "flashOff"
26999
+ ]);
27000
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27001
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
27002
+ /**
27003
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27004
+ * native panel and the PTZ mimic render as a button.
27005
+ *
27006
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27007
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27008
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
27009
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27010
+ * - `label` — operator-facing English label.
27011
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27012
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27013
+ * PTZ render ONLY enabled entries. Data-driven: the provider
27014
+ * flips it from config, never by editing code.
27015
+ */
27016
+ var NavigationActionEntrySchema = object({
27017
+ id: string(),
27018
+ kind: NavigationEntryKindSchema,
27019
+ label: string(),
27020
+ icon: string(),
27021
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27022
+ soundId: number().int().optional(),
27023
+ /** Per-device feature flag — render this entry only when true. */
27024
+ enabled: boolean()
27025
+ });
27026
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
27027
+ var NavigationPointSchema = object({
27028
+ x: number(),
27029
+ y: number()
27030
+ });
27031
+ /**
27032
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27033
+ * The cap reports which are enabled so the UI / PTZ render only the controls
27034
+ * that are turned on for THIS device. Data-driven: the provider derives these
27035
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27036
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27037
+ * that are not dictionary entries.
27038
+ *
27039
+ * - `move` / `stop` — the momentary drive joystick.
27040
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27041
+ * map-coordinate plumbing is wired.
27042
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27043
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27044
+ * - `light` — the on/off fill-light toggle (works anytime).
27045
+ * - `lightMode` — the auto/manual selector + manual level slider (a
27046
+ * camera-service control; needs an active stream).
27047
+ */
27048
+ var NavigationFeaturesSchema = object({
27049
+ move: boolean(),
27050
+ stop: boolean(),
27051
+ goToPoint: boolean(),
27052
+ runAction: boolean(),
27053
+ playSound: boolean(),
27054
+ light: boolean(),
27055
+ lightMode: boolean()
27056
+ });
27057
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27058
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
27059
+ /**
27060
+ * Live navigation state so the UI can reflect what the robot is doing:
27061
+ * - `mode` — coarse activity (idle / cleaning / following / …).
27062
+ * - `following` — person/pet follow is currently armed.
27063
+ * - `flash` — the on-camera fill light is on.
27064
+ * - `lightMode` — auto vs manual fill-light mode.
27065
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
27066
+ * `lightMode === 'manual'`.
27067
+ */
27068
+ var NavigationStatusSchema = object({
27069
+ mode: _enum([
27070
+ "idle",
27071
+ "cleaning",
27072
+ "spot",
27073
+ "following",
27074
+ "goto",
27075
+ "returning",
27076
+ "paused",
27077
+ "unknown"
27078
+ ]),
27079
+ following: boolean(),
27080
+ flash: boolean(),
27081
+ lightMode: NavigationLightModeSchema,
27082
+ lightLevel: number().min(40).max(100),
27083
+ /** Ms epoch when the slice was last updated. */
27084
+ lastChangedAt: number()
27085
+ });
27086
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
27087
+ DeviceType.Camera, method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(NavigationActionEntrySchema)), method(object({
27088
+ deviceId: number(),
27089
+ actionId: NavigationActionIdSchema
27090
+ }), _void(), { kind: "mutation" }), method(object({
27091
+ deviceId: number(),
27092
+ soundId: number().int()
27093
+ }), _void(), { kind: "mutation" }), method(object({
27094
+ deviceId: number(),
27095
+ on: boolean()
27096
+ }), _void(), { kind: "mutation" }), method(object({
27097
+ deviceId: number(),
27098
+ mode: NavigationLightModeSchema,
27099
+ level: number().min(40).max(100).optional()
27100
+ }), _void(), { kind: "mutation" }), method(object({
27101
+ deviceId: number(),
27102
+ level: number().min(40).max(100)
27103
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27104
+ deviceId: number(),
27105
+ status: NavigationStatusSchema
27106
+ });
26870
27107
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
26871
27108
  kind: "mutation",
26872
27109
  auth: "admin"
@@ -31931,6 +32168,66 @@ Object.freeze({
31931
32168
  addonId: null,
31932
32169
  access: "create"
31933
32170
  },
32171
+ "navigation.getFeatures": {
32172
+ capName: "navigation",
32173
+ capScope: "device",
32174
+ addonId: null,
32175
+ access: "view"
32176
+ },
32177
+ "navigation.goToPoint": {
32178
+ capName: "navigation",
32179
+ capScope: "device",
32180
+ addonId: null,
32181
+ access: "create"
32182
+ },
32183
+ "navigation.listActions": {
32184
+ capName: "navigation",
32185
+ capScope: "device",
32186
+ addonId: null,
32187
+ access: "view"
32188
+ },
32189
+ "navigation.move": {
32190
+ capName: "navigation",
32191
+ capScope: "device",
32192
+ addonId: null,
32193
+ access: "create"
32194
+ },
32195
+ "navigation.playSound": {
32196
+ capName: "navigation",
32197
+ capScope: "device",
32198
+ addonId: null,
32199
+ access: "create"
32200
+ },
32201
+ "navigation.runAction": {
32202
+ capName: "navigation",
32203
+ capScope: "device",
32204
+ addonId: null,
32205
+ access: "create"
32206
+ },
32207
+ "navigation.setLightLevel": {
32208
+ capName: "navigation",
32209
+ capScope: "device",
32210
+ addonId: null,
32211
+ access: "create"
32212
+ },
32213
+ "navigation.setLightMode": {
32214
+ capName: "navigation",
32215
+ capScope: "device",
32216
+ addonId: null,
32217
+ access: "create"
32218
+ },
32219
+ "navigation.setLightOn": {
32220
+ capName: "navigation",
32221
+ capScope: "device",
32222
+ addonId: null,
32223
+ access: "create"
32224
+ },
32225
+ "navigation.stop": {
32226
+ capName: "navigation",
32227
+ capScope: "device",
32228
+ addonId: null,
32229
+ access: "create"
32230
+ },
31934
32231
  "networkAccess.getEndpoint": {
31935
32232
  capName: "network-access",
31936
32233
  capScope: "system",
@@ -36026,6 +36323,56 @@ Object.freeze({
36026
36323
  form: "single",
36027
36324
  optional: false
36028
36325
  }],
36326
+ "navigation.getFeatures": [{
36327
+ name: "deviceId",
36328
+ form: "single",
36329
+ optional: false
36330
+ }],
36331
+ "navigation.goToPoint": [{
36332
+ name: "deviceId",
36333
+ form: "single",
36334
+ optional: false
36335
+ }],
36336
+ "navigation.listActions": [{
36337
+ name: "deviceId",
36338
+ form: "single",
36339
+ optional: false
36340
+ }],
36341
+ "navigation.move": [{
36342
+ name: "deviceId",
36343
+ form: "single",
36344
+ optional: false
36345
+ }],
36346
+ "navigation.playSound": [{
36347
+ name: "deviceId",
36348
+ form: "single",
36349
+ optional: false
36350
+ }],
36351
+ "navigation.runAction": [{
36352
+ name: "deviceId",
36353
+ form: "single",
36354
+ optional: false
36355
+ }],
36356
+ "navigation.setLightLevel": [{
36357
+ name: "deviceId",
36358
+ form: "single",
36359
+ optional: false
36360
+ }],
36361
+ "navigation.setLightMode": [{
36362
+ name: "deviceId",
36363
+ form: "single",
36364
+ optional: false
36365
+ }],
36366
+ "navigation.setLightOn": [{
36367
+ name: "deviceId",
36368
+ form: "single",
36369
+ optional: false
36370
+ }],
36371
+ "navigation.stop": [{
36372
+ name: "deviceId",
36373
+ form: "single",
36374
+ optional: false
36375
+ }],
36029
36376
  "networkQuality.getDeviceStats": [{
36030
36377
  name: "deviceId",
36031
36378
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-mqtt-broker",
3
- "version": "1.2.69",
3
+ "version": "1.2.71",
4
4
  "description": "MQTT broker registry addon for CamStack — manages external broker entries + an optional embedded aedes broker. Consumers spin up their own `mqtt.js` clients via the `mqtt-broker` cap.",
5
5
  "keywords": [
6
6
  "camstack",