@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.mjs CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
5
  //#endregion
6
- //#region ../types/dist/event-category-zAv7pMUz.mjs
6
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
7
7
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
8
8
  EventCategory["SystemBoot"] = "system.boot";
9
9
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -198,6 +198,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
198
198
  EventCategory["ProcessCrashed"] = "process.crashed";
199
199
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
200
200
  EventCategory["ProcessRestarted"] = "process.restarted";
201
+ /**
202
+ * The SET of storage locations changed — one was created, edited, enabled,
203
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
204
+ *
205
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
206
+ * it must also converge on its own periodic path, because a dropped event
207
+ * must not leave a node writing to yesterday's disk set forever. It exists
208
+ * because there was NO signal at all — an operator who added a second
209
+ * recordings disk in the admin UI got nothing, and the recorder kept its
210
+ * resolved locations until something else happened to re-resolve them
211
+ * (D387). Payload `StorageLocationsChangedPayload`.
212
+ */
213
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
201
214
  EventCategory["RecordingStarted"] = "recording.started";
202
215
  EventCategory["RecordingStopped"] = "recording.stopped";
203
216
  EventCategory["RecordingError"] = "recording.error";
@@ -8536,6 +8549,21 @@ var StorageCleanupJobSchema = object({
8536
8549
  });
8537
8550
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8538
8551
  /**
8552
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8553
+ * alias below is `z.infer<>` of it, never a second spelling.
8554
+ */
8555
+ var StorageLocationModeSchema = _enum([
8556
+ "active",
8557
+ "readonly",
8558
+ "drain",
8559
+ "disabled"
8560
+ ]);
8561
+ _enum([
8562
+ "normal",
8563
+ "never",
8564
+ "drain"
8565
+ ]);
8566
+ /**
8539
8567
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8540
8568
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8541
8569
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8601,6 +8629,21 @@ var StorageLocationSchema = object({
8601
8629
  * stops existing rather than being re-derived on every read.
8602
8630
  */
8603
8631
  enabled: boolean().optional(),
8632
+ /**
8633
+ * THE state of this location (D385), and the only authority on what may be
8634
+ * written, read or evicted here. Interpreted in exactly one place —
8635
+ * `storage-location-mode.ts` — which also folds the legacy
8636
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8637
+ * ambiguous.
8638
+ *
8639
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8640
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8641
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8642
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8643
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8644
+ * either, so the two cannot disagree.
8645
+ */
8646
+ mode: StorageLocationModeSchema.optional(),
8604
8647
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8605
8648
  * for node-local locations it can reach) — never persisted, absent when the
8606
8649
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8608,11 +8651,46 @@ var StorageLocationSchema = object({
8608
8651
  totalBytes: number(),
8609
8652
  availableBytes: number()
8610
8653
  }).nullable().optional(),
8654
+ /**
8655
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8656
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8657
+ * never persisted, never a filesystem walk.
8658
+ *
8659
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8660
+ * location yet — nobody stores here, the owning addon is down, or the first
8661
+ * refresh has not completed. A UI must omit the segment rather than draw it
8662
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8663
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8664
+ * be spelled out loud instead of appearing by accident.
8665
+ *
8666
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8667
+ * about the whole figure rather than about its freshest part.
8668
+ */
8669
+ owned: object({
8670
+ bytes: number().int().nonnegative(),
8671
+ measuredAtMs: number().int().nonnegative()
8672
+ }).optional(),
8611
8673
  createdAt: number(),
8612
8674
  updatedAt: number()
8613
8675
  });
8614
8676
  object({ isDefault: boolean().optional() });
