@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.js CHANGED
@@ -29,7 +29,7 @@ let node_fs = require("node:fs");
29
29
  let node_path = require("node:path");
30
30
  node_path = __toESM(node_path);
31
31
  let node_url = require("node:url");
32
- //#region ../types/dist/event-category-zAv7pMUz.mjs
32
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
33
33
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
34
34
  EventCategory["SystemBoot"] = "system.boot";
35
35
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -224,6 +224,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
224
224
  EventCategory["ProcessCrashed"] = "process.crashed";
225
225
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
226
226
  EventCategory["ProcessRestarted"] = "process.restarted";
227
+ /**
228
+ * The SET of storage locations changed — one was created, edited, enabled,
229
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
230
+ *
231
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
232
+ * it must also converge on its own periodic path, because a dropped event
233
+ * must not leave a node writing to yesterday's disk set forever. It exists
234
+ * because there was NO signal at all — an operator who added a second
235
+ * recordings disk in the admin UI got nothing, and the recorder kept its
236
+ * resolved locations until something else happened to re-resolve them
237
+ * (D387). Payload `StorageLocationsChangedPayload`.
238
+ */
239
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
227
240
  EventCategory["RecordingStarted"] = "recording.started";
228
241
  EventCategory["RecordingStopped"] = "recording.stopped";
229
242
  EventCategory["RecordingError"] = "recording.error";
@@ -8669,6 +8682,21 @@ var StorageCleanupJobSchema = object({
8669
8682
  });
8670
8683
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8671
8684
  /**
8685
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8686
+ * alias below is `z.infer<>` of it, never a second spelling.
8687
+ */
8688
+ var StorageLocationModeSchema = _enum([
8689
+ "active",
8690
+ "readonly",
8691
+ "drain",
8692
+ "disabled"
8693
+ ]);
8694
+ _enum([
8695
+ "normal",
8696
+ "never",
8697
+ "drain"
8698
+ ]);
8699
+ /**
8672
8700
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8673
8701
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8674
8702
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8734,6 +8762,21 @@ var StorageLocationSchema = object({
8734
8762
  * stops existing rather than being re-derived on every read.
8735
8763
  */
8736
8764
  enabled: boolean().optional(),
8765
+ /**
8766
+ * THE state of this location (D385), and the only authority on what may be
8767
+ * written, read or evicted here. Interpreted in exactly one place —
8768
+ * `storage-location-mode.ts` — which also folds the legacy
8769
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8770
+ * ambiguous.
8771
+ *
8772
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8773
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8774
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8775
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8776
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8777
+ * either, so the two cannot disagree.
8778
+ */
8779
+ mode: StorageLocationModeSchema.optional(),
8737
8780
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8738
8781
  * for node-local locations it can reach) — never persisted, absent when the
8739
8782
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8741,11 +8784,46 @@ var StorageLocationSchema = object({
8741
8784
  totalBytes: number(),
8742
8785
  availableBytes: number()
8743
8786
  }).nullable().optional(),
8787
+ /**
8788
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8789
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8790
+ * never persisted, never a filesystem walk.
8791
+ *
8792
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8793
+ * location yet — nobody stores here, the owning addon is down, or the first
8794
+ * refresh has not completed. A UI must omit the segment rather than draw it
8795
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8796
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8797
+ * be spelled out loud instead of appearing by accident.
8798
+ *
8799
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8800
+ * about the whole figure rather than about its freshest part.
8801
+ */
8802
+ owned: object({
8803
+ bytes: number().int().nonnegative(),
8804
+ measuredAtMs: number().int().nonnegative()
8805
+ }).optional(),
8744
8806
  createdAt: number(),
8745
8807
  updatedAt: number()
8746
8808
  });
8747
8809
  object({ isDefault: boolean().optional() });
