@camstack/addon-mqtt-broker 1.2.79 → 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.
@@ -44,7 +44,7 @@ let crypto$10 = __toESM(crypto$1, 1);
44
44
  crypto$1 = __toESM(crypto$1);
45
45
  let node_fs = require("node:fs");
46
46
  let node_path = require("node:path");
47
- //#region ../types/dist/event-category-zAv7pMUz.mjs
47
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
48
48
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
49
49
  EventCategory["SystemBoot"] = "system.boot";
50
50
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -239,6 +239,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
239
239
  EventCategory["ProcessCrashed"] = "process.crashed";
240
240
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
241
241
  EventCategory["ProcessRestarted"] = "process.restarted";
242
+ /**
243
+ * The SET of storage locations changed — one was created, edited, enabled,
244
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
245
+ *
246
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
247
+ * it must also converge on its own periodic path, because a dropped event
248
+ * must not leave a node writing to yesterday's disk set forever. It exists
249
+ * because there was NO signal at all — an operator who added a second
250
+ * recordings disk in the admin UI got nothing, and the recorder kept its
251
+ * resolved locations until something else happened to re-resolve them
252
+ * (D387). Payload `StorageLocationsChangedPayload`.
253
+ */
254
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
242
255
  EventCategory["RecordingStarted"] = "recording.started";
243
256
  EventCategory["RecordingStopped"] = "recording.stopped";
244
257
  EventCategory["RecordingError"] = "recording.error";
@@ -8565,6 +8578,21 @@ var StorageCleanupJobSchema = object({
8565
8578
  });
8566
8579
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8567
8580
  /**
8581
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8582
+ * alias below is `z.infer<>` of it, never a second spelling.
8583
+ */
8584
+ var StorageLocationModeSchema = _enum([
8585
+ "active",
8586
+ "readonly",
8587
+ "drain",
8588
+ "disabled"
8589
+ ]);
8590
+ _enum([
8591
+ "normal",
8592
+ "never",
8593
+ "drain"
8594
+ ]);
8595
+ /**
8568
8596
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8569
8597
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8570
8598
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8630,6 +8658,21 @@ var StorageLocationSchema = object({
8630
8658
  * stops existing rather than being re-derived on every read.
8631
8659
  */
8632
8660
  enabled: boolean().optional(),
8661
+ /**
8662
+ * THE state of this location (D385), and the only authority on what may be
8663
+ * written, read or evicted here. Interpreted in exactly one place —
8664
+ * `storage-location-mode.ts` — which also folds the legacy
8665
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8666
+ * ambiguous.
8667
+ *
8668
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8669
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8670
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8671
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8672
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8673
+ * either, so the two cannot disagree.
8674
+ */
8675
+ mode: StorageLocationModeSchema.optional(),
8633
8676
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8634
8677
  * for node-local locations it can reach) — never persisted, absent when the
8635
8678
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8637,11 +8680,46 @@ var StorageLocationSchema = object({
8637
8680
  totalBytes: number(),
8638
8681
  availableBytes: number()
8639
8682
  }).nullable().optional(),
8683
+ /**
8684
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8685
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8686
+ * never persisted, never a filesystem walk.
8687
+ *
8688
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8689
+ * location yet — nobody stores here, the owning addon is down, or the first
8690
+ * refresh has not completed. A UI must omit the segment rather than draw it
8691
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8692
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8693
+ * be spelled out loud instead of appearing by accident.
8694
+ *
8695
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8696
+ * about the whole figure rather than about its freshest part.
8697
+ */
8698
+ owned: object({
8699
+ bytes: number().int().nonnegative(),
8700
+ measuredAtMs: number().int().nonnegative()
8701
+ }).optional(),
8640
8702
  createdAt: number(),
8641
8703
  updatedAt: number()
8642
8704
  });
8643
8705
  object({ isDefault: boolean().optional() });
