@camstack/addon-provider-onvif 1.2.78 → 1.2.79

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
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region \0rolldown/runtime.js
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  //#endregion
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";
@@ -8535,6 +8548,21 @@ var StorageCleanupJobSchema = object({
8535
8548
  });
8536
8549
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8537
8550
  /**
8551
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8552
+ * alias below is `z.infer<>` of it, never a second spelling.
8553
+ */
8554
+ var StorageLocationModeSchema = _enum([
8555
+ "active",
8556
+ "readonly",
8557
+ "drain",
8558
+ "disabled"
8559
+ ]);
8560
+ _enum([
8561
+ "normal",
8562
+ "never",
8563
+ "drain"
8564
+ ]);
8565
+ /**
8538
8566
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8539
8567
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8540
8568
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8600,6 +8628,21 @@ var StorageLocationSchema = object({
8600
8628
  * stops existing rather than being re-derived on every read.
8601
8629
  */
8602
8630
  enabled: boolean().optional(),
8631
+ /**
8632
+ * THE state of this location (D385), and the only authority on what may be
8633
+ * written, read or evicted here. Interpreted in exactly one place —
8634
+ * `storage-location-mode.ts` — which also folds the legacy
8635
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8636
+ * ambiguous.
8637
+ *
8638
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8639
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8640
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8641
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8642
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8643
+ * either, so the two cannot disagree.
8644
+ */
8645
+ mode: StorageLocationModeSchema.optional(),
8603
8646
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8604
8647
  * for node-local locations it can reach) — never persisted, absent when the
8605
8648
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8607,11 +8650,46 @@ var StorageLocationSchema = object({
8607
8650
  totalBytes: number(),
8608
8651
  availableBytes: number()
8609
8652
  }).nullable().optional(),
8653
+ /**
8654
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8655
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8656
+ * never persisted, never a filesystem walk.
8657
+ *
8658
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8659
+ * location yet — nobody stores here, the owning addon is down, or the first
8660
+ * refresh has not completed. A UI must omit the segment rather than draw it
8661
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8662
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8663
+ * be spelled out loud instead of appearing by accident.
8664
+ *
8665
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8666
+ * about the whole figure rather than about its freshest part.
8667
+ */
8668
+ owned: object({
8669
+ bytes: number().int().nonnegative(),
8670
+ measuredAtMs: number().int().nonnegative()
8671
+ }).optional(),
8610
8672
  createdAt: number(),
8611
8673
  updatedAt: number()
8612
8674
  });
8613
8675
  object({ isDefault: boolean().optional() });
8614
8676
  /**
8677
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8678
+ *
8679
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8680
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8681
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8682
+ * operator learns not to believe the screen.
8683
+ */
8684
+ var StorageDrainProgressSchema = object({
8685
+ locationId: string(),
8686
+ startedAtMs: number(),
8687
+ startBytes: number(),
8688
+ bytesRemaining: number(),
8689
+ drained: boolean(),
8690
+ estimatedEmptyAtMs: number().nullable()
8691
+ });
8692
+ /**
8615
8693
  * Reference accepted by consumer-facing `api.storage.*` calls.
8616
8694
  * Either:
8617
8695
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -21757,7 +21835,7 @@ method(object({
21757
21835
  }), _void(), {
21758
21836
  kind: "mutation",
21759
21837
  auth: "admin"
21760
- }), method(object({ id: string() }), object({
21838
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21761
21839
  ok: boolean(),
21762
21840
  error: string().optional()
21763
21841
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21827,6 +21905,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21827
21905
  kind: "mutation",
21828
21906
  auth: "admin"
21829
21907
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21908
+ /**
21909
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21910
+ * location (D388).
21911
+ *
21912
+ * ## Why this is not `storage-evictable`
21913
+ *
21914
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21915
+ * not, in two ways that both matter and both bite hardest on the locations an
21916
+ * operator most wants a figure for:
21917
+ *
21918
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21919
+ * and `recordingsLow:default` deliberately share one root and evict as one
21920
+ * oldest-first pool, so both answer with the SAME combined total. As an
21921
+ * occupancy figure that double-counts the disk.
21922
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21923
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21924
+ * is retiring and staring at.
21925
+ *
21926
+ * So this is its own contract with its own quantity, and the quantity is
21927
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21928
+ * would ever be willing to delete it. A provider that can only answer
21929
+ * "evictable" must not register here — a number that silently means different
21930
+ * things per class is worse than no number.
21931
+ *
21932
+ * ## Absence is an answer
21933
+ *
21934
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21935
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21936
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21937
+ * consuming side has to be written out loud instead of appearing by accident.
21938
+ *
21939
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21940
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21941
+ */
21942
+ /** One provider's occupancy answer for one location. */
21943
+ var StorageOccupancyReportSchema = object({
21944
+ locationId: string(),
21945
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21946
+ * not net of what it is willing to delete. */
21947
+ ownedBytes: number().int().nonnegative(),
21948
+ /** When the provider last actually measured this. The orchestrator carries it
21949
+ * through so a UI can say how old the figure is instead of implying "now". */
21950
+ measuredAtMs: number().int().nonnegative()
21951
+ });
21952
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21830
21953
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21831
21954
  providerId: string().min(1),
