@camstack/addon-provider-dreame 0.2.79 → 0.2.80

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.
Files changed (3) hide show
  1. package/dist/addon.js +648 -513
  2. package/dist/addon.mjs +648 -513
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -52669,7 +52669,7 @@ var DreameCameraStream = class extends TypedEmitter {
52669
52669
  }
52670
52670
  };
52671
52671
  //#endregion
52672
- //#region ../types/dist/event-category-zAv7pMUz.mjs
52672
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
52673
52673
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
52674
52674
  EventCategory["SystemBoot"] = "system.boot";
52675
52675
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -52864,6 +52864,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
52864
52864
  EventCategory["ProcessCrashed"] = "process.crashed";
52865
52865
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
52866
52866
  EventCategory["ProcessRestarted"] = "process.restarted";
52867
+ /**
52868
+ * The SET of storage locations changed — one was created, edited, enabled,
52869
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
52870
+ *
52871
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
52872
+ * it must also converge on its own periodic path, because a dropped event
52873
+ * must not leave a node writing to yesterday's disk set forever. It exists
52874
+ * because there was NO signal at all — an operator who added a second
52875
+ * recordings disk in the admin UI got nothing, and the recorder kept its
52876
+ * resolved locations until something else happened to re-resolve them
52877
+ * (D387). Payload `StorageLocationsChangedPayload`.
52878
+ */
52879
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
52867
52880
  EventCategory["RecordingStarted"] = "recording.started";
52868
52881
  EventCategory["RecordingStopped"] = "recording.stopped";
52869
52882
  EventCategory["RecordingError"] = "recording.error";
@@ -61206,6 +61219,21 @@ var StorageCleanupJobSchema = object({
61206
61219
  });
61207
61220
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
61208
61221
  /**
61222
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
61223
+ * alias below is `z.infer<>` of it, never a second spelling.
61224
+ */
61225
+ var StorageLocationModeSchema = _enum([
61226
+ "active",
61227
+ "readonly",
61228
+ "drain",
61229
+ "disabled"
61230
+ ]);
61231
+ _enum([
61232
+ "normal",
61233
+ "never",
61234
+ "drain"
61235
+ ]);
61236
+ /**
61209
61237
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
61210
61238
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
61211
61239
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -61271,6 +61299,21 @@ var StorageLocationSchema = object({
61271
61299
  * stops existing rather than being re-derived on every read.
61272
61300
  */
61273
61301
  enabled: boolean().optional(),
61302
+ /**
61303
+ * THE state of this location (D385), and the only authority on what may be
61304
+ * written, read or evicted here. Interpreted in exactly one place —
61305
+ * `storage-location-mode.ts` — which also folds the legacy
61306
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
61307
+ * ambiguous.
61308
+ *
61309
+ * OPTIONAL only for the wire and for rows written before D385: absence is
61310
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
61311
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
61312
+ * re-derived on every read. `enabled` survives one release as a DERIVED
61313
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
61314
+ * either, so the two cannot disagree.
61315
+ */
61316
+ mode: StorageLocationModeSchema.optional(),
61274
61317
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
61275
61318
  * for node-local locations it can reach) — never persisted, absent when the
61276
61319
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -61278,11 +61321,46 @@ var StorageLocationSchema = object({
61278
61321
  totalBytes: number(),
61279
61322
  availableBytes: number()
61280
61323
  }).nullable().optional(),
61324
+ /**
61325
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
61326
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
61327
+ * never persisted, never a filesystem walk.
61328
+ *
61329
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
61330
+ * location yet — nobody stores here, the owning addon is down, or the first
61331
+ * refresh has not completed. A UI must omit the segment rather than draw it
61332
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
61333
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
61334
+ * be spelled out loud instead of appearing by accident.
61335
+ *
61336
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
61337
+ * about the whole figure rather than about its freshest part.
61338
+ */
61339
+ owned: object({
61340
+ bytes: number().int().nonnegative(),
61341
+ measuredAtMs: number().int().nonnegative()
61342
+ }).optional(),
61281
61343
  createdAt: number(),
61282
61344
  updatedAt: number()
61283
61345
  });
61284
61346
  object({ isDefault: boolean().optional() });
