@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.
@@ -39,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
39
39
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40
40
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
41
41
  //#endregion
42
- //#region ../types/dist/event-category-zAv7pMUz.mjs
42
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
43
43
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
44
44
  EventCategory["SystemBoot"] = "system.boot";
45
45
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -234,6 +234,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
234
234
  EventCategory["ProcessCrashed"] = "process.crashed";
235
235
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
236
236
  EventCategory["ProcessRestarted"] = "process.restarted";
237
+ /**
238
+ * The SET of storage locations changed — one was created, edited, enabled,
239
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
240
+ *
241
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
242
+ * it must also converge on its own periodic path, because a dropped event
243
+ * must not leave a node writing to yesterday's disk set forever. It exists
244
+ * because there was NO signal at all — an operator who added a second
245
+ * recordings disk in the admin UI got nothing, and the recorder kept its
246
+ * resolved locations until something else happened to re-resolve them
247
+ * (D387). Payload `StorageLocationsChangedPayload`.
248
+ */
249
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
237
250
  EventCategory["RecordingStarted"] = "recording.started";
238
251
  EventCategory["RecordingStopped"] = "recording.stopped";
239
252
  EventCategory["RecordingError"] = "recording.error";
@@ -8560,6 +8573,21 @@ var StorageCleanupJobSchema = object({
8560
8573
  });
8561
8574
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8562
8575
  /**
8576
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8577
+ * alias below is `z.infer<>` of it, never a second spelling.
8578
+ */
8579
+ var StorageLocationModeSchema = _enum([
8580
+ "active",
8581
+ "readonly",
8582
+ "drain",
8583
+ "disabled"
8584
+ ]);
8585
+ _enum([
8586
+ "normal",
8587
+ "never",
8588
+ "drain"
8589
+ ]);
8590
+ /**
8563
8591
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8564
8592
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8565
8593
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8625,6 +8653,21 @@ var StorageLocationSchema = object({
8625
8653
  * stops existing rather than being re-derived on every read.
8626
8654
  */
8627
8655
  enabled: boolean().optional(),
8656
+ /**
8657
+ * THE state of this location (D385), and the only authority on what may be
8658
+ * written, read or evicted here. Interpreted in exactly one place —
8659
+ * `storage-location-mode.ts` — which also folds the legacy
8660
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8661
+ * ambiguous.
8662
+ *
8663
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8664
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8665
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8666
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8667
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8668
+ * either, so the two cannot disagree.
8669
+ */
8670
+ mode: StorageLocationModeSchema.optional(),
8628
8671
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8629
8672
  * for node-local locations it can reach) — never persisted, absent when the
8630
8673
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8632,11 +8675,46 @@ var StorageLocationSchema = object({
8632
8675
  totalBytes: number(),
8633
8676
  availableBytes: number()
8634
8677
  }).nullable().optional(),
8678
+ /**
8679
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8680
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8681
+ * never persisted, never a filesystem walk.
8682
+ *
8683
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8684
+ * location yet — nobody stores here, the owning addon is down, or the first
8685
+ * refresh has not completed. A UI must omit the segment rather than draw it
8686
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8687
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8688
+ * be spelled out loud instead of appearing by accident.
8689
+ *
8690
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8691
+ * about the whole figure rather than about its freshest part.
8692
+ */
8693
+ owned: object({
8694
+ bytes: number().int().nonnegative(),
8695
+ measuredAtMs: number().int().nonnegative()
8696
+ }).optional(),
8635
8697
  createdAt: number(),
8636
8698
  updatedAt: number()
8637
8699
  });
8638
8700
  object({ isDefault: boolean().optional() });
