@camstack/addon-provider-dreo 0.2.79 → 0.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 +500 -365
  2. package/dist/addon.mjs +500 -365
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
37
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
38
38
  //#endregion
39
- //#region ../types/dist/event-category-zAv7pMUz.mjs
39
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
40
40
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
41
41
  EventCategory["SystemBoot"] = "system.boot";
42
42
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -231,6 +231,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
231
231
  EventCategory["ProcessCrashed"] = "process.crashed";
232
232
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
233
233
  EventCategory["ProcessRestarted"] = "process.restarted";
234
+ /**
235
+ * The SET of storage locations changed — one was created, edited, enabled,
236
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
237
+ *
238
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
239
+ * it must also converge on its own periodic path, because a dropped event
240
+ * must not leave a node writing to yesterday's disk set forever. It exists
241
+ * because there was NO signal at all — an operator who added a second
242
+ * recordings disk in the admin UI got nothing, and the recorder kept its
243
+ * resolved locations until something else happened to re-resolve them
244
+ * (D387). Payload `StorageLocationsChangedPayload`.
245
+ */
246
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
234
247
  EventCategory["RecordingStarted"] = "recording.started";
235
248
  EventCategory["RecordingStopped"] = "recording.stopped";
236
249
  EventCategory["RecordingError"] = "recording.error";
@@ -8573,6 +8586,21 @@ var StorageCleanupJobSchema = object({
8573
8586
  });
8574
8587
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8575
8588
  /**
8589
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8590
+ * alias below is `z.infer<>` of it, never a second spelling.
8591
+ */
8592
+ var StorageLocationModeSchema = _enum([
8593
+ "active",
8594
+ "readonly",
8595
+ "drain",
8596
+ "disabled"
8597
+ ]);
8598
+ _enum([
8599
+ "normal",
8600
+ "never",
8601
+ "drain"
8602
+ ]);
8603
+ /**
8576
8604
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8577
8605
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8578
8606
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8638,6 +8666,21 @@ var StorageLocationSchema = object({
8638
8666
  * stops existing rather than being re-derived on every read.
8639
8667
  */
8640
8668
  enabled: boolean().optional(),
8669
+ /**
8670
+ * THE state of this location (D385), and the only authority on what may be
8671
+ * written, read or evicted here. Interpreted in exactly one place —
8672
+ * `storage-location-mode.ts` — which also folds the legacy
8673
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8674
+ * ambiguous.
8675
+ *
8676
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8677
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8678
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8679
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8680
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8681
+ * either, so the two cannot disagree.
8682
+ */
8683
+ mode: StorageLocationModeSchema.optional(),
8641
8684
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8642
8685
  * for node-local locations it can reach) — never persisted, absent when the
8643
8686
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8645,11 +8688,46 @@ var StorageLocationSchema = object({
8645
8688
  totalBytes: number(),
8646
8689
  availableBytes: number()
8647
8690
  }).nullable().optional(),
8691
+ /**
8692
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8693
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8694
+ * never persisted, never a filesystem walk.
8695
+ *
8696
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8697
+ * location yet — nobody stores here, the owning addon is down, or the first
8698
+ * refresh has not completed. A UI must omit the segment rather than draw it
8699
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8700
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8701
+ * be spelled out loud instead of appearing by accident.
8702
+ *
8703
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8704
+ * about the whole figure rather than about its freshest part.
8705
+ */
8706
+ owned: object({
8707
+ bytes: number().int().nonnegative(),
8708
+ measuredAtMs: number().int().nonnegative()
8709
+ }).optional(),
8648
8710
  createdAt: number(),
8649
8711
  updatedAt: number()
8650
8712
  });
8651
8713
  object({ isDefault: boolean().optional() });
