@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.
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from "node:crypto";
2
2
  import * as path from "node:path";
3
- //#region ../types/dist/event-category-zAv7pMUz.mjs
3
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -195,6 +195,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
195
195
  EventCategory["ProcessCrashed"] = "process.crashed";
196
196
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
197
197
  EventCategory["ProcessRestarted"] = "process.restarted";
198
+ /**
199
+ * The SET of storage locations changed — one was created, edited, enabled,
200
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
201
+ *
202
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
203
+ * it must also converge on its own periodic path, because a dropped event
204
+ * must not leave a node writing to yesterday's disk set forever. It exists
205
+ * because there was NO signal at all — an operator who added a second
206
+ * recordings disk in the admin UI got nothing, and the recorder kept its
207
+ * resolved locations until something else happened to re-resolve them
208
+ * (D387). Payload `StorageLocationsChangedPayload`.
209
+ */
210
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
198
211
  EventCategory["RecordingStarted"] = "recording.started";
199
212
  EventCategory["RecordingStopped"] = "recording.stopped";
200
213
  EventCategory["RecordingError"] = "recording.error";
@@ -8521,6 +8534,21 @@ var StorageCleanupJobSchema = object({
8521
8534
  });
8522
8535
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8523
8536
  /**
8537
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8538
+ * alias below is `z.infer<>` of it, never a second spelling.
8539
+ */
8540
+ var StorageLocationModeSchema = _enum([
8541
+ "active",
8542
+ "readonly",
8543
+ "drain",
8544
+ "disabled"
8545
+ ]);
8546
+ _enum([
8547
+ "normal",
8548
+ "never",
8549
+ "drain"
8550
+ ]);
8551
+ /**
8524
8552
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8525
8553
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8526
8554
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8586,6 +8614,21 @@ var StorageLocationSchema = object({
8586
8614
  * stops existing rather than being re-derived on every read.
8587
8615
  */
8588
8616
  enabled: boolean().optional(),
8617
+ /**
8618
+ * THE state of this location (D385), and the only authority on what may be
8619
+ * written, read or evicted here. Interpreted in exactly one place —
8620
+ * `storage-location-mode.ts` — which also folds the legacy
8621
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8622
+ * ambiguous.
8623
+ *
8624
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8625
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8626
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8627
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8628
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8629
+ * either, so the two cannot disagree.
8630
+ */
8631
+ mode: StorageLocationModeSchema.optional(),
8589
8632
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8590
8633
  * for node-local locations it can reach) — never persisted, absent when the
8591
8634
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8593,11 +8636,46 @@ var StorageLocationSchema = object({
8593
8636
  totalBytes: number(),
8594
8637
  availableBytes: number()
8595
8638
  }).nullable().optional(),
8639
+ /**
8640
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8641
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8642
+ * never persisted, never a filesystem walk.
8643
+ *
8644
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8645
+ * location yet — nobody stores here, the owning addon is down, or the first
8646
+ * refresh has not completed. A UI must omit the segment rather than draw it
8647
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8648
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8649
+ * be spelled out loud instead of appearing by accident.
8650
+ *
8651
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8652
+ * about the whole figure rather than about its freshest part.
8653
+ */
8654
+ owned: object({
8655
+ bytes: number().int().nonnegative(),
8656
+ measuredAtMs: number().int().nonnegative()
8657
+ }).optional(),
8596
8658
  createdAt: number(),
8597
8659
  updatedAt: number()
8598
8660
  });
8599
8661
  object({ isDefault: boolean().optional() });