8644
8706
  /**
8707
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8708
+ *
8709
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8710
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8711
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8712
+ * operator learns not to believe the screen.
8713
+ */
8714
+ var StorageDrainProgressSchema = object({
8715
+ locationId: string(),
8716
+ startedAtMs: number(),
8717
+ startBytes: number(),
8718
+ bytesRemaining: number(),
8719
+ drained: boolean(),
8720
+ estimatedEmptyAtMs: number().nullable()
8721
+ });
8722
+ /**
8645
8723
  * Reference accepted by consumer-facing `api.storage.*` calls.
8646
8724
  * Either:
8647
8725
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -21670,7 +21748,7 @@ method(object({
21670
21748
  }), _void(), {
21671
21749
  kind: "mutation",
21672
21750
  auth: "admin"
21673
- }), method(object({ id: string() }), object({
21751
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21674
21752
  ok: boolean(),
21675
21753
  error: string().optional()
21676
21754
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21740,6 +21818,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21740
21818
  kind: "mutation",
21741
21819
  auth: "admin"
21742
21820
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21821
+ /**
21822
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21823
+ * location (D388).
21824
+ *
21825
+ * ## Why this is not `storage-evictable`
21826
+ *
21827
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21828
+ * not, in two ways that both matter and both bite hardest on the locations an
21829
+ * operator most wants a figure for:
21830
+ *
21831
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21832
+ * and `recordingsLow:default` deliberately share one root and evict as one
21833
+ * oldest-first pool, so both answer with the SAME combined total. As an
21834
+ * occupancy figure that double-counts the disk.
21835
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21836
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21837
+ * is retiring and staring at.
21838
+ *
21839
+ * So this is its own contract with its own quantity, and the quantity is
21840
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21841
+ * would ever be willing to delete it. A provider that can only answer
21842
+ * "evictable" must not register here — a number that silently means different
21843
+ * things per class is worse than no number.
21844
+ *
21845
+ * ## Absence is an answer
21846
+ *
21847
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21848
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21849
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21850
+ * consuming side has to be written out loud instead of appearing by accident.
21851
+ *
21852
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21853
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21854
+ */
21855
+ /** One provider's occupancy answer for one location. */
21856
+ var StorageOccupancyReportSchema = object({
21857
+ locationId: string(),
21858
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21859
+ * not net of what it is willing to delete. */
21860
+ ownedBytes: number().int().nonnegative(),
21861
+ /** When the provider last actually measured this. The orchestrator carries it
21862
+ * through so a UI can say how old the figure is instead of implying "now". */
21863
+ measuredAtMs: number().int().nonnegative()
21864
+ });
21865
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21743
21866
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21744
21867
  providerId: string().min(1),
21745
21868
  displayName: string().min(1),
@@ -23375,39 +23498,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23375
23498
  deviceId: number(),
23376
23499
  status: BatteryStatusSchema
23377
23500
  });
