@camstack/addon-remote-storage 1.2.78 → 1.2.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  let node_crypto = require("node:crypto");
24
24
  let node_path = require("node:path");
25
25
  node_path = __toESM(node_path);
26
- //#region ../types/dist/event-category-zAv7pMUz.mjs
26
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
27
27
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
28
28
  EventCategory["SystemBoot"] = "system.boot";
29
29
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -218,6 +218,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
218
218
  EventCategory["ProcessCrashed"] = "process.crashed";
219
219
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
220
220
  EventCategory["ProcessRestarted"] = "process.restarted";
221
+ /**
222
+ * The SET of storage locations changed — one was created, edited, enabled,
223
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
224
+ *
225
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
226
+ * it must also converge on its own periodic path, because a dropped event
227
+ * must not leave a node writing to yesterday's disk set forever. It exists
228
+ * because there was NO signal at all — an operator who added a second
229
+ * recordings disk in the admin UI got nothing, and the recorder kept its
230
+ * resolved locations until something else happened to re-resolve them
231
+ * (D387). Payload `StorageLocationsChangedPayload`.
232
+ */
233
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
221
234
  EventCategory["RecordingStarted"] = "recording.started";
222
235
  EventCategory["RecordingStopped"] = "recording.stopped";
223
236
  EventCategory["RecordingError"] = "recording.error";
@@ -8544,6 +8557,21 @@ var StorageCleanupJobSchema = object({
8544
8557
  });
8545
8558
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8546
8559
  /**
8560
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8561
+ * alias below is `z.infer<>` of it, never a second spelling.
8562
+ */
8563
+ var StorageLocationModeSchema = _enum([
8564
+ "active",
8565
+ "readonly",
8566
+ "drain",
8567
+ "disabled"
8568
+ ]);
8569
+ _enum([
8570
+ "normal",
8571
+ "never",
8572
+ "drain"
8573
+ ]);
8574
+ /**
8547
8575
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8548
8576
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8549
8577
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8609,6 +8637,21 @@ var StorageLocationSchema = object({
8609
8637
  * stops existing rather than being re-derived on every read.
8610
8638
  */
8611
8639
  enabled: boolean().optional(),
8640
+ /**
8641
+ * THE state of this location (D385), and the only authority on what may be
8642
+ * written, read or evicted here. Interpreted in exactly one place —
8643
+ * `storage-location-mode.ts` — which also folds the legacy
8644
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8645
+ * ambiguous.
8646
+ *
8647
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8648
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8649
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8650
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8651
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8652
+ * either, so the two cannot disagree.
8653
+ */
8654
+ mode: StorageLocationModeSchema.optional(),
8612
8655
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8613
8656
  * for node-local locations it can reach) — never persisted, absent when the
8614
8657
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8616,11 +8659,46 @@ var StorageLocationSchema = object({
8616
8659
  totalBytes: number(),
8617
8660
  availableBytes: number()
8618
8661
  }).nullable().optional(),
8662
+ /**
8663
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8664
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8665
+ * never persisted, never a filesystem walk.
8666
+ *
8667
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8668
+ * location yet — nobody stores here, the owning addon is down, or the first
8669
+ * refresh has not completed. A UI must omit the segment rather than draw it
8670
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8671
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8672
+ * be spelled out loud instead of appearing by accident.
8673
+ *
8674
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8675
+ * about the whole figure rather than about its freshest part.
8676
+ */
8677
+ owned: object({
8678
+ bytes: number().int().nonnegative(),
8679
+ measuredAtMs: number().int().nonnegative()
8680
+ }).optional(),
8619
8681
  createdAt: number(),
8620
8682
  updatedAt: number()
8621
8683
  });
8622
8684
  object({ isDefault: boolean().optional() });