8600
8662
  /**
8663
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8664
+ *
8665
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8666
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8667
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8668
+ * operator learns not to believe the screen.
8669
+ */
8670
+ var StorageDrainProgressSchema = object({
8671
+ locationId: string(),
8672
+ startedAtMs: number(),
8673
+ startBytes: number(),
8674
+ bytesRemaining: number(),
8675
+ drained: boolean(),
8676
+ estimatedEmptyAtMs: number().nullable()
8677
+ });
8678
+ /**
8601
8679
  * Reference accepted by consumer-facing `api.storage.*` calls.
8602
8680
  * Either:
8603
8681
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -20038,8 +20116,25 @@ var occupancyRecheckFramesField = {
20038
20116
  * (analyzer attaches detected `regions[]`; onboard does not — the
20039
20117
  * camera typically only reports a binary signal plus an optional
20040
20118
  * channel/AI class which lives in dedicated event channels).
20041
- */
20042
- var MotionSourceEnum = _enum(["onboard", "analyzer"]);
20119
+ *
20120
+ * - `onboard` — the camera's firmware said something moved.
20121
+ * - `analyzer` — this runner's frame-diff said so, and attaches `regions[]`.
20122
+ * - `device-activity` — the DEVICE said it is doing its job: the
20123
+ * `recording-signal` LEVEL the same device raises for the recorder
20124
+ * ([D380](../../../../docs/decisions/adr-0380-a-device-decided-recording-is-a-mode-with-no-schedule-seeded-once.md)),
20125
+ * republished as a motion source. It attaches **nothing** — no regions, no
20126
+ * class: the only fact it carries is that the device is active, and a robot
20127
+ * vacuum that is itself the moving object has no region worth sending. It is
20128
+ * a LEVEL, so unlike `onboard` it has a real falling edge, and unlike
20129
+ * `analyzer` it must not open the frame-diff side-channel — the runner's
20130
+ * `handleOnboardMotionAnalyzer` gate is `source === 'onboard'` and stays that
20131
+ * way ([D392](../../../../docs/decisions/adr-0392-a-device-that-says-it-is-working-is-a-motion-source-of-its-own.md)).
20132
+ */
20133
+ var MotionSourceEnum = _enum([
20134
+ "onboard",
20135
+ "analyzer",
20136
+ "device-activity"
20137
+ ]);
20043
20138
  /**
20044
20139
  * List of motion sources active on a camera. Empty array is valid:
20045
20140
  * "no source" — happens for battery cams without firmware motion when
@@ -21558,7 +21653,7 @@ method(object({
21558
21653
  }), _void(), {
21559
21654
  kind: "mutation",
21560
21655
  auth: "admin"
21561
- }), method(object({ id: string() }), object({
21656
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21562
21657
  ok: boolean(),
21563
21658
  error: string().optional()
21564
21659
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21628,6 +21723,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21628
21723
  kind: "mutation",
21629
21724
  auth: "admin"
21630
21725
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21726
+ /**
21727
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21728
+ * location (D388).
21729
+ *
21730
+ * ## Why this is not `storage-evictable`
21731
+ *
21732
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21733
+ * not, in two ways that both matter and both bite hardest on the locations an
21734
+ * operator most wants a figure for:
21735
+ *
21736
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21737
+ * and `recordingsLow:default` deliberately share one root and evict as one
21738
+ * oldest-first pool, so both answer with the SAME combined total. As an
21739
+ * occupancy figure that double-counts the disk.
21740
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21741
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21742
+ * is retiring and staring at.
21743
+ *
21744
+ * So this is its own contract with its own quantity, and the quantity is
21745
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21746
+ * would ever be willing to delete it. A provider that can only answer
21747
+ * "evictable" must not register here — a number that silently means different
21748
+ * things per class is worse than no number.
21749
+ *
21750
+ * ## Absence is an answer
21751
+ *
21752
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21753
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21754
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21755
+ * consuming side has to be written out loud instead of appearing by accident.
21756
+ *
21757
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21758
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21759
+ */
21760
+ /** One provider's occupancy answer for one location. */
21761
+ var StorageOccupancyReportSchema = object({
21762
+ locationId: string(),
21763
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21764
+ * not net of what it is willing to delete. */
21765
+ ownedBytes: number().int().nonnegative(),
21766
+ /** When the provider last actually measured this. The orchestrator carries it
21767
+ * through so a UI can say how old the figure is instead of implying "now". */
21768
+ measuredAtMs: number().int().nonnegative()
21769
+ });
21770
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21631
21771
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21632
21772
  providerId: string().min(1),
21633
21773
  displayName: string().min(1),
