@camstack/addon-notifiers 1.2.83 → 1.2.84

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 +367 -232
  2. package/dist/addon.mjs +367 -232
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -2,7 +2,7 @@ import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
2
2
  import { readFileSync } from "node:fs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- //#region ../types/dist/event-category-zAv7pMUz.mjs
5
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -197,6 +197,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
197
197
  EventCategory["ProcessCrashed"] = "process.crashed";
198
198
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
199
199
  EventCategory["ProcessRestarted"] = "process.restarted";
200
+ /**
201
+ * The SET of storage locations changed — one was created, edited, enabled,
202
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
203
+ *
204
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
205
+ * it must also converge on its own periodic path, because a dropped event
206
+ * must not leave a node writing to yesterday's disk set forever. It exists
207
+ * because there was NO signal at all — an operator who added a second
208
+ * recordings disk in the admin UI got nothing, and the recorder kept its
209
+ * resolved locations until something else happened to re-resolve them
210
+ * (D387). Payload `StorageLocationsChangedPayload`.
211
+ */
212
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
200
213
  EventCategory["RecordingStarted"] = "recording.started";
201
214
  EventCategory["RecordingStopped"] = "recording.stopped";
202
215
  EventCategory["RecordingError"] = "recording.error";
@@ -8642,6 +8655,21 @@ var StorageCleanupJobSchema = object({
8642
8655
  });
8643
8656
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8644
8657
  /**
8658
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8659
+ * alias below is `z.infer<>` of it, never a second spelling.
8660
+ */
8661
+ var StorageLocationModeSchema = _enum([
8662
+ "active",
8663
+ "readonly",
8664
+ "drain",
8665
+ "disabled"
8666
+ ]);
8667
+ _enum([
8668
+ "normal",
8669
+ "never",
8670
+ "drain"
8671
+ ]);
8672
+ /**
8645
8673
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8646
8674
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8647
8675
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8707,6 +8735,21 @@ var StorageLocationSchema = object({
8707
8735
  * stops existing rather than being re-derived on every read.
8708
8736
  */
8709
8737
  enabled: boolean().optional(),
8738
+ /**
8739
+ * THE state of this location (D385), and the only authority on what may be
8740
+ * written, read or evicted here. Interpreted in exactly one place —
8741
+ * `storage-location-mode.ts` — which also folds the legacy
8742
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8743
+ * ambiguous.
8744
+ *
8745
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8746
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8747
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8748
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8749
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8750
+ * either, so the two cannot disagree.
8751
+ */
8752
+ mode: StorageLocationModeSchema.optional(),
8710
8753
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8711
8754
  * for node-local locations it can reach) — never persisted, absent when the
8712
8755
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8714,11 +8757,46 @@ var StorageLocationSchema = object({
8714
8757
  totalBytes: number(),
8715
8758
  availableBytes: number()
8716
8759
  }).nullable().optional(),
8760
+ /**
8761
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8762
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8763
+ * never persisted, never a filesystem walk.
8764
+ *
8765
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8766
+ * location yet — nobody stores here, the owning addon is down, or the first
8767
+ * refresh has not completed. A UI must omit the segment rather than draw it
8768
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8769
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8770
+ * be spelled out loud instead of appearing by accident.
8771
+ *
8772
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8773
+ * about the whole figure rather than about its freshest part.
8774
+ */
8775
+ owned: object({
8776
+ bytes: number().int().nonnegative(),
8777
+ measuredAtMs: number().int().nonnegative()
8778
+ }).optional(),
8717
8779
  createdAt: number(),
8718
8780
  updatedAt: number()
8719
8781
  });
8720
8782
  object({ isDefault: boolean().optional() });