8623
8685
  /**
8686
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8687
+ *
8688
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8689
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8690
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8691
+ * operator learns not to believe the screen.
8692
+ */
8693
+ var StorageDrainProgressSchema = object({
8694
+ locationId: string(),
8695
+ startedAtMs: number(),
8696
+ startBytes: number(),
8697
+ bytesRemaining: number(),
8698
+ drained: boolean(),
8699
+ estimatedEmptyAtMs: number().nullable()
8700
+ });
8701
+ /**
8624
8702
  * Reference accepted by consumer-facing `api.storage.*` calls.
8625
8703
  * Either:
8626
8704
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -21581,7 +21659,7 @@ method(object({
21581
21659
  }), _void(), {
21582
21660
  kind: "mutation",
21583
21661
  auth: "admin"
21584
- }), method(object({ id: string() }), object({
21662
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21585
21663
  ok: boolean(),
21586
21664
  error: string().optional()
21587
21665
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21651,6 +21729,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21651
21729
  kind: "mutation",
21652
21730
  auth: "admin"
21653
21731
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21732
+ /**
21733
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21734
+ * location (D388).
21735
+ *
21736
+ * ## Why this is not `storage-evictable`
21737
+ *
21738
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21739
+ * not, in two ways that both matter and both bite hardest on the locations an
21740
+ * operator most wants a figure for:
21741
+ *
21742
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21743
+ * and `recordingsLow:default` deliberately share one root and evict as one
21744
+ * oldest-first pool, so both answer with the SAME combined total. As an
21745
+ * occupancy figure that double-counts the disk.
21746
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21747
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21748
+ * is retiring and staring at.
21749
+ *
21750
+ * So this is its own contract with its own quantity, and the quantity is
21751
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21752
+ * would ever be willing to delete it. A provider that can only answer
21753
+ * "evictable" must not register here — a number that silently means different
21754
+ * things per class is worse than no number.
21755
+ *
21756
+ * ## Absence is an answer
21757
+ *
21758
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21759
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21760
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21761
+ * consuming side has to be written out loud instead of appearing by accident.
21762
+ *
21763
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21764
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21765
+ */
21766
+ /** One provider's occupancy answer for one location. */
21767
+ var StorageOccupancyReportSchema = object({
21768
+ locationId: string(),
21769
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21770
+ * not net of what it is willing to delete. */
21771
+ ownedBytes: number().int().nonnegative(),
21772
+ /** When the provider last actually measured this. The orchestrator carries it
21773
+ * through so a UI can say how old the figure is instead of implying "now". */
21774
+ measuredAtMs: number().int().nonnegative()
21775
+ });
21776
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21654
21777
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21655
21778
  providerId: string().min(1),
21656
21779
  displayName: string().min(1),
@@ -23346,39 +23469,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23346
23469
  deviceId: number(),
23347
23470
  status: BatteryStatusSchema
23348
23471
  });