@@ -23323,39 +23463,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23323
23463
  deviceId: number(),
23324
23464
  status: BatteryStatusSchema
23325
23465
  });
23326
- /**
23327
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23328
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23329
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23330
- * one Home Assistant projection.
23331
- */
23332
- var NetworkLinkStatusSchema = object({
23333
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23334
- type: _enum([
23335
- "wifi",
23336
- "ethernet",
23337
- "cellular",
23338
- "unknown"
23339
- ]),
23340
- /**
23341
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23342
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23343
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23344
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23345
- * SKIP a null rather than coerce it.
23346
- */
23347
- signalPercent: number().min(0).max(100).nullable(),
23348
- /** Raw received signal strength in dBm, when the firmware reports one. */
23349
- rssiDbm: number().optional(),
23350
- /** Network name of a wireless link, when the firmware reports it. */
23351
- ssid: string().optional(),
23352
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23353
- lastUpdated: number()
23354
- });
23355
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23356
- deviceId: number(),
23357
- status: NetworkLinkStatusSchema
23358
- });
23359
23466
  object({
23360
23467
  on: boolean(),
23361
23468
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25709,6 +25816,236 @@ DeviceType.Camera, method(object({
25709
25816
  detection: NativeDetectionSchema
25710
25817
  });
25711
25818
  /**
25819
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25820
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25821
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25822
+ *
25823
+ * Why a NEW cap rather than overloading `ptz`:
25824
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25825
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25826
+ * The two are different physical models: PTZ is absolute-position + presets,
25827
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25828
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25829
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25830
+ * the reverse:
25831
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25832
+ * / `getOptions`), and
25833
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25834
+ * robot camera shows up in the existing PTZ control path without every
25835
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25836
+ * not here (see the addon design note):
25837
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25838
+ * ptz.stop() → navigation.stop()
25839
+ * ptz.goHome() → navigation.runAction('goHome')
25840
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25841
+ * ptz.goToPreset(id) → navigation.runAction(id)
25842
+ *
25843
+ * ## Continuous drive
25844
+ *
25845
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25846
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25847
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25848
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25849
+ * coalesce them. The UI owns the cadence.
25850
+ *
25851
+ * ## The action dictionary
25852
+ *
25853
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25854
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25855
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25856
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25857
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25858
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25859
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
25860
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
25861
+ *
25862
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
25863
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
25864
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
25865
+ * every device handle. A future nodedreame publish adds a typed
25866
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
25867
+ * provider can then swap the raw calls for the typed methods with no change to
25868
+ * THIS contract.
25869
+ */
25870
+ /**
25871
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
25872
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
25873
+ * halts it.
25874
+ *
25875
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
25876
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
25877
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
25878
+ * vector by it (drivers without proportional drive ignore it).
25879
+ *
25880
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
25881
+ * axis alone; an all-undefined nudge is a no-op.
25882
+ */
25883
+ var NavigationMoveCommandSchema = object({
25884
+ pan: number().min(-1).max(1).optional(),
25885
+ tilt: number().min(-1).max(1).optional(),
25886
+ speed: number().min(0).max(1).optional()
25887
+ });
25888
+ /**
25889
+ * The enumerated discrete actions a navigation-capable robot can perform via
25890
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
25891
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
25892
+ * `playSound` (see the `sound` dictionary entries).
25893
+ */
25894
+ var NavigationActionIdSchema = _enum([
25895
+ "goHome",
25896
+ "locate",
25897
+ "spotClean",
25898
+ "findPet",
25899
+ "personFollow",
25900
+ "stop",
25901
+ "startClean",
25902
+ "pauseClean",
25903
+ "dockWash",
25904
+ "autoEmpty",
25905
+ "flashOn",
25906
+ "flashOff"
25907
+ ]);
25908
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
25909
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
25910
+ /**
25911
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
25912
+ * native panel and the PTZ mimic render as a button.
25913
+ *
25914
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
25915
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
25916
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
25917
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
25918
+ * - `label` — operator-facing English label.
25919
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
25920
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
25921
+ * PTZ render ONLY enabled entries. Data-driven: the provider
25922
+ * flips it from config, never by editing code.
25923
+ */
25924
+ var NavigationActionEntrySchema = object({
25925
+ id: string(),
25926
+ kind: NavigationEntryKindSchema,
25927
+ label: string(),
25928
+ icon: string(),
25929
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
25930
+ soundId: number().int().optional(),
25931
+ /** Per-device feature flag — render this entry only when true. */
25932
+ enabled: boolean()
25933
+ });
25934
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
25935
+ var NavigationPointSchema = object({
25936
+ x: number(),
25937
+ y: number()
25938
+ });
25939
+ /**
25940
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
25941
+ * The cap reports which are enabled so the UI / PTZ render only the controls
25942
+ * that are turned on for THIS device. Data-driven: the provider derives these
25943
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
25944
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
25945
+ * that are not dictionary entries.
25946
+ *
25947
+ * - `move` / `stop` — the momentary drive joystick.
25948
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
25949
+ * map-coordinate plumbing is wired.
25950
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
25951
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
25952
+ * - `light` — the on/off fill-light toggle (works anytime).
25953
+ * - `lightMode` — the auto/manual selector + manual level slider (a
25954
+ * camera-service control; needs an active stream).
25955
+ */
25956
+ var NavigationFeaturesSchema = object({
25957
+ move: boolean(),
25958
+ stop: boolean(),
25959
+ goToPoint: boolean(),
25960
+ runAction: boolean(),
25961
+ playSound: boolean(),
25962
+ light: boolean(),
25963
+ lightMode: boolean()
25964
+ });
25965
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
25966
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
25967
+ /**
25968
+ * Live navigation state so the UI can reflect what the robot is doing:
25969
+ * - `mode` — coarse activity (idle / cleaning / following / …).
25970
+ * - `following` — person/pet follow is currently armed.
25971
+ * - `flash` — the on-camera fill light is on.
25972
+ * - `lightMode` — auto vs manual fill-light mode.
25973
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
25974
+ * `lightMode === 'manual'`.
25975
+ */
25976
+ var NavigationStatusSchema = object({
25977
+ mode: _enum([
25978
+ "idle",
25979
+ "cleaning",
25980
+ "spot",
25981
+ "following",
25982
+ "goto",
25983
+ "returning",
25984
+ "paused",
25985
+ "unknown"
25986
+ ]),
25987
+ following: boolean(),
25988
+ flash: boolean(),
25989
+ lightMode: NavigationLightModeSchema,
25990
+ lightLevel: number().min(40).max(100),
25991
+ /** Ms epoch when the slice was last updated. */
25992
+ lastChangedAt: number()
25993
+ });
25994
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
25995
+ 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({
25996
+ deviceId: number(),
25997
+ actionId: NavigationActionIdSchema
25998
+ }), _void(), { kind: "mutation" }), method(object({
25999
+ deviceId: number(),
26000
+ soundId: number().int()
26001
+ }), _void(), { kind: "mutation" }), method(object({
26002
+ deviceId: number(),
26003
+ on: boolean()
26004
+ }), _void(), { kind: "mutation" }), method(object({
26005
+ deviceId: number(),
26006
+ mode: NavigationLightModeSchema,
26007
+ level: number().min(40).max(100).optional()
26008
+ }), _void(), { kind: "mutation" }), method(object({
26009
+ deviceId: number(),
26010
+ level: number().min(40).max(100)
26011
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26012
+ deviceId: number(),
26013
+ status: NavigationStatusSchema
26014
+ });
26015
+ /**
26016
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26017
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26018
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26019
+ * one Home Assistant projection.
26020
+ */
26021
+ var NetworkLinkStatusSchema = object({
26022
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26023
+ type: _enum([
26024
+ "wifi",
26025
+ "ethernet",
26026
+ "cellular",
26027
+ "unknown"
26028
+ ]),
26029
+ /**
26030
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26031
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26032
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26033
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26034
+ * SKIP a null rather than coerce it.
26035
+ */
26036
+ signalPercent: number().min(0).max(100).nullable(),
26037
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26038
+ rssiDbm: number().optional(),
26039
+ /** Network name of a wireless link, when the firmware reports it. */
26040
+ ssid: string().optional(),
26041
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26042
+ lastUpdated: number()
26043
+ });
26044
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26045
+ deviceId: number(),
26046
+ status: NetworkLinkStatusSchema
26047
+ });
26048
+ /**
25712
26049
  * network-quality — system-scoped singleton capability tracking RTT,
25713
26050
  * jitter, and observed/peak bandwidth per device + per client.
25714
26051
  *
@@ -26950,203 +27287,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
26950
27287
  deviceId: number(),
26951
27288
  status: PtzAutotrackStatusSchema
26952
27289
  });
26953
- /**
26954
- * `navigation` — a device-scoped capability that natively expresses the FULL
26955
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
26956
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
26957
- *
26958
- * Why a NEW cap rather than overloading `ptz`:
26959
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
26960
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
26961
- * The two are different physical models: PTZ is absolute-position + presets,
26962
- * navigation is momentary drive nudges + discrete robot ACTIONS
26963
- * (dock / spot-clean / follow-pet / go-to-point / …).
26964
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
26965
- * the reverse:
26966
- * 1. a native CamStack navigation panel (data-driven from `listActions`
26967
- * / `getOptions`), and
26968
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
26969
- * robot camera shows up in the existing PTZ control path without every
26970
- * PTZ provider learning about robots. The mapping lives in the adapter,
26971
- * not here (see the addon design note):
26972
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
26973
- * ptz.stop() → navigation.stop()
26974
- * ptz.goHome() → navigation.runAction('goHome')
26975
- * ptz.getPresets() → navigation.listActions() (id→preset)
26976
- * ptz.goToPreset(id) → navigation.runAction(id)
26977
- *
26978
- * ## Continuous drive
26979
- *
26980
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
26981
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
26982
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
26983
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
26984
- * coalesce them. The UI owns the cadence.
26985
- *
26986
- * ## The action dictionary
26987
- *
26988
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
26989
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
26990
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
26991
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
26992
- * vendor-specific list. `kind: 'action'` entries are triggered with
26993
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
26994
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
26995
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26996
- *
26997
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26998
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26999
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27000
- * every device handle. A future nodedreame publish adds a typed
27001
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27002
- * provider can then swap the raw calls for the typed methods with no change to
27003
- * THIS contract.
27004
- */
27005
- /**
27006
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27007
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27008
- * halts it.
27009
- *
27010
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27011
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27012
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27013
- * vector by it (drivers without proportional drive ignore it).
27014
- *
27015
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27016
- * axis alone; an all-undefined nudge is a no-op.
27017
- */
27018
- var NavigationMoveCommandSchema = object({
27019
- pan: number().min(-1).max(1).optional(),
27020
- tilt: number().min(-1).max(1).optional(),
27021
- speed: number().min(0).max(1).optional()
27022
- });
27023
- /**
27024
- * The enumerated discrete actions a navigation-capable robot can perform via
27025
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27026
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27027
- * `playSound` (see the `sound` dictionary entries).
27028
- */
27029
- var NavigationActionIdSchema = _enum([
27030
- "goHome",
27031
- "locate",
27032
- "spotClean",
27033
- "findPet",
27034
- "personFollow",
27035
- "stop",
27036
- "startClean",
27037
- "pauseClean",
27038
- "dockWash",
27039
- "autoEmpty",
27040
- "flashOn",
27041
- "flashOff"
27042
- ]);
27043
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27044
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27045
- /**
27046
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27047
- * native panel and the PTZ mimic render as a button.
27048
- *
27049
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27050
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27051
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27052
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27053
- * - `label` — operator-facing English label.
27054
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27055
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27056
- * PTZ render ONLY enabled entries. Data-driven: the provider
27057
- * flips it from config, never by editing code.
27058
- */
27059
- var NavigationActionEntrySchema = object({
27060
- id: string(),
27061
- kind: NavigationEntryKindSchema,
27062
- label: string(),
27063
- icon: string(),
27064
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27065
- soundId: number().int().optional(),
27066
- /** Per-device feature flag — render this entry only when true. */
27067
- enabled: boolean()
27068
- });
27069
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27070
- var NavigationPointSchema = object({
27071
- x: number(),
27072
- y: number()
27073
- });
27074
- /**
27075
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27076
- * The cap reports which are enabled so the UI / PTZ render only the controls
27077
- * that are turned on for THIS device. Data-driven: the provider derives these
27078
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27079
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27080
- * that are not dictionary entries.
27081
- *
27082
- * - `move` / `stop` — the momentary drive joystick.
27083
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27084
- * map-coordinate plumbing is wired.
27085
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27086
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27087
- * - `light` — the on/off fill-light toggle (works anytime).
27088
- * - `lightMode` — the auto/manual selector + manual level slider (a
27089
- * camera-service control; needs an active stream).
27090
- */
27091
- var NavigationFeaturesSchema = object({
27092
- move: boolean(),
27093
- stop: boolean(),
27094
- goToPoint: boolean(),
27095
- runAction: boolean(),
27096
- playSound: boolean(),
27097
- light: boolean(),
27098
- lightMode: boolean()
27099
- });
27100
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27101
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27102
- /**
27103
- * Live navigation state so the UI can reflect what the robot is doing:
27104
- * - `mode` — coarse activity (idle / cleaning / following / …).
27105
- * - `following` — person/pet follow is currently armed.
27106
- * - `flash` — the on-camera fill light is on.
27107
- * - `lightMode` — auto vs manual fill-light mode.
27108
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27109
- * `lightMode === 'manual'`.
27110
- */
27111
- var NavigationStatusSchema = object({
27112
- mode: _enum([
27113
- "idle",
27114
- "cleaning",
27115
- "spot",
27116
- "following",
27117
- "goto",
27118
- "returning",
27119
- "paused",
27120
- "unknown"
27121
- ]),
27122
- following: boolean(),
27123
- flash: boolean(),
27124
- lightMode: NavigationLightModeSchema,
27125
- lightLevel: number().min(40).max(100),
27126
- /** Ms epoch when the slice was last updated. */
27127
- lastChangedAt: number()
27128
- });
27129
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27130
- 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({
27131
- deviceId: number(),
27132
- actionId: NavigationActionIdSchema
27133
- }), _void(), { kind: "mutation" }), method(object({
27134
- deviceId: number(),
27135
- soundId: number().int()
27136
- }), _void(), { kind: "mutation" }), method(object({
27137
- deviceId: number(),
27138
- on: boolean()
27139
- }), _void(), { kind: "mutation" }), method(object({
27140
- deviceId: number(),
27141
- mode: NavigationLightModeSchema,
27142
- level: number().min(40).max(100).optional()
27143
- }), _void(), { kind: "mutation" }), method(object({
27144
- deviceId: number(),
27145
- level: number().min(40).max(100)
27146
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27147
- deviceId: number(),
27148
- status: NavigationStatusSchema
27149
- });
27150
27290
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27151
27291
  kind: "mutation",
27152
27292
  auth: "admin"
@@ -34461,6 +34601,12 @@ Object.freeze({
34461
34601
  addonId: null,
34462
34602
  access: "view"
34463
34603
  },
34604
+ "storage.listDrainProgress": {
34605
+ capName: "storage",
34606
+ capScope: "system",
34607
+ addonId: null,
34608
+ access: "view"
34609
+ },
34464
34610
  "storage.listLocationDeclarations": {
34465
34611
  capName: "storage",
34466
34612
  capScope: "system",
@@ -34605,6 +34751,12 @@ Object.freeze({
34605
34751
  addonId: null,
34606
34752
  access: "view"
34607
34753
  },
34754
+ "storageOccupancy.getOccupancy": {
34755
+ capName: "storage-occupancy",
34756
+ capScope: "system",
34757
+ addonId: null,
34758
+ access: "view"
34759
+ },
34608
34760
  "storageProvider.abortUpload": {
34609
34761
  capName: "storage-provider",
34610
34762
  capScope: "system",