8721
8783
  /**
8784
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8785
+ *
8786
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8787
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8788
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8789
+ * operator learns not to believe the screen.
8790
+ */
8791
+ var StorageDrainProgressSchema = object({
8792
+ locationId: string(),
8793
+ startedAtMs: number(),
8794
+ startBytes: number(),
8795
+ bytesRemaining: number(),
8796
+ drained: boolean(),
8797
+ estimatedEmptyAtMs: number().nullable()
8798
+ });
8799
+ /**
8722
8800
  * Reference accepted by consumer-facing `api.storage.*` calls.
8723
8801
  * Either:
8724
8802
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -21734,7 +21812,7 @@ method(object({
21734
21812
  }), _void(), {
21735
21813
  kind: "mutation",
21736
21814
  auth: "admin"
21737
- }), method(object({ id: string() }), object({
21815
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21738
21816
  ok: boolean(),
21739
21817
  error: string().optional()
21740
21818
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21804,6 +21882,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21804
21882
  kind: "mutation",
21805
21883
  auth: "admin"
21806
21884
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21885
+ /**
21886
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21887
+ * location (D388).
21888
+ *
21889
+ * ## Why this is not `storage-evictable`
21890
+ *
21891
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21892
+ * not, in two ways that both matter and both bite hardest on the locations an
21893
+ * operator most wants a figure for:
21894
+ *
21895
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21896
+ * and `recordingsLow:default` deliberately share one root and evict as one
21897
+ * oldest-first pool, so both answer with the SAME combined total. As an
21898
+ * occupancy figure that double-counts the disk.
21899
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21900
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21901
+ * is retiring and staring at.
21902
+ *
21903
+ * So this is its own contract with its own quantity, and the quantity is
21904
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21905
+ * would ever be willing to delete it. A provider that can only answer
21906
+ * "evictable" must not register here — a number that silently means different
21907
+ * things per class is worse than no number.
21908
+ *
21909
+ * ## Absence is an answer
21910
+ *
21911
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21912
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21913
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21914
+ * consuming side has to be written out loud instead of appearing by accident.
21915
+ *
21916
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21917
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21918
+ */
21919
+ /** One provider's occupancy answer for one location. */
21920
+ var StorageOccupancyReportSchema = object({
21921
+ locationId: string(),
21922
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21923
+ * not net of what it is willing to delete. */
21924
+ ownedBytes: number().int().nonnegative(),
21925
+ /** When the provider last actually measured this. The orchestrator carries it
21926
+ * through so a UI can say how old the figure is instead of implying "now". */
21927
+ measuredAtMs: number().int().nonnegative()
21928
+ });
21929
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21807
21930
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21808
21931
  providerId: string().min(1),
21809
21932
  displayName: string().min(1),
@@ -23439,39 +23562,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23439
23562
  deviceId: number(),
23440
23563
  status: BatteryStatusSchema
23441
23564
  });