23349
- /**
23350
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23351
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23352
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23353
- * one Home Assistant projection.
23354
- */
23355
- var NetworkLinkStatusSchema = object({
23356
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23357
- type: _enum([
23358
- "wifi",
23359
- "ethernet",
23360
- "cellular",
23361
- "unknown"
23362
- ]),
23363
- /**
23364
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23365
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23366
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23367
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23368
- * SKIP a null rather than coerce it.
23369
- */
23370
- signalPercent: number().min(0).max(100).nullable(),
23371
- /** Raw received signal strength in dBm, when the firmware reports one. */
23372
- rssiDbm: number().optional(),
23373
- /** Network name of a wireless link, when the firmware reports it. */
23374
- ssid: string().optional(),
23375
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23376
- lastUpdated: number()
23377
- });
23378
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23379
- deviceId: number(),
23380
- status: NetworkLinkStatusSchema
23381
- });
23382
23472
  object({
23383
23473
  on: boolean(),
23384
23474
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25732,6 +25822,236 @@ DeviceType.Camera, method(object({
25732
25822
  detection: NativeDetectionSchema
25733
25823
  });
25734
25824
  /**
25825
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25826
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25827
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25828
+ *
25829
+ * Why a NEW cap rather than overloading `ptz`:
25830
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25831
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25832
+ * The two are different physical models: PTZ is absolute-position + presets,
25833
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25834
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25835
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25836
+ * the reverse:
25837
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25838
+ * / `getOptions`), and
25839
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25840
+ * robot camera shows up in the existing PTZ control path without every
25841
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25842
+ * not here (see the addon design note):
25843
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25844
+ * ptz.stop() → navigation.stop()
25845
+ * ptz.goHome() → navigation.runAction('goHome')
25846
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25847
+ * ptz.goToPreset(id) → navigation.runAction(id)
25848
+ *
25849
+ * ## Continuous drive
25850
+ *
25851
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25852
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25853
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25854
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25855
+ * coalesce them. The UI owns the cadence.
25856
+ *
25857
+ * ## The action dictionary
25858
+ *
25859
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25860
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25861
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25862
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25863
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25864
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25865
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
25866
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
25867
+ *
25868
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
25869
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
25870
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
25871
+ * every device handle. A future nodedreame publish adds a typed
25872
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
25873
+ * provider can then swap the raw calls for the typed methods with no change to
25874
+ * THIS contract.
25875
+ */
25876
+ /**
25877
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
25878
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
25879
+ * halts it.
25880
+ *
25881
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
25882
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
25883
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
25884
+ * vector by it (drivers without proportional drive ignore it).
25885
+ *
25886
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
25887
+ * axis alone; an all-undefined nudge is a no-op.
25888
+ */
25889
+ var NavigationMoveCommandSchema = object({
25890
+ pan: number().min(-1).max(1).optional(),
25891
+ tilt: number().min(-1).max(1).optional(),
25892
+ speed: number().min(0).max(1).optional()
25893
+ });
25894
+ /**
25895
+ * The enumerated discrete actions a navigation-capable robot can perform via
25896
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
25897
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
25898
+ * `playSound` (see the `sound` dictionary entries).
25899
+ */
25900
+ var NavigationActionIdSchema = _enum([
25901
+ "goHome",
25902
+ "locate",
25903
+ "spotClean",
25904
+ "findPet",
25905
+ "personFollow",
25906
+ "stop",
25907
+ "startClean",
25908
+ "pauseClean",
25909
+ "dockWash",
25910
+ "autoEmpty",
25911
+ "flashOn",
25912
+ "flashOff"
25913
+ ]);
25914
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
25915
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
25916
+ /**
25917
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
25918
+ * native panel and the PTZ mimic render as a button.
25919
+ *
25920
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
25921
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
25922
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
25923
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
25924
+ * - `label` — operator-facing English label.
25925
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
25926
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
25927
+ * PTZ render ONLY enabled entries. Data-driven: the provider
25928
+ * flips it from config, never by editing code.
25929
+ */
25930
+ var NavigationActionEntrySchema = object({
25931
+ id: string(),
25932
+ kind: NavigationEntryKindSchema,
25933
+ label: string(),
25934
+ icon: string(),
25935
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
25936
+ soundId: number().int().optional(),
25937
+ /** Per-device feature flag — render this entry only when true. */
25938
+ enabled: boolean()
25939
+ });
25940
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
25941
+ var NavigationPointSchema = object({
25942
+ x: number(),
25943
+ y: number()
25944
+ });
25945
+ /**
25946
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
25947
+ * The cap reports which are enabled so the UI / PTZ render only the controls
25948
+ * that are turned on for THIS device. Data-driven: the provider derives these
25949
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
25950
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
25951
+ * that are not dictionary entries.
25952
+ *
25953
+ * - `move` / `stop` — the momentary drive joystick.
25954
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
25955
+ * map-coordinate plumbing is wired.
25956
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
25957
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
25958
+ * - `light` — the on/off fill-light toggle (works anytime).
25959
+ * - `lightMode` — the auto/manual selector + manual level slider (a
25960
+ * camera-service control; needs an active stream).
25961
+ */
25962
+ var NavigationFeaturesSchema = object({
25963
+ move: boolean(),
25964
+ stop: boolean(),
25965
+ goToPoint: boolean(),
25966
+ runAction: boolean(),
25967
+ playSound: boolean(),
25968
+ light: boolean(),
25969
+ lightMode: boolean()
25970
+ });
25971
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
25972
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
25973
+ /**
25974
+ * Live navigation state so the UI can reflect what the robot is doing:
25975
+ * - `mode` — coarse activity (idle / cleaning / following / …).
25976
+ * - `following` — person/pet follow is currently armed.
25977
+ * - `flash` — the on-camera fill light is on.
25978
+ * - `lightMode` — auto vs manual fill-light mode.
25979
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
25980
+ * `lightMode === 'manual'`.
25981
+ */
25982
+ var NavigationStatusSchema = object({
25983
+ mode: _enum([
25984
+ "idle",
25985
+ "cleaning",
25986
+ "spot",
25987
+ "following",
25988
+ "goto",
25989
+ "returning",
25990
+ "paused",
25991
+ "unknown"
25992
+ ]),
25993
+ following: boolean(),
25994
+ flash: boolean(),
25995
+ lightMode: NavigationLightModeSchema,
25996
+ lightLevel: number().min(40).max(100),
25997
+ /** Ms epoch when the slice was last updated. */
25998
+ lastChangedAt: number()
25999
+ });
26000
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26001
+ 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({
26002
+ deviceId: number(),
26003
+ actionId: NavigationActionIdSchema
26004
+ }), _void(), { kind: "mutation" }), method(object({
26005
+ deviceId: number(),
26006
+ soundId: number().int()
26007
+ }), _void(), { kind: "mutation" }), method(object({
26008
+ deviceId: number(),
26009
+ on: boolean()
26010
+ }), _void(), { kind: "mutation" }), method(object({
26011
+ deviceId: number(),
26012
+ mode: NavigationLightModeSchema,
26013
+ level: number().min(40).max(100).optional()
26014
+ }), _void(), { kind: "mutation" }), method(object({
26015
+ deviceId: number(),
26016
+ level: number().min(40).max(100)
26017
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26018
+ deviceId: number(),
26019
+ status: NavigationStatusSchema
26020
+ });
26021
+ /**
26022
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26023
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26024
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26025
+ * one Home Assistant projection.
26026
+ */
26027
+ var NetworkLinkStatusSchema = object({
26028
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26029
+ type: _enum([
26030
+ "wifi",
26031
+ "ethernet",
26032
+ "cellular",
26033
+ "unknown"
26034
+ ]),
26035
+ /**
26036
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26037
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26038
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26039
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26040
+ * SKIP a null rather than coerce it.
26041
+ */
26042
+ signalPercent: number().min(0).max(100).nullable(),
26043
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26044
+ rssiDbm: number().optional(),
26045
+ /** Network name of a wireless link, when the firmware reports it. */
26046
+ ssid: string().optional(),
26047
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26048
+ lastUpdated: number()
26049
+ });
26050
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26051
+ deviceId: number(),
26052
+ status: NetworkLinkStatusSchema
26053
+ });
26054
+ /**
25735
26055
  * network-quality — system-scoped singleton capability tracking RTT,
25736
26056
  * jitter, and observed/peak bandwidth per device + per client.
25737
26057
  *
@@ -26973,203 +27293,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
26973
27293
  deviceId: number(),
26974
27294
  status: PtzAutotrackStatusSchema
26975
27295
  });
26976
- /**
26977
- * `navigation` — a device-scoped capability that natively expresses the FULL
26978
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
26979
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
26980
- *
26981
- * Why a NEW cap rather than overloading `ptz`:
26982
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
26983
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
26984
- * The two are different physical models: PTZ is absolute-position + presets,
26985
- * navigation is momentary drive nudges + discrete robot ACTIONS
26986
- * (dock / spot-clean / follow-pet / go-to-point / …).
26987
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
26988
- * the reverse:
26989
- * 1. a native CamStack navigation panel (data-driven from `listActions`
26990
- * / `getOptions`), and
26991
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
26992
- * robot camera shows up in the existing PTZ control path without every
26993
- * PTZ provider learning about robots. The mapping lives in the adapter,
26994
- * not here (see the addon design note):
26995
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
26996
- * ptz.stop() → navigation.stop()
26997
- * ptz.goHome() → navigation.runAction('goHome')
26998
- * ptz.getPresets() → navigation.listActions() (id→preset)
26999
- * ptz.goToPreset(id) → navigation.runAction(id)
27000
- *
27001
- * ## Continuous drive
27002
- *
27003
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27004
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27005
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27006
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27007
- * coalesce them. The UI owns the cadence.
27008
- *
27009
- * ## The action dictionary
27010
- *
27011
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27012
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27013
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27014
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27015
- * vendor-specific list. `kind: 'action'` entries are triggered with
27016
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27017
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27018
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27019
- *
27020
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27021
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27022
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27023
- * every device handle. A future nodedreame publish adds a typed
27024
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27025
- * provider can then swap the raw calls for the typed methods with no change to
27026
- * THIS contract.
27027
- */
27028
- /**
27029
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27030
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27031
- * halts it.
27032
- *
27033
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27034
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27035
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27036
- * vector by it (drivers without proportional drive ignore it).
27037
- *
27038
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27039
- * axis alone; an all-undefined nudge is a no-op.
27040
- */
27041
- var NavigationMoveCommandSchema = object({
27042
- pan: number().min(-1).max(1).optional(),
27043
- tilt: number().min(-1).max(1).optional(),
27044
- speed: number().min(0).max(1).optional()
27045
- });
27046
- /**
27047
- * The enumerated discrete actions a navigation-capable robot can perform via
27048
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27049
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27050
- * `playSound` (see the `sound` dictionary entries).
27051
- */
27052
- var NavigationActionIdSchema = _enum([
27053
- "goHome",
27054
- "locate",
27055
- "spotClean",
27056
- "findPet",
27057
- "personFollow",
27058
- "stop",
27059
- "startClean",
27060
- "pauseClean",
27061
- "dockWash",
27062
- "autoEmpty",
27063
- "flashOn",
27064
- "flashOff"
27065
- ]);
27066
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27067
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27068
- /**
27069
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27070
- * native panel and the PTZ mimic render as a button.
27071
- *
27072
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27073
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27074
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27075
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27076
- * - `label` — operator-facing English label.
27077
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27078
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27079
- * PTZ render ONLY enabled entries. Data-driven: the provider
27080
- * flips it from config, never by editing code.
27081
- */
27082
- var NavigationActionEntrySchema = object({
27083
- id: string(),
27084
- kind: NavigationEntryKindSchema,
27085
- label: string(),
27086
- icon: string(),
27087
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27088
- soundId: number().int().optional(),
27089
- /** Per-device feature flag — render this entry only when true. */
27090
- enabled: boolean()
27091
- });
27092
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27093
- var NavigationPointSchema = object({
27094
- x: number(),
27095
- y: number()
27096
- });
27097
- /**
27098
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27099
- * The cap reports which are enabled so the UI / PTZ render only the controls
27100
- * that are turned on for THIS device. Data-driven: the provider derives these
27101
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27102
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27103
- * that are not dictionary entries.
27104
- *
27105
- * - `move` / `stop` — the momentary drive joystick.
27106
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27107
- * map-coordinate plumbing is wired.
27108
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27109
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27110
- * - `light` — the on/off fill-light toggle (works anytime).
27111
- * - `lightMode` — the auto/manual selector + manual level slider (a
27112
- * camera-service control; needs an active stream).
27113
- */
27114
- var NavigationFeaturesSchema = object({
27115
- move: boolean(),
27116
- stop: boolean(),
27117
- goToPoint: boolean(),
27118
- runAction: boolean(),
27119
- playSound: boolean(),
27120
- light: boolean(),
27121
- lightMode: boolean()
27122
- });
27123
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27124
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27125
- /**
27126
- * Live navigation state so the UI can reflect what the robot is doing:
27127
- * - `mode` — coarse activity (idle / cleaning / following / …).
27128
- * - `following` — person/pet follow is currently armed.
27129
- * - `flash` — the on-camera fill light is on.
27130
- * - `lightMode` — auto vs manual fill-light mode.
27131
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27132
- * `lightMode === 'manual'`.
27133
- */
27134
- var NavigationStatusSchema = object({
27135
- mode: _enum([
27136
- "idle",
27137
- "cleaning",
27138
- "spot",
27139
- "following",
27140
- "goto",
27141
- "returning",
27142
- "paused",
27143
- "unknown"
27144
- ]),
27145
- following: boolean(),
27146
- flash: boolean(),
27147
- lightMode: NavigationLightModeSchema,
27148
- lightLevel: number().min(40).max(100),
27149
- /** Ms epoch when the slice was last updated. */
27150
- lastChangedAt: number()
27151
- });
27152
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27153
- 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({
27154
- deviceId: number(),
27155
- actionId: NavigationActionIdSchema
27156
- }), _void(), { kind: "mutation" }), method(object({
27157
- deviceId: number(),
27158
- soundId: number().int()
27159
- }), _void(), { kind: "mutation" }), method(object({
27160
- deviceId: number(),
27161
- on: boolean()
27162
- }), _void(), { kind: "mutation" }), method(object({
27163
- deviceId: number(),
27164
- mode: NavigationLightModeSchema,
27165
- level: number().min(40).max(100).optional()
27166
- }), _void(), { kind: "mutation" }), method(object({
27167
- deviceId: number(),
27168
- level: number().min(40).max(100)
27169
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27170
- deviceId: number(),
27171
- status: NavigationStatusSchema
27172
- });
27173
27296
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27174
27297
  kind: "mutation",
27175
27298
  auth: "admin"
@@ -34484,6 +34607,12 @@ Object.freeze({
34484
34607
  addonId: null,
34485
34608
  access: "view"
34486
34609
  },
34610
+ "storage.listDrainProgress": {
34611
+ capName: "storage",
34612
+ capScope: "system",
34613
+ addonId: null,
34614
+ access: "view"
34615
+ },
34487
34616
  "storage.listLocationDeclarations": {
34488
34617
  capName: "storage",
34489
34618
  capScope: "system",
@@ -34628,6 +34757,12 @@ Object.freeze({
34628
34757
  addonId: null,
34629
34758
  access: "view"
34630
34759
  },
34760
+ "storageOccupancy.getOccupancy": {
34761
+ capName: "storage-occupancy",
34762
+ capScope: "system",
34763
+ addonId: null,
34764
+ access: "view"
34765
+ },
34631
34766
  "storageProvider.abortUpload": {
34632
34767
  capName: "storage-provider",
34633
34768
  capScope: "system",