@camstack/addon-mqtt-broker 1.2.79 → 1.2.81

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
@@ -20150,8 +20228,25 @@ var occupancyRecheckFramesField = {
20150
20228
  * (analyzer attaches detected `regions[]`; onboard does not — the
20151
20229
  * camera typically only reports a binary signal plus an optional
20152
20230
  * channel/AI class which lives in dedicated event channels).
20231
+ *
20232
+ * - `onboard` — the camera's firmware said something moved.
20233
+ * - `analyzer` — this runner's frame-diff said so, and attaches `regions[]`.
20234
+ * - `device-activity` — the DEVICE said it is doing its job: the
20235
+ * `recording-signal` LEVEL the same device raises for the recorder
20236
+ * ([D380](../../../../docs/decisions/adr-0380-a-device-decided-recording-is-a-mode-with-no-schedule-seeded-once.md)),
20237
+ * republished as a motion source. It attaches **nothing** — no regions, no
20238
+ * class: the only fact it carries is that the device is active, and a robot
20239
+ * vacuum that is itself the moving object has no region worth sending. It is
20240
+ * a LEVEL, so unlike `onboard` it has a real falling edge, and unlike
20241
+ * `analyzer` it must not open the frame-diff side-channel — the runner's
20242
+ * `handleOnboardMotionAnalyzer` gate is `source === 'onboard'` and stays that
20243
+ * way ([D392](../../../../docs/decisions/adr-0392-a-device-that-says-it-is-working-is-a-motion-source-of-its-own.md)).
20153
20244
  */
20154
- var MotionSourceEnum = _enum(["onboard", "analyzer"]);
20245
+ var MotionSourceEnum = _enum([
20246
+ "onboard",
20247
+ "analyzer",
20248
+ "device-activity"
20249
+ ]);
20155
20250
  /**
20156
20251
  * List of motion sources active on a camera. Empty array is valid:
20157
20252
  * "no source" — happens for battery cams without firmware motion when
@@ -21670,7 +21765,7 @@ method(object({
21670
21765
  }), _void(), {
21671
21766
  kind: "mutation",
21672
21767
  auth: "admin"
21673
- }), method(object({ id: string() }), object({
21768
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21674
21769
  ok: boolean(),
21675
21770
  error: string().optional()
21676
21771
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21740,6 +21835,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21740
21835
  kind: "mutation",
21741
21836
  auth: "admin"
21742
21837
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21838
+ /**
21839
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21840
+ * location (D388).
21841
+ *
21842
+ * ## Why this is not `storage-evictable`
21843
+ *
21844
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21845
+ * not, in two ways that both matter and both bite hardest on the locations an
21846
+ * operator most wants a figure for:
21847
+ *
21848
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21849
+ * and `recordingsLow:default` deliberately share one root and evict as one
21850
+ * oldest-first pool, so both answer with the SAME combined total. As an
21851
+ * occupancy figure that double-counts the disk.
21852
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21853
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21854
+ * is retiring and staring at.
21855
+ *
21856
+ * So this is its own contract with its own quantity, and the quantity is
21857
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21858
+ * would ever be willing to delete it. A provider that can only answer
21859
+ * "evictable" must not register here — a number that silently means different
21860
+ * things per class is worse than no number.
21861
+ *
21862
+ * ## Absence is an answer
21863
+ *
21864
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21865
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21866
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21867
+ * consuming side has to be written out loud instead of appearing by accident.
21868
+ *
21869
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21870
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21871
+ */
21872
+ /** One provider's occupancy answer for one location. */
21873
+ var StorageOccupancyReportSchema = object({
21874
+ locationId: string(),
21875
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21876
+ * not net of what it is willing to delete. */
21877
+ ownedBytes: number().int().nonnegative(),
21878
+ /** When the provider last actually measured this. The orchestrator carries it
21879
+ * through so a UI can say how old the figure is instead of implying "now". */
21880
+ measuredAtMs: number().int().nonnegative()
21881
+ });
21882
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21743
21883
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21744
21884
  providerId: string().min(1),
21745
21885
  displayName: string().min(1),
@@ -23375,39 +23515,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23375
23515
  deviceId: number(),
23376
23516
  status: BatteryStatusSchema
23377
23517
  });
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
23518
  object({
23412
23519
  on: boolean(),
23413
23520
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25761,6 +25868,236 @@ DeviceType.Camera, method(object({
25761
25868
  detection: NativeDetectionSchema
25762
25869
  });
25763
25870
  /**
25871
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25872
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25873
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25874
+ *
25875
+ * Why a NEW cap rather than overloading `ptz`:
25876
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25877
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25878
+ * The two are different physical models: PTZ is absolute-position + presets,
25879
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25880
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25881
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25882
+ * the reverse:
25883
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25884
+ * / `getOptions`), and
25885
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25886
+ * robot camera shows up in the existing PTZ control path without every
25887
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25888
+ * not here (see the addon design note):
25889
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25890
+ * ptz.stop() → navigation.stop()
25891
+ * ptz.goHome() → navigation.runAction('goHome')
25892
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25893
+ * ptz.goToPreset(id) → navigation.runAction(id)
25894
+ *
25895
+ * ## Continuous drive
25896
+ *
25897
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25898
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25899
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25900
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25901
+ * coalesce them. The UI owns the cadence.
25902
+ *
25903
+ * ## The action dictionary
25904
+ *
25905
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25906
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25907
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25908
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25909
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25910
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25911
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
25912
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
25913
+ *
25914
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
25915
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
25916
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
25917
+ * every device handle. A future nodedreame publish adds a typed
25918
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
25919
+ * provider can then swap the raw calls for the typed methods with no change to
25920
+ * THIS contract.
25921
+ */
25922
+ /**
25923
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
25924
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
25925
+ * halts it.
25926
+ *
25927
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
25928
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
25929
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
25930
+ * vector by it (drivers without proportional drive ignore it).
25931
+ *
25932
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
25933
+ * axis alone; an all-undefined nudge is a no-op.
25934
+ */
25935
+ var NavigationMoveCommandSchema = object({
25936
+ pan: number().min(-1).max(1).optional(),
25937
+ tilt: number().min(-1).max(1).optional(),
25938
+ speed: number().min(0).max(1).optional()
25939
+ });
25940
+ /**
25941
+ * The enumerated discrete actions a navigation-capable robot can perform via
25942
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
25943
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
25944
+ * `playSound` (see the `sound` dictionary entries).
25945
+ */
25946
+ var NavigationActionIdSchema = _enum([
25947
+ "goHome",
25948
+ "locate",
25949
+ "spotClean",
25950
+ "findPet",
25951
+ "personFollow",
25952
+ "stop",
25953
+ "startClean",
25954
+ "pauseClean",
25955
+ "dockWash",
25956
+ "autoEmpty",
25957
+ "flashOn",
25958
+ "flashOff"
25959
+ ]);
25960
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
25961
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
25962
+ /**
25963
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
25964
+ * native panel and the PTZ mimic render as a button.
25965
+ *
25966
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
25967
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
25968
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
25969
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
25970
+ * - `label` — operator-facing English label.
25971
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
25972
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
25973
+ * PTZ render ONLY enabled entries. Data-driven: the provider
25974
+ * flips it from config, never by editing code.
25975
+ */
25976
+ var NavigationActionEntrySchema = object({
25977
+ id: string(),
25978
+ kind: NavigationEntryKindSchema,
25979
+ label: string(),
25980
+ icon: string(),
25981
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
25982
+ soundId: number().int().optional(),
25983
+ /** Per-device feature flag — render this entry only when true. */
25984
+ enabled: boolean()
25985
+ });
25986
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
25987
+ var NavigationPointSchema = object({
25988
+ x: number(),
25989
+ y: number()
25990
+ });
25991
+ /**
25992
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
25993
+ * The cap reports which are enabled so the UI / PTZ render only the controls
25994
+ * that are turned on for THIS device. Data-driven: the provider derives these
25995
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
25996
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
25997
+ * that are not dictionary entries.
25998
+ *
25999
+ * - `move` / `stop` — the momentary drive joystick.
26000
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26001
+ * map-coordinate plumbing is wired.
26002
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26003
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26004
+ * - `light` — the on/off fill-light toggle (works anytime).
26005
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26006
+ * camera-service control; needs an active stream).
26007
+ */
26008
+ var NavigationFeaturesSchema = object({
26009
+ move: boolean(),
26010
+ stop: boolean(),
26011
+ goToPoint: boolean(),
26012
+ runAction: boolean(),
26013
+ playSound: boolean(),
26014
+ light: boolean(),
26015
+ lightMode: boolean()
26016
+ });
26017
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26018
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26019
+ /**
26020
+ * Live navigation state so the UI can reflect what the robot is doing:
26021
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26022
+ * - `following` — person/pet follow is currently armed.
26023
+ * - `flash` — the on-camera fill light is on.
26024
+ * - `lightMode` — auto vs manual fill-light mode.
26025
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26026
+ * `lightMode === 'manual'`.
26027
+ */
26028
+ var NavigationStatusSchema = object({
26029
+ mode: _enum([
26030
+ "idle",
26031
+ "cleaning",
26032
+ "spot",
26033
+ "following",
26034
+ "goto",
26035
+ "returning",
26036
+ "paused",
26037
+ "unknown"
26038
+ ]),
26039
+ following: boolean(),
26040
+ flash: boolean(),
26041
+ lightMode: NavigationLightModeSchema,
26042
+ lightLevel: number().min(40).max(100),
26043
+ /** Ms epoch when the slice was last updated. */
26044
+ lastChangedAt: number()
26045
+ });
26046
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26047
+ 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({
26048
+ deviceId: number(),
26049
+ actionId: NavigationActionIdSchema
26050
+ }), _void(), { kind: "mutation" }), method(object({
26051
+ deviceId: number(),
26052
+ soundId: number().int()
26053
+ }), _void(), { kind: "mutation" }), method(object({
26054
+ deviceId: number(),
26055
+ on: boolean()
26056
+ }), _void(), { kind: "mutation" }), method(object({
26057
+ deviceId: number(),
26058
+ mode: NavigationLightModeSchema,
26059
+ level: number().min(40).max(100).optional()
26060
+ }), _void(), { kind: "mutation" }), method(object({
26061
+ deviceId: number(),
26062
+ level: number().min(40).max(100)
26063
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26064
+ deviceId: number(),
26065
+ status: NavigationStatusSchema
26066
+ });
26067
+ /**
26068
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26069
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26070
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26071
+ * one Home Assistant projection.
26072
+ */
26073
+ var NetworkLinkStatusSchema = object({
26074
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26075
+ type: _enum([
26076
+ "wifi",
26077
+ "ethernet",
26078
+ "cellular",
26079
+ "unknown"
26080
+ ]),
26081
+ /**
26082
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26083
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26084
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26085
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26086
+ * SKIP a null rather than coerce it.
26087
+ */
26088
+ signalPercent: number().min(0).max(100).nullable(),
26089
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26090
+ rssiDbm: number().optional(),
26091
+ /** Network name of a wireless link, when the firmware reports it. */
26092
+ ssid: string().optional(),
26093
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26094
+ lastUpdated: number()
26095
+ });
26096
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26097
+ deviceId: number(),
26098
+ status: NetworkLinkStatusSchema
26099
+ });
26100
+ /**
25764
26101
  * network-quality — system-scoped singleton capability tracking RTT,
25765
26102
  * jitter, and observed/peak bandwidth per device + per client.
25766
26103
  *
@@ -27002,203 +27339,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
27002
27339
  deviceId: number(),
27003
27340
  status: PtzAutotrackStatusSchema
27004
27341
  });
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
27342
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27203
27343
  kind: "mutation",
27204
27344
  auth: "admin"
@@ -34513,6 +34653,12 @@ Object.freeze({
34513
34653
  addonId: null,
34514
34654
  access: "view"
34515
34655
  },
34656
+ "storage.listDrainProgress": {
34657
+ capName: "storage",
34658
+ capScope: "system",
34659
+ addonId: null,
34660
+ access: "view"
34661
+ },
34516
34662
  "storage.listLocationDeclarations": {
34517
34663
  capName: "storage",
34518
34664
  capScope: "system",
@@ -34657,6 +34803,12 @@ Object.freeze({
34657
34803
  addonId: null,
34658
34804
  access: "view"
34659
34805
  },
34806
+ "storageOccupancy.getOccupancy": {
34807
+ capName: "storage-occupancy",
34808
+ capScope: "system",
34809
+ addonId: null,
34810
+ access: "view"
34811
+ },
34660
34812
  "storageProvider.abortUpload": {
34661
34813
  capName: "storage-provider",
34662
34814
  capScope: "system",