23442
- /**
23443
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23444
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23445
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23446
- * one Home Assistant projection.
23447
- */
23448
- var NetworkLinkStatusSchema = object({
23449
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23450
- type: _enum([
23451
- "wifi",
23452
- "ethernet",
23453
- "cellular",
23454
- "unknown"
23455
- ]),
23456
- /**
23457
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23458
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23459
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23460
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23461
- * SKIP a null rather than coerce it.
23462
- */
23463
- signalPercent: number().min(0).max(100).nullable(),
23464
- /** Raw received signal strength in dBm, when the firmware reports one. */
23465
- rssiDbm: number().optional(),
23466
- /** Network name of a wireless link, when the firmware reports it. */
23467
- ssid: string().optional(),
23468
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23469
- lastUpdated: number()
23470
- });
23471
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23472
- deviceId: number(),
23473
- status: NetworkLinkStatusSchema
23474
- });
23475
23565
  object({
23476
23566
  on: boolean(),
23477
23567
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25825,6 +25915,236 @@ DeviceType.Camera, method(object({
25825
25915
  detection: NativeDetectionSchema
25826
25916
  });
25827
25917
  /**
25918
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25919
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25920
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25921
+ *
25922
+ * Why a NEW cap rather than overloading `ptz`:
25923
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25924
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25925
+ * The two are different physical models: PTZ is absolute-position + presets,
25926
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25927
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25928
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25929
+ * the reverse:
25930
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25931
+ * / `getOptions`), and
25932
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25933
+ * robot camera shows up in the existing PTZ control path without every
25934
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25935
+ * not here (see the addon design note):
25936
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25937
+ * ptz.stop() → navigation.stop()
25938
+ * ptz.goHome() → navigation.runAction('goHome')
25939
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25940
+ * ptz.goToPreset(id) → navigation.runAction(id)
25941
+ *
25942
+ * ## Continuous drive
25943
+ *
25944
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25945
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25946
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25947
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25948
+ * coalesce them. The UI owns the cadence.
25949
+ *
25950
+ * ## The action dictionary
25951
+ *
25952
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25953
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25954
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25955
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25956
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25957
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25958
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
25959
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
25960
+ *
25961
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
25962
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
25963
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
25964
+ * every device handle. A future nodedreame publish adds a typed
25965
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
25966
+ * provider can then swap the raw calls for the typed methods with no change to
25967
+ * THIS contract.
25968
+ */
25969
+ /**
25970
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
25971
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
25972
+ * halts it.
25973
+ *
25974
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
25975
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
25976
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
25977
+ * vector by it (drivers without proportional drive ignore it).
25978
+ *
25979
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
25980
+ * axis alone; an all-undefined nudge is a no-op.
25981
+ */
25982
+ var NavigationMoveCommandSchema = object({
25983
+ pan: number().min(-1).max(1).optional(),
25984
+ tilt: number().min(-1).max(1).optional(),
25985
+ speed: number().min(0).max(1).optional()
25986
+ });
25987
+ /**
25988
+ * The enumerated discrete actions a navigation-capable robot can perform via
25989
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
25990
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
25991
+ * `playSound` (see the `sound` dictionary entries).
25992
+ */
25993
+ var NavigationActionIdSchema = _enum([
25994
+ "goHome",
25995
+ "locate",
25996
+ "spotClean",
25997
+ "findPet",
25998
+ "personFollow",
25999
+ "stop",
26000
+ "startClean",
26001
+ "pauseClean",
26002
+ "dockWash",
26003
+ "autoEmpty",
26004
+ "flashOn",
26005
+ "flashOff"
26006
+ ]);
26007
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
26008
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
26009
+ /**
26010
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
26011
+ * native panel and the PTZ mimic render as a button.
26012
+ *
26013
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
26014
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
26015
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
26016
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
26017
+ * - `label` — operator-facing English label.
26018
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
26019
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
26020
+ * PTZ render ONLY enabled entries. Data-driven: the provider
26021
+ * flips it from config, never by editing code.
26022
+ */
26023
+ var NavigationActionEntrySchema = object({
26024
+ id: string(),
26025
+ kind: NavigationEntryKindSchema,
26026
+ label: string(),
26027
+ icon: string(),
26028
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
26029
+ soundId: number().int().optional(),
26030
+ /** Per-device feature flag — render this entry only when true. */
26031
+ enabled: boolean()
26032
+ });
26033
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
26034
+ var NavigationPointSchema = object({
26035
+ x: number(),
26036
+ y: number()
26037
+ });
26038
+ /**
26039
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
26040
+ * The cap reports which are enabled so the UI / PTZ render only the controls
26041
+ * that are turned on for THIS device. Data-driven: the provider derives these
26042
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
26043
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
26044
+ * that are not dictionary entries.
26045
+ *
26046
+ * - `move` / `stop` — the momentary drive joystick.
26047
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26048
+ * map-coordinate plumbing is wired.
26049
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26050
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26051
+ * - `light` — the on/off fill-light toggle (works anytime).
26052
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26053
+ * camera-service control; needs an active stream).
26054
+ */
26055
+ var NavigationFeaturesSchema = object({
26056
+ move: boolean(),
26057
+ stop: boolean(),
26058
+ goToPoint: boolean(),
26059
+ runAction: boolean(),
26060
+ playSound: boolean(),
26061
+ light: boolean(),
26062
+ lightMode: boolean()
26063
+ });
26064
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26065
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26066
+ /**
26067
+ * Live navigation state so the UI can reflect what the robot is doing:
26068
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26069
+ * - `following` — person/pet follow is currently armed.
26070
+ * - `flash` — the on-camera fill light is on.
26071
+ * - `lightMode` — auto vs manual fill-light mode.
26072
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26073
+ * `lightMode === 'manual'`.
26074
+ */
26075
+ var NavigationStatusSchema = object({
26076
+ mode: _enum([
26077
+ "idle",
26078
+ "cleaning",
26079
+ "spot",
26080
+ "following",
26081
+ "goto",
26082
+ "returning",
26083
+ "paused",
26084
+ "unknown"
26085
+ ]),
26086
+ following: boolean(),
26087
+ flash: boolean(),
26088
+ lightMode: NavigationLightModeSchema,
26089
+ lightLevel: number().min(40).max(100),
26090
+ /** Ms epoch when the slice was last updated. */
26091
+ lastChangedAt: number()
26092
+ });
26093
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26094
+ 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({
26095
+ deviceId: number(),
26096
+ actionId: NavigationActionIdSchema
26097
+ }), _void(), { kind: "mutation" }), method(object({
26098
+ deviceId: number(),
26099
+ soundId: number().int()
26100
+ }), _void(), { kind: "mutation" }), method(object({
26101
+ deviceId: number(),
26102
+ on: boolean()
26103
+ }), _void(), { kind: "mutation" }), method(object({
26104
+ deviceId: number(),
26105
+ mode: NavigationLightModeSchema,
26106
+ level: number().min(40).max(100).optional()
26107
+ }), _void(), { kind: "mutation" }), method(object({
26108
+ deviceId: number(),
26109
+ level: number().min(40).max(100)
26110
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26111
+ deviceId: number(),
26112
+ status: NavigationStatusSchema
26113
+ });
26114
+ /**
26115
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26116
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26117
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26118
+ * one Home Assistant projection.
26119
+ */
26120
+ var NetworkLinkStatusSchema = object({
26121
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26122
+ type: _enum([
26123
+ "wifi",
26124
+ "ethernet",
26125
+ "cellular",
26126
+ "unknown"
26127
+ ]),
26128
+ /**
26129
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26130
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26131
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26132
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26133
+ * SKIP a null rather than coerce it.
26134
+ */
26135
+ signalPercent: number().min(0).max(100).nullable(),
26136
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26137
+ rssiDbm: number().optional(),
26138
+ /** Network name of a wireless link, when the firmware reports it. */
26139
+ ssid: string().optional(),
26140
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26141
+ lastUpdated: number()
26142
+ });
26143
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26144
+ deviceId: number(),
26145
+ status: NetworkLinkStatusSchema
26146
+ });
26147
+ /**
25828
26148
  * network-quality — system-scoped singleton capability tracking RTT,
25829
26149
  * jitter, and observed/peak bandwidth per device + per client.
25830
26150
  *
@@ -27066,203 +27386,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
27066
27386
  deviceId: number(),
27067
27387
  status: PtzAutotrackStatusSchema
27068
27388
  });
27069
- /**
27070
- * `navigation` — a device-scoped capability that natively expresses the FULL
27071
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
27072
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
27073
- *
27074
- * Why a NEW cap rather than overloading `ptz`:
27075
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27076
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27077
- * The two are different physical models: PTZ is absolute-position + presets,
27078
- * navigation is momentary drive nudges + discrete robot ACTIONS
27079
- * (dock / spot-clean / follow-pet / go-to-point / …).
27080
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27081
- * the reverse:
27082
- * 1. a native CamStack navigation panel (data-driven from `listActions`
27083
- * / `getOptions`), and
27084
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27085
- * robot camera shows up in the existing PTZ control path without every
27086
- * PTZ provider learning about robots. The mapping lives in the adapter,
27087
- * not here (see the addon design note):
27088
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27089
- * ptz.stop() → navigation.stop()
27090
- * ptz.goHome() → navigation.runAction('goHome')
27091
- * ptz.getPresets() → navigation.listActions() (id→preset)
27092
- * ptz.goToPreset(id) → navigation.runAction(id)
27093
- *
27094
- * ## Continuous drive
27095
- *
27096
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27097
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27098
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27099
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27100
- * coalesce them. The UI owns the cadence.
27101
- *
27102
- * ## The action dictionary
27103
- *
27104
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27105
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27106
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27107
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27108
- * vendor-specific list. `kind: 'action'` entries are triggered with
27109
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27110
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27111
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27112
- *
27113
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27114
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27115
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27116
- * every device handle. A future nodedreame publish adds a typed
27117
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27118
- * provider can then swap the raw calls for the typed methods with no change to
27119
- * THIS contract.
27120
- */
27121
- /**
27122
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27123
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27124
- * halts it.
27125
- *
27126
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27127
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27128
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27129
- * vector by it (drivers without proportional drive ignore it).
27130
- *
27131
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27132
- * axis alone; an all-undefined nudge is a no-op.
27133
- */
27134
- var NavigationMoveCommandSchema = object({
27135
- pan: number().min(-1).max(1).optional(),
27136
- tilt: number().min(-1).max(1).optional(),
27137
- speed: number().min(0).max(1).optional()
27138
- });
27139
- /**
27140
- * The enumerated discrete actions a navigation-capable robot can perform via
27141
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27142
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27143
- * `playSound` (see the `sound` dictionary entries).
27144
- */
27145
- var NavigationActionIdSchema = _enum([
27146
- "goHome",
27147
- "locate",
27148
- "spotClean",
27149
- "findPet",
27150
- "personFollow",
27151
- "stop",
27152
- "startClean",
27153
- "pauseClean",
27154
- "dockWash",
27155
- "autoEmpty",
27156
- "flashOn",
27157
- "flashOff"
27158
- ]);
27159
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27160
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27161
- /**
27162
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27163
- * native panel and the PTZ mimic render as a button.
27164
- *
27165
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27166
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27167
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27168
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27169
- * - `label` — operator-facing English label.
27170
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27171
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27172
- * PTZ render ONLY enabled entries. Data-driven: the provider
27173
- * flips it from config, never by editing code.
27174
- */
27175
- var NavigationActionEntrySchema = object({
27176
- id: string(),
27177
- kind: NavigationEntryKindSchema,
27178
- label: string(),
27179
- icon: string(),
27180
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27181
- soundId: number().int().optional(),
27182
- /** Per-device feature flag — render this entry only when true. */
27183
- enabled: boolean()
27184
- });
27185
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27186
- var NavigationPointSchema = object({
27187
- x: number(),
27188
- y: number()
27189
- });
27190
- /**
27191
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27192
- * The cap reports which are enabled so the UI / PTZ render only the controls
27193
- * that are turned on for THIS device. Data-driven: the provider derives these
27194
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27195
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27196
- * that are not dictionary entries.
27197
- *
27198
- * - `move` / `stop` — the momentary drive joystick.
27199
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27200
- * map-coordinate plumbing is wired.
27201
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27202
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27203
- * - `light` — the on/off fill-light toggle (works anytime).
27204
- * - `lightMode` — the auto/manual selector + manual level slider (a
27205
- * camera-service control; needs an active stream).
27206
- */
27207
- var NavigationFeaturesSchema = object({
27208
- move: boolean(),
27209
- stop: boolean(),
27210
- goToPoint: boolean(),
27211
- runAction: boolean(),
27212
- playSound: boolean(),
27213
- light: boolean(),
27214
- lightMode: boolean()
27215
- });
27216
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27217
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27218
- /**
27219
- * Live navigation state so the UI can reflect what the robot is doing:
27220
- * - `mode` — coarse activity (idle / cleaning / following / …).
27221
- * - `following` — person/pet follow is currently armed.
27222
- * - `flash` — the on-camera fill light is on.
27223
- * - `lightMode` — auto vs manual fill-light mode.
27224
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27225
- * `lightMode === 'manual'`.
27226
- */
27227
- var NavigationStatusSchema = object({
27228
- mode: _enum([
27229
- "idle",
27230
- "cleaning",
27231
- "spot",
27232
- "following",
27233
- "goto",
27234
- "returning",
27235
- "paused",
27236
- "unknown"
27237
- ]),
27238
- following: boolean(),
27239
- flash: boolean(),
27240
- lightMode: NavigationLightModeSchema,
27241
- lightLevel: number().min(40).max(100),
27242
- /** Ms epoch when the slice was last updated. */
27243
- lastChangedAt: number()
27244
- });
27245
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27246
- 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({
27247
- deviceId: number(),
27248
- actionId: NavigationActionIdSchema
27249
- }), _void(), { kind: "mutation" }), method(object({
27250
- deviceId: number(),
27251
- soundId: number().int()
27252
- }), _void(), { kind: "mutation" }), method(object({
27253
- deviceId: number(),
27254
- on: boolean()
27255
- }), _void(), { kind: "mutation" }), method(object({
27256
- deviceId: number(),
27257
- mode: NavigationLightModeSchema,
27258
- level: number().min(40).max(100).optional()
27259
- }), _void(), { kind: "mutation" }), method(object({
27260
- deviceId: number(),
27261
- level: number().min(40).max(100)
27262
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27263
- deviceId: number(),
27264
- status: NavigationStatusSchema
27265
- });
27266
27389
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27267
27390
  kind: "mutation",
27268
27391
  auth: "admin"
@@ -34577,6 +34700,12 @@ Object.freeze({
34577
34700
  addonId: null,
34578
34701
  access: "view"
34579
34702
  },
34703
+ "storage.listDrainProgress": {
34704
+ capName: "storage",
34705
+ capScope: "system",
34706
+ addonId: null,
34707
+ access: "view"
34708
+ },
34580
34709
  "storage.listLocationDeclarations": {
34581
34710
  capName: "storage",
34582
34711
  capScope: "system",
@@ -34721,6 +34850,12 @@ Object.freeze({
34721
34850
  addonId: null,
34722
34851
  access: "view"
34723
34852
  },
34853
+ "storageOccupancy.getOccupancy": {
34854
+ capName: "storage-occupancy",
34855
+ capScope: "system",
34856
+ addonId: null,
34857
+ access: "view"
34858
+ },
34724
34859
  "storageProvider.abortUpload": {
34725
34860
  capName: "storage-provider",
34726
34861
  capScope: "system",