@camstack/addon-provider-wyze 0.2.83 → 0.2.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +500 -365
  2. package/dist/addon.mjs +500 -365
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -10,7 +10,7 @@ import { getCACertificates, setDefaultCACertificates } from "node:tls";
10
10
  //#region \0rolldown/runtime.js
11
11
  var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
12
12
  //#endregion
13
- //#region ../types/dist/event-category-zAv7pMUz.mjs
13
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
14
14
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
15
15
  EventCategory["SystemBoot"] = "system.boot";
16
16
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -205,6 +205,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
205
205
  EventCategory["ProcessCrashed"] = "process.crashed";
206
206
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
207
207
  EventCategory["ProcessRestarted"] = "process.restarted";
208
+ /**
209
+ * The SET of storage locations changed — one was created, edited, enabled,
210
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
211
+ *
212
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
213
+ * it must also converge on its own periodic path, because a dropped event
214
+ * must not leave a node writing to yesterday's disk set forever. It exists
215
+ * because there was NO signal at all — an operator who added a second
216
+ * recordings disk in the admin UI got nothing, and the recorder kept its
217
+ * resolved locations until something else happened to re-resolve them
218
+ * (D387). Payload `StorageLocationsChangedPayload`.
219
+ */
220
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
208
221
  EventCategory["RecordingStarted"] = "recording.started";
209
222
  EventCategory["RecordingStopped"] = "recording.stopped";
210
223
  EventCategory["RecordingError"] = "recording.error";
@@ -8547,6 +8560,21 @@ var StorageCleanupJobSchema = object({
8547
8560
  });
8548
8561
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8549
8562
  /**
8563
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8564
+ * alias below is `z.infer<>` of it, never a second spelling.
8565
+ */
8566
+ var StorageLocationModeSchema = _enum([
8567
+ "active",
8568
+ "readonly",
8569
+ "drain",
8570
+ "disabled"
8571
+ ]);
8572
+ _enum([
8573
+ "normal",
8574
+ "never",
8575
+ "drain"
8576
+ ]);
8577
+ /**
8550
8578
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8551
8579
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8552
8580
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8612,6 +8640,21 @@ var StorageLocationSchema = object({
8612
8640
  * stops existing rather than being re-derived on every read.
8613
8641
  */
8614
8642
  enabled: boolean().optional(),
8643
+ /**
8644
+ * THE state of this location (D385), and the only authority on what may be
8645
+ * written, read or evicted here. Interpreted in exactly one place —
8646
+ * `storage-location-mode.ts` — which also folds the legacy
8647
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8648
+ * ambiguous.
8649
+ *
8650
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8651
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8652
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8653
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8654
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8655
+ * either, so the two cannot disagree.
8656
+ */
8657
+ mode: StorageLocationModeSchema.optional(),
8615
8658
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8616
8659
  * for node-local locations it can reach) — never persisted, absent when the
8617
8660
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8619,11 +8662,46 @@ var StorageLocationSchema = object({
8619
8662
  totalBytes: number(),
8620
8663
  availableBytes: number()
8621
8664
  }).nullable().optional(),
8665
+ /**
8666
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8667
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8668
+ * never persisted, never a filesystem walk.
8669
+ *
8670
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8671
+ * location yet — nobody stores here, the owning addon is down, or the first
8672
+ * refresh has not completed. A UI must omit the segment rather than draw it
8673
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8674
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8675
+ * be spelled out loud instead of appearing by accident.
8676
+ *
8677
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8678
+ * about the whole figure rather than about its freshest part.
8679
+ */
8680
+ owned: object({
8681
+ bytes: number().int().nonnegative(),
8682
+ measuredAtMs: number().int().nonnegative()
8683
+ }).optional(),
8622
8684
  createdAt: number(),
8623
8685
  updatedAt: number()
8624
8686
  });
8625
8687
  object({ isDefault: boolean().optional() });