8748
8810
  /**
8811
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8812
+ *
8813
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8814
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8815
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8816
+ * operator learns not to believe the screen.
8817
+ */
8818
+ var StorageDrainProgressSchema = object({
8819
+ locationId: string(),
8820
+ startedAtMs: number(),
8821
+ startBytes: number(),
8822
+ bytesRemaining: number(),
8823
+ drained: boolean(),
8824
+ estimatedEmptyAtMs: number().nullable()
8825
+ });
8826
+ /**
8749
8827
  * Reference accepted by consumer-facing `api.storage.*` calls.
8750
8828
  * Either:
8751
8829
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -21761,7 +21839,7 @@ method(object({
21761
21839
  }), _void(), {
21762
21840
  kind: "mutation",
21763
21841
  auth: "admin"
21764
- }), method(object({ id: string() }), object({
21842
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21765
21843
  ok: boolean(),
21766
21844
  error: string().optional()
21767
21845
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21831,6 +21909,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21831
21909
  kind: "mutation",
21832
21910
  auth: "admin"
21833
21911
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21912
+ /**
21913
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21914
+ * location (D388).
21915
+ *
21916
+ * ## Why this is not `storage-evictable`
21917
+ *
21918
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21919
+ * not, in two ways that both matter and both bite hardest on the locations an
21920
+ * operator most wants a figure for:
21921
+ *
21922
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21923
+ * and `recordingsLow:default` deliberately share one root and evict as one
21924
+ * oldest-first pool, so both answer with the SAME combined total. As an
21925
+ * occupancy figure that double-counts the disk.
21926
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21927
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21928
+ * is retiring and staring at.
21929
+ *
21930
+ * So this is its own contract with its own quantity, and the quantity is
21931
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21932
+ * would ever be willing to delete it. A provider that can only answer
21933
+ * "evictable" must not register here — a number that silently means different
21934
+ * things per class is worse than no number.
21935
+ *
21936
+ * ## Absence is an answer
21937
+ *
21938
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21939
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21940
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21941
+ * consuming side has to be written out loud instead of appearing by accident.
21942
+ *
21943
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21944
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21945
+ */
21946
+ /** One provider's occupancy answer for one location. */
21947
+ var StorageOccupancyReportSchema = object({
21948
+ locationId: string(),
21949
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21950
+ * not net of what it is willing to delete. */
21951
+ ownedBytes: number().int().nonnegative(),
21952
+ /** When the provider last actually measured this. The orchestrator carries it
21953
+ * through so a UI can say how old the figure is instead of implying "now". */
21954
+ measuredAtMs: number().int().nonnegative()
21955
+ });
21956
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21834
21957
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21835
21958
  providerId: string().min(1),
21836
21959
  displayName: string().min(1),
@@ -23466,39 +23589,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23466
23589
  deviceId: number(),
23467
23590
  status: BatteryStatusSchema
23468
23591
  });
