@camstack/addon-matter-broker 0.2.69 → 0.2.70

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
@@ -29044,6 +29044,287 @@ var ptzAutotrackCapability = {
29044
29044
  */
29045
29045
  durability: "session"
29046
29046
  };
29047
+ /**
29048
+ * `navigation` — a device-scoped capability that natively expresses the FULL
29049
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
29050
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
29051
+ *
29052
+ * Why a NEW cap rather than overloading `ptz`:
29053
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29054
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29055
+ * The two are different physical models: PTZ is absolute-position + presets,
29056
+ * navigation is momentary drive nudges + discrete robot ACTIONS
29057
+ * (dock / spot-clean / follow-pet / go-to-point / …).
29058
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29059
+ * the reverse:
29060
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
29061
+ * / `getOptions`), and
29062
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29063
+ * robot camera shows up in the existing PTZ control path without every
29064
+ * PTZ provider learning about robots. The mapping lives in the adapter,
29065
+ * not here (see the addon design note):
29066
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29067
+ * ptz.stop() → navigation.stop()
29068
+ * ptz.goHome() → navigation.runAction('goHome')
29069
+ * ptz.getPresets() → navigation.listActions() (id→preset)
29070
+ * ptz.goToPreset(id) → navigation.runAction(id)
29071
+ *
29072
+ * ## Continuous drive
29073
+ *
29074
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29075
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29076
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29077
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29078
+ * coalesce them. The UI owns the cadence.
29079
+ *
29080
+ * ## The action dictionary
29081
+ *
29082
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29083
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29084
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29085
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29086
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29087
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29088
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29089
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29090
+ *
29091
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29092
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29093
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29094
+ * every device handle. A future nodedreame publish adds a typed
29095
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29096
+ * provider can then swap the raw calls for the typed methods with no change to
29097
+ * THIS contract.
29098
+ */
29099
+ /**
29100
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29101
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29102
+ * halts it.
29103
+ *
29104
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29105
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29106
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29107
+ * vector by it (drivers without proportional drive ignore it).
29108
+ *
29109
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29110
+ * axis alone; an all-undefined nudge is a no-op.
29111
+ */
29112
+ var NavigationMoveCommandSchema = object({
29113
+ pan: number().min(-1).max(1).optional(),
29114
+ tilt: number().min(-1).max(1).optional(),
29115
+ speed: number().min(0).max(1).optional()
29116
+ });
29117
+ /**
29118
+ * The enumerated discrete actions a navigation-capable robot can perform via
29119
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29120
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29121
+ * `playSound` (see the `sound` dictionary entries).
29122
+ */
29123
+ var NavigationActionIdSchema = _enum([
29124
+ "goHome",
29125
+ "locate",
29126
+ "spotClean",
29127
+ "findPet",
29128
+ "personFollow",
29129
+ "stop",
29130
+ "startClean",
29131
+ "pauseClean",
29132
+ "dockWash",
29133
+ "autoEmpty",
29134
+ "flashOn",
29135
+ "flashOff"
29136
+ ]);
29137
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29138
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29139
+ /**
29140
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29141
+ * native panel and the PTZ mimic render as a button.
29142
+ *
29143
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29144
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29145
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29146
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29147
+ * - `label` — operator-facing English label.
29148
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29149
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29150
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29151
+ * flips it from config, never by editing code.
29152
+ */
29153
+ var NavigationActionEntrySchema = object({
29154
+ id: string$2(),
29155
+ kind: NavigationEntryKindSchema,
29156
+ label: string$2(),
29157
+ icon: string$2(),
29158
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29159
+ soundId: number().int().optional(),
29160
+ /** Per-device feature flag — render this entry only when true. */
29161
+ enabled: boolean()
29162
+ });
29163
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29164
+ var NavigationPointSchema = object({
29165
+ x: number(),
29166
+ y: number()
29167
+ });
29168
+ /**
29169
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29170
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29171
+ * that are turned on for THIS device. Data-driven: the provider derives these
29172
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29173
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29174
+ * that are not dictionary entries.
29175
+ *
29176
+ * - `move` / `stop` — the momentary drive joystick.
29177
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29178
+ * map-coordinate plumbing is wired.
29179
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29180
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29181
+ * - `light` — the on/off fill-light toggle (works anytime).
29182
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29183
+ * camera-service control; needs an active stream).
29184
+ */
29185
+ var NavigationFeaturesSchema = object({
29186
+ move: boolean(),
29187
+ stop: boolean(),
29188
+ goToPoint: boolean(),
29189
+ runAction: boolean(),
29190
+ playSound: boolean(),
29191
+ light: boolean(),
29192
+ lightMode: boolean()
29193
+ });
29194
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29195
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29196
+ /**
29197
+ * Live navigation state so the UI can reflect what the robot is doing:
29198
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29199
+ * - `following` — person/pet follow is currently armed.
29200
+ * - `flash` — the on-camera fill light is on.
29201
+ * - `lightMode` — auto vs manual fill-light mode.
29202
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29203
+ * `lightMode === 'manual'`.
29204
+ */
29205
+ var NavigationStatusSchema = object({
29206
+ mode: _enum([
29207
+ "idle",
29208
+ "cleaning",
29209
+ "spot",
29210
+ "following",
29211
+ "goto",
29212
+ "returning",
29213
+ "paused",
29214
+ "unknown"
29215
+ ]),
29216
+ following: boolean(),
29217
+ flash: boolean(),
29218
+ lightMode: NavigationLightModeSchema,
29219
+ lightLevel: number().min(40).max(100),
29220
+ /** Ms epoch when the slice was last updated. */
29221
+ lastChangedAt: number()
29222
+ });
29223
+ /**
29224
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29225
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29226
+ * convention.
29227
+ */
29228
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29229
+ var navigationCapability = {
29230
+ name: "navigation",
29231
+ scope: "device",
29232
+ deviceNative: true,
29233
+ mode: "singleton",
29234
+ deviceTypes: [DeviceType.Camera],
29235
+ deviceConfig: { ui: {
29236
+ kind: "widget",
29237
+ widgetId: "host/navigation-panel",
29238
+ tab: "navigation",
29239
+ topTab: true,
29240
+ label: "Navigation",
29241
+ order: 0
29242
+ } },
29243
+ methods: {
29244
+ /**
29245
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29246
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29247
+ * path) works for any authenticated user, not admin-only. The UI sends
29248
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29249
+ * a single drive write WITHOUT debouncing.
29250
+ */
29251
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29252
+ /** Halt all motion immediately (zero drive vector). */
29253
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29254
+ /** Send the robot to a point on its live map. */
29255
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29256
+ /**
29257
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29258
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29259
+ */
29260
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29261
+ /**
29262
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29263
+ * unsupported action ids are rejected by the provider.
29264
+ */
29265
+ runAction: method(object({
29266
+ deviceId: number(),
29267
+ actionId: NavigationActionIdSchema
29268
+ }), _void(), { kind: "mutation" }),
29269
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29270
+ playSound: method(object({
29271
+ deviceId: number(),
29272
+ soundId: number().int()
29273
+ }), _void(), { kind: "mutation" }),
29274
+ /**
29275
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29276
+ * works anytime, no active stream required).
29277
+ */
29278
+ setLightOn: method(object({
29279
+ deviceId: number(),
29280
+ on: boolean()
29281
+ }), _void(), { kind: "mutation" }),
29282
+ /**
29283
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29284
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29285
+ * action that generally needs an active camera stream/monitor session — the
29286
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29287
+ */
29288
+ setLightMode: method(object({
29289
+ deviceId: number(),
29290
+ mode: NavigationLightModeSchema,
29291
+ level: number().min(40).max(100).optional()
29292
+ }), _void(), { kind: "mutation" }),
29293
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29294
+ setLightLevel: method(object({
29295
+ deviceId: number(),
29296
+ level: number().min(40).max(100)
29297
+ }), _void(), { kind: "mutation" }),
29298
+ /**
29299
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29300
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29301
+ * `listActions`).
29302
+ */
29303
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29304
+ },
29305
+ events: { onStatusChanged: { data: object({
29306
+ deviceId: number(),
29307
+ status: NavigationStatusSchema
29308
+ }) } },
29309
+ status: {
29310
+ schema: NavigationStatusSchema,
29311
+ kind: "push"
29312
+ },
29313
+ /**
29314
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29315
+ * for live mode / follow / flash changes.
29316
+ */
29317
+ runtimeState: NavigationRuntimeStateSchema,
29318
+ /**
29319
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29320
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29321
+ * that. The live handle re-publishes on connect.
29322
+ *
29323
+ * See `RuntimeStateDurability`. Enforced by
29324
+ * `scripts/check-runtime-state-durability.ts`.
29325
+ */
29326
+ durability: "session"
29327
+ };
29047
29328
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29048
29329
  kind: "mutation",