8639
8701
  /**
8702
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8703
+ *
8704
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8705
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8706
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8707
+ * operator learns not to believe the screen.
8708
+ */
8709
+ var StorageDrainProgressSchema = object({
8710
+ locationId: string(),
8711
+ startedAtMs: number(),
8712
+ startBytes: number(),
8713
+ bytesRemaining: number(),
8714
+ drained: boolean(),
8715
+ estimatedEmptyAtMs: number().nullable()
8716
+ });
8717
+ /**
8640
8718
  * Reference accepted by consumer-facing `api.storage.*` calls.
8641
8719
  * Either:
8642
8720
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -20145,8 +20223,25 @@ var occupancyRecheckFramesField = {
20145
20223
  * (analyzer attaches detected `regions[]`; onboard does not — the
20146
20224
  * camera typically only reports a binary signal plus an optional
20147
20225
  * channel/AI class which lives in dedicated event channels).
20226
+ *
20227
+ * - `onboard` — the camera's firmware said something moved.
20228
+ * - `analyzer` — this runner's frame-diff said so, and attaches `regions[]`.
20229
+ * - `device-activity` — the DEVICE said it is doing its job: the
20230
+ * `recording-signal` LEVEL the same device raises for the recorder
20231
+ * ([D380](../../../../docs/decisions/adr-0380-a-device-decided-recording-is-a-mode-with-no-schedule-seeded-once.md)),
20232
+ * republished as a motion source. It attaches **nothing** — no regions, no
20233
+ * class: the only fact it carries is that the device is active, and a robot
20234
+ * vacuum that is itself the moving object has no region worth sending. It is
20235
+ * a LEVEL, so unlike `onboard` it has a real falling edge, and unlike
20236
+ * `analyzer` it must not open the frame-diff side-channel — the runner's
20237
+ * `handleOnboardMotionAnalyzer` gate is `source === 'onboard'` and stays that
20238
+ * way ([D392](../../../../docs/decisions/adr-0392-a-device-that-says-it-is-working-is-a-motion-source-of-its-own.md)).
20148
20239
  */
20149
- var MotionSourceEnum = _enum(["onboard", "analyzer"]);
20240
+ var MotionSourceEnum = _enum([
20241
+ "onboard",
20242
+ "analyzer",
20243
+ "device-activity"
20244
+ ]);
20150
20245
  /**
20151
20246
  * List of motion sources active on a camera. Empty array is valid:
20152
20247
  * "no source" — happens for battery cams without firmware motion when
@@ -21665,7 +21760,7 @@ method(object({
21665
21760
  }), _void(), {
21666
21761
  kind: "mutation",
21667
21762
  auth: "admin"
21668
- }), method(object({ id: string() }), object({
21763
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21669
21764
  ok: boolean(),
21670
21765
  error: string().optional()
21671
21766
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21735,6 +21830,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21735
21830
  kind: "mutation",
21736
21831
  auth: "admin"
21737
21832
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21833
+ /**
21834
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21835
+ * location (D388).
21836
+ *
21837
+ * ## Why this is not `storage-evictable`
21838
+ *
21839
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21840
+ * not, in two ways that both matter and both bite hardest on the locations an
21841
+ * operator most wants a figure for:
21842
+ *
21843
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21844
+ * and `recordingsLow:default` deliberately share one root and evict as one
21845
+ * oldest-first pool, so both answer with the SAME combined total. As an
21846
+ * occupancy figure that double-counts the disk.
21847
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21848
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21849
+ * is retiring and staring at.
21850
+ *
21851
+ * So this is its own contract with its own quantity, and the quantity is
21852
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21853
+ * would ever be willing to delete it. A provider that can only answer
21854
+ * "evictable" must not register here — a number that silently means different
21855
+ * things per class is worse than no number.
21856
+ *
21857
+ * ## Absence is an answer
21858
+ *
21859
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21860
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21861
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21862
+ * consuming side has to be written out loud instead of appearing by accident.
21863
+ *
21864
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21865
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21866
+ */
21867
+ /** One provider's occupancy answer for one location. */
21868
+ var StorageOccupancyReportSchema = object({
21869
+ locationId: string(),
21870
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21871
+ * not net of what it is willing to delete. */
21872
+ ownedBytes: number().int().nonnegative(),
21873
+ /** When the provider last actually measured this. The orchestrator carries it
21874
+ * through so a UI can say how old the figure is instead of implying "now". */
21875
+ measuredAtMs: number().int().nonnegative()
21876
+ });
21877
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21738
21878
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21739
21879
  providerId: string().min(1),