8615
8677
  /**
8678
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8679
+ *
8680
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8681
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8682
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8683
+ * operator learns not to believe the screen.
8684
+ */
8685
+ var StorageDrainProgressSchema = object({
8686
+ locationId: string(),
8687
+ startedAtMs: number(),
8688
+ startBytes: number(),
8689
+ bytesRemaining: number(),
8690
+ drained: boolean(),
8691
+ estimatedEmptyAtMs: number().nullable()
8692
+ });
8693
+ /**
8616
8694
  * Reference accepted by consumer-facing `api.storage.*` calls.
8617
8695
  * Either:
8618
8696
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -20134,8 +20212,25 @@ var occupancyRecheckFramesField = {
20134
20212
  * (analyzer attaches detected `regions[]`; onboard does not — the
20135
20213
  * camera typically only reports a binary signal plus an optional
20136
20214
  * channel/AI class which lives in dedicated event channels).
20137
- */
20138
- var MotionSourceEnum = _enum(["onboard", "analyzer"]);
20215
+ *
20216
+ * - `onboard` — the camera's firmware said something moved.
20217
+ * - `analyzer` — this runner's frame-diff said so, and attaches `regions[]`.
20218
+ * - `device-activity` — the DEVICE said it is doing its job: the
20219
+ * `recording-signal` LEVEL the same device raises for the recorder
20220
+ * ([D380](../../../../docs/decisions/adr-0380-a-device-decided-recording-is-a-mode-with-no-schedule-seeded-once.md)),
20221
+ * republished as a motion source. It attaches **nothing** — no regions, no
20222
+ * class: the only fact it carries is that the device is active, and a robot
20223
+ * vacuum that is itself the moving object has no region worth sending. It is
20224
+ * a LEVEL, so unlike `onboard` it has a real falling edge, and unlike
20225
+ * `analyzer` it must not open the frame-diff side-channel — the runner's
20226
+ * `handleOnboardMotionAnalyzer` gate is `source === 'onboard'` and stays that
20227
+ * way ([D392](../../../../docs/decisions/adr-0392-a-device-that-says-it-is-working-is-a-motion-source-of-its-own.md)).
20228
+ */
20229
+ var MotionSourceEnum = _enum([
20230
+ "onboard",
20231
+ "analyzer",
20232
+ "device-activity"
20233
+ ]);
20139
20234
  /**
20140
20235
  * List of motion sources active on a camera. Empty array is valid:
20141
20236
  * "no source" — happens for battery cams without firmware motion when
@@ -21758,7 +21853,7 @@ method(object({
21758
21853
  }), _void(), {
21759
21854
  kind: "mutation",
21760
21855
  auth: "admin"
21761
- }), method(object({ id: string() }), object({
21856
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21762
21857
  ok: boolean(),
21763
21858
  error: string().optional()
21764
21859
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21828,6 +21923,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21828
21923
  kind: "mutation",
21829
21924
  auth: "admin"
21830
21925
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21926
+ /**
21927
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21928
+ * location (D388).
21929
+ *
21930
+ * ## Why this is not `storage-evictable`
21931
+ *
21932
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21933
+ * not, in two ways that both matter and both bite hardest on the locations an
21934
+ * operator most wants a figure for:
21935
+ *
21936
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21937
+ * and `recordingsLow:default` deliberately share one root and evict as one
21938
+ * oldest-first pool, so both answer with the SAME combined total. As an
21939
+ * occupancy figure that double-counts the disk.
21940
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21941
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21942
+ * is retiring and staring at.
21943
+ *
21944
+ * So this is its own contract with its own quantity, and the quantity is
21945
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21946
+ * would ever be willing to delete it. A provider that can only answer
21947
+ * "evictable" must not register here — a number that silently means different
21948
+ * things per class is worse than no number.
21949
+ *
21950
+ * ## Absence is an answer
21951
+ *
21952
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21953
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21954
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21955
+ * consuming side has to be written out loud instead of appearing by accident.
21956
+ *
21957
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21958
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21959
+ */
21960
+ /** One provider's occupancy answer for one location. */
21961
+ var StorageOccupancyReportSchema = object({
21962
+ locationId: string(),
21963
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21964
+ * not net of what it is willing to delete. */
21965
+ ownedBytes: number().int().nonnegative(),
21966
+ /** When the provider last actually measured this. The orchestrator carries it
21967
+ * through so a UI can say how old the figure is instead of implying "now". */
21968
+ measuredAtMs: number().int().nonnegative()
21969
+ });
21970
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21831
21971
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21832
21972
  providerId: string().min(1),