8652
8714
  /**
8715
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8716
+ *
8717
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8718
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8719
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8720
+ * operator learns not to believe the screen.
8721
+ */
8722
+ var StorageDrainProgressSchema = object({
8723
+ locationId: string(),
8724
+ startedAtMs: number(),
8725
+ startBytes: number(),
8726
+ bytesRemaining: number(),
8727
+ drained: boolean(),
8728
+ estimatedEmptyAtMs: number().nullable()
8729
+ });
8730
+ /**
8653
8731
  * Reference accepted by consumer-facing `api.storage.*` calls.
8654
8732
  * Either:
8655
8733
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -21995,7 +22073,7 @@ method(object({
21995
22073
  }), _void(), {
21996
22074
  kind: "mutation",
21997
22075
  auth: "admin"
21998
- }), method(object({ id: string() }), object({
22076
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21999
22077
  ok: boolean(),
22000
22078
  error: string().optional()
22001
22079
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22065,6 +22143,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22065
22143
  kind: "mutation",
22066
22144
  auth: "admin"
22067
22145
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22146
+ /**
22147
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22148
+ * location (D388).
22149
+ *
22150
+ * ## Why this is not `storage-evictable`
22151
+ *
22152
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22153
+ * not, in two ways that both matter and both bite hardest on the locations an
22154
+ * operator most wants a figure for:
22155
+ *
22156
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22157
+ * and `recordingsLow:default` deliberately share one root and evict as one
22158
+ * oldest-first pool, so both answer with the SAME combined total. As an
22159
+ * occupancy figure that double-counts the disk.
22160
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22161
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22162
+ * is retiring and staring at.
22163
+ *
22164
+ * So this is its own contract with its own quantity, and the quantity is
22165
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22166
+ * would ever be willing to delete it. A provider that can only answer
22167
+ * "evictable" must not register here — a number that silently means different
22168
+ * things per class is worse than no number.
22169
+ *
22170
+ * ## Absence is an answer
22171
+ *
22172
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22173
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22174
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22175
+ * consuming side has to be written out loud instead of appearing by accident.
22176
+ *
22177
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22178
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22179
+ */
22180
+ /** One provider's occupancy answer for one location. */
22181
+ var StorageOccupancyReportSchema = object({
22182
+ locationId: string(),
22183
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22184
+ * not net of what it is willing to delete. */
22185
+ ownedBytes: number().int().nonnegative(),
22186
+ /** When the provider last actually measured this. The orchestrator carries it
22187
+ * through so a UI can say how old the figure is instead of implying "now". */
22188
+ measuredAtMs: number().int().nonnegative()
22189
+ });
22190
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22068
22191
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22069
22192
  providerId: string().min(1),
22070
22193
  displayName: string().min(1),