8626
8688
  /**
8689
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8690
+ *
8691
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8692
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8693
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8694
+ * operator learns not to believe the screen.
8695
+ */
8696
+ var StorageDrainProgressSchema = object({
8697
+ locationId: string(),
8698
+ startedAtMs: number(),
8699
+ startBytes: number(),
8700
+ bytesRemaining: number(),
8701
+ drained: boolean(),
8702
+ estimatedEmptyAtMs: number().nullable()
8703
+ });
8704
+ /**
8627
8705
  * Reference accepted by consumer-facing `api.storage.*` calls.
8628
8706
  * Either:
8629
8707
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -22073,7 +22151,7 @@ method(object({
22073
22151
  }), _void(), {
22074
22152
  kind: "mutation",
22075
22153
  auth: "admin"
22076
- }), method(object({ id: string() }), object({
22154
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
22077
22155
  ok: boolean(),
22078
22156
  error: string().optional()
22079
22157
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22143,6 +22221,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22143
22221
  kind: "mutation",
22144
22222
  auth: "admin"
22145
22223
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22224
+ /**
22225
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22226
+ * location (D388).
22227
+ *
22228
+ * ## Why this is not `storage-evictable`
22229
+ *
22230
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22231
+ * not, in two ways that both matter and both bite hardest on the locations an
22232
+ * operator most wants a figure for:
22233
+ *
22234
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22235
+ * and `recordingsLow:default` deliberately share one root and evict as one
22236
+ * oldest-first pool, so both answer with the SAME combined total. As an
22237
+ * occupancy figure that double-counts the disk.
22238
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22239
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22240
+ * is retiring and staring at.
22241
+ *
22242
+ * So this is its own contract with its own quantity, and the quantity is
22243
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22244
+ * would ever be willing to delete it. A provider that can only answer
22245
+ * "evictable" must not register here — a number that silently means different
22246
+ * things per class is worse than no number.
22247
+ *
22248
+ * ## Absence is an answer
22249
+ *
22250
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22251
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22252
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22253
+ * consuming side has to be written out loud instead of appearing by accident.
22254
+ *
22255
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22256
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22257
+ */
22258
+ /** One provider's occupancy answer for one location. */
22259
+ var StorageOccupancyReportSchema = object({
22260
+ locationId: string(),
22261
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22262
+ * not net of what it is willing to delete. */
22263
+ ownedBytes: number().int().nonnegative(),
22264
+ /** When the provider last actually measured this. The orchestrator carries it
22265
+ * through so a UI can say how old the figure is instead of implying "now". */
22266
+ measuredAtMs: number().int().nonnegative()
22267
+ });
22268
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22146
22269
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22147
22270
  providerId: string().min(1),
22148
22271
  displayName: string().min(1),