23378
- /**
23379
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23380
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23381
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23382
- * one Home Assistant projection.
23383
- */
23384
- var NetworkLinkStatusSchema = object({
23385
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23386
- type: _enum([
23387
- "wifi",
23388
- "ethernet",
23389
- "cellular",
23390
- "unknown"
23391
- ]),
23392
- /**
23393
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23394
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23395
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23396
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23397
- * SKIP a null rather than coerce it.
23398
- */
23399
- signalPercent: number().min(0).max(100).nullable(),
23400
- /** Raw received signal strength in dBm, when the firmware reports one. */
23401
- rssiDbm: number().optional(),
23402
- /** Network name of a wireless link, when the firmware reports it. */
23403
- ssid: string().optional(),
23404
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23405
- lastUpdated: number()
23406
- });
23407
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23408
- deviceId: number(),
23409
- status: NetworkLinkStatusSchema
23410
- });
23411
23501
  object({
23412
23502
  on: boolean(),
23413
23503
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25761,6 +25851,236 @@ DeviceType.Camera, method(object({
25761
25851
  detection: NativeDetectionSchema
25762
25852
  });
25763
25853
  /**
25854
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25855
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25856
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25857
+ *
25858
+ * Why a NEW cap rather than overloading `ptz`:
25859
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25860
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25861
+ * The two are different physical models: PTZ is absolute-position + presets,
25862
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25863
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25864
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25865
+ * the reverse:
25866
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25867
+ * / `getOptions`), and
25868
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25869
+ * robot camera shows up in the existing PTZ control path without every
25870
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25871
+ * not here (see the addon design note):
25872
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25873
+ * ptz.stop() → navigation.stop()
25874
+ * ptz.goHome() → navigation.runAction('goHome')
25875
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25876
+ * ptz.goToPreset(id) → navigation.runAction(id)
25877
+ *
25878
+ * ## Continuous drive
25879
+ *
25880
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25881
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25882
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25883
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25884
+ * coalesce them. The UI owns the cadence.
25885
+ *
25886
+ * ## The action dictionary
25887
+ *
25888
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25889
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25890
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25891
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25892
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25893
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25894
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
25895
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
25896
+ *
25897
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
25898
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
25899
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
25900
+ * every device handle. A future nodedreame publish adds a typed
25901
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
25902
+ * provider can then swap the raw calls for the typed methods with no change to
25903
+ * THIS contract.
25904
+ */
25905
+ /**
25906
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
25907
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
25908
+ * halts it.
25909
+ *
25910
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
25911
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
25912
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
25913
+ * vector by it (drivers without proportional drive ignore it).
25914
+ *
25915
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
25916
+ * axis alone; an all-undefined nudge is a no-op.
25917
+ */
25918
+ var NavigationMoveCommandSchema = object({
25919
+ pan: number().min(-1).max(1).optional(),
25920
+ tilt: number().min(-1).max(1).optional(),
25921
+ speed: number().min(0).max(1).optional()
25922
+ });
25923
+ /**
25924
+ * The enumerated discrete actions a navigation-capable robot can perform via
25925
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
25926
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
25927
+ * `playSound` (see the `sound` dictionary entries).
25928
+ */
25929
+ var NavigationActionIdSchema = _enum([
25930
+ "goHome",
25931
+ "locate",
25932
+ "spotClean",
25933
+ "findPet",
25934
+ "personFollow",
25935
+ "stop",
25936
+ "startClean",
25937
+ "pauseClean",
25938
+ "dockWash",
25939
+ "autoEmpty",
25940
+ "flashOn",
25941
+ "flashOff"
25942
+ ]);
25943
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
25944
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
25945
+ /**
25946
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
25947
+ * native panel and the PTZ mimic render as a button.
25948
+ *
25949
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
25950
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
25951
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
25952
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
25953
+ * - `label` — operator-facing English label.
25954
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
25955
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
25956
+ * PTZ render ONLY enabled entries. Data-driven: the provider
25957
+ * flips it from config, never by editing code.
25958
+ */
25959
+ var NavigationActionEntrySchema = object({
25960
+ id: string(),
25961
+ kind: NavigationEntryKindSchema,
25962
+ label: string(),
25963
+ icon: string(),
25964
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
25965
+ soundId: number().int().optional(),
25966
+ /** Per-device feature flag — render this entry only when true. */
25967
+ enabled: boolean()
25968
+ });
25969
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
25970
+ var NavigationPointSchema = object({
25971
+ x: number(),
25972
+ y: number()
25973
+ });
25974
+ /**
25975
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
25976
+ * The cap reports which are enabled so the UI / PTZ render only the controls
25977
+ * that are turned on for THIS device. Data-driven: the provider derives these
25978
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
25979
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
25980
+ * that are not dictionary entries.
25981
+ *
25982
+ * - `move` / `stop` — the momentary drive joystick.
25983
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
25984
+ * map-coordinate plumbing is wired.
25985
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
25986
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
25987
+ * - `light` — the on/off fill-light toggle (works anytime).
25988
+ * - `lightMode` — the auto/manual selector + manual level slider (a
25989
+ * camera-service control; needs an active stream).
25990
+ */
25991
+ var NavigationFeaturesSchema = object({
25992
+ move: boolean(),
25993
+ stop: boolean(),
25994
+ goToPoint: boolean(),
25995
+ runAction: boolean(),
25996
+ playSound: boolean(),
25997
+ light: boolean(),
25998
+ lightMode: boolean()
25999
+ });
26000
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26001
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26002
+ /**
26003
+ * Live navigation state so the UI can reflect what the robot is doing:
26004
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26005
+ * - `following` — person/pet follow is currently armed.
26006
+ * - `flash` — the on-camera fill light is on.
26007
+ * - `lightMode` — auto vs manual fill-light mode.
26008
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26009
+ * `lightMode === 'manual'`.
26010
+ */
26011
+ var NavigationStatusSchema = object({
26012
+ mode: _enum([
26013
+ "idle",
26014
+ "cleaning",
26015
+ "spot",
26016
+ "following",
26017
+ "goto",
26018
+ "returning",
26019
+ "paused",
26020
+ "unknown"
26021
+ ]),
26022
+ following: boolean(),
26023
+ flash: boolean(),
26024
+ lightMode: NavigationLightModeSchema,
26025
+ lightLevel: number().min(40).max(100),
26026
+ /** Ms epoch when the slice was last updated. */
26027
+ lastChangedAt: number()
26028
+ });
26029
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26030
+ 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({
26031
+ deviceId: number(),
26032
+ actionId: NavigationActionIdSchema
26033
+ }), _void(), { kind: "mutation" }), method(object({
26034
+ deviceId: number(),
26035
+ soundId: number().int()
26036
+ }), _void(), { kind: "mutation" }), method(object({
26037
+ deviceId: number(),
26038
+ on: boolean()
26039
+ }), _void(), { kind: "mutation" }), method(object({
26040
+ deviceId: number(),
26041
+ mode: NavigationLightModeSchema,
26042
+ level: number().min(40).max(100).optional()
26043
+ }), _void(), { kind: "mutation" }), method(object({
26044
+ deviceId: number(),
26045
+ level: number().min(40).max(100)
26046
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26047
+ deviceId: number(),
26048
+ status: NavigationStatusSchema
26049
+ });
26050
+ /**
26051
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26052
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26053
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26054
+ * one Home Assistant projection.
26055
+ */
26056
+ var NetworkLinkStatusSchema = object({
26057
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26058
+ type: _enum([
26059
+ "wifi",
26060
+ "ethernet",
26061
+ "cellular",
26062
+ "unknown"
26063
+ ]),
26064
+ /**
26065
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26066
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26067
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26068
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26069
+ * SKIP a null rather than coerce it.
26070
+ */
26071
+ signalPercent: number().min(0).max(100).nullable(),
26072
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26073
+ rssiDbm: number().optional(),
26074
+ /** Network name of a wireless link, when the firmware reports it. */
26075
+ ssid: string().optional(),
26076
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26077
+ lastUpdated: number()
26078
+ });
26079
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26080
+ deviceId: number(),
26081
+ status: NetworkLinkStatusSchema
26082
+ });
26083
+ /**
25764
26084
  * network-quality — system-scoped singleton capability tracking RTT,
25765
26085
  * jitter, and observed/peak bandwidth per device + per client.
25766
26086
  *
@@ -27002,203 +27322,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
27002
27322
  deviceId: number(),
27003
27323
  status: PtzAutotrackStatusSchema
27004
27324
  });
27005
- /**
27006
- * `navigation` — a device-scoped capability that natively expresses the FULL
27007
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
27008
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
27009
- *
27010
- * Why a NEW cap rather than overloading `ptz`:
27011
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27012
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27013
- * The two are different physical models: PTZ is absolute-position + presets,
27014
- * navigation is momentary drive nudges + discrete robot ACTIONS
27015
- * (dock / spot-clean / follow-pet / go-to-point / …).
27016
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27017
- * the reverse:
27018
- * 1. a native CamStack navigation panel (data-driven from `listActions`
27019
- * / `getOptions`), and
27020
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27021
- * robot camera shows up in the existing PTZ control path without every
27022
- * PTZ provider learning about robots. The mapping lives in the adapter,
27023
- * not here (see the addon design note):
27024
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27025
- * ptz.stop() → navigation.stop()
27026
- * ptz.goHome() → navigation.runAction('goHome')
27027
- * ptz.getPresets() → navigation.listActions() (id→preset)
27028
- * ptz.goToPreset(id) → navigation.runAction(id)
27029
- *
27030
- * ## Continuous drive
27031
- *
27032
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27033
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27034
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27035
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27036
- * coalesce them. The UI owns the cadence.
27037
- *
27038
- * ## The action dictionary
27039
- *
27040
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27041
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27042
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27043
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27044
- * vendor-specific list. `kind: 'action'` entries are triggered with
27045
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27046
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27047
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27048
- *
27049
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27050
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27051
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27052
- * every device handle. A future nodedreame publish adds a typed
27053
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27054
- * provider can then swap the raw calls for the typed methods with no change to
27055
- * THIS contract.
27056
- */
27057
- /**
27058
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27059
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27060
- * halts it.
27061
- *
27062
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27063
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27064
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27065
- * vector by it (drivers without proportional drive ignore it).
27066
- *
27067
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27068
- * axis alone; an all-undefined nudge is a no-op.
27069
- */
27070
- var NavigationMoveCommandSchema = object({
27071
- pan: number().min(-1).max(1).optional(),
27072
- tilt: number().min(-1).max(1).optional(),
27073
- speed: number().min(0).max(1).optional()
27074
- });
27075
- /**
27076
- * The enumerated discrete actions a navigation-capable robot can perform via
27077
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27078
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27079
- * `playSound` (see the `sound` dictionary entries).
27080
- */
27081
- var NavigationActionIdSchema = _enum([
27082
- "goHome",
27083
- "locate",
27084
- "spotClean",
27085
- "findPet",
27086
- "personFollow",
27087
- "stop",
27088
- "startClean",
27089
- "pauseClean",
27090
- "dockWash",
27091
- "autoEmpty",
27092
- "flashOn",
27093
- "flashOff"
27094
- ]);
27095
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27096
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27097
- /**
27098
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27099
- * native panel and the PTZ mimic render as a button.
27100
- *
27101
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27102
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27103
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27104
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27105
- * - `label` — operator-facing English label.
27106
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27107
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27108
- * PTZ render ONLY enabled entries. Data-driven: the provider
27109
- * flips it from config, never by editing code.
27110
- */
27111
- var NavigationActionEntrySchema = object({
27112
- id: string(),
27113
- kind: NavigationEntryKindSchema,
27114
- label: string(),
27115
- icon: string(),
27116
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27117
- soundId: number().int().optional(),
27118
- /** Per-device feature flag — render this entry only when true. */
27119
- enabled: boolean()
27120
- });
27121
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27122
- var NavigationPointSchema = object({
27123
- x: number(),
27124
- y: number()
27125
- });
27126
- /**
27127
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27128
- * The cap reports which are enabled so the UI / PTZ render only the controls
27129
- * that are turned on for THIS device. Data-driven: the provider derives these
27130
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27131
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27132
- * that are not dictionary entries.
27133
- *
27134
- * - `move` / `stop` — the momentary drive joystick.
27135
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27136
- * map-coordinate plumbing is wired.
27137
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27138
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27139
- * - `light` — the on/off fill-light toggle (works anytime).
27140
- * - `lightMode` — the auto/manual selector + manual level slider (a
27141
- * camera-service control; needs an active stream).
27142
- */
27143
- var NavigationFeaturesSchema = object({
27144
- move: boolean(),
27145
- stop: boolean(),
27146
- goToPoint: boolean(),
27147
- runAction: boolean(),
27148
- playSound: boolean(),
27149
- light: boolean(),
27150
- lightMode: boolean()
27151
- });
27152
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27153
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27154
- /**
27155
- * Live navigation state so the UI can reflect what the robot is doing:
27156
- * - `mode` — coarse activity (idle / cleaning / following / …).
27157
- * - `following` — person/pet follow is currently armed.
27158
- * - `flash` — the on-camera fill light is on.
27159
- * - `lightMode` — auto vs manual fill-light mode.
27160
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27161
- * `lightMode === 'manual'`.
27162
- */
27163
- var NavigationStatusSchema = object({
27164
- mode: _enum([
27165
- "idle",
27166
- "cleaning",
27167
- "spot",
27168
- "following",
27169
- "goto",
27170
- "returning",
27171
- "paused",
27172
- "unknown"
27173
- ]),
27174
- following: boolean(),
27175
- flash: boolean(),
27176
- lightMode: NavigationLightModeSchema,
27177
- lightLevel: number().min(40).max(100),
27178
- /** Ms epoch when the slice was last updated. */
27179
- lastChangedAt: number()
27180
- });
27181
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27182
- 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({
27183
- deviceId: number(),
27184
- actionId: NavigationActionIdSchema
27185
- }), _void(), { kind: "mutation" }), method(object({
27186
- deviceId: number(),
27187
- soundId: number().int()
27188
- }), _void(), { kind: "mutation" }), method(object({
27189
- deviceId: number(),
27190
- on: boolean()
27191
- }), _void(), { kind: "mutation" }), method(object({
27192
- deviceId: number(),
27193
- mode: NavigationLightModeSchema,
27194
- level: number().min(40).max(100).optional()
27195
- }), _void(), { kind: "mutation" }), method(object({
27196
- deviceId: number(),
27197
- level: number().min(40).max(100)
27198
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27199
- deviceId: number(),
27200
- status: NavigationStatusSchema
27201
- });
27202
27325
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27203
27326
  kind: "mutation",
27204
27327
  auth: "admin"
@@ -34513,6 +34636,12 @@ Object.freeze({
34513
34636
  addonId: null,
34514
34637
  access: "view"
34515
34638
  },
34639
+ "storage.listDrainProgress": {
34640
+ capName: "storage",
34641
+ capScope: "system",
34642
+ addonId: null,
34643
+ access: "view"
34644
+ },
34516
34645
  "storage.listLocationDeclarations": {
34517
34646
  capName: "storage",
34518
34647
  capScope: "system",
@@ -34657,6 +34786,12 @@ Object.freeze({
34657
34786
  addonId: null,
34658
34787
  access: "view"
34659
34788
  },
34789
+ "storageOccupancy.getOccupancy": {
34790
+ capName: "storage-occupancy",
34791
+ capScope: "system",
34792
+ addonId: null,
34793
+ access: "view"
34794
+ },
34660
34795
  "storageProvider.abortUpload": {
34661
34796
  capName: "storage-provider",
34662
34797
  capScope: "system",