@@ -23900,88 +24023,6 @@ onStatusChanged: { data: object({
23900
24023
  volatileStateFields: ["lastUpdated"]
23901
24024
  };
23902
24025
  /**
23903
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23904
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23905
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23906
- * one Home Assistant projection.
23907
- */
23908
- var NetworkLinkStatusSchema = object({
23909
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23910
- type: _enum([
23911
- "wifi",
23912
- "ethernet",
23913
- "cellular",
23914
- "unknown"
23915
- ]),
23916
- /**
23917
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23918
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23919
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23920
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23921
- * SKIP a null rather than coerce it.
23922
- */
23923
- signalPercent: number().min(0).max(100).nullable(),
23924
- /** Raw received signal strength in dBm, when the firmware reports one. */
23925
- rssiDbm: number().optional(),
23926
- /** Network name of a wireless link, when the firmware reports it. */
23927
- ssid: string().optional(),
23928
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23929
- lastUpdated: number()
23930
- });
23931
- var networkLinkCapability = {
23932
- name: "network-link",
23933
- scope: "device",
23934
- deviceNative: true,
23935
- mode: "singleton",
23936
- deviceTypes: [
23937
- DeviceType.Camera,
23938
- DeviceType.Sensor,
23939
- DeviceType.Button,
23940
- DeviceType.Switch,
23941
- DeviceType.Light,
23942
- DeviceType.Lock,
23943
- DeviceType.Siren
23944
- ],
23945
- methods: {},
23946
- events: {
23947
- /**
23948
- * Emitted whenever the cached status changes (a link switch, a signal
23949
- * reading that moved). Mirrored on the parent chain by the
23950
- * DeviceEventPropagator like `battery.onStatusChanged`.
23951
- */
23952
- onStatusChanged: { data: object({
23953
- deviceId: number(),
23954
- status: NetworkLinkStatusSchema
23955
- }) } },
23956
- status: {
23957
- schema: NetworkLinkStatusSchema,
23958
- kind: "push",
23959
- empty: {
23960
- type: "unknown",
23961
- signalPercent: null,
23962
- lastUpdated: 0
23963
- }
23964
- },
23965
- /**
23966
- * Runtime-state slice — every provider stores the same shape under
23967
- * `device.runtimeState['network-link']`, read once by the badge and the
23968
- * Home Assistant projector regardless of the driver.
23969
- */
23970
- runtimeState: NetworkLinkStatusSchema,
23971
- /**
23972
- * Runtime-state durability: **restored** — a link reading is slow to
23973
- * change and a sleeping battery camera may not report for hours; the
23974
- * restored slice is what the badge shows until the next read.
23975
- *
23976
- * See `RuntimeStateDurability`. Enforced by
23977
- * `scripts/check-runtime-state-durability.ts`.
23978
- */
23979
- durability: "restored",
23980
- /** Clock fields: written, but excluded from the compare that decides
23981
- * whether persisting is worth a SQLite commit. */
23982
- volatileStateFields: ["lastUpdated"]
23983
- };
23984
- /**
23985
24026
  * Generic boolean sensor — last-resort fallback when no domain-
23986
24027
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23987
24028
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -27519,6 +27560,369 @@ var nativeObjectDetectionCapability = {
27519
27560
  volatileStateFields: ["lastFetchedAt"]
27520
27561
  };
27521
27562
  /**
27563
+ * `navigation` — a device-scoped capability that natively expresses the FULL
27564
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
27565
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
27566
+ *
27567
+ * Why a NEW cap rather than overloading `ptz`:
27568
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27569
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27570
+ * The two are different physical models: PTZ is absolute-position + presets,
27571
+ * navigation is momentary drive nudges + discrete robot ACTIONS
27572
+ * (dock / spot-clean / follow-pet / go-to-point / …).
27573
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27574
+ * the reverse:
27575
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
27576
+ * / `getOptions`), and
27577
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27578
+ * robot camera shows up in the existing PTZ control path without every
27579
+ * PTZ provider learning about robots. The mapping lives in the adapter,
27580
+ * not here (see the addon design note):
27581
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27582
+ * ptz.stop() → navigation.stop()
27583
+ * ptz.goHome() → navigation.runAction('goHome')
27584
+ * ptz.getPresets() → navigation.listActions() (id→preset)
27585
+ * ptz.goToPreset(id) → navigation.runAction(id)
27586
+ *
27587
+ * ## Continuous drive
27588
+ *
27589
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27590
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27591
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27592
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27593
+ * coalesce them. The UI owns the cadence.
27594
+ *
27595
+ * ## The action dictionary
27596
+ *
27597
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27598
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27599
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27600
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27601
+ * vendor-specific list. `kind: 'action'` entries are triggered with
27602
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27603
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
27604
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27605
+ *
27606
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27607
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27608
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
27609
+ * every device handle. A future nodedreame publish adds a typed
27610
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27611
+ * provider can then swap the raw calls for the typed methods with no change to
27612
+ * THIS contract.
27613
+ */
27614
+ /**
27615
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27616
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27617
+ * halts it.
27618
+ *
27619
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
27620
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27621
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27622
+ * vector by it (drivers without proportional drive ignore it).
27623
+ *
27624
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27625
+ * axis alone; an all-undefined nudge is a no-op.
27626
+ */
27627
+ var NavigationMoveCommandSchema = object({
27628
+ pan: number().min(-1).max(1).optional(),
27629
+ tilt: number().min(-1).max(1).optional(),
27630
+ speed: number().min(0).max(1).optional()
27631
+ });
27632
+ /**
27633
+ * The enumerated discrete actions a navigation-capable robot can perform via
27634
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27635
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
27636
+ * `playSound` (see the `sound` dictionary entries).
27637
+ */
27638
+ var NavigationActionIdSchema = _enum([
27639
+ "goHome",
27640
+ "locate",
27641
+ "spotClean",
27642
+ "findPet",
27643
+ "personFollow",
27644
+ "stop",
27645
+ "startClean",
27646
+ "pauseClean",
27647
+ "dockWash",
27648
+ "autoEmpty",
27649
+ "flashOn",
27650
+ "flashOff"
27651
+ ]);
27652
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27653
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
27654
+ /**
27655
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27656
+ * native panel and the PTZ mimic render as a button.
27657
+ *
27658
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27659
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27660
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
27661
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27662
+ * - `label` — operator-facing English label.
27663
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27664
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27665
+ * PTZ render ONLY enabled entries. Data-driven: the provider
27666
+ * flips it from config, never by editing code.
27667
+ */
27668
+ var NavigationActionEntrySchema = object({
27669
+ id: string(),
27670
+ kind: NavigationEntryKindSchema,
27671
+ label: string(),
27672
+ icon: string(),
27673
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27674
+ soundId: number().int().optional(),
27675
+ /** Per-device feature flag — render this entry only when true. */
27676
+ enabled: boolean()
27677
+ });
27678
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
27679
+ var NavigationPointSchema = object({
27680
+ x: number(),
27681
+ y: number()
27682
+ });
27683
+ /**
27684
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27685
+ * The cap reports which are enabled so the UI / PTZ render only the controls
27686
+ * that are turned on for THIS device. Data-driven: the provider derives these
27687
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27688
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27689
+ * that are not dictionary entries.
27690
+ *
27691
+ * - `move` / `stop` — the momentary drive joystick.
27692
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27693
+ * map-coordinate plumbing is wired.
27694
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27695
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27696
+ * - `light` — the on/off fill-light toggle (works anytime).
27697
+ * - `lightMode` — the auto/manual selector + manual level slider (a
27698
+ * camera-service control; needs an active stream).
27699
+ */
27700
+ var NavigationFeaturesSchema = object({
27701
+ move: boolean(),
27702
+ stop: boolean(),
27703
+ goToPoint: boolean(),
27704
+ runAction: boolean(),
27705
+ playSound: boolean(),
27706
+ light: boolean(),
27707
+ lightMode: boolean()
27708
+ });
27709
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27710
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
27711
+ /**
27712
+ * Live navigation state so the UI can reflect what the robot is doing:
27713
+ * - `mode` — coarse activity (idle / cleaning / following / …).
27714
+ * - `following` — person/pet follow is currently armed.
27715
+ * - `flash` — the on-camera fill light is on.
27716
+ * - `lightMode` — auto vs manual fill-light mode.
27717
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
27718
+ * `lightMode === 'manual'`.
27719
+ */
27720
+ var NavigationStatusSchema = object({
27721
+ mode: _enum([
27722
+ "idle",
27723
+ "cleaning",
27724
+ "spot",
27725
+ "following",
27726
+ "goto",
27727
+ "returning",
27728
+ "paused",
27729
+ "unknown"
27730
+ ]),
27731
+ following: boolean(),
27732
+ flash: boolean(),
27733
+ lightMode: NavigationLightModeSchema,
27734
+ lightLevel: number().min(40).max(100),
27735
+ /** Ms epoch when the slice was last updated. */
27736
+ lastChangedAt: number()
27737
+ });
27738
+ /**
27739
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
27740
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
27741
+ * convention.
27742
+ */
27743
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
27744
+ var navigationCapability = {
27745
+ name: "navigation",
27746
+ scope: "device",
27747
+ deviceNative: true,
27748
+ mode: "singleton",
27749
+ deviceTypes: [DeviceType.Camera],
27750
+ deviceConfig: { ui: {
27751
+ kind: "widget",
27752
+ widgetId: "host/navigation-panel",
27753
+ tab: "navigation",
27754
+ topTab: true,
27755
+ label: "Navigation",
27756
+ order: 0
27757
+ } },
27758
+ methods: {
27759
+ /**
27760
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
27761
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
27762
+ * path) works for any authenticated user, not admin-only. The UI sends
27763
+ * these at ~1 Hz while a control is held; the provider forwards each one to
27764
+ * a single drive write WITHOUT debouncing.
27765
+ */
27766
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27767
+ /** Halt all motion immediately (zero drive vector). */
27768
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
27769
+ /** Send the robot to a point on its live map. */
27770
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27771
+ /**
27772
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
27773
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
27774
+ */
27775
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
27776
+ /**
27777
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
27778
+ * unsupported action ids are rejected by the provider.
27779
+ */
27780
+ runAction: method(object({
27781
+ deviceId: number(),
27782
+ actionId: NavigationActionIdSchema
27783
+ }), _void(), { kind: "mutation" }),
27784
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
27785
+ playSound: method(object({
27786
+ deviceId: number(),
27787
+ soundId: number().int()
27788
+ }), _void(), { kind: "mutation" }),
27789
+ /**
27790
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
27791
+ * works anytime, no active stream required).
27792
+ */
27793
+ setLightOn: method(object({
27794
+ deviceId: number(),
27795
+ on: boolean()
27796
+ }), _void(), { kind: "mutation" }),
27797
+ /**
27798
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
27799
+ * initial `level`. The auto/manual + level control is a CAMERA-service
27800
+ * action that generally needs an active camera stream/monitor session — the
27801
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
27802
+ */
27803
+ setLightMode: method(object({
27804
+ deviceId: number(),
27805
+ mode: NavigationLightModeSchema,
27806
+ level: number().min(40).max(100).optional()
27807
+ }), _void(), { kind: "mutation" }),
27808
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
27809
+ setLightLevel: method(object({
27810
+ deviceId: number(),
27811
+ level: number().min(40).max(100)
27812
+ }), _void(), { kind: "mutation" }),
27813
+ /**
27814
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
27815
+ * controls the UI shows (the per-entry flags for the dictionary come back on
27816
+ * `listActions`).
27817
+ */
27818
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
27819
+ },
27820
+ events: { onStatusChanged: { data: object({
27821
+ deviceId: number(),
27822
+ status: NavigationStatusSchema
27823
+ }) } },
27824
+ status: {
27825
+ schema: NavigationStatusSchema,
27826
+ kind: "push"
27827
+ },
27828
+ /**
27829
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
27830
+ * for live mode / follow / flash changes.
27831
+ */
27832
+ runtimeState: NavigationRuntimeStateSchema,
27833
+ /**
27834
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
27835
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
27836
+ * that. The live handle re-publishes on connect.
27837
+ *
27838
+ * See `RuntimeStateDurability`. Enforced by
27839
+ * `scripts/check-runtime-state-durability.ts`.
27840
+ */
27841
+ durability: "session"
27842
+ };
27843
+ /**
27844
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
27845
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
27846
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
27847
+ * one Home Assistant projection.
27848
+ */
27849
+ var NetworkLinkStatusSchema = object({
27850
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
27851
+ type: _enum([
27852
+ "wifi",
27853
+ "ethernet",
27854
+ "cellular",
27855
+ "unknown"
27856
+ ]),
27857
+ /**
27858
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
27859
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
27860
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
27861
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
27862
+ * SKIP a null rather than coerce it.
27863
+ */
27864
+ signalPercent: number().min(0).max(100).nullable(),
27865
+ /** Raw received signal strength in dBm, when the firmware reports one. */
27866
+ rssiDbm: number().optional(),
27867
+ /** Network name of a wireless link, when the firmware reports it. */
27868
+ ssid: string().optional(),
27869
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
27870
+ lastUpdated: number()
27871
+ });
27872
+ var networkLinkCapability = {
27873
+ name: "network-link",
27874
+ scope: "device",
27875
+ deviceNative: true,
27876
+ mode: "singleton",
27877
+ deviceTypes: [
27878
+ DeviceType.Camera,
27879
+ DeviceType.Sensor,
27880
+ DeviceType.Button,
27881
+ DeviceType.Switch,
27882
+ DeviceType.Light,
27883
+ DeviceType.Lock,
27884
+ DeviceType.Siren
27885
+ ],
27886
+ methods: {},
27887
+ events: {
27888
+ /**
27889
+ * Emitted whenever the cached status changes (a link switch, a signal
27890
+ * reading that moved). Mirrored on the parent chain by the
27891
+ * DeviceEventPropagator like `battery.onStatusChanged`.
27892
+ */
27893
+ onStatusChanged: { data: object({
27894
+ deviceId: number(),
27895
+ status: NetworkLinkStatusSchema
27896
+ }) } },
27897
+ status: {
27898
+ schema: NetworkLinkStatusSchema,
27899
+ kind: "push",
27900
+ empty: {
27901
+ type: "unknown",
27902
+ signalPercent: null,
27903
+ lastUpdated: 0
27904
+ }
27905
+ },
27906
+ /**
27907
+ * Runtime-state slice — every provider stores the same shape under
27908
+ * `device.runtimeState['network-link']`, read once by the badge and the
27909
+ * Home Assistant projector regardless of the driver.
27910
+ */
27911
+ runtimeState: NetworkLinkStatusSchema,
27912
+ /**
27913
+ * Runtime-state durability: **restored** — a link reading is slow to
27914
+ * change and a sleeping battery camera may not report for hours; the
27915
+ * restored slice is what the badge shows until the next read.
27916
+ *
27917
+ * See `RuntimeStateDurability`. Enforced by
27918
+ * `scripts/check-runtime-state-durability.ts`.
27919
+ */
27920
+ durability: "restored",
27921
+ /** Clock fields: written, but excluded from the compare that decides
27922
+ * whether persisting is worth a SQLite commit. */
27923
+ volatileStateFields: ["lastUpdated"]
27924
+ };
27925
+ /**
27522
27926
  * network-quality — system-scoped singleton capability tracking RTT,
27523
27927
  * jitter, and observed/peak bandwidth per device + per client.
27524
27928
  *
@@ -29099,287 +29503,6 @@ var ptzAutotrackCapability = {
29099
29503
  */
29100
29504
  durability: "session"
29101
29505
  };
29102
- /**
29103
- * `navigation` — a device-scoped capability that natively expresses the FULL
29104
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
29105
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
29106
- *
29107
- * Why a NEW cap rather than overloading `ptz`:
29108
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29109
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29110
- * The two are different physical models: PTZ is absolute-position + presets,
29111
- * navigation is momentary drive nudges + discrete robot ACTIONS
29112
- * (dock / spot-clean / follow-pet / go-to-point / …).
29113
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29114
- * the reverse:
29115
- * 1. a native CamStack navigation panel (data-driven from `listActions`
29116
- * / `getOptions`), and
29117
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29118
- * robot camera shows up in the existing PTZ control path without every
29119
- * PTZ provider learning about robots. The mapping lives in the adapter,
29120
- * not here (see the addon design note):
29121
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29122
- * ptz.stop() → navigation.stop()
29123
- * ptz.goHome() → navigation.runAction('goHome')
29124
- * ptz.getPresets() → navigation.listActions() (id→preset)
29125
- * ptz.goToPreset(id) → navigation.runAction(id)
29126
- *
29127
- * ## Continuous drive
29128
- *
29129
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29130
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29131
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29132
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29133
- * coalesce them. The UI owns the cadence.
29134
- *
29135
- * ## The action dictionary
29136
- *
29137
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29138
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29139
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29140
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29141
- * vendor-specific list. `kind: 'action'` entries are triggered with
29142
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29143
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
29144
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29145
- *
29146
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29147
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29148
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
29149
- * every device handle. A future nodedreame publish adds a typed
29150
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29151
- * provider can then swap the raw calls for the typed methods with no change to
29152
- * THIS contract.
29153
- */
29154
- /**
29155
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29156
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29157
- * halts it.
29158
- *
29159
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
29160
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29161
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29162
- * vector by it (drivers without proportional drive ignore it).
29163
- *
29164
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29165
- * axis alone; an all-undefined nudge is a no-op.
29166
- */
29167
- var NavigationMoveCommandSchema = object({
29168
- pan: number().min(-1).max(1).optional(),
29169
- tilt: number().min(-1).max(1).optional(),
29170
- speed: number().min(0).max(1).optional()
29171
- });
29172
- /**
29173
- * The enumerated discrete actions a navigation-capable robot can perform via
29174
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29175
- * subset it supports through `listActions`. Sounds are NOT here — they go through
29176
- * `playSound` (see the `sound` dictionary entries).
29177
- */
29178
- var NavigationActionIdSchema = _enum([
29179
- "goHome",
29180
- "locate",
29181
- "spotClean",
29182
- "findPet",
29183
- "personFollow",
29184
- "stop",
29185
- "startClean",
29186
- "pauseClean",
29187
- "dockWash",
29188
- "autoEmpty",
29189
- "flashOn",
29190
- "flashOff"
29191
- ]);
29192
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29193
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
29194
- /**
29195
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29196
- * native panel and the PTZ mimic render as a button.
29197
- *
29198
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29199
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29200
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
29201
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29202
- * - `label` — operator-facing English label.
29203
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29204
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29205
- * PTZ render ONLY enabled entries. Data-driven: the provider
29206
- * flips it from config, never by editing code.
29207
- */
29208
- var NavigationActionEntrySchema = object({
29209
- id: string(),
29210
- kind: NavigationEntryKindSchema,
29211
- label: string(),
29212
- icon: string(),
29213
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29214
- soundId: number().int().optional(),
29215
- /** Per-device feature flag — render this entry only when true. */
29216
- enabled: boolean()
29217
- });
29218
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
29219
- var NavigationPointSchema = object({
29220
- x: number(),
29221
- y: number()
29222
- });
29223
- /**
29224
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29225
- * The cap reports which are enabled so the UI / PTZ render only the controls
29226
- * that are turned on for THIS device. Data-driven: the provider derives these
29227
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29228
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29229
- * that are not dictionary entries.
29230
- *
29231
- * - `move` / `stop` — the momentary drive joystick.
29232
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29233
- * map-coordinate plumbing is wired.
29234
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29235
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29236
- * - `light` — the on/off fill-light toggle (works anytime).
29237
- * - `lightMode` — the auto/manual selector + manual level slider (a
29238
- * camera-service control; needs an active stream).
29239
- */
29240
- var NavigationFeaturesSchema = object({
29241
- move: boolean(),
29242
- stop: boolean(),
29243
- goToPoint: boolean(),
29244
- runAction: boolean(),
29245
- playSound: boolean(),
29246
- light: boolean(),
29247
- lightMode: boolean()
29248
- });
29249
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29250
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
29251
- /**
29252
- * Live navigation state so the UI can reflect what the robot is doing:
29253
- * - `mode` — coarse activity (idle / cleaning / following / …).
29254
- * - `following` — person/pet follow is currently armed.
29255
- * - `flash` — the on-camera fill light is on.
29256
- * - `lightMode` — auto vs manual fill-light mode.
29257
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
29258
- * `lightMode === 'manual'`.
29259
- */
29260
- var NavigationStatusSchema = object({
29261
- mode: _enum([
29262
- "idle",
29263
- "cleaning",
29264
- "spot",
29265
- "following",
29266
- "goto",
29267
- "returning",
29268
- "paused",
29269
- "unknown"
29270
- ]),
29271
- following: boolean(),
29272
- flash: boolean(),
29273
- lightMode: NavigationLightModeSchema,
29274
- lightLevel: number().min(40).max(100),
29275
- /** Ms epoch when the slice was last updated. */
29276
- lastChangedAt: number()
29277
- });
29278
- /**
29279
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29280
- * observable). Adds `lastFetchedAt` on top of the status shape per the
29281
- * convention.
29282
- */
29283
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29284
- var navigationCapability = {
29285
- name: "navigation",
29286
- scope: "device",
29287
- deviceNative: true,
29288
- mode: "singleton",
29289
- deviceTypes: [DeviceType.Camera],
29290
- deviceConfig: { ui: {
29291
- kind: "widget",
29292
- widgetId: "host/navigation-panel",
29293
- tab: "navigation",
29294
- topTab: true,
29295
- label: "Navigation",
29296
- order: 0
29297
- } },
29298
- methods: {
29299
- /**
29300
- * Momentary drive nudge (the robot moves). `protected` — mirrors
29301
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29302
- * path) works for any authenticated user, not admin-only. The UI sends
29303
- * these at ~1 Hz while a control is held; the provider forwards each one to
29304
- * a single drive write WITHOUT debouncing.
29305
- */
29306
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29307
- /** Halt all motion immediately (zero drive vector). */
29308
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29309
- /** Send the robot to a point on its live map. */
29310
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29311
- /**
29312
- * Enumerate the discrete controls THIS device supports (data-driven UI +
29313
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29314
- */
29315
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29316
- /**
29317
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29318
- * unsupported action ids are rejected by the provider.
29319
- */
29320
- runAction: method(object({
29321
- deviceId: number(),
29322
- actionId: NavigationActionIdSchema
29323
- }), _void(), { kind: "mutation" }),
29324
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29325
- playSound: method(object({
29326
- deviceId: number(),
29327
- soundId: number().int()
29328
- }), _void(), { kind: "mutation" }),
29329
- /**
29330
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29331
- * works anytime, no active stream required).
29332
- */
29333
- setLightOn: method(object({
29334
- deviceId: number(),
29335
- on: boolean()
29336
- }), _void(), { kind: "mutation" }),
29337
- /**
29338
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29339
- * initial `level`. The auto/manual + level control is a CAMERA-service
29340
- * action that generally needs an active camera stream/monitor session — the
29341
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
29342
- */
29343
- setLightMode: method(object({
29344
- deviceId: number(),
29345
- mode: NavigationLightModeSchema,
29346
- level: number().min(40).max(100).optional()
29347
- }), _void(), { kind: "mutation" }),
29348
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29349
- setLightLevel: method(object({
29350
- deviceId: number(),
29351
- level: number().min(40).max(100)
29352
- }), _void(), { kind: "mutation" }),
29353
- /**
29354
- * Per-device FEATURE-FLAG report for the general primitives — drives which
29355
- * controls the UI shows (the per-entry flags for the dictionary come back on
29356
- * `listActions`).
29357
- */
29358
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29359
- },
29360
- events: { onStatusChanged: { data: object({
29361
- deviceId: number(),
29362
- status: NavigationStatusSchema
29363
- }) } },
29364
- status: {
29365
- schema: NavigationStatusSchema,
29366
- kind: "push"
29367
- },
29368
- /**
29369
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29370
- * for live mode / follow / flash changes.
29371
- */
29372
- runtimeState: NavigationRuntimeStateSchema,
29373
- /**
29374
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
29375
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
29376
- * that. The live handle re-publishes on connect.
29377
- *
29378
- * See `RuntimeStateDurability`. Enforced by
29379
- * `scripts/check-runtime-state-durability.ts`.
29380
- */
29381
- durability: "session"
29382
- };
29383
29506
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29384
29507
  kind: "mutation",
29385
29508
  auth: "admin"
@@ -38842,6 +38965,12 @@ Object.freeze({
38842
38965
  addonId: null,
38843
38966
  access: "view"
38844
38967
  },
38968
+ "storage.listDrainProgress": {
38969
+ capName: "storage",
38970
+ capScope: "system",
38971
+ addonId: null,
38972
+ access: "view"
38973
+ },
38845
38974
  "storage.listLocationDeclarations": {
38846
38975
  capName: "storage",
38847
38976
  capScope: "system",
@@ -38986,6 +39115,12 @@ Object.freeze({
38986
39115
  addonId: null,
38987
39116
  access: "view"
38988
39117
  },
39118
+ "storageOccupancy.getOccupancy": {
39119
+ capName: "storage-occupancy",
39120
+ capScope: "system",
39121
+ addonId: null,
39122
+ access: "view"
39123
+ },
38989
39124
  "storageProvider.abortUpload": {
38990
39125
  capName: "storage-provider",
38991
39126
  capScope: "system",