23469
- /**
23470
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23471
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23472
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23473
- * one Home Assistant projection.
23474
- */
23475
- var NetworkLinkStatusSchema = object({
23476
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23477
- type: _enum([
23478
- "wifi",
23479
- "ethernet",
23480
- "cellular",
23481
- "unknown"
23482
- ]),
23483
- /**
23484
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23485
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23486
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23487
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23488
- * SKIP a null rather than coerce it.
23489
- */
23490
- signalPercent: number().min(0).max(100).nullable(),
23491
- /** Raw received signal strength in dBm, when the firmware reports one. */
23492
- rssiDbm: number().optional(),
23493
- /** Network name of a wireless link, when the firmware reports it. */
23494
- ssid: string().optional(),
23495
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23496
- lastUpdated: number()
23497
- });
23498
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23499
- deviceId: number(),
23500
- status: NetworkLinkStatusSchema
23501
- });
23502
23592
  object({
23503
23593
  on: boolean(),
23504
23594
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25852,6 +25942,236 @@ DeviceType.Camera, method(object({
25852
25942
  detection: NativeDetectionSchema
25853
25943
  });
25854
25944
  /**
25945
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25946
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25947
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25948
+ *
25949
+ * Why a NEW cap rather than overloading `ptz`:
25950
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25951
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25952
+ * The two are different physical models: PTZ is absolute-position + presets,
25953
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25954
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25955
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25956
+ * the reverse:
25957
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25958
+ * / `getOptions`), and
25959
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25960
+ * robot camera shows up in the existing PTZ control path without every
25961
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25962
+ * not here (see the addon design note):
25963
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25964
+ * ptz.stop() → navigation.stop()
25965
+ * ptz.goHome() → navigation.runAction('goHome')
25966
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25967
+ * ptz.goToPreset(id) → navigation.runAction(id)
25968
+ *
25969
+ * ## Continuous drive
25970
+ *
25971
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25972
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25973
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25974
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25975
+ * coalesce them. The UI owns the cadence.
25976
+ *
25977
+ * ## The action dictionary
25978
+ *
25979
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25980
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25981
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25982
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25983
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25984
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25985
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
25986
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
25987
+ *
25988
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
25989
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
25990
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
25991
+ * every device handle. A future nodedreame publish adds a typed
25992
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
25993
+ * provider can then swap the raw calls for the typed methods with no change to
25994
+ * THIS contract.
25995
+ */
25996
+ /**
25997
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
25998
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
25999
+ * halts it.
26000
+ *
26001
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
26002
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26003
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26004
+ * vector by it (drivers without proportional drive ignore it).
26005
+ *
26006
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26007
+ * axis alone; an all-undefined nudge is a no-op.
26008
+ */
26009
+ var NavigationMoveCommandSchema = object({
26010
+ pan: number().min(-1).max(1).optional(),
26011
+ tilt: number().min(-1).max(1).optional(),
26012
+ speed: number().min(0).max(1).optional()
26013
+ });
26014
+ /**
26015
+ * The enumerated discrete actions a navigation-capable robot can perform via
26016
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26017
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26018
+ * `playSound` (see the `sound` dictionary entries).
26019
+ */
26020
+ var NavigationActionIdSchema = _enum([
26021
+ "goHome",
26022
+ "locate",
26023
+ "spotClean",
26024
+ "findPet",
26025
+ "personFollow",
26026
+ "stop",
26027
+ "startClean",
26028
+ "pauseClean",
26029
+ "dockWash",
26030
+ "autoEmpty",
26031
+ "flashOn",
26032
+ "flashOff"
26033
+ ]);
26034
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
26035
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
26036
+ /**
26037
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
26038
+ * native panel and the PTZ mimic render as a button.
26039
+ *
26040
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
26041
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
26042
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
26043
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
26044
+ * - `label` — operator-facing English label.
26045
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
26046
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
26047
+ * PTZ render ONLY enabled entries. Data-driven: the provider
26048
+ * flips it from config, never by editing code.
26049
+ */
26050
+ var NavigationActionEntrySchema = object({
26051
+ id: string(),
26052
+ kind: NavigationEntryKindSchema,
26053
+ label: string(),
26054
+ icon: string(),
26055
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
26056
+ soundId: number().int().optional(),
26057
+ /** Per-device feature flag — render this entry only when true. */
26058
+ enabled: boolean()
26059
+ });
26060
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
26061
+ var NavigationPointSchema = object({
26062
+ x: number(),
26063
+ y: number()
26064
+ });
26065
+ /**
26066
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
26067
+ * The cap reports which are enabled so the UI / PTZ render only the controls
26068
+ * that are turned on for THIS device. Data-driven: the provider derives these
26069
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
26070
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
26071
+ * that are not dictionary entries.
26072
+ *
26073
+ * - `move` / `stop` — the momentary drive joystick.
26074
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26075
+ * map-coordinate plumbing is wired.
26076
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26077
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26078
+ * - `light` — the on/off fill-light toggle (works anytime).
26079
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26080
+ * camera-service control; needs an active stream).
26081
+ */
26082
+ var NavigationFeaturesSchema = object({
26083
+ move: boolean(),
26084
+ stop: boolean(),
26085
+ goToPoint: boolean(),
26086
+ runAction: boolean(),
26087
+ playSound: boolean(),
26088
+ light: boolean(),
26089
+ lightMode: boolean()
26090
+ });
26091
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26092
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26093
+ /**
26094
+ * Live navigation state so the UI can reflect what the robot is doing:
26095
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26096
+ * - `following` — person/pet follow is currently armed.
26097
+ * - `flash` — the on-camera fill light is on.
26098
+ * - `lightMode` — auto vs manual fill-light mode.
26099
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26100
+ * `lightMode === 'manual'`.
26101
+ */
26102
+ var NavigationStatusSchema = object({
26103
+ mode: _enum([
26104
+ "idle",
26105
+ "cleaning",
26106
+ "spot",
26107
+ "following",
26108
+ "goto",
26109
+ "returning",
26110
+ "paused",
26111
+ "unknown"
26112
+ ]),
26113
+ following: boolean(),
26114
+ flash: boolean(),
26115
+ lightMode: NavigationLightModeSchema,
26116
+ lightLevel: number().min(40).max(100),
26117
+ /** Ms epoch when the slice was last updated. */
26118
+ lastChangedAt: number()
26119
+ });
26120
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26121
+ 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({
26122
+ deviceId: number(),
26123
+ actionId: NavigationActionIdSchema
26124
+ }), _void(), { kind: "mutation" }), method(object({
26125
+ deviceId: number(),
26126
+ soundId: number().int()
26127
+ }), _void(), { kind: "mutation" }), method(object({
26128
+ deviceId: number(),
26129
+ on: boolean()
26130
+ }), _void(), { kind: "mutation" }), method(object({
26131
+ deviceId: number(),
26132
+ mode: NavigationLightModeSchema,
26133
+ level: number().min(40).max(100).optional()
26134
+ }), _void(), { kind: "mutation" }), method(object({
26135
+ deviceId: number(),
26136
+ level: number().min(40).max(100)
26137
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26138
+ deviceId: number(),
26139
+ status: NavigationStatusSchema
26140
+ });
26141
+ /**
26142
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26143
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26144
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26145
+ * one Home Assistant projection.
26146
+ */
26147
+ var NetworkLinkStatusSchema = object({
26148
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26149
+ type: _enum([
26150
+ "wifi",
26151
+ "ethernet",
26152
+ "cellular",
26153
+ "unknown"
26154
+ ]),
26155
+ /**
26156
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26157
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26158
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26159
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26160
+ * SKIP a null rather than coerce it.
26161
+ */
26162
+ signalPercent: number().min(0).max(100).nullable(),
26163
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26164
+ rssiDbm: number().optional(),
26165
+ /** Network name of a wireless link, when the firmware reports it. */
26166
+ ssid: string().optional(),
26167
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26168
+ lastUpdated: number()
26169
+ });
26170
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26171
+ deviceId: number(),
26172
+ status: NetworkLinkStatusSchema
26173
+ });
26174
+ /**
25855
26175
  * network-quality — system-scoped singleton capability tracking RTT,
25856
26176
  * jitter, and observed/peak bandwidth per device + per client.
25857
26177
  *
@@ -27093,203 +27413,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
27093
27413
  deviceId: number(),
27094
27414
  status: PtzAutotrackStatusSchema
27095
27415
  });
27096
- /**
27097
- * `navigation` — a device-scoped capability that natively expresses the FULL
27098
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
27099
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
27100
- *
27101
- * Why a NEW cap rather than overloading `ptz`:
27102
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27103
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27104
- * The two are different physical models: PTZ is absolute-position + presets,
27105
- * navigation is momentary drive nudges + discrete robot ACTIONS
27106
- * (dock / spot-clean / follow-pet / go-to-point / …).
27107
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27108
- * the reverse:
27109
- * 1. a native CamStack navigation panel (data-driven from `listActions`
27110
- * / `getOptions`), and
27111
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27112
- * robot camera shows up in the existing PTZ control path without every
27113
- * PTZ provider learning about robots. The mapping lives in the adapter,
27114
- * not here (see the addon design note):
27115
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27116
- * ptz.stop() → navigation.stop()
27117
- * ptz.goHome() → navigation.runAction('goHome')
27118
- * ptz.getPresets() → navigation.listActions() (id→preset)
27119
- * ptz.goToPreset(id) → navigation.runAction(id)
27120
- *
27121
- * ## Continuous drive
27122
- *
27123
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27124
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27125
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27126
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27127
- * coalesce them. The UI owns the cadence.
27128
- *
27129
- * ## The action dictionary
27130
- *
27131
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27132
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27133
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27134
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27135
- * vendor-specific list. `kind: 'action'` entries are triggered with
27136
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27137
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27138
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27139
- *
27140
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27141
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27142
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27143
- * every device handle. A future nodedreame publish adds a typed
27144
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27145
- * provider can then swap the raw calls for the typed methods with no change to
27146
- * THIS contract.
27147
- */
27148
- /**
27149
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27150
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27151
- * halts it.
27152
- *
27153
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27154
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27155
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27156
- * vector by it (drivers without proportional drive ignore it).
27157
- *
27158
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27159
- * axis alone; an all-undefined nudge is a no-op.
27160
- */
27161
- var NavigationMoveCommandSchema = object({
27162
- pan: number().min(-1).max(1).optional(),
27163
- tilt: number().min(-1).max(1).optional(),
27164
- speed: number().min(0).max(1).optional()
27165
- });
27166
- /**
27167
- * The enumerated discrete actions a navigation-capable robot can perform via
27168
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27169
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27170
- * `playSound` (see the `sound` dictionary entries).
27171
- */
27172
- var NavigationActionIdSchema = _enum([
27173
- "goHome",
27174
- "locate",
27175
- "spotClean",
27176
- "findPet",
27177
- "personFollow",
27178
- "stop",
27179
- "startClean",
27180
- "pauseClean",
27181
- "dockWash",
27182
- "autoEmpty",
27183
- "flashOn",
27184
- "flashOff"
27185
- ]);
27186
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27187
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27188
- /**
27189
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27190
- * native panel and the PTZ mimic render as a button.
27191
- *
27192
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27193
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27194
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27195
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27196
- * - `label` — operator-facing English label.
27197
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27198
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27199
- * PTZ render ONLY enabled entries. Data-driven: the provider
27200
- * flips it from config, never by editing code.
27201
- */
27202
- var NavigationActionEntrySchema = object({
27203
- id: string(),
27204
- kind: NavigationEntryKindSchema,
27205
- label: string(),
27206
- icon: string(),
27207
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27208
- soundId: number().int().optional(),
27209
- /** Per-device feature flag — render this entry only when true. */
27210
- enabled: boolean()
27211
- });
27212
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27213
- var NavigationPointSchema = object({
27214
- x: number(),
27215
- y: number()
27216
- });
27217
- /**
27218
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27219
- * The cap reports which are enabled so the UI / PTZ render only the controls
27220
- * that are turned on for THIS device. Data-driven: the provider derives these
27221
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27222
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27223
- * that are not dictionary entries.
27224
- *
27225
- * - `move` / `stop` — the momentary drive joystick.
27226
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27227
- * map-coordinate plumbing is wired.
27228
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27229
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27230
- * - `light` — the on/off fill-light toggle (works anytime).
27231
- * - `lightMode` — the auto/manual selector + manual level slider (a
27232
- * camera-service control; needs an active stream).
27233
- */
27234
- var NavigationFeaturesSchema = object({
27235
- move: boolean(),
27236
- stop: boolean(),
27237
- goToPoint: boolean(),
27238
- runAction: boolean(),
27239
- playSound: boolean(),
27240
- light: boolean(),
27241
- lightMode: boolean()
27242
- });
27243
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27244
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27245
- /**
27246
- * Live navigation state so the UI can reflect what the robot is doing:
27247
- * - `mode` — coarse activity (idle / cleaning / following / …).
27248
- * - `following` — person/pet follow is currently armed.
27249
- * - `flash` — the on-camera fill light is on.
27250
- * - `lightMode` — auto vs manual fill-light mode.
27251
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27252
- * `lightMode === 'manual'`.
27253
- */
27254
- var NavigationStatusSchema = object({
27255
- mode: _enum([
27256
- "idle",
27257
- "cleaning",
27258
- "spot",
27259
- "following",
27260
- "goto",
27261
- "returning",
27262
- "paused",
27263
- "unknown"
27264
- ]),
27265
- following: boolean(),
27266
- flash: boolean(),
27267
- lightMode: NavigationLightModeSchema,
27268
- lightLevel: number().min(40).max(100),
27269
- /** Ms epoch when the slice was last updated. */
27270
- lastChangedAt: number()
27271
- });
27272
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27273
- 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({
27274
- deviceId: number(),
27275
- actionId: NavigationActionIdSchema
27276
- }), _void(), { kind: "mutation" }), method(object({
27277
- deviceId: number(),
27278
- soundId: number().int()
27279
- }), _void(), { kind: "mutation" }), method(object({
27280
- deviceId: number(),
27281
- on: boolean()
27282
- }), _void(), { kind: "mutation" }), method(object({
27283
- deviceId: number(),
27284
- mode: NavigationLightModeSchema,
27285
- level: number().min(40).max(100).optional()
27286
- }), _void(), { kind: "mutation" }), method(object({
27287
- deviceId: number(),
27288
- level: number().min(40).max(100)
27289
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27290
- deviceId: number(),
27291
- status: NavigationStatusSchema
27292
- });
27293
27416
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27294
27417
  kind: "mutation",
27295
27418
  auth: "admin"
@@ -34604,6 +34727,12 @@ Object.freeze({
34604
34727
  addonId: null,
34605
34728
  access: "view"
34606
34729
  },
34730
+ "storage.listDrainProgress": {
34731
+ capName: "storage",
34732
+ capScope: "system",
34733
+ addonId: null,
34734
+ access: "view"
34735
+ },
34607
34736
  "storage.listLocationDeclarations": {
34608
34737
  capName: "storage",
34609
34738
  capScope: "system",
@@ -34748,6 +34877,12 @@ Object.freeze({
34748
34877
  addonId: null,
34749
34878
  access: "view"
34750
34879
  },
34880
+ "storageOccupancy.getOccupancy": {
34881
+ capName: "storage-occupancy",
34882
+ capScope: "system",
34883
+ addonId: null,
34884
+ access: "view"
34885
+ },
34751
34886
  "storageProvider.abortUpload": {
34752
34887
  capName: "storage-provider",
34753
34888
  capScope: "system",