@camstack/addon-notifiers 1.2.83 → 1.2.85

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 +386 -234
  2. package/dist/addon.mjs +386 -234
  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
@@ -20241,8 +20319,25 @@ var occupancyRecheckFramesField = {
20241
20319
  * (analyzer attaches detected `regions[]`; onboard does not — the
20242
20320
  * camera typically only reports a binary signal plus an optional
20243
20321
  * channel/AI class which lives in dedicated event channels).
20244
- */
20245
- var MotionSourceEnum = _enum(["onboard", "analyzer"]);
20322
+ *
20323
+ * - `onboard` — the camera's firmware said something moved.
20324
+ * - `analyzer` — this runner's frame-diff said so, and attaches `regions[]`.
20325
+ * - `device-activity` — the DEVICE said it is doing its job: the
20326
+ * `recording-signal` LEVEL the same device raises for the recorder
20327
+ * ([D380](../../../../docs/decisions/adr-0380-a-device-decided-recording-is-a-mode-with-no-schedule-seeded-once.md)),
20328
+ * republished as a motion source. It attaches **nothing** — no regions, no
20329
+ * class: the only fact it carries is that the device is active, and a robot
20330
+ * vacuum that is itself the moving object has no region worth sending. It is
20331
+ * a LEVEL, so unlike `onboard` it has a real falling edge, and unlike
20332
+ * `analyzer` it must not open the frame-diff side-channel — the runner's
20333
+ * `handleOnboardMotionAnalyzer` gate is `source === 'onboard'` and stays that
20334
+ * way ([D392](../../../../docs/decisions/adr-0392-a-device-that-says-it-is-working-is-a-motion-source-of-its-own.md)).
20335
+ */
20336
+ var MotionSourceEnum = _enum([
20337
+ "onboard",
20338
+ "analyzer",
20339
+ "device-activity"
20340
+ ]);
20246
20341
  /**
20247
20342
  * List of motion sources active on a camera. Empty array is valid:
20248
20343
  * "no source" — happens for battery cams without firmware motion when
@@ -21761,7 +21856,7 @@ method(object({
21761
21856
  }), _void(), {
21762
21857
  kind: "mutation",
21763
21858
  auth: "admin"
21764
- }), method(object({ id: string() }), object({
21859
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21765
21860
  ok: boolean(),
21766
21861
  error: string().optional()
21767
21862
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21831,6 +21926,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21831
21926
  kind: "mutation",
21832
21927
  auth: "admin"
21833
21928
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21929
+ /**
21930
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21931
+ * location (D388).
21932
+ *
21933
+ * ## Why this is not `storage-evictable`
21934
+ *
21935
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21936
+ * not, in two ways that both matter and both bite hardest on the locations an
21937
+ * operator most wants a figure for:
21938
+ *
21939
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21940
+ * and `recordingsLow:default` deliberately share one root and evict as one
21941
+ * oldest-first pool, so both answer with the SAME combined total. As an
21942
+ * occupancy figure that double-counts the disk.
21943
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21944
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21945
+ * is retiring and staring at.
21946
+ *
21947
+ * So this is its own contract with its own quantity, and the quantity is
21948
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21949
+ * would ever be willing to delete it. A provider that can only answer
21950
+ * "evictable" must not register here — a number that silently means different
21951
+ * things per class is worse than no number.
21952
+ *
21953
+ * ## Absence is an answer
21954
+ *
21955
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21956
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21957
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21958
+ * consuming side has to be written out loud instead of appearing by accident.
21959
+ *
21960
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21961
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21962
+ */
21963
+ /** One provider's occupancy answer for one location. */
21964
+ var StorageOccupancyReportSchema = object({
21965
+ locationId: string(),
21966
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21967
+ * not net of what it is willing to delete. */
21968
+ ownedBytes: number().int().nonnegative(),
21969
+ /** When the provider last actually measured this. The orchestrator carries it
21970
+ * through so a UI can say how old the figure is instead of implying "now". */
21971
+ measuredAtMs: number().int().nonnegative()
21972
+ });
21973
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21834
21974
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21835
21975
  providerId: string().min(1),
21836
21976
  displayName: string().min(1),
@@ -23466,39 +23606,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23466
23606
  deviceId: number(),
23467
23607
  status: BatteryStatusSchema
23468
23608
  });
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
23609
  object({
23503
23610
  on: boolean(),
23504
23611
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25852,6 +25959,236 @@ DeviceType.Camera, method(object({
25852
25959
  detection: NativeDetectionSchema
25853
25960
  });
25854
25961
  /**
25962
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25963
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25964
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25965
+ *
25966
+ * Why a NEW cap rather than overloading `ptz`:
25967
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25968
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25969
+ * The two are different physical models: PTZ is absolute-position + presets,
25970
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25971
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25972
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25973
+ * the reverse:
25974
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25975
+ * / `getOptions`), and
25976
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25977
+ * robot camera shows up in the existing PTZ control path without every
25978
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25979
+ * not here (see the addon design note):
25980
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25981
+ * ptz.stop() → navigation.stop()
25982
+ * ptz.goHome() → navigation.runAction('goHome')
25983
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25984
+ * ptz.goToPreset(id) → navigation.runAction(id)
25985
+ *
25986
+ * ## Continuous drive
25987
+ *
25988
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25989
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25990
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25991
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25992
+ * coalesce them. The UI owns the cadence.
25993
+ *
25994
+ * ## The action dictionary
25995
+ *
25996
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25997
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25998
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25999
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
26000
+ * vendor-specific list. `kind: 'action'` entries are triggered with
26001
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
26002
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
26003
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26004
+ *
26005
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26006
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26007
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
26008
+ * every device handle. A future nodedreame publish adds a typed
26009
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
26010
+ * provider can then swap the raw calls for the typed methods with no change to
26011
+ * THIS contract.
26012
+ */
26013
+ /**
26014
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
26015
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
26016
+ * halts it.
26017
+ *
26018
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
26019
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26020
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26021
+ * vector by it (drivers without proportional drive ignore it).
26022
+ *
26023
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26024
+ * axis alone; an all-undefined nudge is a no-op.
26025
+ */
26026
+ var NavigationMoveCommandSchema = object({
26027
+ pan: number().min(-1).max(1).optional(),
26028
+ tilt: number().min(-1).max(1).optional(),
26029
+ speed: number().min(0).max(1).optional()
26030
+ });
26031
+ /**
26032
+ * The enumerated discrete actions a navigation-capable robot can perform via
26033
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26034
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26035
+ * `playSound` (see the `sound` dictionary entries).
26036
+ */
26037
+ var NavigationActionIdSchema = _enum([
26038
+ "goHome",
26039
+ "locate",
26040
+ "spotClean",
26041
+ "findPet",
26042
+ "personFollow",
26043
+ "stop",
26044
+ "startClean",
26045
+ "pauseClean",
26046
+ "dockWash",
26047
+ "autoEmpty",
26048
+ "flashOn",
26049
+ "flashOff"
26050
+ ]);
26051
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
26052
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
26053
+ /**
26054
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
26055
+ * native panel and the PTZ mimic render as a button.
26056
+ *
26057
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
26058
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
26059
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
26060
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
26061
+ * - `label` — operator-facing English label.
26062
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
26063
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
26064
+ * PTZ render ONLY enabled entries. Data-driven: the provider
26065
+ * flips it from config, never by editing code.
26066
+ */
26067
+ var NavigationActionEntrySchema = object({
26068
+ id: string(),
26069
+ kind: NavigationEntryKindSchema,
26070
+ label: string(),
26071
+ icon: string(),
26072
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
26073
+ soundId: number().int().optional(),
26074
+ /** Per-device feature flag — render this entry only when true. */
26075
+ enabled: boolean()
26076
+ });
26077
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
26078
+ var NavigationPointSchema = object({
26079
+ x: number(),
26080
+ y: number()
26081
+ });
26082
+ /**
26083
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
26084
+ * The cap reports which are enabled so the UI / PTZ render only the controls
26085
+ * that are turned on for THIS device. Data-driven: the provider derives these
26086
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
26087
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
26088
+ * that are not dictionary entries.
26089
+ *
26090
+ * - `move` / `stop` — the momentary drive joystick.
26091
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26092
+ * map-coordinate plumbing is wired.
26093
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26094
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26095
+ * - `light` — the on/off fill-light toggle (works anytime).
26096
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26097
+ * camera-service control; needs an active stream).
26098
+ */
26099
+ var NavigationFeaturesSchema = object({
26100
+ move: boolean(),
26101
+ stop: boolean(),
26102
+ goToPoint: boolean(),
26103
+ runAction: boolean(),
26104
+ playSound: boolean(),
26105
+ light: boolean(),
26106
+ lightMode: boolean()
26107
+ });
26108
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26109
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26110
+ /**
26111
+ * Live navigation state so the UI can reflect what the robot is doing:
26112
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26113
+ * - `following` — person/pet follow is currently armed.
26114
+ * - `flash` — the on-camera fill light is on.
26115
+ * - `lightMode` — auto vs manual fill-light mode.
26116
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26117
+ * `lightMode === 'manual'`.
26118
+ */
26119
+ var NavigationStatusSchema = object({
26120
+ mode: _enum([
26121
+ "idle",
26122
+ "cleaning",
26123
+ "spot",
26124
+ "following",
26125
+ "goto",
26126
+ "returning",
26127
+ "paused",
26128
+ "unknown"
26129
+ ]),
26130
+ following: boolean(),
26131
+ flash: boolean(),
26132
+ lightMode: NavigationLightModeSchema,
26133
+ lightLevel: number().min(40).max(100),
26134
+ /** Ms epoch when the slice was last updated. */
26135
+ lastChangedAt: number()
26136
+ });
26137
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26138
+ 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({
26139
+ deviceId: number(),
26140
+ actionId: NavigationActionIdSchema
26141
+ }), _void(), { kind: "mutation" }), method(object({
26142
+ deviceId: number(),
26143
+ soundId: number().int()
26144
+ }), _void(), { kind: "mutation" }), method(object({
26145
+ deviceId: number(),
26146
+ on: boolean()
26147
+ }), _void(), { kind: "mutation" }), method(object({
26148
+ deviceId: number(),
26149
+ mode: NavigationLightModeSchema,
26150
+ level: number().min(40).max(100).optional()
26151
+ }), _void(), { kind: "mutation" }), method(object({
26152
+ deviceId: number(),
26153
+ level: number().min(40).max(100)
26154
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26155
+ deviceId: number(),
26156
+ status: NavigationStatusSchema
26157
+ });
26158
+ /**
26159
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26160
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26161
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26162
+ * one Home Assistant projection.
26163
+ */
26164
+ var NetworkLinkStatusSchema = object({
26165
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26166
+ type: _enum([
26167
+ "wifi",
26168
+ "ethernet",
26169
+ "cellular",
26170
+ "unknown"
26171
+ ]),
26172
+ /**
26173
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26174
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26175
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26176
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26177
+ * SKIP a null rather than coerce it.
26178
+ */
26179
+ signalPercent: number().min(0).max(100).nullable(),
26180
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26181
+ rssiDbm: number().optional(),
26182
+ /** Network name of a wireless link, when the firmware reports it. */
26183
+ ssid: string().optional(),
26184
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26185
+ lastUpdated: number()
26186
+ });
26187
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26188
+ deviceId: number(),
26189
+ status: NetworkLinkStatusSchema
26190
+ });
26191
+ /**
25855
26192
  * network-quality — system-scoped singleton capability tracking RTT,
25856
26193
  * jitter, and observed/peak bandwidth per device + per client.
25857
26194
  *
@@ -27093,203 +27430,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
27093
27430
  deviceId: number(),
27094
27431
  status: PtzAutotrackStatusSchema
27095
27432
  });
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
27433
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27294
27434
  kind: "mutation",
27295
27435
  auth: "admin"
@@ -34604,6 +34744,12 @@ Object.freeze({
34604
34744
  addonId: null,
34605
34745
  access: "view"
34606
34746
  },
34747
+ "storage.listDrainProgress": {
34748
+ capName: "storage",
34749
+ capScope: "system",
34750
+ addonId: null,
34751
+ access: "view"
34752
+ },
34607
34753
  "storage.listLocationDeclarations": {
34608
34754
  capName: "storage",
34609
34755
  capScope: "system",
@@ -34748,6 +34894,12 @@ Object.freeze({
34748
34894
  addonId: null,
34749
34895
  access: "view"
34750
34896
  },
34897
+ "storageOccupancy.getOccupancy": {
34898
+ capName: "storage-occupancy",
34899
+ capScope: "system",
34900
+ addonId: null,
34901
+ access: "view"
34902
+ },
34751
34903
  "storageProvider.abortUpload": {
34752
34904
  capName: "storage-provider",
34753
34905
  capScope: "system",