61285
61347
  /**
61348
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
61349
+ *
61350
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
61351
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
61352
+ * drain with no observed growth has no honest ETA, and inventing one is how an
61353
+ * operator learns not to believe the screen.
61354
+ */
61355
+ var StorageDrainProgressSchema = object({
61356
+ locationId: string(),
61357
+ startedAtMs: number(),
61358
+ startBytes: number(),
61359
+ bytesRemaining: number(),
61360
+ drained: boolean(),
61361
+ estimatedEmptyAtMs: number().nullable()
61362
+ });
61363
+ /**
61286
61364
  * Reference accepted by consumer-facing `api.storage.*` calls.
61287
61365
  * Either:
61288
61366
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -74628,7 +74706,7 @@ method(object({
74628
74706
  }), _void(), {
74629
74707
  kind: "mutation",
74630
74708
  auth: "admin"
74631
- }), method(object({ id: string() }), object({
74709
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
74632
74710
  ok: boolean(),
74633
74711
  error: string().optional()
74634
74712
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -74698,6 +74776,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
74698
74776
  kind: "mutation",
74699
74777
  auth: "admin"
74700
74778
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
74779
+ /**
74780
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
74781
+ * location (D388).
74782
+ *
74783
+ * ## Why this is not `storage-evictable`
74784
+ *
74785
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
74786
+ * not, in two ways that both matter and both bite hardest on the locations an
74787
+ * operator most wants a figure for:
74788
+ *
74789
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
74790
+ * and `recordingsLow:default` deliberately share one root and evict as one
74791
+ * oldest-first pool, so both answer with the SAME combined total. As an
74792
+ * occupancy figure that double-counts the disk.
74793
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
74794
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
74795
+ * is retiring and staring at.
74796
+ *
74797
+ * So this is its own contract with its own quantity, and the quantity is
74798
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
74799
+ * would ever be willing to delete it. A provider that can only answer
74800
+ * "evictable" must not register here — a number that silently means different
74801
+ * things per class is worse than no number.
74802
+ *
74803
+ * ## Absence is an answer
74804
+ *
74805
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
74806
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
74807
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
74808
+ * consuming side has to be written out loud instead of appearing by accident.
74809
+ *
74810
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
74811
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
74812
+ */
74813
+ /** One provider's occupancy answer for one location. */
74814
+ var StorageOccupancyReportSchema = object({
74815
+ locationId: string(),
74816
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
74817
+ * not net of what it is willing to delete. */
74818
+ ownedBytes: number().int().nonnegative(),
74819
+ /** When the provider last actually measured this. The orchestrator carries it
74820
+ * through so a UI can say how old the figure is instead of implying "now". */
74821
+ measuredAtMs: number().int().nonnegative()
74822
+ });
74823
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
74701
74824
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
74702
74825
  providerId: string().min(1),
74703
74826
  displayName: string().min(1),