21832
21955
  displayName: string().min(1),
@@ -23462,39 +23585,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23462
23585
  deviceId: number(),
23463
23586
  status: BatteryStatusSchema
23464
23587
  });
23465
- /**
23466
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23467
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23468
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23469
- * one Home Assistant projection.
23470
- */
23471
- var NetworkLinkStatusSchema = object({
23472
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23473
- type: _enum([
23474
- "wifi",
23475
- "ethernet",
23476
- "cellular",
23477
- "unknown"
23478
- ]),
23479
- /**
23480
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23481
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23482
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23483
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23484
- * SKIP a null rather than coerce it.
23485
- */
23486
- signalPercent: number().min(0).max(100).nullable(),
23487
- /** Raw received signal strength in dBm, when the firmware reports one. */
23488
- rssiDbm: number().optional(),
23489
- /** Network name of a wireless link, when the firmware reports it. */
23490
- ssid: string().optional(),
23491
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23492
- lastUpdated: number()
23493
- });
23494
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23495
- deviceId: number(),
23496
- status: NetworkLinkStatusSchema
23497
- });
23498
23588
  object({
23499
23589
  on: boolean(),
23500
23590
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25848,6 +25938,236 @@ DeviceType.Camera, method(object({
25848
25938
  detection: NativeDetectionSchema
25849
25939
  });
25850
25940
  /**
25941
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25942
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25943
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25944
+ *
25945
+ * Why a NEW cap rather than overloading `ptz`:
25946
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25947
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25948
+ * The two are different physical models: PTZ is absolute-position + presets,
25949
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25950
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25951
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25952
+ * the reverse:
25953
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25954
+ * / `getOptions`), and
25955
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25956
+ * robot camera shows up in the existing PTZ control path without every
25957
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25958
+ * not here (see the addon design note):
25959
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25960
+ * ptz.stop() → navigation.stop()
25961
+ * ptz.goHome() → navigation.runAction('goHome')
25962
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25963
+ * ptz.goToPreset(id) → navigation.runAction(id)
25964
+ *
25965
+ * ## Continuous drive
25966
+ *
25967
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25968
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25969
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25970
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25971
+ * coalesce them. The UI owns the cadence.
25972
+ *
25973
+ * ## The action dictionary
25974
+ *
25975
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25976
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25977
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25978
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25979
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25980
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25981
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
25982
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
25983
+ *
25984
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
25985
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
25986
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
25987
+ * every device handle. A future nodedreame publish adds a typed
25988
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
25989
+ * provider can then swap the raw calls for the typed methods with no change to
25990
+ * THIS contract.
25991
+ */
25992
+ /**
25993
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
25994
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
25995
+ * halts it.
25996
+ *
25997
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
25998
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
25999
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26000
+ * vector by it (drivers without proportional drive ignore it).
26001
+ *
26002
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26003
+ * axis alone; an all-undefined nudge is a no-op.
26004
+ */
26005
+ var NavigationMoveCommandSchema = object({
26006
+ pan: number().min(-1).max(1).optional(),
26007
+ tilt: number().min(-1).max(1).optional(),
26008
+ speed: number().min(0).max(1).optional()
26009
+ });
26010
+ /**
26011
+ * The enumerated discrete actions a navigation-capable robot can perform via
26012
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26013
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26014
+ * `playSound` (see the `sound` dictionary entries).
26015
+ */
26016
+ var NavigationActionIdSchema = _enum([
26017
+ "goHome",
26018
+ "locate",
26019
+ "spotClean",
26020
+ "findPet",
26021
+ "personFollow",
26022
+ "stop",
26023
+ "startClean",
26024
+ "pauseClean",
26025
+ "dockWash",
26026
+ "autoEmpty",
26027
+ "flashOn",
26028
+ "flashOff"
26029
+ ]);
26030
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
26031
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
26032
+ /**
26033
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
26034
+ * native panel and the PTZ mimic render as a button.
26035
+ *
26036
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
26037
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
26038
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
26039
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
26040
+ * - `label` — operator-facing English label.
26041
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
26042
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
26043
+ * PTZ render ONLY enabled entries. Data-driven: the provider
26044
+ * flips it from config, never by editing code.
26045
+ */
26046
+ var NavigationActionEntrySchema = object({
26047
+ id: string(),
26048
+ kind: NavigationEntryKindSchema,
26049
+ label: string(),
26050
+ icon: string(),
26051
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
26052
+ soundId: number().int().optional(),
26053
+ /** Per-device feature flag — render this entry only when true. */
26054
+ enabled: boolean()
26055
+ });
26056
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
26057
+ var NavigationPointSchema = object({
26058
+ x: number(),
26059
+ y: number()
26060
+ });
26061
+ /**
26062
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
26063
+ * The cap reports which are enabled so the UI / PTZ render only the controls
26064
+ * that are turned on for THIS device. Data-driven: the provider derives these
26065
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
26066
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
26067
+ * that are not dictionary entries.
26068
+ *
26069
+ * - `move` / `stop` — the momentary drive joystick.
26070
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26071
+ * map-coordinate plumbing is wired.
26072
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26073
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26074
+ * - `light` — the on/off fill-light toggle (works anytime).
26075
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26076
+ * camera-service control; needs an active stream).
26077
+ */
26078
+ var NavigationFeaturesSchema = object({
26079
+ move: boolean(),
26080
+ stop: boolean(),
26081
+ goToPoint: boolean(),
26082
+ runAction: boolean(),
26083
+ playSound: boolean(),
26084
+ light: boolean(),
26085
+ lightMode: boolean()
26086
+ });
26087
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26088
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26089
+ /**
26090
+ * Live navigation state so the UI can reflect what the robot is doing:
26091
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26092
+ * - `following` — person/pet follow is currently armed.
26093
+ * - `flash` — the on-camera fill light is on.
26094
+ * - `lightMode` — auto vs manual fill-light mode.
26095
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26096
+ * `lightMode === 'manual'`.
26097
+ */
26098
+ var NavigationStatusSchema = object({
26099
+ mode: _enum([
26100
+ "idle",
26101
+ "cleaning",
26102
+ "spot",
26103
+ "following",
26104
+ "goto",
26105
+ "returning",
26106
+ "paused",
26107
+ "unknown"
26108
+ ]),
26109
+ following: boolean(),
26110
+ flash: boolean(),
26111
+ lightMode: NavigationLightModeSchema,
26112
+ lightLevel: number().min(40).max(100),
26113
+ /** Ms epoch when the slice was last updated. */
26114
+ lastChangedAt: number()
26115
+ });
26116
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26117
+ 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({
26118
+ deviceId: number(),
26119
+ actionId: NavigationActionIdSchema
26120
+ }), _void(), { kind: "mutation" }), method(object({
26121
+ deviceId: number(),
26122
+ soundId: number().int()
26123
+ }), _void(), { kind: "mutation" }), method(object({
26124
+ deviceId: number(),
26125
+ on: boolean()
26126
+ }), _void(), { kind: "mutation" }), method(object({
26127
+ deviceId: number(),
26128
+ mode: NavigationLightModeSchema,
26129
+ level: number().min(40).max(100).optional()
26130
+ }), _void(), { kind: "mutation" }), method(object({
26131
+ deviceId: number(),
26132
+ level: number().min(40).max(100)
26133
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26134
+ deviceId: number(),
26135
+ status: NavigationStatusSchema
26136
+ });
26137
+ /**
26138
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26139
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26140
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26141
+ * one Home Assistant projection.
26142
+ */
26143
+ var NetworkLinkStatusSchema = object({
26144
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26145
+ type: _enum([
26146
+ "wifi",
26147
+ "ethernet",
26148
+ "cellular",
26149
+ "unknown"
26150
+ ]),
26151
+ /**
26152
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26153
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26154
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26155
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26156
+ * SKIP a null rather than coerce it.
26157
+ */
26158
+ signalPercent: number().min(0).max(100).nullable(),
26159
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26160
+ rssiDbm: number().optional(),
26161
+ /** Network name of a wireless link, when the firmware reports it. */
26162
+ ssid: string().optional(),
26163
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26164
+ lastUpdated: number()
26165
+ });
26166
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26167
+ deviceId: number(),
26168
+ status: NetworkLinkStatusSchema
26169
+ });
26170
+ /**
25851
26171
  * network-quality — system-scoped singleton capability tracking RTT,
25852
26172
  * jitter, and observed/peak bandwidth per device + per client.
25853
26173
  *
@@ -27131,203 +27451,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
27131
27451
  deviceId: number(),
27132
27452
  status: PtzAutotrackStatusSchema
27133
27453
  });
27134
- /**
27135
- * `navigation` — a device-scoped capability that natively expresses the FULL
27136
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
27137
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
27138
- *
27139
- * Why a NEW cap rather than overloading `ptz`:
27140
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27141
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27142
- * The two are different physical models: PTZ is absolute-position + presets,
27143
- * navigation is momentary drive nudges + discrete robot ACTIONS
27144
- * (dock / spot-clean / follow-pet / go-to-point / …).
27145
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27146
- * the reverse:
27147
- * 1. a native CamStack navigation panel (data-driven from `listActions`
27148
- * / `getOptions`), and
27149
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27150
- * robot camera shows up in the existing PTZ control path without every
27151
- * PTZ provider learning about robots. The mapping lives in the adapter,
27152
- * not here (see the addon design note):
27153
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27154
- * ptz.stop() → navigation.stop()
27155
- * ptz.goHome() → navigation.runAction('goHome')
27156
- * ptz.getPresets() → navigation.listActions() (id→preset)
27157
- * ptz.goToPreset(id) → navigation.runAction(id)
27158
- *
27159
- * ## Continuous drive
27160
- *
27161
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27162
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27163
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27164
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27165
- * coalesce them. The UI owns the cadence.
27166
- *
27167
- * ## The action dictionary
27168
- *
27169
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27170
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27171
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27172
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27173
- * vendor-specific list. `kind: 'action'` entries are triggered with
27174
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27175
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27176
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27177
- *
27178
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27179
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27180
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27181
- * every device handle. A future nodedreame publish adds a typed
27182
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27183
- * provider can then swap the raw calls for the typed methods with no change to
27184
- * THIS contract.
27185
- */
27186
- /**
27187
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27188
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27189
- * halts it.
27190
- *
27191
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27192
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27193
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27194
- * vector by it (drivers without proportional drive ignore it).
27195
- *
27196
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27197
- * axis alone; an all-undefined nudge is a no-op.
27198
- */
27199
- var NavigationMoveCommandSchema = object({
27200
- pan: number().min(-1).max(1).optional(),
27201
- tilt: number().min(-1).max(1).optional(),
27202
- speed: number().min(0).max(1).optional()
27203
- });
27204
- /**
27205
- * The enumerated discrete actions a navigation-capable robot can perform via
27206
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27207
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27208
- * `playSound` (see the `sound` dictionary entries).
27209
- */
27210
- var NavigationActionIdSchema = _enum([
27211
- "goHome",
27212
- "locate",
27213
- "spotClean",
27214
- "findPet",
27215
- "personFollow",
27216
- "stop",
27217
- "startClean",
27218
- "pauseClean",
27219
- "dockWash",
27220
- "autoEmpty",
27221
- "flashOn",
27222
- "flashOff"
27223
- ]);
27224
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27225
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27226
- /**
27227
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27228
- * native panel and the PTZ mimic render as a button.
27229
- *
27230
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27231
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27232
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27233
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27234
- * - `label` — operator-facing English label.
27235
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27236
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27237
- * PTZ render ONLY enabled entries. Data-driven: the provider
27238
- * flips it from config, never by editing code.
27239
- */
27240
- var NavigationActionEntrySchema = object({
27241
- id: string(),
27242
- kind: NavigationEntryKindSchema,
27243
- label: string(),
27244
- icon: string(),
27245
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27246
- soundId: number().int().optional(),
27247
- /** Per-device feature flag — render this entry only when true. */
27248
- enabled: boolean()
27249
- });
27250
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27251
- var NavigationPointSchema = object({
27252
- x: number(),
27253
- y: number()
27254
- });
27255
- /**
27256
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27257
- * The cap reports which are enabled so the UI / PTZ render only the controls
27258
- * that are turned on for THIS device. Data-driven: the provider derives these
27259
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27260
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27261
- * that are not dictionary entries.
27262
- *
27263
- * - `move` / `stop` — the momentary drive joystick.
27264
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27265
- * map-coordinate plumbing is wired.
27266
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27267
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27268
- * - `light` — the on/off fill-light toggle (works anytime).
27269
- * - `lightMode` — the auto/manual selector + manual level slider (a
27270
- * camera-service control; needs an active stream).
27271
- */
27272
- var NavigationFeaturesSchema = object({
27273
- move: boolean(),
27274
- stop: boolean(),
27275
- goToPoint: boolean(),
27276
- runAction: boolean(),
27277
- playSound: boolean(),
27278
- light: boolean(),
27279
- lightMode: boolean()
27280
- });
27281
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27282
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27283
- /**
27284
- * Live navigation state so the UI can reflect what the robot is doing:
27285
- * - `mode` — coarse activity (idle / cleaning / following / …).
27286
- * - `following` — person/pet follow is currently armed.
27287
- * - `flash` — the on-camera fill light is on.
27288
- * - `lightMode` — auto vs manual fill-light mode.
27289
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27290
- * `lightMode === 'manual'`.
27291
- */
27292
- var NavigationStatusSchema = object({
27293
- mode: _enum([
27294
- "idle",
27295
- "cleaning",
27296
- "spot",
27297
- "following",
27298
- "goto",
27299
- "returning",
27300
- "paused",
27301
- "unknown"
27302
- ]),
27303
- following: boolean(),
27304
- flash: boolean(),
27305
- lightMode: NavigationLightModeSchema,
27306
- lightLevel: number().min(40).max(100),
27307
- /** Ms epoch when the slice was last updated. */
27308
- lastChangedAt: number()
27309
- });
27310
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27311
- 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({
27312
- deviceId: number(),
27313
- actionId: NavigationActionIdSchema
27314
- }), _void(), { kind: "mutation" }), method(object({
27315
- deviceId: number(),
27316
- soundId: number().int()
27317
- }), _void(), { kind: "mutation" }), method(object({
27318
- deviceId: number(),
27319
- on: boolean()
27320
- }), _void(), { kind: "mutation" }), method(object({
27321
- deviceId: number(),
27322
- mode: NavigationLightModeSchema,
27323
- level: number().min(40).max(100).optional()
27324
- }), _void(), { kind: "mutation" }), method(object({
27325
- deviceId: number(),
27326
- level: number().min(40).max(100)
27327
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27328
- deviceId: number(),
27329
- status: NavigationStatusSchema
27330
- });
27331
27454
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27332
27455
  kind: "mutation",
27333
27456
  auth: "admin"
@@ -35468,6 +35591,12 @@ Object.freeze({
35468
35591
  addonId: null,
35469
35592
  access: "view"
35470
35593
  },
35594
+ "storage.listDrainProgress": {
35595
+ capName: "storage",
35596
+ capScope: "system",
35597
+ addonId: null,
35598
+ access: "view"
35599
+ },
35471
35600
  "storage.listLocationDeclarations": {
35472
35601
  capName: "storage",
35473
35602
  capScope: "system",
@@ -35612,6 +35741,12 @@ Object.freeze({
35612
35741
  addonId: null,
35613
35742
  access: "view"
35614
35743
  },
35744
+ "storageOccupancy.getOccupancy": {
35745
+ capName: "storage-occupancy",
35746
+ capScope: "system",
35747
+ addonId: null,
35748
+ access: "view"
35749
+ },
35615
35750
  "storageProvider.abortUpload": {
35616
35751
  capName: "storage-provider",
35617
35752
  capScope: "system",