21740
21880
  displayName: string().min(1),
@@ -23370,39 +23510,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23370
23510
  deviceId: number(),
23371
23511
  status: BatteryStatusSchema
23372
23512
  });
23373
- /**
23374
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23375
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23376
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23377
- * one Home Assistant projection.
23378
- */
23379
- var NetworkLinkStatusSchema = object({
23380
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23381
- type: _enum([
23382
- "wifi",
23383
- "ethernet",
23384
- "cellular",
23385
- "unknown"
23386
- ]),
23387
- /**
23388
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23389
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23390
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23391
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23392
- * SKIP a null rather than coerce it.
23393
- */
23394
- signalPercent: number().min(0).max(100).nullable(),
23395
- /** Raw received signal strength in dBm, when the firmware reports one. */
23396
- rssiDbm: number().optional(),
23397
- /** Network name of a wireless link, when the firmware reports it. */
23398
- ssid: string().optional(),
23399
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23400
- lastUpdated: number()
23401
- });
23402
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23403
- deviceId: number(),
23404
- status: NetworkLinkStatusSchema
23405
- });
23406
23513
  object({
23407
23514
  on: boolean(),
23408
23515
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25756,6 +25863,236 @@ DeviceType.Camera, method(object({
25756
25863
  detection: NativeDetectionSchema
25757
25864
  });
25758
25865
  /**
25866
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25867
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25868
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25869
+ *
25870
+ * Why a NEW cap rather than overloading `ptz`:
25871
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25872
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25873
+ * The two are different physical models: PTZ is absolute-position + presets,
25874
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25875
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25876
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25877
+ * the reverse:
25878
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25879
+ * / `getOptions`), and
25880
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25881
+ * robot camera shows up in the existing PTZ control path without every
25882
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25883
+ * not here (see the addon design note):
25884
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25885
+ * ptz.stop() → navigation.stop()
25886
+ * ptz.goHome() → navigation.runAction('goHome')
25887
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25888
+ * ptz.goToPreset(id) → navigation.runAction(id)
25889
+ *
25890
+ * ## Continuous drive
25891
+ *
25892
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25893
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25894
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25895
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25896
+ * coalesce them. The UI owns the cadence.
25897
+ *
25898
+ * ## The action dictionary
25899
+ *
25900
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25901
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25902
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25903
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25904
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25905
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25906
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
25907
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
25908
+ *
25909
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
25910
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
25911
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
25912
+ * every device handle. A future nodedreame publish adds a typed
25913
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
25914
+ * provider can then swap the raw calls for the typed methods with no change to
25915
+ * THIS contract.
25916
+ */
25917
+ /**
25918
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
25919
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
25920
+ * halts it.
25921
+ *
25922
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
25923
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
25924
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
25925
+ * vector by it (drivers without proportional drive ignore it).
25926
+ *
25927
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
25928
+ * axis alone; an all-undefined nudge is a no-op.
25929
+ */
25930
+ var NavigationMoveCommandSchema = object({
25931
+ pan: number().min(-1).max(1).optional(),
25932
+ tilt: number().min(-1).max(1).optional(),
25933
+ speed: number().min(0).max(1).optional()
25934
+ });
25935
+ /**
25936
+ * The enumerated discrete actions a navigation-capable robot can perform via
25937
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
25938
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
25939
+ * `playSound` (see the `sound` dictionary entries).
25940
+ */
25941
+ var NavigationActionIdSchema = _enum([
25942
+ "goHome",
25943
+ "locate",
25944
+ "spotClean",
25945
+ "findPet",
25946
+ "personFollow",
25947
+ "stop",
25948
+ "startClean",
25949
+ "pauseClean",
25950
+ "dockWash",
25951
+ "autoEmpty",
25952
+ "flashOn",
25953
+ "flashOff"
25954
+ ]);
25955
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
25956
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
25957
+ /**
25958
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
25959
+ * native panel and the PTZ mimic render as a button.
25960
+ *
25961
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
25962
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
25963
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
25964
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
25965
+ * - `label` — operator-facing English label.
25966
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
25967
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
25968
+ * PTZ render ONLY enabled entries. Data-driven: the provider
25969
+ * flips it from config, never by editing code.
25970
+ */
25971
+ var NavigationActionEntrySchema = object({
25972
+ id: string(),
25973
+ kind: NavigationEntryKindSchema,
25974
+ label: string(),
25975
+ icon: string(),
25976
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
25977
+ soundId: number().int().optional(),
25978
+ /** Per-device feature flag — render this entry only when true. */
25979
+ enabled: boolean()
25980
+ });
25981
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
25982
+ var NavigationPointSchema = object({
25983
+ x: number(),
25984
+ y: number()
25985
+ });
25986
+ /**
25987
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
25988
+ * The cap reports which are enabled so the UI / PTZ render only the controls
25989
+ * that are turned on for THIS device. Data-driven: the provider derives these
25990
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
25991
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
25992
+ * that are not dictionary entries.
25993
+ *
25994
+ * - `move` / `stop` — the momentary drive joystick.
25995
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
25996
+ * map-coordinate plumbing is wired.
25997
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
25998
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
25999
+ * - `light` — the on/off fill-light toggle (works anytime).
26000
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26001
+ * camera-service control; needs an active stream).
26002
+ */
26003
+ var NavigationFeaturesSchema = object({
26004
+ move: boolean(),
26005
+ stop: boolean(),
26006
+ goToPoint: boolean(),
26007
+ runAction: boolean(),
26008
+ playSound: boolean(),
26009
+ light: boolean(),
26010
+ lightMode: boolean()
26011
+ });
26012
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26013
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26014
+ /**
26015
+ * Live navigation state so the UI can reflect what the robot is doing:
26016
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26017
+ * - `following` — person/pet follow is currently armed.
26018
+ * - `flash` — the on-camera fill light is on.
26019
+ * - `lightMode` — auto vs manual fill-light mode.
26020
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26021
+ * `lightMode === 'manual'`.
26022
+ */
26023
+ var NavigationStatusSchema = object({
26024
+ mode: _enum([
26025
+ "idle",
26026
+ "cleaning",
26027
+ "spot",
26028
+ "following",
26029
+ "goto",
26030
+ "returning",
26031
+ "paused",
26032
+ "unknown"
26033
+ ]),
26034
+ following: boolean(),
26035
+ flash: boolean(),
26036
+ lightMode: NavigationLightModeSchema,
26037
+ lightLevel: number().min(40).max(100),
26038
+ /** Ms epoch when the slice was last updated. */
26039
+ lastChangedAt: number()
26040
+ });
26041
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26042
+ 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({
26043
+ deviceId: number(),
26044
+ actionId: NavigationActionIdSchema
26045
+ }), _void(), { kind: "mutation" }), method(object({
26046
+ deviceId: number(),
26047
+ soundId: number().int()
26048
+ }), _void(), { kind: "mutation" }), method(object({
26049
+ deviceId: number(),
26050
+ on: boolean()
26051
+ }), _void(), { kind: "mutation" }), method(object({
26052
+ deviceId: number(),
26053
+ mode: NavigationLightModeSchema,
26054
+ level: number().min(40).max(100).optional()
26055
+ }), _void(), { kind: "mutation" }), method(object({
26056
+ deviceId: number(),
26057
+ level: number().min(40).max(100)
26058
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26059
+ deviceId: number(),
26060
+ status: NavigationStatusSchema
26061
+ });
26062
+ /**
26063
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26064
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26065
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26066
+ * one Home Assistant projection.
26067
+ */
26068
+ var NetworkLinkStatusSchema = object({
26069
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26070
+ type: _enum([
26071
+ "wifi",
26072
+ "ethernet",
26073
+ "cellular",
26074
+ "unknown"
26075
+ ]),
26076
+ /**
26077
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26078
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26079
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26080
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26081
+ * SKIP a null rather than coerce it.
26082
+ */
26083
+ signalPercent: number().min(0).max(100).nullable(),
26084
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26085
+ rssiDbm: number().optional(),
26086
+ /** Network name of a wireless link, when the firmware reports it. */
26087
+ ssid: string().optional(),
26088
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26089
+ lastUpdated: number()
26090
+ });
26091
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26092
+ deviceId: number(),
26093
+ status: NetworkLinkStatusSchema
26094
+ });
26095
+ /**
25759
26096
  * network-quality — system-scoped singleton capability tracking RTT,
25760
26097
  * jitter, and observed/peak bandwidth per device + per client.
25761
26098
  *
@@ -26997,203 +27334,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
26997
27334
  deviceId: number(),
26998
27335
  status: PtzAutotrackStatusSchema
26999
27336
  });
27000
- /**
27001
- * `navigation` — a device-scoped capability that natively expresses the FULL
27002
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
27003
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
27004
- *
27005
- * Why a NEW cap rather than overloading `ptz`:
27006
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27007
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27008
- * The two are different physical models: PTZ is absolute-position + presets,
27009
- * navigation is momentary drive nudges + discrete robot ACTIONS
27010
- * (dock / spot-clean / follow-pet / go-to-point / …).
27011
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27012
- * the reverse:
27013
- * 1. a native CamStack navigation panel (data-driven from `listActions`
27014
- * / `getOptions`), and
27015
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27016
- * robot camera shows up in the existing PTZ control path without every
27017
- * PTZ provider learning about robots. The mapping lives in the adapter,
27018
- * not here (see the addon design note):
27019
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27020
- * ptz.stop() → navigation.stop()
27021
- * ptz.goHome() → navigation.runAction('goHome')
27022
- * ptz.getPresets() → navigation.listActions() (id→preset)
27023
- * ptz.goToPreset(id) → navigation.runAction(id)
27024
- *
27025
- * ## Continuous drive
27026
- *
27027
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27028
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27029
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27030
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27031
- * coalesce them. The UI owns the cadence.
27032
- *
27033
- * ## The action dictionary
27034
- *
27035
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27036
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27037
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27038
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27039
- * vendor-specific list. `kind: 'action'` entries are triggered with
27040
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27041
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27042
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27043
- *
27044
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27045
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27046
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27047
- * every device handle. A future nodedreame publish adds a typed
27048
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27049
- * provider can then swap the raw calls for the typed methods with no change to
27050
- * THIS contract.
27051
- */
27052
- /**
27053
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27054
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27055
- * halts it.
27056
- *
27057
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27058
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27059
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27060
- * vector by it (drivers without proportional drive ignore it).
27061
- *
27062
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27063
- * axis alone; an all-undefined nudge is a no-op.
27064
- */
27065
- var NavigationMoveCommandSchema = object({
27066
- pan: number().min(-1).max(1).optional(),
27067
- tilt: number().min(-1).max(1).optional(),
27068
- speed: number().min(0).max(1).optional()
27069
- });
27070
- /**
27071
- * The enumerated discrete actions a navigation-capable robot can perform via
27072
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27073
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27074
- * `playSound` (see the `sound` dictionary entries).
27075
- */
27076
- var NavigationActionIdSchema = _enum([
27077
- "goHome",
27078
- "locate",
27079
- "spotClean",
27080
- "findPet",
27081
- "personFollow",
27082
- "stop",
27083
- "startClean",
27084
- "pauseClean",
27085
- "dockWash",
27086
- "autoEmpty",
27087
- "flashOn",
27088
- "flashOff"
27089
- ]);
27090
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27091
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27092
- /**
27093
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27094
- * native panel and the PTZ mimic render as a button.
27095
- *
27096
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27097
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27098
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27099
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27100
- * - `label` — operator-facing English label.
27101
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27102
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27103
- * PTZ render ONLY enabled entries. Data-driven: the provider
27104
- * flips it from config, never by editing code.
27105
- */
27106
- var NavigationActionEntrySchema = object({
27107
- id: string(),
27108
- kind: NavigationEntryKindSchema,
27109
- label: string(),
27110
- icon: string(),
27111
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27112
- soundId: number().int().optional(),
27113
- /** Per-device feature flag — render this entry only when true. */
27114
- enabled: boolean()
27115
- });
27116
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27117
- var NavigationPointSchema = object({
27118
- x: number(),
27119
- y: number()
27120
- });
27121
- /**
27122
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27123
- * The cap reports which are enabled so the UI / PTZ render only the controls
27124
- * that are turned on for THIS device. Data-driven: the provider derives these
27125
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27126
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27127
- * that are not dictionary entries.
27128
- *
27129
- * - `move` / `stop` — the momentary drive joystick.
27130
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27131
- * map-coordinate plumbing is wired.
27132
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27133
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27134
- * - `light` — the on/off fill-light toggle (works anytime).
27135
- * - `lightMode` — the auto/manual selector + manual level slider (a
27136
- * camera-service control; needs an active stream).
27137
- */
27138
- var NavigationFeaturesSchema = object({
27139
- move: boolean(),
27140
- stop: boolean(),
27141
- goToPoint: boolean(),
27142
- runAction: boolean(),
27143
- playSound: boolean(),
27144
- light: boolean(),
27145
- lightMode: boolean()
27146
- });
27147
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27148
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27149
- /**
27150
- * Live navigation state so the UI can reflect what the robot is doing:
27151
- * - `mode` — coarse activity (idle / cleaning / following / …).
27152
- * - `following` — person/pet follow is currently armed.
27153
- * - `flash` — the on-camera fill light is on.
27154
- * - `lightMode` — auto vs manual fill-light mode.
27155
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27156
- * `lightMode === 'manual'`.
27157
- */
27158
- var NavigationStatusSchema = object({
27159
- mode: _enum([
27160
- "idle",
27161
- "cleaning",
27162
- "spot",
27163
- "following",
27164
- "goto",
27165
- "returning",
27166
- "paused",
27167
- "unknown"
27168
- ]),
27169
- following: boolean(),
27170
- flash: boolean(),
27171
- lightMode: NavigationLightModeSchema,
27172
- lightLevel: number().min(40).max(100),
27173
- /** Ms epoch when the slice was last updated. */
27174
- lastChangedAt: number()
27175
- });
27176
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27177
- 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({
27178
- deviceId: number(),
27179
- actionId: NavigationActionIdSchema
27180
- }), _void(), { kind: "mutation" }), method(object({
27181
- deviceId: number(),
27182
- soundId: number().int()
27183
- }), _void(), { kind: "mutation" }), method(object({
27184
- deviceId: number(),
27185
- on: boolean()
27186
- }), _void(), { kind: "mutation" }), method(object({
27187
- deviceId: number(),
27188
- mode: NavigationLightModeSchema,
27189
- level: number().min(40).max(100).optional()
27190
- }), _void(), { kind: "mutation" }), method(object({
27191
- deviceId: number(),
27192
- level: number().min(40).max(100)
27193
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27194
- deviceId: number(),
27195
- status: NavigationStatusSchema
27196
- });
27197
27337
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27198
27338
  kind: "mutation",
27199
27339
  auth: "admin"
@@ -34508,6 +34648,12 @@ Object.freeze({
34508
34648
  addonId: null,
34509
34649
  access: "view"
34510
34650
  },
34651
+ "storage.listDrainProgress": {
34652
+ capName: "storage",
34653
+ capScope: "system",
34654
+ addonId: null,
34655
+ access: "view"
34656
+ },
34511
34657
  "storage.listLocationDeclarations": {
34512
34658
  capName: "storage",
34513
34659
  capScope: "system",
@@ -34652,6 +34798,12 @@ Object.freeze({
34652
34798
  addonId: null,
34653
34799
  access: "view"
34654
34800
  },
34801
+ "storageOccupancy.getOccupancy": {
34802
+ capName: "storage-occupancy",
34803
+ capScope: "system",
34804
+ addonId: null,
34805
+ access: "view"
34806
+ },
34655
34807
  "storageProvider.abortUpload": {
34656
34808
  capName: "storage-provider",
34657
34809
  capScope: "system",