@@ -23978,88 +24101,6 @@ onStatusChanged: { data: object({
23978
24101
  volatileStateFields: ["lastUpdated"]
23979
24102
  };
23980
24103
  /**
23981
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23982
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23983
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23984
- * one Home Assistant projection.
23985
- */
23986
- var NetworkLinkStatusSchema = object({
23987
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23988
- type: _enum([
23989
- "wifi",
23990
- "ethernet",
23991
- "cellular",
23992
- "unknown"
23993
- ]),
23994
- /**
23995
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23996
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23997
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23998
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23999
- * SKIP a null rather than coerce it.
24000
- */
24001
- signalPercent: number().min(0).max(100).nullable(),
24002
- /** Raw received signal strength in dBm, when the firmware reports one. */
24003
- rssiDbm: number().optional(),
24004
- /** Network name of a wireless link, when the firmware reports it. */
24005
- ssid: string().optional(),
24006
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24007
- lastUpdated: number()
24008
- });
24009
- var networkLinkCapability = {
24010
- name: "network-link",
24011
- scope: "device",
24012
- deviceNative: true,
24013
- mode: "singleton",
24014
- deviceTypes: [
24015
- DeviceType.Camera,
24016
- DeviceType.Sensor,
24017
- DeviceType.Button,
24018
- DeviceType.Switch,
24019
- DeviceType.Light,
24020
- DeviceType.Lock,
24021
- DeviceType.Siren
24022
- ],
24023
- methods: {},
24024
- events: {
24025
- /**
24026
- * Emitted whenever the cached status changes (a link switch, a signal
24027
- * reading that moved). Mirrored on the parent chain by the
24028
- * DeviceEventPropagator like `battery.onStatusChanged`.
24029
- */
24030
- onStatusChanged: { data: object({
24031
- deviceId: number(),
24032
- status: NetworkLinkStatusSchema
24033
- }) } },
24034
- status: {
24035
- schema: NetworkLinkStatusSchema,
24036
- kind: "push",
24037
- empty: {
24038
- type: "unknown",
24039
- signalPercent: null,
24040
- lastUpdated: 0
24041
- }
24042
- },
24043
- /**
24044
- * Runtime-state slice — every provider stores the same shape under
24045
- * `device.runtimeState['network-link']`, read once by the badge and the
24046
- * Home Assistant projector regardless of the driver.
24047
- */
24048
- runtimeState: NetworkLinkStatusSchema,
24049
- /**
24050
- * Runtime-state durability: **restored** — a link reading is slow to
24051
- * change and a sleeping battery camera may not report for hours; the
24052
- * restored slice is what the badge shows until the next read.
24053
- *
24054
- * See `RuntimeStateDurability`. Enforced by
24055
- * `scripts/check-runtime-state-durability.ts`.
24056
- */
24057
- durability: "restored",
24058
- /** Clock fields: written, but excluded from the compare that decides
24059
- * whether persisting is worth a SQLite commit. */
24060
- volatileStateFields: ["lastUpdated"]
24061
- };
24062
- /**
24063
24104
  * Generic boolean sensor — last-resort fallback when no domain-
24064
24105
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24065
24106
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -27597,6 +27638,369 @@ var nativeObjectDetectionCapability = {
27597
27638
  volatileStateFields: ["lastFetchedAt"]
27598
27639
  };
27599
27640
  /**
27641
+ * `navigation` — a device-scoped capability that natively expresses the FULL
27642
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
27643
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
27644
+ *
27645
+ * Why a NEW cap rather than overloading `ptz`:
27646
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27647
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27648
+ * The two are different physical models: PTZ is absolute-position + presets,
27649
+ * navigation is momentary drive nudges + discrete robot ACTIONS
27650
+ * (dock / spot-clean / follow-pet / go-to-point / …).
27651
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27652
+ * the reverse:
27653
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
27654
+ * / `getOptions`), and
27655
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27656
+ * robot camera shows up in the existing PTZ control path without every
27657
+ * PTZ provider learning about robots. The mapping lives in the adapter,
27658
+ * not here (see the addon design note):
27659
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27660
+ * ptz.stop() → navigation.stop()
27661
+ * ptz.goHome() → navigation.runAction('goHome')
27662
+ * ptz.getPresets() → navigation.listActions() (id→preset)
27663
+ * ptz.goToPreset(id) → navigation.runAction(id)
27664
+ *
27665
+ * ## Continuous drive
27666
+ *
27667
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27668
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27669
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27670
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27671
+ * coalesce them. The UI owns the cadence.
27672
+ *
27673
+ * ## The action dictionary
27674
+ *
27675
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27676
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27677
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27678
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27679
+ * vendor-specific list. `kind: 'action'` entries are triggered with
27680
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27681
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
27682
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27683
+ *
27684
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27685
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27686
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
27687
+ * every device handle. A future nodedreame publish adds a typed
27688
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27689
+ * provider can then swap the raw calls for the typed methods with no change to
27690
+ * THIS contract.
27691
+ */
27692
+ /**
27693
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27694
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27695
+ * halts it.
27696
+ *
27697
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
27698
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27699
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27700
+ * vector by it (drivers without proportional drive ignore it).
27701
+ *
27702
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27703
+ * axis alone; an all-undefined nudge is a no-op.
27704
+ */
27705
+ var NavigationMoveCommandSchema = object({
27706
+ pan: number().min(-1).max(1).optional(),
27707
+ tilt: number().min(-1).max(1).optional(),
27708
+ speed: number().min(0).max(1).optional()
27709
+ });
27710
+ /**
27711
+ * The enumerated discrete actions a navigation-capable robot can perform via
27712
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27713
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
27714
+ * `playSound` (see the `sound` dictionary entries).
27715
+ */
27716
+ var NavigationActionIdSchema = _enum([
27717
+ "goHome",
27718
+ "locate",
27719
+ "spotClean",
27720
+ "findPet",
27721
+ "personFollow",
27722
+ "stop",
27723
+ "startClean",
27724
+ "pauseClean",
27725
+ "dockWash",
27726
+ "autoEmpty",
27727
+ "flashOn",
27728
+ "flashOff"
27729
+ ]);
27730
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27731
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
27732
+ /**
27733
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27734
+ * native panel and the PTZ mimic render as a button.
27735
+ *
27736
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27737
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27738
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
27739
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27740
+ * - `label` — operator-facing English label.
27741
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27742
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27743
+ * PTZ render ONLY enabled entries. Data-driven: the provider
27744
+ * flips it from config, never by editing code.
27745
+ */
27746
+ var NavigationActionEntrySchema = object({
27747
+ id: string(),
27748
+ kind: NavigationEntryKindSchema,
27749
+ label: string(),
27750
+ icon: string(),
27751
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27752
+ soundId: number().int().optional(),
27753
+ /** Per-device feature flag — render this entry only when true. */
27754
+ enabled: boolean()
27755
+ });
27756
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
27757
+ var NavigationPointSchema = object({
27758
+ x: number(),
27759
+ y: number()
27760
+ });
27761
+ /**
27762
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27763
+ * The cap reports which are enabled so the UI / PTZ render only the controls
27764
+ * that are turned on for THIS device. Data-driven: the provider derives these
27765
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27766
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27767
+ * that are not dictionary entries.
27768
+ *
27769
+ * - `move` / `stop` — the momentary drive joystick.
27770
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27771
+ * map-coordinate plumbing is wired.
27772
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27773
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27774
+ * - `light` — the on/off fill-light toggle (works anytime).
27775
+ * - `lightMode` — the auto/manual selector + manual level slider (a
27776
+ * camera-service control; needs an active stream).
27777
+ */
27778
+ var NavigationFeaturesSchema = object({
27779
+ move: boolean(),
27780
+ stop: boolean(),
27781
+ goToPoint: boolean(),
27782
+ runAction: boolean(),
27783
+ playSound: boolean(),
27784
+ light: boolean(),
27785
+ lightMode: boolean()
27786
+ });
27787
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27788
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
27789
+ /**
27790
+ * Live navigation state so the UI can reflect what the robot is doing:
27791
+ * - `mode` — coarse activity (idle / cleaning / following / …).
27792
+ * - `following` — person/pet follow is currently armed.
27793
+ * - `flash` — the on-camera fill light is on.
27794
+ * - `lightMode` — auto vs manual fill-light mode.
27795
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
27796
+ * `lightMode === 'manual'`.
27797
+ */
27798
+ var NavigationStatusSchema = object({
27799
+ mode: _enum([
27800
+ "idle",
27801
+ "cleaning",
27802
+ "spot",
27803
+ "following",
27804
+ "goto",
27805
+ "returning",
27806
+ "paused",
27807
+ "unknown"
27808
+ ]),
27809
+ following: boolean(),
27810
+ flash: boolean(),
27811
+ lightMode: NavigationLightModeSchema,
27812
+ lightLevel: number().min(40).max(100),
27813
+ /** Ms epoch when the slice was last updated. */
27814
+ lastChangedAt: number()
27815
+ });
27816
+ /**
27817
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
27818
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
27819
+ * convention.
27820
+ */
27821
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
27822
+ var navigationCapability = {
27823
+ name: "navigation",
27824
+ scope: "device",
27825
+ deviceNative: true,
27826
+ mode: "singleton",
27827
+ deviceTypes: [DeviceType.Camera],
27828
+ deviceConfig: { ui: {
27829
+ kind: "widget",
27830
+ widgetId: "host/navigation-panel",
27831
+ tab: "navigation",
27832
+ topTab: true,
27833
+ label: "Navigation",
27834
+ order: 0
27835
+ } },
27836
+ methods: {
27837
+ /**
27838
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
27839
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
27840
+ * path) works for any authenticated user, not admin-only. The UI sends
27841
+ * these at ~1 Hz while a control is held; the provider forwards each one to
27842
+ * a single drive write WITHOUT debouncing.
27843
+ */
27844
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27845
+ /** Halt all motion immediately (zero drive vector). */
27846
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
27847
+ /** Send the robot to a point on its live map. */
27848
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27849
+ /**
27850
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
27851
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
27852
+ */
27853
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
27854
+ /**
27855
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
27856
+ * unsupported action ids are rejected by the provider.
27857
+ */
27858
+ runAction: method(object({
27859
+ deviceId: number(),
27860
+ actionId: NavigationActionIdSchema
27861
+ }), _void(), { kind: "mutation" }),
27862
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
27863
+ playSound: method(object({
27864
+ deviceId: number(),
27865
+ soundId: number().int()
27866
+ }), _void(), { kind: "mutation" }),
27867
+ /**
27868
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
27869
+ * works anytime, no active stream required).
27870
+ */
27871
+ setLightOn: method(object({
27872
+ deviceId: number(),
27873
+ on: boolean()
27874
+ }), _void(), { kind: "mutation" }),
27875
+ /**
27876
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
27877
+ * initial `level`. The auto/manual + level control is a CAMERA-service
27878
+ * action that generally needs an active camera stream/monitor session — the
27879
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
27880
+ */
27881
+ setLightMode: method(object({
27882
+ deviceId: number(),
27883
+ mode: NavigationLightModeSchema,
27884
+ level: number().min(40).max(100).optional()
27885
+ }), _void(), { kind: "mutation" }),
27886
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
27887
+ setLightLevel: method(object({
27888
+ deviceId: number(),
27889
+ level: number().min(40).max(100)
27890
+ }), _void(), { kind: "mutation" }),
27891
+ /**
27892
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
27893
+ * controls the UI shows (the per-entry flags for the dictionary come back on
27894
+ * `listActions`).
27895
+ */
27896
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
27897
+ },
27898
+ events: { onStatusChanged: { data: object({
27899
+ deviceId: number(),
27900
+ status: NavigationStatusSchema
27901
+ }) } },
27902
+ status: {
27903
+ schema: NavigationStatusSchema,
27904
+ kind: "push"
27905
+ },
27906
+ /**
27907
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
27908
+ * for live mode / follow / flash changes.
27909
+ */
27910
+ runtimeState: NavigationRuntimeStateSchema,
27911
+ /**
27912
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
27913
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
27914
+ * that. The live handle re-publishes on connect.
27915
+ *
27916
+ * See `RuntimeStateDurability`. Enforced by
27917
+ * `scripts/check-runtime-state-durability.ts`.
27918
+ */
27919
+ durability: "session"
27920
+ };
27921
+ /**
27922
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
27923
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
27924
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
27925
+ * one Home Assistant projection.
27926
+ */
27927
+ var NetworkLinkStatusSchema = object({
27928
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
27929
+ type: _enum([
27930
+ "wifi",
27931
+ "ethernet",
27932
+ "cellular",
27933
+ "unknown"
27934
+ ]),
27935
+ /**
27936
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
27937
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
27938
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
27939
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
27940
+ * SKIP a null rather than coerce it.
27941
+ */
27942
+ signalPercent: number().min(0).max(100).nullable(),
27943
+ /** Raw received signal strength in dBm, when the firmware reports one. */
27944
+ rssiDbm: number().optional(),
27945
+ /** Network name of a wireless link, when the firmware reports it. */
27946
+ ssid: string().optional(),
27947
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
27948
+ lastUpdated: number()
27949
+ });
27950
+ var networkLinkCapability = {
27951
+ name: "network-link",
27952
+ scope: "device",
27953
+ deviceNative: true,
27954
+ mode: "singleton",
27955
+ deviceTypes: [
27956
+ DeviceType.Camera,
27957
+ DeviceType.Sensor,
27958
+ DeviceType.Button,
27959
+ DeviceType.Switch,
27960
+ DeviceType.Light,
27961
+ DeviceType.Lock,
27962
+ DeviceType.Siren
27963
+ ],
27964
+ methods: {},
27965
+ events: {
27966
+ /**
27967
+ * Emitted whenever the cached status changes (a link switch, a signal
27968
+ * reading that moved). Mirrored on the parent chain by the
27969
+ * DeviceEventPropagator like `battery.onStatusChanged`.
27970
+ */
27971
+ onStatusChanged: { data: object({
27972
+ deviceId: number(),
27973
+ status: NetworkLinkStatusSchema
27974
+ }) } },
27975
+ status: {
27976
+ schema: NetworkLinkStatusSchema,
27977
+ kind: "push",
27978
+ empty: {
27979
+ type: "unknown",
27980
+ signalPercent: null,
27981
+ lastUpdated: 0
27982
+ }
27983
+ },
27984
+ /**
27985
+ * Runtime-state slice — every provider stores the same shape under
27986
+ * `device.runtimeState['network-link']`, read once by the badge and the
27987
+ * Home Assistant projector regardless of the driver.
27988
+ */
27989
+ runtimeState: NetworkLinkStatusSchema,
27990
+ /**
27991
+ * Runtime-state durability: **restored** — a link reading is slow to
27992
+ * change and a sleeping battery camera may not report for hours; the
27993
+ * restored slice is what the badge shows until the next read.
27994
+ *
27995
+ * See `RuntimeStateDurability`. Enforced by
27996
+ * `scripts/check-runtime-state-durability.ts`.
27997
+ */
27998
+ durability: "restored",
27999
+ /** Clock fields: written, but excluded from the compare that decides
28000
+ * whether persisting is worth a SQLite commit. */
28001
+ volatileStateFields: ["lastUpdated"]
28002
+ };
28003
+ /**
27600
28004
  * network-quality — system-scoped singleton capability tracking RTT,
27601
28005
  * jitter, and observed/peak bandwidth per device + per client.
27602
28006
  *
@@ -29177,287 +29581,6 @@ var ptzAutotrackCapability = {
29177
29581
  */
29178
29582
  durability: "session"
29179
29583
  };
29180
- /**
29181
- * `navigation` — a device-scoped capability that natively expresses the FULL
29182
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
29183
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
29184
- *
29185
- * Why a NEW cap rather than overloading `ptz`:
29186
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29187
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29188
- * The two are different physical models: PTZ is absolute-position + presets,
29189
- * navigation is momentary drive nudges + discrete robot ACTIONS
29190
- * (dock / spot-clean / follow-pet / go-to-point / …).
29191
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29192
- * the reverse:
29193
- * 1. a native CamStack navigation panel (data-driven from `listActions`
29194
- * / `getOptions`), and
29195
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29196
- * robot camera shows up in the existing PTZ control path without every
29197
- * PTZ provider learning about robots. The mapping lives in the adapter,
29198
- * not here (see the addon design note):
29199
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29200
- * ptz.stop() → navigation.stop()
29201
- * ptz.goHome() → navigation.runAction('goHome')
29202
- * ptz.getPresets() → navigation.listActions() (id→preset)
29203
- * ptz.goToPreset(id) → navigation.runAction(id)
29204
- *
29205
- * ## Continuous drive
29206
- *
29207
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29208
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29209
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29210
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29211
- * coalesce them. The UI owns the cadence.
29212
- *
29213
- * ## The action dictionary
29214
- *
29215
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29216
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29217
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29218
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29219
- * vendor-specific list. `kind: 'action'` entries are triggered with
29220
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29221
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
29222
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29223
- *
29224
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29225
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29226
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
29227
- * every device handle. A future nodedreame publish adds a typed
29228
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29229
- * provider can then swap the raw calls for the typed methods with no change to
29230
- * THIS contract.
29231
- */
29232
- /**
29233
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29234
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29235
- * halts it.
29236
- *
29237
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
29238
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29239
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29240
- * vector by it (drivers without proportional drive ignore it).
29241
- *
29242
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29243
- * axis alone; an all-undefined nudge is a no-op.
29244
- */
29245
- var NavigationMoveCommandSchema = object({
29246
- pan: number().min(-1).max(1).optional(),
29247
- tilt: number().min(-1).max(1).optional(),
29248
- speed: number().min(0).max(1).optional()
29249
- });
29250
- /**
29251
- * The enumerated discrete actions a navigation-capable robot can perform via
29252
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29253
- * subset it supports through `listActions`. Sounds are NOT here — they go through
29254
- * `playSound` (see the `sound` dictionary entries).
29255
- */
29256
- var NavigationActionIdSchema = _enum([
29257
- "goHome",
29258
- "locate",
29259
- "spotClean",
29260
- "findPet",
29261
- "personFollow",
29262
- "stop",
29263
- "startClean",
29264
- "pauseClean",
29265
- "dockWash",
29266
- "autoEmpty",
29267
- "flashOn",
29268
- "flashOff"
29269
- ]);
29270
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29271
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
29272
- /**
29273
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29274
- * native panel and the PTZ mimic render as a button.
29275
- *
29276
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29277
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29278
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
29279
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29280
- * - `label` — operator-facing English label.
29281
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29282
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29283
- * PTZ render ONLY enabled entries. Data-driven: the provider
29284
- * flips it from config, never by editing code.
29285
- */
29286
- var NavigationActionEntrySchema = object({
29287
- id: string(),
29288
- kind: NavigationEntryKindSchema,
29289
- label: string(),
29290
- icon: string(),
29291
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29292
- soundId: number().int().optional(),
29293
- /** Per-device feature flag — render this entry only when true. */
29294
- enabled: boolean()
29295
- });
29296
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
29297
- var NavigationPointSchema = object({
29298
- x: number(),
29299
- y: number()
29300
- });
29301
- /**
29302
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29303
- * The cap reports which are enabled so the UI / PTZ render only the controls
29304
- * that are turned on for THIS device. Data-driven: the provider derives these
29305
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29306
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29307
- * that are not dictionary entries.
29308
- *
29309
- * - `move` / `stop` — the momentary drive joystick.
29310
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29311
- * map-coordinate plumbing is wired.
29312
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29313
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29314
- * - `light` — the on/off fill-light toggle (works anytime).
29315
- * - `lightMode` — the auto/manual selector + manual level slider (a
29316
- * camera-service control; needs an active stream).
29317
- */
29318
- var NavigationFeaturesSchema = object({
29319
- move: boolean(),
29320
- stop: boolean(),
29321
- goToPoint: boolean(),
29322
- runAction: boolean(),
29323
- playSound: boolean(),
29324
- light: boolean(),
29325
- lightMode: boolean()
29326
- });
29327
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29328
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
29329
- /**
29330
- * Live navigation state so the UI can reflect what the robot is doing:
29331
- * - `mode` — coarse activity (idle / cleaning / following / …).
29332
- * - `following` — person/pet follow is currently armed.
29333
- * - `flash` — the on-camera fill light is on.
29334
- * - `lightMode` — auto vs manual fill-light mode.
29335
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
29336
- * `lightMode === 'manual'`.
29337
- */
29338
- var NavigationStatusSchema = object({
29339
- mode: _enum([
29340
- "idle",
29341
- "cleaning",
29342
- "spot",
29343
- "following",
29344
- "goto",
29345
- "returning",
29346
- "paused",
29347
- "unknown"
29348
- ]),
29349
- following: boolean(),
29350
- flash: boolean(),
29351
- lightMode: NavigationLightModeSchema,
29352
- lightLevel: number().min(40).max(100),
29353
- /** Ms epoch when the slice was last updated. */
29354
- lastChangedAt: number()
29355
- });
29356
- /**
29357
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29358
- * observable). Adds `lastFetchedAt` on top of the status shape per the
29359
- * convention.
29360
- */
29361
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29362
- var navigationCapability = {
29363
- name: "navigation",
29364
- scope: "device",
29365
- deviceNative: true,
29366
- mode: "singleton",
29367
- deviceTypes: [DeviceType.Camera],
29368
- deviceConfig: { ui: {
29369
- kind: "widget",
29370
- widgetId: "host/navigation-panel",
29371
- tab: "navigation",
29372
- topTab: true,
29373
- label: "Navigation",
29374
- order: 0
29375
- } },
29376
- methods: {
29377
- /**
29378
- * Momentary drive nudge (the robot moves). `protected` — mirrors
29379
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29380
- * path) works for any authenticated user, not admin-only. The UI sends
29381
- * these at ~1 Hz while a control is held; the provider forwards each one to
29382
- * a single drive write WITHOUT debouncing.
29383
- */
29384
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29385
- /** Halt all motion immediately (zero drive vector). */
29386
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29387
- /** Send the robot to a point on its live map. */
29388
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29389
- /**
29390
- * Enumerate the discrete controls THIS device supports (data-driven UI +
29391
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29392
- */
29393
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29394
- /**
29395
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29396
- * unsupported action ids are rejected by the provider.
29397
- */
29398
- runAction: method(object({
29399
- deviceId: number(),
29400
- actionId: NavigationActionIdSchema
29401
- }), _void(), { kind: "mutation" }),
29402
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29403
- playSound: method(object({
29404
- deviceId: number(),
29405
- soundId: number().int()
29406
- }), _void(), { kind: "mutation" }),
29407
- /**
29408
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29409
- * works anytime, no active stream required).
29410
- */
29411
- setLightOn: method(object({
29412
- deviceId: number(),
29413
- on: boolean()
29414
- }), _void(), { kind: "mutation" }),
29415
- /**
29416
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29417
- * initial `level`. The auto/manual + level control is a CAMERA-service
29418
- * action that generally needs an active camera stream/monitor session — the
29419
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
29420
- */
29421
- setLightMode: method(object({
29422
- deviceId: number(),
29423
- mode: NavigationLightModeSchema,
29424
- level: number().min(40).max(100).optional()
29425
- }), _void(), { kind: "mutation" }),
29426
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29427
- setLightLevel: method(object({
29428
- deviceId: number(),
29429
- level: number().min(40).max(100)
29430
- }), _void(), { kind: "mutation" }),
29431
- /**
29432
- * Per-device FEATURE-FLAG report for the general primitives — drives which
29433
- * controls the UI shows (the per-entry flags for the dictionary come back on
29434
- * `listActions`).
29435
- */
29436
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29437
- },
29438
- events: { onStatusChanged: { data: object({
29439
- deviceId: number(),
29440
- status: NavigationStatusSchema
29441
- }) } },
29442
- status: {
29443
- schema: NavigationStatusSchema,
29444
- kind: "push"
29445
- },
29446
- /**
29447
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29448
- * for live mode / follow / flash changes.
29449
- */
29450
- runtimeState: NavigationRuntimeStateSchema,
29451
- /**
29452
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
29453
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
29454
- * that. The live handle re-publishes on connect.
29455
- *
29456
- * See `RuntimeStateDurability`. Enforced by
29457
- * `scripts/check-runtime-state-durability.ts`.
29458
- */
29459
- durability: "session"
29460
- };
29461
29584
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29462
29585
  kind: "mutation",
29463
29586
  auth: "admin"
@@ -38920,6 +39043,12 @@ Object.freeze({
38920
39043
  addonId: null,
38921
39044
  access: "view"
38922
39045
  },
39046
+ "storage.listDrainProgress": {
39047
+ capName: "storage",
39048
+ capScope: "system",
39049
+ addonId: null,
39050
+ access: "view"
39051
+ },
38923
39052
  "storage.listLocationDeclarations": {
38924
39053
  capName: "storage",
38925
39054
  capScope: "system",
@@ -39064,6 +39193,12 @@ Object.freeze({
39064
39193
  addonId: null,
39065
39194
  access: "view"
39066
39195
  },
39196
+ "storageOccupancy.getOccupancy": {
39197
+ capName: "storage-occupancy",
39198
+ capScope: "system",
39199
+ addonId: null,
39200
+ access: "view"
39201
+ },
39067
39202
  "storageProvider.abortUpload": {
39068
39203
  capName: "storage-provider",
39069
39204
  capScope: "system",