@@ -76533,99 +76656,6 @@ onStatusChanged: { data: object({
76533
76656
  volatileStateFields: ["lastUpdated"]
76534
76657
  };
76535
76658
  /**
76536
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
76537
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
76538
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
76539
- * one Home Assistant projection.
76540
- */
76541
- var NetworkLinkStatusSchema = object({
76542
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
76543
- type: _enum([
76544
- "wifi",
76545
- "ethernet",
76546
- "cellular",
76547
- "unknown"
76548
- ]),
76549
- /**
76550
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
76551
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
76552
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
76553
- * one whose reading has not landed must not be drawn at 0 %. Consumers
76554
- * SKIP a null rather than coerce it.
76555
- */
76556
- signalPercent: number().min(0).max(100).nullable(),
76557
- /** Raw received signal strength in dBm, when the firmware reports one. */
76558
- rssiDbm: number().optional(),
76559
- /** Network name of a wireless link, when the firmware reports it. */
76560
- ssid: string().optional(),
76561
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
76562
- lastUpdated: number()
76563
- });
76564
- /** The slice a provider seeds before its first read: nothing is known yet. */
76565
- var NETWORK_LINK_UNKNOWN = {
76566
- type: "unknown",
76567
- signalPercent: null,
76568
- lastUpdated: 0
76569
- };
76570
- /**
76571
- * Normalise a signal the firmware reports as BARS (0..`maxBars`) to 0..100.
76572
- * Out-of-range or non-finite input is not a reading: `null`.
76573
- */
76574
- function signalPercentFromBars(bars, maxBars) {
76575
- if (bars === void 0 || !Number.isFinite(bars) || maxBars <= 0) return null;
76576
- if (bars < 0 || bars > maxBars) return null;
76577
- return Math.round(bars / maxBars * 100);
76578
- }
76579
- var networkLinkCapability = {
76580
- name: "network-link",
76581
- scope: "device",
76582
- deviceNative: true,
76583
- mode: "singleton",
76584
- deviceTypes: [
76585
- DeviceType.Camera,
76586
- DeviceType.Sensor,
76587
- DeviceType.Button,
76588
- DeviceType.Switch,
76589
- DeviceType.Light,
76590
- DeviceType.Lock,
76591
- DeviceType.Siren
76592
- ],
76593
- methods: {},
76594
- events: {
76595
- /**
76596
- * Emitted whenever the cached status changes (a link switch, a signal
76597
- * reading that moved). Mirrored on the parent chain by the
76598
- * DeviceEventPropagator like `battery.onStatusChanged`.
76599
- */
76600
- onStatusChanged: { data: object({
76601
- deviceId: number(),
76602
- status: NetworkLinkStatusSchema
76603
- }) } },
76604
- status: {
76605
- schema: NetworkLinkStatusSchema,
76606
- kind: "push",
76607
- empty: NETWORK_LINK_UNKNOWN
76608
- },
76609
- /**
76610
- * Runtime-state slice — every provider stores the same shape under
76611
- * `device.runtimeState['network-link']`, read once by the badge and the
76612
- * Home Assistant projector regardless of the driver.
76613
- */
76614
- runtimeState: NetworkLinkStatusSchema,
76615
- /**
76616
- * Runtime-state durability: **restored** — a link reading is slow to
76617
- * change and a sleeping battery camera may not report for hours; the
76618
- * restored slice is what the badge shows until the next read.
76619
- *
76620
- * See `RuntimeStateDurability`. Enforced by
76621
- * `scripts/check-runtime-state-durability.ts`.
76622
- */
76623
- durability: "restored",
76624
- /** Clock fields: written, but excluded from the compare that decides
76625
- * whether persisting is worth a SQLite commit. */
76626
- volatileStateFields: ["lastUpdated"]
76627
- };
76628
- /**
76629
76659
  * Generic boolean sensor — last-resort fallback when no domain-
76630
76660
  * specific binary cap fits (Home Assistant `binary_sensor` without a
76631
76661
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -80180,6 +80210,517 @@ var nativeObjectDetectionCapability = {
80180
80210
  volatileStateFields: ["lastFetchedAt"]
80181
80211
  };
80182
80212
  /**
80213
+ * `navigation` — a device-scoped capability that natively expresses the FULL
80214
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
80215
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
80216
+ *
80217
+ * Why a NEW cap rather than overloading `ptz`:
80218
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
80219
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
80220
+ * The two are different physical models: PTZ is absolute-position + presets,
80221
+ * navigation is momentary drive nudges + discrete robot ACTIONS
80222
+ * (dock / spot-clean / follow-pet / go-to-point / …).
80223
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
80224
+ * the reverse:
80225
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
80226
+ * / `getOptions`), and
80227
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
80228
+ * robot camera shows up in the existing PTZ control path without every
80229
+ * PTZ provider learning about robots. The mapping lives in the adapter,
80230
+ * not here (see the addon design note):
80231
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
80232
+ * ptz.stop() → navigation.stop()
80233
+ * ptz.goHome() → navigation.runAction('goHome')
80234
+ * ptz.getPresets() → navigation.listActions() (id→preset)
80235
+ * ptz.goToPreset(id) → navigation.runAction(id)
80236
+ *
80237
+ * ## Continuous drive
80238
+ *
80239
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
80240
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
80241
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
80242
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
80243
+ * coalesce them. The UI owns the cadence.
80244
+ *
80245
+ * ## The action dictionary
80246
+ *
80247
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
80248
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
80249
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
80250
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
80251
+ * vendor-specific list. `kind: 'action'` entries are triggered with
80252
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
80253
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
80254
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
80255
+ *
80256
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
80257
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
80258
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
80259
+ * every device handle. A future nodedreame publish adds a typed
80260
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
80261
+ * provider can then swap the raw calls for the typed methods with no change to
80262
+ * THIS contract.
80263
+ */
80264
+ /**
80265
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
80266
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
80267
+ * halts it.
80268
+ *
80269
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
80270
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
80271
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
80272
+ * vector by it (drivers without proportional drive ignore it).
80273
+ *
80274
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
80275
+ * axis alone; an all-undefined nudge is a no-op.
80276
+ */
80277
+ var NavigationMoveCommandSchema = object({
80278
+ pan: number().min(-1).max(1).optional(),
80279
+ tilt: number().min(-1).max(1).optional(),
80280
+ speed: number().min(0).max(1).optional()
80281
+ });
80282
+ /**
80283
+ * The enumerated discrete actions a navigation-capable robot can perform via
80284
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
80285
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
80286
+ * `playSound` (see the `sound` dictionary entries).
80287
+ */
80288
+ var NavigationActionIdSchema = _enum([
80289
+ "goHome",
80290
+ "locate",
80291
+ "spotClean",
80292
+ "findPet",
80293
+ "personFollow",
80294
+ "stop",
80295
+ "startClean",
80296
+ "pauseClean",
80297
+ "dockWash",
80298
+ "autoEmpty",
80299
+ "flashOn",
80300
+ "flashOff"
80301
+ ]);
80302
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
80303
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
80304
+ /**
80305
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
80306
+ * native panel and the PTZ mimic render as a button.
80307
+ *
80308
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
80309
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
80310
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
80311
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
80312
+ * - `label` — operator-facing English label.
80313
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
80314
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
80315
+ * PTZ render ONLY enabled entries. Data-driven: the provider
80316
+ * flips it from config, never by editing code.
80317
+ */
80318
+ var NavigationActionEntrySchema = object({
80319
+ id: string(),
80320
+ kind: NavigationEntryKindSchema,
80321
+ label: string(),
80322
+ icon: string(),
80323
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
80324
+ soundId: number().int().optional(),
80325
+ /** Per-device feature flag — render this entry only when true. */
80326
+ enabled: boolean()
80327
+ });
80328
+ /**
80329
+ * Canonical dictionary of every navigation control (discrete actions + sounds)
80330
+ * with its default label + icon hint. A provider filters this to the subset a
80331
+ * device supports (and may override a label). Exported so the provider AND the
80332
+ * UI share ONE list instead of re-deriving labels / ids independently.
80333
+ *
80334
+ * Icons are lucide-style hints; the viewer maps them to its own icon set. Every
80335
+ * catalog default is `enabled: true`; a provider overrides per-device from
80336
+ * config (data-driven — enabling / disabling one later is a config change, not a
80337
+ * code change).
80338
+ */
80339
+ var NAVIGATION_ACTION_CATALOG = [
80340
+ {
80341
+ id: "startClean",
80342
+ kind: "action",
80343
+ label: "Start cleaning",
80344
+ icon: "play",
80345
+ enabled: true
80346
+ },
80347
+ {
80348
+ id: "pauseClean",
80349
+ kind: "action",
80350
+ label: "Pause cleaning",
80351
+ icon: "pause",
80352
+ enabled: true
80353
+ },
80354
+ {
80355
+ id: "stop",
80356
+ kind: "action",
80357
+ label: "Stop",
80358
+ icon: "hand",
80359
+ enabled: true
80360
+ },
80361
+ {
80362
+ id: "goHome",
80363
+ kind: "action",
80364
+ label: "Return to dock",
80365
+ icon: "home",
80366
+ enabled: true
80367
+ },
80368
+ {
80369
+ id: "locate",
80370
+ kind: "action",
80371
+ label: "Locate",
80372
+ icon: "bell",
80373
+ enabled: true
80374
+ },
80375
+ {
80376
+ id: "spotClean",
80377
+ kind: "action",
80378
+ label: "Spot clean here",
80379
+ icon: "crosshair",
80380
+ enabled: true
80381
+ },
80382
+ {
80383
+ id: "findPet",
80384
+ kind: "action",
80385
+ label: "Find pet",
80386
+ icon: "paw-print",
80387
+ enabled: true
80388
+ },
80389
+ {
80390
+ id: "personFollow",
80391
+ kind: "action",
80392
+ label: "Follow me",
80393
+ icon: "footprints",
80394
+ enabled: true
80395
+ },
80396
+ {
80397
+ id: "dockWash",
80398
+ kind: "action",
80399
+ label: "Wash mop",
80400
+ icon: "droplets",
80401
+ enabled: true
80402
+ },
80403
+ {
80404
+ id: "autoEmpty",
80405
+ kind: "action",
80406
+ label: "Empty dustbin",
80407
+ icon: "trash-2",
80408
+ enabled: true
80409
+ },
80410
+ {
80411
+ id: "flashOn",
80412
+ kind: "action",
80413
+ label: "Flash on",
80414
+ icon: "flashlight",
80415
+ enabled: true
80416
+ },
80417
+ {
80418
+ id: "flashOff",
80419
+ kind: "action",
80420
+ label: "Flash off",
80421
+ icon: "flashlight-off",
80422
+ enabled: true
80423
+ },
80424
+ {
80425
+ id: "sound:meow",
80426
+ kind: "sound",
80427
+ label: "Meow",
80428
+ icon: "cat",
80429
+ soundId: 684,
80430
+ enabled: true
80431
+ },
80432
+ {
80433
+ id: "sound:bark",
80434
+ kind: "sound",
80435
+ label: "Woof",
80436
+ icon: "dog",
80437
+ soundId: 685,
80438
+ enabled: true
80439
+ },
80440
+ {
80441
+ id: "sound:footsteps",
80442
+ kind: "sound",
80443
+ label: "Footsteps",
80444
+ icon: "footprints",
80445
+ soundId: 686,
80446
+ enabled: true
80447
+ },
80448
+ {
80449
+ id: "sound:purring",
80450
+ kind: "sound",
80451
+ label: "Purring",
80452
+ icon: "cat",
80453
+ soundId: 687,
80454
+ enabled: true
80455
+ },
80456
+ {
80457
+ id: "sound:tickTock",
80458
+ kind: "sound",
80459
+ label: "Tick-tock",
80460
+ icon: "clock",
80461
+ soundId: 688,
80462
+ enabled: true
80463
+ }
80464
+ ];
80465
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
80466
+ var NavigationPointSchema = object({
80467
+ x: number(),
80468
+ y: number()
80469
+ });
80470
+ /**
80471
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
80472
+ * The cap reports which are enabled so the UI / PTZ render only the controls
80473
+ * that are turned on for THIS device. Data-driven: the provider derives these
80474
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
80475
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
80476
+ * that are not dictionary entries.
80477
+ *
80478
+ * - `move` / `stop` — the momentary drive joystick.
80479
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
80480
+ * map-coordinate plumbing is wired.
80481
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
80482
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
80483
+ * - `light` — the on/off fill-light toggle (works anytime).
80484
+ * - `lightMode` — the auto/manual selector + manual level slider (a
80485
+ * camera-service control; needs an active stream).
80486
+ */
80487
+ var NavigationFeaturesSchema = object({
80488
+ move: boolean(),
80489
+ stop: boolean(),
80490
+ goToPoint: boolean(),
80491
+ runAction: boolean(),
80492
+ playSound: boolean(),
80493
+ light: boolean(),
80494
+ lightMode: boolean()
80495
+ });
80496
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
80497
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
80498
+ /**
80499
+ * Live navigation state so the UI can reflect what the robot is doing:
80500
+ * - `mode` — coarse activity (idle / cleaning / following / …).
80501
+ * - `following` — person/pet follow is currently armed.
80502
+ * - `flash` — the on-camera fill light is on.
80503
+ * - `lightMode` — auto vs manual fill-light mode.
80504
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
80505
+ * `lightMode === 'manual'`.
80506
+ */
80507
+ var NavigationStatusSchema = object({
80508
+ mode: _enum([
80509
+ "idle",
80510
+ "cleaning",
80511
+ "spot",
80512
+ "following",
80513
+ "goto",
80514
+ "returning",
80515
+ "paused",
80516
+ "unknown"
80517
+ ]),
80518
+ following: boolean(),
80519
+ flash: boolean(),
80520
+ lightMode: NavigationLightModeSchema,
80521
+ lightLevel: number().min(40).max(100),
80522
+ /** Ms epoch when the slice was last updated. */
80523
+ lastChangedAt: number()
80524
+ });
80525
+ /**
80526
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
80527
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
80528
+ * convention.
80529
+ */
80530
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
80531
+ var navigationCapability = {
80532
+ name: "navigation",
80533
+ scope: "device",
80534
+ deviceNative: true,
80535
+ mode: "singleton",
80536
+ deviceTypes: [DeviceType.Camera],
80537
+ deviceConfig: { ui: {
80538
+ kind: "widget",
80539
+ widgetId: "host/navigation-panel",
80540
+ tab: "navigation",
80541
+ topTab: true,
80542
+ label: "Navigation",
80543
+ order: 0
80544
+ } },
80545
+ methods: {
80546
+ /**
80547
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
80548
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
80549
+ * path) works for any authenticated user, not admin-only. The UI sends
80550
+ * these at ~1 Hz while a control is held; the provider forwards each one to
80551
+ * a single drive write WITHOUT debouncing.
80552
+ */
80553
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
80554
+ /** Halt all motion immediately (zero drive vector). */
80555
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
80556
+ /** Send the robot to a point on its live map. */
80557
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
80558
+ /**
80559
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
80560
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
80561
+ */
80562
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
80563
+ /**
80564
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
80565
+ * unsupported action ids are rejected by the provider.
80566
+ */
80567
+ runAction: method(object({
80568
+ deviceId: number(),
80569
+ actionId: NavigationActionIdSchema
80570
+ }), _void(), { kind: "mutation" }),
80571
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
80572
+ playSound: method(object({
80573
+ deviceId: number(),
80574
+ soundId: number().int()
80575
+ }), _void(), { kind: "mutation" }),
80576
+ /**
80577
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
80578
+ * works anytime, no active stream required).
80579
+ */
80580
+ setLightOn: method(object({
80581
+ deviceId: number(),
80582
+ on: boolean()
80583
+ }), _void(), { kind: "mutation" }),
80584
+ /**
80585
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
80586
+ * initial `level`. The auto/manual + level control is a CAMERA-service
80587
+ * action that generally needs an active camera stream/monitor session — the
80588
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
80589
+ */
80590
+ setLightMode: method(object({
80591
+ deviceId: number(),
80592
+ mode: NavigationLightModeSchema,
80593
+ level: number().min(40).max(100).optional()
80594
+ }), _void(), { kind: "mutation" }),
80595
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
80596
+ setLightLevel: method(object({
80597
+ deviceId: number(),
80598
+ level: number().min(40).max(100)
80599
+ }), _void(), { kind: "mutation" }),
80600
+ /**
80601
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
80602
+ * controls the UI shows (the per-entry flags for the dictionary come back on
80603
+ * `listActions`).
80604
+ */
80605
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
80606
+ },
80607
+ events: { onStatusChanged: { data: object({
80608
+ deviceId: number(),
80609
+ status: NavigationStatusSchema
80610
+ }) } },
80611
+ status: {
80612
+ schema: NavigationStatusSchema,
80613
+ kind: "push"
80614
+ },
80615
+ /**
80616
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
80617
+ * for live mode / follow / flash changes.
80618
+ */
80619
+ runtimeState: NavigationRuntimeStateSchema,
80620
+ /**
80621
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
80622
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
80623
+ * that. The live handle re-publishes on connect.
80624
+ *
80625
+ * See `RuntimeStateDurability`. Enforced by
80626
+ * `scripts/check-runtime-state-durability.ts`.
80627
+ */
80628
+ durability: "session"
80629
+ };
80630
+ /**
80631
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
80632
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
80633
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
80634
+ * one Home Assistant projection.
80635
+ */
80636
+ var NetworkLinkStatusSchema = object({
80637
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
80638
+ type: _enum([
80639
+ "wifi",
80640
+ "ethernet",
80641
+ "cellular",
80642
+ "unknown"
80643
+ ]),
80644
+ /**
80645
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
80646
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
80647
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
80648
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
80649
+ * SKIP a null rather than coerce it.
80650
+ */
80651
+ signalPercent: number().min(0).max(100).nullable(),
80652
+ /** Raw received signal strength in dBm, when the firmware reports one. */
80653
+ rssiDbm: number().optional(),
80654
+ /** Network name of a wireless link, when the firmware reports it. */
80655
+ ssid: string().optional(),
80656
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
80657
+ lastUpdated: number()
80658
+ });
80659
+ /** The slice a provider seeds before its first read: nothing is known yet. */
80660
+ var NETWORK_LINK_UNKNOWN = {
80661
+ type: "unknown",
80662
+ signalPercent: null,
80663
+ lastUpdated: 0
80664
+ };
80665
+ /**
80666
+ * Normalise a signal the firmware reports as BARS (0..`maxBars`) to 0..100.
80667
+ * Out-of-range or non-finite input is not a reading: `null`.
80668
+ */
80669
+ function signalPercentFromBars(bars, maxBars) {
80670
+ if (bars === void 0 || !Number.isFinite(bars) || maxBars <= 0) return null;
80671
+ if (bars < 0 || bars > maxBars) return null;
80672
+ return Math.round(bars / maxBars * 100);
80673
+ }
80674
+ var networkLinkCapability = {
80675
+ name: "network-link",
80676
+ scope: "device",
80677
+ deviceNative: true,
80678
+ mode: "singleton",
80679
+ deviceTypes: [
80680
+ DeviceType.Camera,
80681
+ DeviceType.Sensor,
80682
+ DeviceType.Button,
80683
+ DeviceType.Switch,
80684
+ DeviceType.Light,
80685
+ DeviceType.Lock,
80686
+ DeviceType.Siren
80687
+ ],
80688
+ methods: {},
80689
+ events: {
80690
+ /**
80691
+ * Emitted whenever the cached status changes (a link switch, a signal
80692
+ * reading that moved). Mirrored on the parent chain by the
80693
+ * DeviceEventPropagator like `battery.onStatusChanged`.
80694
+ */
80695
+ onStatusChanged: { data: object({
80696
+ deviceId: number(),
80697
+ status: NetworkLinkStatusSchema
80698
+ }) } },
80699
+ status: {
80700
+ schema: NetworkLinkStatusSchema,
80701
+ kind: "push",
80702
+ empty: NETWORK_LINK_UNKNOWN
80703
+ },
80704
+ /**
80705
+ * Runtime-state slice — every provider stores the same shape under
80706
+ * `device.runtimeState['network-link']`, read once by the badge and the
80707
+ * Home Assistant projector regardless of the driver.
80708
+ */
80709
+ runtimeState: NetworkLinkStatusSchema,
80710
+ /**
80711
+ * Runtime-state durability: **restored** — a link reading is slow to
80712
+ * change and a sleeping battery camera may not report for hours; the
80713
+ * restored slice is what the badge shows until the next read.
80714
+ *
80715
+ * See `RuntimeStateDurability`. Enforced by
80716
+ * `scripts/check-runtime-state-durability.ts`.
80717
+ */
80718
+ durability: "restored",
80719
+ /** Clock fields: written, but excluded from the compare that decides
80720
+ * whether persisting is worth a SQLite commit. */
80721
+ volatileStateFields: ["lastUpdated"]
80722
+ };
80723
+ /**
80183
80724
  * network-quality — system-scoped singleton capability tracking RTT,
80184
80725
  * jitter, and observed/peak bandwidth per device + per client.
80185
80726
  *
@@ -81760,424 +82301,6 @@ var ptzAutotrackCapability = {
81760
82301
  */
81761
82302
  durability: "session"
81762
82303
  };
81763
- /**
81764
- * `navigation` — a device-scoped capability that natively expresses the FULL
81765
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
81766
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
81767
- *
81768
- * Why a NEW cap rather than overloading `ptz`:
81769
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
81770
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
81771
- * The two are different physical models: PTZ is absolute-position + presets,
81772
- * navigation is momentary drive nudges + discrete robot ACTIONS
81773
- * (dock / spot-clean / follow-pet / go-to-point / …).
81774
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
81775
- * the reverse:
81776
- * 1. a native CamStack navigation panel (data-driven from `listActions`
81777
- * / `getOptions`), and
81778
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
81779
- * robot camera shows up in the existing PTZ control path without every
81780
- * PTZ provider learning about robots. The mapping lives in the adapter,
81781
- * not here (see the addon design note):
81782
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
81783
- * ptz.stop() → navigation.stop()
81784
- * ptz.goHome() → navigation.runAction('goHome')
81785
- * ptz.getPresets() → navigation.listActions() (id→preset)
81786
- * ptz.goToPreset(id) → navigation.runAction(id)
81787
- *
81788
- * ## Continuous drive
81789
- *
81790
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
81791
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
81792
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
81793
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
81794
- * coalesce them. The UI owns the cadence.
81795
- *
81796
- * ## The action dictionary
81797
- *
81798
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
81799
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
81800
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
81801
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
81802
- * vendor-specific list. `kind: 'action'` entries are triggered with
81803
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
81804
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
81805
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
81806
- *
81807
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
81808
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
81809
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
81810
- * every device handle. A future nodedreame publish adds a typed
81811
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
81812
- * provider can then swap the raw calls for the typed methods with no change to
81813
- * THIS contract.
81814
- */
81815
- /**
81816
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
81817
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
81818
- * halts it.
81819
- *
81820
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
81821
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
81822
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
81823
- * vector by it (drivers without proportional drive ignore it).
81824
- *
81825
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
81826
- * axis alone; an all-undefined nudge is a no-op.
81827
- */
81828
- var NavigationMoveCommandSchema = object({
81829
- pan: number().min(-1).max(1).optional(),
81830
- tilt: number().min(-1).max(1).optional(),
81831
- speed: number().min(0).max(1).optional()
81832
- });
81833
- /**
81834
- * The enumerated discrete actions a navigation-capable robot can perform via
81835
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
81836
- * subset it supports through `listActions`. Sounds are NOT here — they go through
81837
- * `playSound` (see the `sound` dictionary entries).
81838
- */
81839
- var NavigationActionIdSchema = _enum([
81840
- "goHome",
81841
- "locate",
81842
- "spotClean",
81843
- "findPet",
81844
- "personFollow",
81845
- "stop",
81846
- "startClean",
81847
- "pauseClean",
81848
- "dockWash",
81849
- "autoEmpty",
81850
- "flashOn",
81851
- "flashOff"
81852
- ]);
81853
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
81854
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
81855
- /**
81856
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
81857
- * native panel and the PTZ mimic render as a button.
81858
- *
81859
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
81860
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
81861
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
81862
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
81863
- * - `label` — operator-facing English label.
81864
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
81865
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
81866
- * PTZ render ONLY enabled entries. Data-driven: the provider
81867
- * flips it from config, never by editing code.
81868
- */
81869
- var NavigationActionEntrySchema = object({
81870
- id: string(),
81871
- kind: NavigationEntryKindSchema,
81872
- label: string(),
81873
- icon: string(),
81874
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
81875
- soundId: number().int().optional(),
81876
- /** Per-device feature flag — render this entry only when true. */
81877
- enabled: boolean()
81878
- });
81879
- /**
81880
- * Canonical dictionary of every navigation control (discrete actions + sounds)
81881
- * with its default label + icon hint. A provider filters this to the subset a
81882
- * device supports (and may override a label). Exported so the provider AND the
81883
- * UI share ONE list instead of re-deriving labels / ids independently.
81884
- *
81885
- * Icons are lucide-style hints; the viewer maps them to its own icon set. Every
81886
- * catalog default is `enabled: true`; a provider overrides per-device from
81887
- * config (data-driven — enabling / disabling one later is a config change, not a
81888
- * code change).
81889
- */
81890
- var NAVIGATION_ACTION_CATALOG = [
81891
- {
81892
- id: "startClean",
81893
- kind: "action",
81894
- label: "Start cleaning",
81895
- icon: "play",
81896
- enabled: true
81897
- },
81898
- {
81899
- id: "pauseClean",
81900
- kind: "action",
81901
- label: "Pause cleaning",
81902
- icon: "pause",
81903
- enabled: true
81904
- },
81905
- {
81906
- id: "stop",
81907
- kind: "action",
81908
- label: "Stop",
81909
- icon: "hand",
81910
- enabled: true
81911
- },
81912
- {
81913
- id: "goHome",
81914
- kind: "action",
81915
- label: "Return to dock",
81916
- icon: "home",
81917
- enabled: true
81918
- },
81919
- {
81920
- id: "locate",
81921
- kind: "action",
81922
- label: "Locate",
81923
- icon: "bell",
81924
- enabled: true
81925
- },
81926
- {
81927
- id: "spotClean",
81928
- kind: "action",
81929
- label: "Spot clean here",
81930
- icon: "crosshair",
81931
- enabled: true
81932
- },
81933
- {
81934
- id: "findPet",
81935
- kind: "action",
81936
- label: "Find pet",
81937
- icon: "paw-print",
81938
- enabled: true
81939
- },
81940
- {
81941
- id: "personFollow",
81942
- kind: "action",
81943
- label: "Follow me",
81944
- icon: "footprints",
81945
- enabled: true
81946
- },
81947
- {
81948
- id: "dockWash",
81949
- kind: "action",
81950
- label: "Wash mop",
81951
- icon: "droplets",
81952
- enabled: true
81953
- },
81954
- {
81955
- id: "autoEmpty",
81956
- kind: "action",
81957
- label: "Empty dustbin",
81958
- icon: "trash-2",
81959
- enabled: true
81960
- },
81961
- {
81962
- id: "flashOn",
81963
- kind: "action",
81964
- label: "Flash on",
81965
- icon: "flashlight",
81966
- enabled: true
81967
- },
81968
- {
81969
- id: "flashOff",
81970
- kind: "action",
81971
- label: "Flash off",
81972
- icon: "flashlight-off",
81973
- enabled: true
81974
- },
81975
- {
81976
- id: "sound:meow",
81977
- kind: "sound",
81978
- label: "Meow",
81979
- icon: "cat",
81980
- soundId: 684,
81981
- enabled: true
81982
- },
81983
- {
81984
- id: "sound:bark",
81985
- kind: "sound",
81986
- label: "Woof",
81987
- icon: "dog",
81988
- soundId: 685,
81989
- enabled: true
81990
- },
81991
- {
81992
- id: "sound:footsteps",
81993
- kind: "sound",
81994
- label: "Footsteps",
81995
- icon: "footprints",
81996
- soundId: 686,
81997
- enabled: true
81998
- },
81999
- {
82000
- id: "sound:purring",
82001
- kind: "sound",
82002
- label: "Purring",
82003
- icon: "cat",
82004
- soundId: 687,
82005
- enabled: true
82006
- },
82007
- {
82008
- id: "sound:tickTock",
82009
- kind: "sound",
82010
- label: "Tick-tock",
82011
- icon: "clock",
82012
- soundId: 688,
82013
- enabled: true
82014
- }
82015
- ];
82016
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
82017
- var NavigationPointSchema = object({
82018
- x: number(),
82019
- y: number()
82020
- });
82021
- /**
82022
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
82023
- * The cap reports which are enabled so the UI / PTZ render only the controls
82024
- * that are turned on for THIS device. Data-driven: the provider derives these
82025
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
82026
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
82027
- * that are not dictionary entries.
82028
- *
82029
- * - `move` / `stop` — the momentary drive joystick.
82030
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
82031
- * map-coordinate plumbing is wired.
82032
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
82033
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
82034
- * - `light` — the on/off fill-light toggle (works anytime).
82035
- * - `lightMode` — the auto/manual selector + manual level slider (a
82036
- * camera-service control; needs an active stream).
82037
- */
82038
- var NavigationFeaturesSchema = object({
82039
- move: boolean(),
82040
- stop: boolean(),
82041
- goToPoint: boolean(),
82042
- runAction: boolean(),
82043
- playSound: boolean(),
82044
- light: boolean(),
82045
- lightMode: boolean()
82046
- });
82047
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
82048
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
82049
- /**
82050
- * Live navigation state so the UI can reflect what the robot is doing:
82051
- * - `mode` — coarse activity (idle / cleaning / following / …).
82052
- * - `following` — person/pet follow is currently armed.
82053
- * - `flash` — the on-camera fill light is on.
82054
- * - `lightMode` — auto vs manual fill-light mode.
82055
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
82056
- * `lightMode === 'manual'`.
82057
- */
82058
- var NavigationStatusSchema = object({
82059
- mode: _enum([
82060
- "idle",
82061
- "cleaning",
82062
- "spot",
82063
- "following",
82064
- "goto",
82065
- "returning",
82066
- "paused",
82067
- "unknown"
82068
- ]),
82069
- following: boolean(),
82070
- flash: boolean(),
82071
- lightMode: NavigationLightModeSchema,
82072
- lightLevel: number().min(40).max(100),
82073
- /** Ms epoch when the slice was last updated. */
82074
- lastChangedAt: number()
82075
- });
82076
- /**
82077
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
82078
- * observable). Adds `lastFetchedAt` on top of the status shape per the
82079
- * convention.
82080
- */
82081
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
82082
- var navigationCapability = {
82083
- name: "navigation",
82084
- scope: "device",
82085
- deviceNative: true,
82086
- mode: "singleton",
82087
- deviceTypes: [DeviceType.Camera],
82088
- deviceConfig: { ui: {
82089
- kind: "widget",
82090
- widgetId: "host/navigation-panel",
82091
- tab: "navigation",
82092
- topTab: true,
82093
- label: "Navigation",
82094
- order: 0
82095
- } },
82096
- methods: {
82097
- /**
82098
- * Momentary drive nudge (the robot moves). `protected` — mirrors
82099
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
82100
- * path) works for any authenticated user, not admin-only. The UI sends
82101
- * these at ~1 Hz while a control is held; the provider forwards each one to
82102
- * a single drive write WITHOUT debouncing.
82103
- */
82104
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
82105
- /** Halt all motion immediately (zero drive vector). */
82106
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
82107
- /** Send the robot to a point on its live map. */
82108
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
82109
- /**
82110
- * Enumerate the discrete controls THIS device supports (data-driven UI +
82111
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
82112
- */
82113
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
82114
- /**
82115
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
82116
- * unsupported action ids are rejected by the provider.
82117
- */
82118
- runAction: method(object({
82119
- deviceId: number(),
82120
- actionId: NavigationActionIdSchema
82121
- }), _void(), { kind: "mutation" }),
82122
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
82123
- playSound: method(object({
82124
- deviceId: number(),
82125
- soundId: number().int()
82126
- }), _void(), { kind: "mutation" }),
82127
- /**
82128
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
82129
- * works anytime, no active stream required).
82130
- */
82131
- setLightOn: method(object({
82132
- deviceId: number(),
82133
- on: boolean()
82134
- }), _void(), { kind: "mutation" }),
82135
- /**
82136
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
82137
- * initial `level`. The auto/manual + level control is a CAMERA-service
82138
- * action that generally needs an active camera stream/monitor session — the
82139
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
82140
- */
82141
- setLightMode: method(object({
82142
- deviceId: number(),
82143
- mode: NavigationLightModeSchema,
82144
- level: number().min(40).max(100).optional()
82145
- }), _void(), { kind: "mutation" }),
82146
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
82147
- setLightLevel: method(object({
82148
- deviceId: number(),
82149
- level: number().min(40).max(100)
82150
- }), _void(), { kind: "mutation" }),
82151
- /**
82152
- * Per-device FEATURE-FLAG report for the general primitives — drives which
82153
- * controls the UI shows (the per-entry flags for the dictionary come back on
82154
- * `listActions`).
82155
- */
82156
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
82157
- },
82158
- events: { onStatusChanged: { data: object({
82159
- deviceId: number(),
82160
- status: NavigationStatusSchema
82161
- }) } },
82162
- status: {
82163
- schema: NavigationStatusSchema,
82164
- kind: "push"
82165
- },
82166
- /**
82167
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
82168
- * for live mode / follow / flash changes.
82169
- */
82170
- runtimeState: NavigationRuntimeStateSchema,
82171
- /**
82172
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
82173
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
82174
- * that. The live handle re-publishes on connect.
82175
- *
82176
- * See `RuntimeStateDurability`. Enforced by
82177
- * `scripts/check-runtime-state-durability.ts`.
82178
- */
82179
- durability: "session"
82180
- };
82181
82304
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
82182
82305
  kind: "mutation",
82183
82306
  auth: "admin"
@@ -91640,6 +91763,12 @@ Object.freeze({
91640
91763
  addonId: null,
91641
91764
  access: "view"
91642
91765
  },
91766
+ "storage.listDrainProgress": {
91767
+ capName: "storage",
91768
+ capScope: "system",
91769
+ addonId: null,
91770
+ access: "view"
91771
+ },
91643
91772
  "storage.listLocationDeclarations": {
91644
91773
  capName: "storage",
91645
91774
  capScope: "system",
@@ -91784,6 +91913,12 @@ Object.freeze({
91784
91913
  addonId: null,
91785
91914
  access: "view"
91786
91915
  },
91916
+ "storageOccupancy.getOccupancy": {
91917
+ capName: "storage-occupancy",
91918
+ capScope: "system",
91919
+ addonId: null,
91920
+ access: "view"
91921
+ },
91787
91922
  "storageProvider.abortUpload": {
91788
91923
  capName: "storage-provider",
91789
91924
  capScope: "system",