@camstack/addon-provider-onvif 1.2.78 → 1.2.80

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