@camstack/addon-remote-storage 1.2.78 → 1.2.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
@@ -20061,8 +20139,25 @@ var occupancyRecheckFramesField = {
20061
20139
  * (analyzer attaches detected `regions[]`; onboard does not — the
20062
20140
  * camera typically only reports a binary signal plus an optional
20063
20141
  * channel/AI class which lives in dedicated event channels).
20064
- */
20065
- var MotionSourceEnum = _enum(["onboard", "analyzer"]);
20142
+ *
20143
+ * - `onboard` — the camera's firmware said something moved.
20144
+ * - `analyzer` — this runner's frame-diff said so, and attaches `regions[]`.
20145
+ * - `device-activity` — the DEVICE said it is doing its job: the
20146
+ * `recording-signal` LEVEL the same device raises for the recorder
20147
+ * ([D380](../../../../docs/decisions/adr-0380-a-device-decided-recording-is-a-mode-with-no-schedule-seeded-once.md)),
20148
+ * republished as a motion source. It attaches **nothing** — no regions, no
20149
+ * class: the only fact it carries is that the device is active, and a robot
20150
+ * vacuum that is itself the moving object has no region worth sending. It is
20151
+ * a LEVEL, so unlike `onboard` it has a real falling edge, and unlike
20152
+ * `analyzer` it must not open the frame-diff side-channel — the runner's
20153
+ * `handleOnboardMotionAnalyzer` gate is `source === 'onboard'` and stays that
20154
+ * way ([D392](../../../../docs/decisions/adr-0392-a-device-that-says-it-is-working-is-a-motion-source-of-its-own.md)).
20155
+ */
20156
+ var MotionSourceEnum = _enum([
20157
+ "onboard",
20158
+ "analyzer",
20159
+ "device-activity"
20160
+ ]);
20066
20161
  /**
20067
20162
  * List of motion sources active on a camera. Empty array is valid:
20068
20163
  * "no source" — happens for battery cams without firmware motion when
@@ -21581,7 +21676,7 @@ method(object({
21581
21676
  }), _void(), {
21582
21677
  kind: "mutation",
21583
21678
  auth: "admin"
21584
- }), method(object({ id: string() }), object({
21679
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21585
21680
  ok: boolean(),
21586
21681
  error: string().optional()
21587
21682
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21651,6 +21746,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21651
21746
  kind: "mutation",
21652
21747
  auth: "admin"
21653
21748
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21749
+ /**
21750
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21751
+ * location (D388).
21752
+ *
21753
+ * ## Why this is not `storage-evictable`
21754
+ *
21755
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21756
+ * not, in two ways that both matter and both bite hardest on the locations an
21757
+ * operator most wants a figure for:
21758
+ *
21759
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21760
+ * and `recordingsLow:default` deliberately share one root and evict as one
21761
+ * oldest-first pool, so both answer with the SAME combined total. As an
21762
+ * occupancy figure that double-counts the disk.
21763
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21764
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21765
+ * is retiring and staring at.
21766
+ *
21767
+ * So this is its own contract with its own quantity, and the quantity is
21768
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21769
+ * would ever be willing to delete it. A provider that can only answer
21770
+ * "evictable" must not register here — a number that silently means different
21771
+ * things per class is worse than no number.
21772
+ *
21773
+ * ## Absence is an answer
21774
+ *
21775
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21776
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21777
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21778
+ * consuming side has to be written out loud instead of appearing by accident.
21779
+ *
21780
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21781
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21782
+ */
21783
+ /** One provider's occupancy answer for one location. */
21784
+ var StorageOccupancyReportSchema = object({
21785
+ locationId: string(),
21786
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21787
+ * not net of what it is willing to delete. */
21788
+ ownedBytes: number().int().nonnegative(),
21789
+ /** When the provider last actually measured this. The orchestrator carries it
21790
+ * through so a UI can say how old the figure is instead of implying "now". */
21791
+ measuredAtMs: number().int().nonnegative()
21792
+ });
21793
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21654
21794
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21655
21795
  providerId: string().min(1),
21656
21796
  displayName: string().min(1),
@@ -23346,39 +23486,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23346
23486
  deviceId: number(),
23347
23487
  status: BatteryStatusSchema
23348
23488
  });
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
23489
  object({
23383
23490
  on: boolean(),
23384
23491
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25732,6 +25839,236 @@ DeviceType.Camera, method(object({
25732
25839
  detection: NativeDetectionSchema
25733
25840
  });
25734
25841
  /**
25842
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25843
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25844
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25845
+ *
25846
+ * Why a NEW cap rather than overloading `ptz`:
25847
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25848
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25849
+ * The two are different physical models: PTZ is absolute-position + presets,
25850
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25851
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25852
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25853
+ * the reverse:
25854
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25855
+ * / `getOptions`), and
25856
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25857
+ * robot camera shows up in the existing PTZ control path without every
25858
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25859
+ * not here (see the addon design note):
25860
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25861
+ * ptz.stop() → navigation.stop()
25862
+ * ptz.goHome() → navigation.runAction('goHome')
25863
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25864
+ * ptz.goToPreset(id) → navigation.runAction(id)
25865
+ *
25866
+ * ## Continuous drive
25867
+ *
25868
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25869
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25870
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25871
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25872
+ * coalesce them. The UI owns the cadence.
25873
+ *
25874
+ * ## The action dictionary
25875
+ *
25876
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25877
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25878
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25879
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25880
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25881
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25882
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
25883
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
25884
+ *
25885
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
25886
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
25887
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
25888
+ * every device handle. A future nodedreame publish adds a typed
25889
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
25890
+ * provider can then swap the raw calls for the typed methods with no change to
25891
+ * THIS contract.
25892
+ */
25893
+ /**
25894
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
25895
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
25896
+ * halts it.
25897
+ *
25898
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
25899
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
25900
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
25901
+ * vector by it (drivers without proportional drive ignore it).
25902
+ *
25903
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
25904
+ * axis alone; an all-undefined nudge is a no-op.
25905
+ */
25906
+ var NavigationMoveCommandSchema = object({
25907
+ pan: number().min(-1).max(1).optional(),
25908
+ tilt: number().min(-1).max(1).optional(),
25909
+ speed: number().min(0).max(1).optional()
25910
+ });
25911
+ /**
25912
+ * The enumerated discrete actions a navigation-capable robot can perform via
25913
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
25914
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
25915
+ * `playSound` (see the `sound` dictionary entries).
25916
+ */
25917
+ var NavigationActionIdSchema = _enum([
25918
+ "goHome",
25919
+ "locate",
25920
+ "spotClean",
25921
+ "findPet",
25922
+ "personFollow",
25923
+ "stop",
25924
+ "startClean",
25925
+ "pauseClean",
25926
+ "dockWash",
25927
+ "autoEmpty",
25928
+ "flashOn",
25929
+ "flashOff"
25930
+ ]);
25931
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
25932
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
25933
+ /**
25934
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
25935
+ * native panel and the PTZ mimic render as a button.
25936
+ *
25937
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
25938
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
25939
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
25940
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
25941
+ * - `label` — operator-facing English label.
25942
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
25943
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
25944
+ * PTZ render ONLY enabled entries. Data-driven: the provider
25945
+ * flips it from config, never by editing code.
25946
+ */
25947
+ var NavigationActionEntrySchema = object({
25948
+ id: string(),
25949
+ kind: NavigationEntryKindSchema,
25950
+ label: string(),
25951
+ icon: string(),
25952
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
25953
+ soundId: number().int().optional(),
25954
+ /** Per-device feature flag — render this entry only when true. */
25955
+ enabled: boolean()
25956
+ });
25957
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
25958
+ var NavigationPointSchema = object({
25959
+ x: number(),
25960
+ y: number()
25961
+ });
25962
+ /**
25963
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
25964
+ * The cap reports which are enabled so the UI / PTZ render only the controls
25965
+ * that are turned on for THIS device. Data-driven: the provider derives these
25966
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
25967
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
25968
+ * that are not dictionary entries.
25969
+ *
25970
+ * - `move` / `stop` — the momentary drive joystick.
25971
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
25972
+ * map-coordinate plumbing is wired.
25973
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
25974
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
25975
+ * - `light` — the on/off fill-light toggle (works anytime).
25976
+ * - `lightMode` — the auto/manual selector + manual level slider (a
25977
+ * camera-service control; needs an active stream).
25978
+ */
25979
+ var NavigationFeaturesSchema = object({
25980
+ move: boolean(),
25981
+ stop: boolean(),
25982
+ goToPoint: boolean(),
25983
+ runAction: boolean(),
25984
+ playSound: boolean(),
25985
+ light: boolean(),
25986
+ lightMode: boolean()
25987
+ });
25988
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
25989
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
25990
+ /**
25991
+ * Live navigation state so the UI can reflect what the robot is doing:
25992
+ * - `mode` — coarse activity (idle / cleaning / following / …).
25993
+ * - `following` — person/pet follow is currently armed.
25994
+ * - `flash` — the on-camera fill light is on.
25995
+ * - `lightMode` — auto vs manual fill-light mode.
25996
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
25997
+ * `lightMode === 'manual'`.
25998
+ */
25999
+ var NavigationStatusSchema = object({
26000
+ mode: _enum([
26001
+ "idle",
26002
+ "cleaning",
26003
+ "spot",
26004
+ "following",
26005
+ "goto",
26006
+ "returning",
26007
+ "paused",
26008
+ "unknown"
26009
+ ]),
26010
+ following: boolean(),
26011
+ flash: boolean(),
26012
+ lightMode: NavigationLightModeSchema,
26013
+ lightLevel: number().min(40).max(100),
26014
+ /** Ms epoch when the slice was last updated. */
26015
+ lastChangedAt: number()
26016
+ });
26017
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26018
+ 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({
26019
+ deviceId: number(),
26020
+ actionId: NavigationActionIdSchema
26021
+ }), _void(), { kind: "mutation" }), method(object({
26022
+ deviceId: number(),
26023
+ soundId: number().int()
26024
+ }), _void(), { kind: "mutation" }), method(object({
26025
+ deviceId: number(),
26026
+ on: boolean()
26027
+ }), _void(), { kind: "mutation" }), method(object({
26028
+ deviceId: number(),
26029
+ mode: NavigationLightModeSchema,
26030
+ level: number().min(40).max(100).optional()
26031
+ }), _void(), { kind: "mutation" }), method(object({
26032
+ deviceId: number(),
26033
+ level: number().min(40).max(100)
26034
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26035
+ deviceId: number(),
26036
+ status: NavigationStatusSchema
26037
+ });
26038
+ /**
26039
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26040
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26041
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26042
+ * one Home Assistant projection.
26043
+ */
26044
+ var NetworkLinkStatusSchema = object({
26045
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26046
+ type: _enum([
26047
+ "wifi",
26048
+ "ethernet",
26049
+ "cellular",
26050
+ "unknown"
26051
+ ]),
26052
+ /**
26053
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26054
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26055
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26056
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26057
+ * SKIP a null rather than coerce it.
26058
+ */
26059
+ signalPercent: number().min(0).max(100).nullable(),
26060
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26061
+ rssiDbm: number().optional(),
26062
+ /** Network name of a wireless link, when the firmware reports it. */
26063
+ ssid: string().optional(),
26064
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26065
+ lastUpdated: number()
26066
+ });
26067
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26068
+ deviceId: number(),
26069
+ status: NetworkLinkStatusSchema
26070
+ });
26071
+ /**
25735
26072
  * network-quality — system-scoped singleton capability tracking RTT,
25736
26073
  * jitter, and observed/peak bandwidth per device + per client.
25737
26074
  *
@@ -26973,203 +27310,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
26973
27310
  deviceId: number(),
26974
27311
  status: PtzAutotrackStatusSchema
26975
27312
  });
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
27313
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27174
27314
  kind: "mutation",
27175
27315
  auth: "admin"
@@ -34484,6 +34624,12 @@ Object.freeze({
34484
34624
  addonId: null,
34485
34625
  access: "view"
34486
34626
  },
34627
+ "storage.listDrainProgress": {
34628
+ capName: "storage",
34629
+ capScope: "system",
34630
+ addonId: null,
34631
+ access: "view"
34632
+ },
34487
34633
  "storage.listLocationDeclarations": {
34488
34634
  capName: "storage",
34489
34635
  capScope: "system",
@@ -34628,6 +34774,12 @@ Object.freeze({
34628
34774
  addonId: null,
34629
34775
  access: "view"
34630
34776
  },
34777
+ "storageOccupancy.getOccupancy": {
34778
+ capName: "storage-occupancy",
34779
+ capScope: "system",
34780
+ addonId: null,
34781
+ access: "view"
34782
+ },
34631
34783
  "storageProvider.abortUpload": {
34632
34784
  capName: "storage-provider",
34633
34785
  capScope: "system",