29049
29330
  auth: "admin"
@@ -32319,6 +32600,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32319
32600
  motionTrigger: motionTriggerCapability,
32320
32601
  motionZones: motionZonesCapability,
32321
32602
  nativeObjectDetection: nativeObjectDetectionCapability,
32603
+ navigation: navigationCapability,
32322
32604
  networkLink: networkLinkCapability,
32323
32605
  notifier: notifierCapability,
32324
32606
  numericSensor: numericSensorCapability,
@@ -36173,6 +36455,66 @@ Object.freeze({
36173
36455
  addonId: null,
36174
36456
  access: "create"
36175
36457
  },
36458
+ "navigation.getFeatures": {
36459
+ capName: "navigation",
36460
+ capScope: "device",
36461
+ addonId: null,
36462
+ access: "view"
36463
+ },
36464
+ "navigation.goToPoint": {
36465
+ capName: "navigation",
36466
+ capScope: "device",
36467
+ addonId: null,
36468
+ access: "create"
36469
+ },
36470
+ "navigation.listActions": {
36471
+ capName: "navigation",
36472
+ capScope: "device",
36473
+ addonId: null,
36474
+ access: "view"
36475
+ },
36476
+ "navigation.move": {
36477
+ capName: "navigation",
36478
+ capScope: "device",
36479
+ addonId: null,
36480
+ access: "create"
36481
+ },
36482
+ "navigation.playSound": {
36483
+ capName: "navigation",
36484
+ capScope: "device",
36485
+ addonId: null,
36486
+ access: "create"
36487
+ },
36488
+ "navigation.runAction": {
36489
+ capName: "navigation",
36490
+ capScope: "device",
36491
+ addonId: null,
36492
+ access: "create"
36493
+ },
36494
+ "navigation.setLightLevel": {
36495
+ capName: "navigation",
36496
+ capScope: "device",
36497
+ addonId: null,
36498
+ access: "create"
36499
+ },
36500
+ "navigation.setLightMode": {
36501
+ capName: "navigation",
36502
+ capScope: "device",
36503
+ addonId: null,
36504
+ access: "create"
36505
+ },
36506
+ "navigation.setLightOn": {
36507
+ capName: "navigation",
36508
+ capScope: "device",
36509
+ addonId: null,
36510
+ access: "create"
36511
+ },
36512
+ "navigation.stop": {
36513
+ capName: "navigation",
36514
+ capScope: "device",
36515
+ addonId: null,
36516
+ access: "create"
36517
+ },
36176
36518
  "networkAccess.getEndpoint": {
36177
36519
  capName: "network-access",
36178
36520
  capScope: "system",
@@ -40268,6 +40610,56 @@ Object.freeze({
40268
40610
  form: "single",
40269
40611
  optional: false
40270
40612
  }],
40613
+ "navigation.getFeatures": [{
40614
+ name: "deviceId",
40615
+ form: "single",
40616
+ optional: false
40617
+ }],
40618
+ "navigation.goToPoint": [{
40619
+ name: "deviceId",
40620
+ form: "single",
40621
+ optional: false
40622
+ }],
40623
+ "navigation.listActions": [{
40624
+ name: "deviceId",
40625
+ form: "single",
40626
+ optional: false
40627
+ }],
40628
+ "navigation.move": [{
40629
+ name: "deviceId",
40630
+ form: "single",
40631
+ optional: false
40632
+ }],
40633
+ "navigation.playSound": [{
40634
+ name: "deviceId",
40635
+ form: "single",
40636
+ optional: false
40637
+ }],
40638
+ "navigation.runAction": [{
40639
+ name: "deviceId",
40640
+ form: "single",
40641
+ optional: false
40642
+ }],
40643
+ "navigation.setLightLevel": [{
40644
+ name: "deviceId",
40645
+ form: "single",
40646
+ optional: false
40647
+ }],
40648
+ "navigation.setLightMode": [{
40649
+ name: "deviceId",
40650
+ form: "single",
40651
+ optional: false
40652
+ }],
40653
+ "navigation.setLightOn": [{
40654
+ name: "deviceId",
40655
+ form: "single",
40656
+ optional: false
40657
+ }],
40658
+ "navigation.stop": [{
40659
+ name: "deviceId",
40660
+ form: "single",
40661
+ optional: false
40662
+ }],
40271
40663
  "networkQuality.getDeviceStats": [{
40272
40664
  name: "deviceId",
40273
40665
  form: "single",
package/dist/addon.mjs CHANGED
@@ -29042,6 +29042,287 @@ var ptzAutotrackCapability = {
29042
29042
  */
29043
29043
  durability: "session"
29044
29044
  };
29045
+ /**
29046
+ * `navigation` — a device-scoped capability that natively expresses the FULL
29047
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
29048
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
29049
+ *
29050
+ * Why a NEW cap rather than overloading `ptz`:
29051
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29052
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29053
+ * The two are different physical models: PTZ is absolute-position + presets,
29054
+ * navigation is momentary drive nudges + discrete robot ACTIONS
29055
+ * (dock / spot-clean / follow-pet / go-to-point / …).
29056
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29057
+ * the reverse:
29058
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
29059
+ * / `getOptions`), and
29060
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29061
+ * robot camera shows up in the existing PTZ control path without every
29062
+ * PTZ provider learning about robots. The mapping lives in the adapter,
29063
+ * not here (see the addon design note):
29064
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29065
+ * ptz.stop() → navigation.stop()
29066
+ * ptz.goHome() → navigation.runAction('goHome')
29067
+ * ptz.getPresets() → navigation.listActions() (id→preset)
29068
+ * ptz.goToPreset(id) → navigation.runAction(id)
29069
+ *
29070
+ * ## Continuous drive
29071
+ *
29072
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29073
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29074
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29075
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29076
+ * coalesce them. The UI owns the cadence.
29077
+ *
29078
+ * ## The action dictionary
29079
+ *
29080
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29081
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29082
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29083
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29084
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29085
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29086
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29087
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29088
+ *
29089
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29090
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29091
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29092
+ * every device handle. A future nodedreame publish adds a typed
29093
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29094
+ * provider can then swap the raw calls for the typed methods with no change to
29095
+ * THIS contract.
29096
+ */
29097
+ /**
29098
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29099
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29100
+ * halts it.
29101
+ *
29102
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29103
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29104
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29105
+ * vector by it (drivers without proportional drive ignore it).
29106
+ *
29107
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29108
+ * axis alone; an all-undefined nudge is a no-op.
29109
+ */
29110
+ var NavigationMoveCommandSchema = object({
29111
+ pan: number().min(-1).max(1).optional(),
29112
+ tilt: number().min(-1).max(1).optional(),
29113
+ speed: number().min(0).max(1).optional()
29114
+ });
29115
+ /**
29116
+ * The enumerated discrete actions a navigation-capable robot can perform via
29117
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29118
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29119
+ * `playSound` (see the `sound` dictionary entries).
29120
+ */
29121
+ var NavigationActionIdSchema = _enum([
29122
+ "goHome",
29123
+ "locate",
29124
+ "spotClean",
29125
+ "findPet",
29126
+ "personFollow",
29127
+ "stop",
29128
+ "startClean",
29129
+ "pauseClean",
29130
+ "dockWash",
29131
+ "autoEmpty",
29132
+ "flashOn",
29133
+ "flashOff"
29134
+ ]);
29135
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29136
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29137
+ /**
29138
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29139
+ * native panel and the PTZ mimic render as a button.
29140
+ *
29141
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29142
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29143
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29144
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29145
+ * - `label` — operator-facing English label.
29146
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29147
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29148
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29149
+ * flips it from config, never by editing code.
29150
+ */
29151
+ var NavigationActionEntrySchema = object({
29152
+ id: string$2(),
29153
+ kind: NavigationEntryKindSchema,
29154
+ label: string$2(),
29155
+ icon: string$2(),
29156
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29157
+ soundId: number().int().optional(),
29158
+ /** Per-device feature flag — render this entry only when true. */
29159
+ enabled: boolean()
29160
+ });
29161
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29162
+ var NavigationPointSchema = object({
29163
+ x: number(),
29164
+ y: number()
29165
+ });
29166
+ /**
29167
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29168
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29169
+ * that are turned on for THIS device. Data-driven: the provider derives these
29170
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29171
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29172
+ * that are not dictionary entries.
29173
+ *
29174
+ * - `move` / `stop` — the momentary drive joystick.
29175
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29176
+ * map-coordinate plumbing is wired.
29177
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29178
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29179
+ * - `light` — the on/off fill-light toggle (works anytime).
29180
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29181
+ * camera-service control; needs an active stream).
29182
+ */
29183
+ var NavigationFeaturesSchema = object({
29184
+ move: boolean(),
29185
+ stop: boolean(),
29186
+ goToPoint: boolean(),
29187
+ runAction: boolean(),
29188
+ playSound: boolean(),
29189
+ light: boolean(),
29190
+ lightMode: boolean()
29191
+ });
29192
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29193
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29194
+ /**
29195
+ * Live navigation state so the UI can reflect what the robot is doing:
29196
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29197
+ * - `following` — person/pet follow is currently armed.
29198
+ * - `flash` — the on-camera fill light is on.
29199
+ * - `lightMode` — auto vs manual fill-light mode.
29200
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29201
+ * `lightMode === 'manual'`.
29202
+ */
29203
+ var NavigationStatusSchema = object({
29204
+ mode: _enum([
29205
+ "idle",
29206
+ "cleaning",
29207
+ "spot",
29208
+ "following",
29209
+ "goto",
29210
+ "returning",
29211
+ "paused",
29212
+ "unknown"
29213
+ ]),
29214
+ following: boolean(),
29215
+ flash: boolean(),
29216
+ lightMode: NavigationLightModeSchema,
29217
+ lightLevel: number().min(40).max(100),
29218
+ /** Ms epoch when the slice was last updated. */
29219
+ lastChangedAt: number()
29220
+ });
29221
+ /**
29222
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29223
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29224
+ * convention.
29225
+ */
29226
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29227
+ var navigationCapability = {
29228
+ name: "navigation",
29229
+ scope: "device",
29230
+ deviceNative: true,
29231
+ mode: "singleton",
29232
+ deviceTypes: [DeviceType.Camera],
29233
+ deviceConfig: { ui: {
29234
+ kind: "widget",
29235
+ widgetId: "host/navigation-panel",
29236
+ tab: "navigation",
29237
+ topTab: true,
29238
+ label: "Navigation",
29239
+ order: 0
29240
+ } },
29241
+ methods: {
29242
+ /**
29243
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29244
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29245
+ * path) works for any authenticated user, not admin-only. The UI sends
29246
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29247
+ * a single drive write WITHOUT debouncing.
29248
+ */
29249
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29250
+ /** Halt all motion immediately (zero drive vector). */
29251
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29252
+ /** Send the robot to a point on its live map. */
29253
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29254
+ /**
29255
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29256
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29257
+ */
29258
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29259
+ /**
29260
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29261
+ * unsupported action ids are rejected by the provider.
29262
+ */
29263
+ runAction: method(object({
29264
+ deviceId: number(),
29265
+ actionId: NavigationActionIdSchema
29266
+ }), _void(), { kind: "mutation" }),
29267
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29268
+ playSound: method(object({
29269
+ deviceId: number(),
29270
+ soundId: number().int()
29271
+ }), _void(), { kind: "mutation" }),
29272
+ /**
29273
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29274
+ * works anytime, no active stream required).
29275
+ */
29276
+ setLightOn: method(object({
29277
+ deviceId: number(),
29278
+ on: boolean()
29279
+ }), _void(), { kind: "mutation" }),
29280
+ /**
29281
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29282
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29283
+ * action that generally needs an active camera stream/monitor session — the
29284
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29285
+ */
29286
+ setLightMode: method(object({
29287
+ deviceId: number(),
29288
+ mode: NavigationLightModeSchema,
29289
+ level: number().min(40).max(100).optional()
29290
+ }), _void(), { kind: "mutation" }),
29291
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29292
+ setLightLevel: method(object({
29293
+ deviceId: number(),
29294
+ level: number().min(40).max(100)
29295
+ }), _void(), { kind: "mutation" }),
29296
+ /**
29297
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29298
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29299
+ * `listActions`).
29300
+ */
29301
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29302
+ },
29303
+ events: { onStatusChanged: { data: object({
29304
+ deviceId: number(),
29305
+ status: NavigationStatusSchema
29306
+ }) } },
29307
+ status: {
29308
+ schema: NavigationStatusSchema,
29309
+ kind: "push"
29310
+ },
29311
+ /**
29312
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29313
+ * for live mode / follow / flash changes.
29314
+ */
29315
+ runtimeState: NavigationRuntimeStateSchema,
29316
+ /**
29317
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29318
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29319
+ * that. The live handle re-publishes on connect.
29320
+ *
29321
+ * See `RuntimeStateDurability`. Enforced by
29322
+ * `scripts/check-runtime-state-durability.ts`.
29323
+ */
29324
+ durability: "session"
29325
+ };
29045
29326
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29046
29327
  kind: "mutation",
29047
29328
  auth: "admin"
@@ -32317,6 +32598,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32317
32598
  motionTrigger: motionTriggerCapability,
32318
32599
  motionZones: motionZonesCapability,
32319
32600
  nativeObjectDetection: nativeObjectDetectionCapability,
32601
+ navigation: navigationCapability,
32320
32602
  networkLink: networkLinkCapability,
32321
32603
  notifier: notifierCapability,
32322
32604
  numericSensor: numericSensorCapability,
@@ -36171,6 +36453,66 @@ Object.freeze({
36171
36453
  addonId: null,
36172
36454
  access: "create"
36173
36455
  },
36456
+ "navigation.getFeatures": {
36457
+ capName: "navigation",
36458
+ capScope: "device",
36459
+ addonId: null,
36460
+ access: "view"
36461
+ },
36462
+ "navigation.goToPoint": {
36463
+ capName: "navigation",
36464
+ capScope: "device",
36465
+ addonId: null,
36466
+ access: "create"
36467
+ },
36468
+ "navigation.listActions": {
36469
+ capName: "navigation",
36470
+ capScope: "device",
36471
+ addonId: null,
36472
+ access: "view"
36473
+ },
36474
+ "navigation.move": {
36475
+ capName: "navigation",
36476
+ capScope: "device",
36477
+ addonId: null,
36478
+ access: "create"
36479
+ },
36480
+ "navigation.playSound": {
36481
+ capName: "navigation",
36482
+ capScope: "device",
36483
+ addonId: null,
36484
+ access: "create"
36485
+ },
36486
+ "navigation.runAction": {
36487
+ capName: "navigation",
36488
+ capScope: "device",
36489
+ addonId: null,
36490
+ access: "create"
36491
+ },
36492
+ "navigation.setLightLevel": {
36493
+ capName: "navigation",
36494
+ capScope: "device",
36495
+ addonId: null,
36496
+ access: "create"
36497
+ },
36498
+ "navigation.setLightMode": {
36499
+ capName: "navigation",
36500
+ capScope: "device",
36501
+ addonId: null,
36502
+ access: "create"
36503
+ },
36504
+ "navigation.setLightOn": {
36505
+ capName: "navigation",
36506
+ capScope: "device",
36507
+ addonId: null,
36508
+ access: "create"
36509
+ },
36510
+ "navigation.stop": {
36511
+ capName: "navigation",
36512
+ capScope: "device",
36513
+ addonId: null,
36514
+ access: "create"
36515
+ },
36174
36516
  "networkAccess.getEndpoint": {
36175
36517
  capName: "network-access",
36176
36518
  capScope: "system",
@@ -40266,6 +40608,56 @@ Object.freeze({
40266
40608
  form: "single",
40267
40609
  optional: false
40268
40610
  }],
40611
+ "navigation.getFeatures": [{
40612
+ name: "deviceId",
40613
+ form: "single",
40614
+ optional: false
40615
+ }],
40616
+ "navigation.goToPoint": [{
40617
+ name: "deviceId",
40618
+ form: "single",
40619
+ optional: false
40620
+ }],
40621
+ "navigation.listActions": [{
40622
+ name: "deviceId",
40623
+ form: "single",
40624
+ optional: false
40625
+ }],
40626
+ "navigation.move": [{
40627
+ name: "deviceId",
40628
+ form: "single",
40629
+ optional: false
40630
+ }],
40631
+ "navigation.playSound": [{
40632
+ name: "deviceId",
40633
+ form: "single",
40634
+ optional: false
40635
+ }],
40636
+ "navigation.runAction": [{
40637
+ name: "deviceId",
40638
+ form: "single",
40639
+ optional: false
40640
+ }],
40641
+ "navigation.setLightLevel": [{
40642
+ name: "deviceId",
40643
+ form: "single",
40644
+ optional: false
40645
+ }],
40646
+ "navigation.setLightMode": [{
40647
+ name: "deviceId",
40648
+ form: "single",
40649
+ optional: false
40650
+ }],
40651
+ "navigation.setLightOn": [{
40652
+ name: "deviceId",
40653
+ form: "single",
40654
+ optional: false
40655
+ }],
40656
+ "navigation.stop": [{
40657
+ name: "deviceId",
40658
+ form: "single",
40659
+ optional: false
40660
+ }],
40269
40661
  "networkQuality.getDeviceStats": [{
40270
40662
  name: "deviceId",
40271
40663
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-matter-broker",
3
- "version": "0.2.69",
3
+ "version": "0.2.70",
4
4
  "description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
5
5
  "keywords": [
6
6
  "camstack",