21833
21973
  displayName: string().min(1),
@@ -23463,39 +23603,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23463
23603
  deviceId: number(),
23464
23604
  status: BatteryStatusSchema
23465
23605
  });
23466
- /**
23467
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23468
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23469
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23470
- * one Home Assistant projection.
23471
- */
23472
- var NetworkLinkStatusSchema = object({
23473
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23474
- type: _enum([
23475
- "wifi",
23476
- "ethernet",
23477
- "cellular",
23478
- "unknown"
23479
- ]),
23480
- /**
23481
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23482
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23483
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23484
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23485
- * SKIP a null rather than coerce it.
23486
- */
23487
- signalPercent: number().min(0).max(100).nullable(),
23488
- /** Raw received signal strength in dBm, when the firmware reports one. */
23489
- rssiDbm: number().optional(),
23490
- /** Network name of a wireless link, when the firmware reports it. */
23491
- ssid: string().optional(),
23492
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23493
- lastUpdated: number()
23494
- });
23495
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23496
- deviceId: number(),
23497
- status: NetworkLinkStatusSchema
23498
- });
23499
23606
  object({
23500
23607
  on: boolean(),
23501
23608
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25849,6 +25956,236 @@ DeviceType.Camera, method(object({
25849
25956
  detection: NativeDetectionSchema
25850
25957
  });
25851
25958
  /**
25959
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25960
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25961
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25962
+ *
25963
+ * Why a NEW cap rather than overloading `ptz`:
25964
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25965
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25966
+ * The two are different physical models: PTZ is absolute-position + presets,
25967
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25968
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25969
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25970
+ * the reverse:
25971
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25972
+ * / `getOptions`), and
25973
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25974
+ * robot camera shows up in the existing PTZ control path without every
25975
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25976
+ * not here (see the addon design note):
25977
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25978
+ * ptz.stop() → navigation.stop()
25979
+ * ptz.goHome() → navigation.runAction('goHome')
25980
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25981
+ * ptz.goToPreset(id) → navigation.runAction(id)
25982
+ *
25983
+ * ## Continuous drive
25984
+ *
25985
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25986
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25987
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25988
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25989
+ * coalesce them. The UI owns the cadence.
25990
+ *
25991
+ * ## The action dictionary
25992
+ *
25993
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25994
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25995
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25996
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25997
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25998
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25999
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
26000
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26001
+ *
26002
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26003
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26004
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
26005
+ * every device handle. A future nodedreame publish adds a typed
26006
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
26007
+ * provider can then swap the raw calls for the typed methods with no change to
26008
+ * THIS contract.
26009
+ */
26010
+ /**
26011
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
26012
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
26013
+ * halts it.
26014
+ *
26015
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
26016
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26017
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26018
+ * vector by it (drivers without proportional drive ignore it).
26019
+ *
26020
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26021
+ * axis alone; an all-undefined nudge is a no-op.
26022
+ */
26023
+ var NavigationMoveCommandSchema = object({
26024
+ pan: number().min(-1).max(1).optional(),
26025
+ tilt: number().min(-1).max(1).optional(),
26026
+ speed: number().min(0).max(1).optional()
26027
+ });
26028
+ /**
26029
+ * The enumerated discrete actions a navigation-capable robot can perform via
26030
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26031
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26032
+ * `playSound` (see the `sound` dictionary entries).
26033
+ */
26034
+ var NavigationActionIdSchema = _enum([
26035
+ "goHome",
26036
+ "locate",
26037
+ "spotClean",
26038
+ "findPet",
26039
+ "personFollow",
26040
+ "stop",
26041
+ "startClean",
26042
+ "pauseClean",
26043
+ "dockWash",
26044
+ "autoEmpty",
26045
+ "flashOn",
26046
+ "flashOff"
26047
+ ]);
26048
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
26049
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
26050
+ /**
26051
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
26052
+ * native panel and the PTZ mimic render as a button.
26053
+ *
26054
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
26055
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
26056
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
26057
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
26058
+ * - `label` — operator-facing English label.
26059
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
26060
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
26061
+ * PTZ render ONLY enabled entries. Data-driven: the provider
26062
+ * flips it from config, never by editing code.
26063
+ */
26064
+ var NavigationActionEntrySchema = object({
26065
+ id: string(),
26066
+ kind: NavigationEntryKindSchema,
26067
+ label: string(),
26068
+ icon: string(),
26069
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
26070
+ soundId: number().int().optional(),
26071
+ /** Per-device feature flag — render this entry only when true. */
26072
+ enabled: boolean()
26073
+ });
26074
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
26075
+ var NavigationPointSchema = object({
26076
+ x: number(),
26077
+ y: number()
26078
+ });
26079
+ /**
26080
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
26081
+ * The cap reports which are enabled so the UI / PTZ render only the controls
26082
+ * that are turned on for THIS device. Data-driven: the provider derives these
26083
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
26084
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
26085
+ * that are not dictionary entries.
26086
+ *
26087
+ * - `move` / `stop` — the momentary drive joystick.
26088
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26089
+ * map-coordinate plumbing is wired.
26090
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26091
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26092
+ * - `light` — the on/off fill-light toggle (works anytime).
26093
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26094
+ * camera-service control; needs an active stream).
26095
+ */
26096
+ var NavigationFeaturesSchema = object({
26097
+ move: boolean(),
26098
+ stop: boolean(),
26099
+ goToPoint: boolean(),
26100
+ runAction: boolean(),
26101
+ playSound: boolean(),
26102
+ light: boolean(),
26103
+ lightMode: boolean()
26104
+ });
26105
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26106
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26107
+ /**
26108
+ * Live navigation state so the UI can reflect what the robot is doing:
26109
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26110
+ * - `following` — person/pet follow is currently armed.
26111
+ * - `flash` — the on-camera fill light is on.
26112
+ * - `lightMode` — auto vs manual fill-light mode.
26113
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26114
+ * `lightMode === 'manual'`.
26115
+ */
26116
+ var NavigationStatusSchema = object({
26117
+ mode: _enum([
26118
+ "idle",
26119
+ "cleaning",
26120
+ "spot",
26121
+ "following",
26122
+ "goto",
26123
+ "returning",
26124
+ "paused",
26125
+ "unknown"
26126
+ ]),
26127
+ following: boolean(),
26128
+ flash: boolean(),
26129
+ lightMode: NavigationLightModeSchema,
26130
+ lightLevel: number().min(40).max(100),
26131
+ /** Ms epoch when the slice was last updated. */
26132
+ lastChangedAt: number()
26133
+ });
26134
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26135
+ 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({
26136
+ deviceId: number(),
26137
+ actionId: NavigationActionIdSchema
26138
+ }), _void(), { kind: "mutation" }), method(object({
26139
+ deviceId: number(),
26140
+ soundId: number().int()
26141
+ }), _void(), { kind: "mutation" }), method(object({
26142
+ deviceId: number(),
26143
+ on: boolean()
26144
+ }), _void(), { kind: "mutation" }), method(object({
26145
+ deviceId: number(),
26146
+ mode: NavigationLightModeSchema,
26147
+ level: number().min(40).max(100).optional()
26148
+ }), _void(), { kind: "mutation" }), method(object({
26149
+ deviceId: number(),
26150
+ level: number().min(40).max(100)
26151
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26152
+ deviceId: number(),
26153
+ status: NavigationStatusSchema
26154
+ });
26155
+ /**
26156
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26157
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26158
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26159
+ * one Home Assistant projection.
26160
+ */
26161
+ var NetworkLinkStatusSchema = object({
26162
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26163
+ type: _enum([
26164
+ "wifi",
26165
+ "ethernet",
26166
+ "cellular",
26167
+ "unknown"
26168
+ ]),
26169
+ /**
26170
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26171
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26172
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26173
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26174
+ * SKIP a null rather than coerce it.
26175
+ */
26176
+ signalPercent: number().min(0).max(100).nullable(),
26177
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26178
+ rssiDbm: number().optional(),
26179
+ /** Network name of a wireless link, when the firmware reports it. */
26180
+ ssid: string().optional(),
26181
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26182
+ lastUpdated: number()
26183
+ });
26184
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26185
+ deviceId: number(),
26186
+ status: NetworkLinkStatusSchema
26187
+ });
26188
+ /**
25852
26189
  * network-quality — system-scoped singleton capability tracking RTT,
25853
26190
  * jitter, and observed/peak bandwidth per device + per client.
25854
26191
  *
@@ -27132,203 +27469,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
27132
27469
  deviceId: number(),
27133
27470
  status: PtzAutotrackStatusSchema
27134
27471
  });
27135
- /**
27136
- * `navigation` — a device-scoped capability that natively expresses the FULL
27137
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
27138
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
27139
- *
27140
- * Why a NEW cap rather than overloading `ptz`:
27141
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27142
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27143
- * The two are different physical models: PTZ is absolute-position + presets,
27144
- * navigation is momentary drive nudges + discrete robot ACTIONS
27145
- * (dock / spot-clean / follow-pet / go-to-point / …).
27146
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27147
- * the reverse:
27148
- * 1. a native CamStack navigation panel (data-driven from `listActions`
27149
- * / `getOptions`), and
27150
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27151
- * robot camera shows up in the existing PTZ control path without every
27152
- * PTZ provider learning about robots. The mapping lives in the adapter,
27153
- * not here (see the addon design note):
27154
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27155
- * ptz.stop() → navigation.stop()
27156
- * ptz.goHome() → navigation.runAction('goHome')
27157
- * ptz.getPresets() → navigation.listActions() (id→preset)
27158
- * ptz.goToPreset(id) → navigation.runAction(id)
27159
- *
27160
- * ## Continuous drive
27161
- *
27162
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27163
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27164
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27165
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27166
- * coalesce them. The UI owns the cadence.
27167
- *
27168
- * ## The action dictionary
27169
- *
27170
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27171
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27172
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27173
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27174
- * vendor-specific list. `kind: 'action'` entries are triggered with
27175
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27176
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27177
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27178
- *
27179
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27180
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27181
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27182
- * every device handle. A future nodedreame publish adds a typed
27183
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27184
- * provider can then swap the raw calls for the typed methods with no change to
27185
- * THIS contract.
27186
- */
27187
- /**
27188
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27189
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27190
- * halts it.
27191
- *
27192
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27193
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27194
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27195
- * vector by it (drivers without proportional drive ignore it).
27196
- *
27197
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27198
- * axis alone; an all-undefined nudge is a no-op.
27199
- */
27200
- var NavigationMoveCommandSchema = object({
27201
- pan: number().min(-1).max(1).optional(),
27202
- tilt: number().min(-1).max(1).optional(),
27203
- speed: number().min(0).max(1).optional()
27204
- });
27205
- /**
27206
- * The enumerated discrete actions a navigation-capable robot can perform via
27207
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27208
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27209
- * `playSound` (see the `sound` dictionary entries).
27210
- */
27211
- var NavigationActionIdSchema = _enum([
27212
- "goHome",
27213
- "locate",
27214
- "spotClean",
27215
- "findPet",
27216
- "personFollow",
27217
- "stop",
27218
- "startClean",
27219
- "pauseClean",
27220
- "dockWash",
27221
- "autoEmpty",
27222
- "flashOn",
27223
- "flashOff"
27224
- ]);
27225
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27226
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27227
- /**
27228
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27229
- * native panel and the PTZ mimic render as a button.
27230
- *
27231
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27232
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27233
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27234
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27235
- * - `label` — operator-facing English label.
27236
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27237
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27238
- * PTZ render ONLY enabled entries. Data-driven: the provider
27239
- * flips it from config, never by editing code.
27240
- */
27241
- var NavigationActionEntrySchema = object({
27242
- id: string(),
27243
- kind: NavigationEntryKindSchema,
27244
- label: string(),
27245
- icon: string(),
27246
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27247
- soundId: number().int().optional(),
27248
- /** Per-device feature flag — render this entry only when true. */
27249
- enabled: boolean()
27250
- });
27251
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27252
- var NavigationPointSchema = object({
27253
- x: number(),
27254
- y: number()
27255
- });
27256
- /**
27257
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27258
- * The cap reports which are enabled so the UI / PTZ render only the controls
27259
- * that are turned on for THIS device. Data-driven: the provider derives these
27260
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27261
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27262
- * that are not dictionary entries.
27263
- *
27264
- * - `move` / `stop` — the momentary drive joystick.
27265
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27266
- * map-coordinate plumbing is wired.
27267
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27268
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27269
- * - `light` — the on/off fill-light toggle (works anytime).
27270
- * - `lightMode` — the auto/manual selector + manual level slider (a
27271
- * camera-service control; needs an active stream).
27272
- */
27273
- var NavigationFeaturesSchema = object({
27274
- move: boolean(),
27275
- stop: boolean(),
27276
- goToPoint: boolean(),
27277
- runAction: boolean(),
27278
- playSound: boolean(),
27279
- light: boolean(),
27280
- lightMode: boolean()
27281
- });
27282
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27283
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27284
- /**
27285
- * Live navigation state so the UI can reflect what the robot is doing:
27286
- * - `mode` — coarse activity (idle / cleaning / following / …).
27287
- * - `following` — person/pet follow is currently armed.
27288
- * - `flash` — the on-camera fill light is on.
27289
- * - `lightMode` — auto vs manual fill-light mode.
27290
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27291
- * `lightMode === 'manual'`.
27292
- */
27293
- var NavigationStatusSchema = object({
27294
- mode: _enum([
27295
- "idle",
27296
- "cleaning",
27297
- "spot",
27298
- "following",
27299
- "goto",
27300
- "returning",
27301
- "paused",
27302
- "unknown"
27303
- ]),
27304
- following: boolean(),
27305
- flash: boolean(),
27306
- lightMode: NavigationLightModeSchema,
27307
- lightLevel: number().min(40).max(100),
27308
- /** Ms epoch when the slice was last updated. */
27309
- lastChangedAt: number()
27310
- });
27311
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27312
- 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({
27313
- deviceId: number(),
27314
- actionId: NavigationActionIdSchema
27315
- }), _void(), { kind: "mutation" }), method(object({
27316
- deviceId: number(),
27317
- soundId: number().int()
27318
- }), _void(), { kind: "mutation" }), method(object({
27319
- deviceId: number(),
27320
- on: boolean()
27321
- }), _void(), { kind: "mutation" }), method(object({
27322
- deviceId: number(),
27323
- mode: NavigationLightModeSchema,
27324
- level: number().min(40).max(100).optional()
27325
- }), _void(), { kind: "mutation" }), method(object({
27326
- deviceId: number(),
27327
- level: number().min(40).max(100)
27328
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27329
- deviceId: number(),
27330
- status: NavigationStatusSchema
27331
- });
27332
27472
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27333
27473
  kind: "mutation",
27334
27474
  auth: "admin"
@@ -35469,6 +35609,12 @@ Object.freeze({
35469
35609
  addonId: null,
35470
35610
  access: "view"
35471
35611
  },
35612
+ "storage.listDrainProgress": {
35613
+ capName: "storage",
35614
+ capScope: "system",
35615
+ addonId: null,
35616
+ access: "view"
35617
+ },
35472
35618
  "storage.listLocationDeclarations": {
35473
35619
  capName: "storage",
35474
35620
  capScope: "system",
@@ -35613,6 +35759,12 @@ Object.freeze({
35613
35759
  addonId: null,
35614
35760
  access: "view"
35615
35761
  },
35762
+ "storageOccupancy.getOccupancy": {
35763
+ capName: "storage-occupancy",
35764
+ capScope: "system",
35765
+ addonId: null,
35766
+ access: "view"
35767
+ },
35616
35768
  "storageProvider.abortUpload": {
35617
35769
  capName: "storage-provider",
35618
35770
  capScope: "system",