@camstack/addon-provider-homeassistant 1.2.95 → 1.2.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-zAv7pMUz.mjs
1
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -193,6 +193,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
193
193
  EventCategory["ProcessCrashed"] = "process.crashed";
194
194
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
195
195
  EventCategory["ProcessRestarted"] = "process.restarted";
196
+ /**
197
+ * The SET of storage locations changed — one was created, edited, enabled,
198
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
199
+ *
200
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
201
+ * it must also converge on its own periodic path, because a dropped event
202
+ * must not leave a node writing to yesterday's disk set forever. It exists
203
+ * because there was NO signal at all — an operator who added a second
204
+ * recordings disk in the admin UI got nothing, and the recorder kept its
205
+ * resolved locations until something else happened to re-resolve them
206
+ * (D387). Payload `StorageLocationsChangedPayload`.
207
+ */
208
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
196
209
  EventCategory["RecordingStarted"] = "recording.started";
197
210
  EventCategory["RecordingStopped"] = "recording.stopped";
198
211
  EventCategory["RecordingError"] = "recording.error";
@@ -8739,6 +8752,21 @@ var StorageCleanupJobSchema = object({
8739
8752
  });
8740
8753
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8741
8754
  /**
8755
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8756
+ * alias below is `z.infer<>` of it, never a second spelling.
8757
+ */
8758
+ var StorageLocationModeSchema = _enum([
8759
+ "active",
8760
+ "readonly",
8761
+ "drain",
8762
+ "disabled"
8763
+ ]);
8764
+ _enum([
8765
+ "normal",
8766
+ "never",
8767
+ "drain"
8768
+ ]);
8769
+ /**
8742
8770
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8743
8771
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8744
8772
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8804,6 +8832,21 @@ var StorageLocationSchema = object({
8804
8832
  * stops existing rather than being re-derived on every read.
8805
8833
  */
8806
8834
  enabled: boolean().optional(),
8835
+ /**
8836
+ * THE state of this location (D385), and the only authority on what may be
8837
+ * written, read or evicted here. Interpreted in exactly one place —
8838
+ * `storage-location-mode.ts` — which also folds the legacy
8839
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8840
+ * ambiguous.
8841
+ *
8842
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8843
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8844
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8845
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8846
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8847
+ * either, so the two cannot disagree.
8848
+ */
8849
+ mode: StorageLocationModeSchema.optional(),
8807
8850
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8808
8851
  * for node-local locations it can reach) — never persisted, absent when the
8809
8852
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8811,11 +8854,46 @@ var StorageLocationSchema = object({
8811
8854
  totalBytes: number(),
8812
8855
  availableBytes: number()
8813
8856
  }).nullable().optional(),
8857
+ /**
8858
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8859
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8860
+ * never persisted, never a filesystem walk.
8861
+ *
8862
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8863
+ * location yet — nobody stores here, the owning addon is down, or the first
8864
+ * refresh has not completed. A UI must omit the segment rather than draw it
8865
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8866
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8867
+ * be spelled out loud instead of appearing by accident.
8868
+ *
8869
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8870
+ * about the whole figure rather than about its freshest part.
8871
+ */
8872
+ owned: object({
8873
+ bytes: number().int().nonnegative(),
8874
+ measuredAtMs: number().int().nonnegative()
8875
+ }).optional(),
8814
8876
  createdAt: number(),
8815
8877
  updatedAt: number()
8816
8878
  });
8817
8879
  object({ isDefault: boolean().optional() });
8818
8880
  /**
8881
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8882
+ *
8883
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8884
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8885
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8886
+ * operator learns not to believe the screen.
8887
+ */
8888
+ var StorageDrainProgressSchema = object({
8889
+ locationId: string(),
8890
+ startedAtMs: number(),
8891
+ startBytes: number(),
8892
+ bytesRemaining: number(),
8893
+ drained: boolean(),
8894
+ estimatedEmptyAtMs: number().nullable()
8895
+ });
8896
+ /**
8819
8897
  * Reference accepted by consumer-facing `api.storage.*` calls.
8820
8898
  * Either:
8821
8899
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -22329,7 +22407,7 @@ method(object({
22329
22407
  }), _void(), {
22330
22408
  kind: "mutation",
22331
22409
  auth: "admin"
22332
- }), method(object({ id: string() }), object({
22410
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
22333
22411
  ok: boolean(),
22334
22412
  error: string().optional()
22335
22413
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22399,6 +22477,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22399
22477
  kind: "mutation",
22400
22478
  auth: "admin"
22401
22479
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22480
+ /**
22481
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22482
+ * location (D388).
22483
+ *
22484
+ * ## Why this is not `storage-evictable`
22485
+ *
22486
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22487
+ * not, in two ways that both matter and both bite hardest on the locations an
22488
+ * operator most wants a figure for:
22489
+ *
22490
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22491
+ * and `recordingsLow:default` deliberately share one root and evict as one
22492
+ * oldest-first pool, so both answer with the SAME combined total. As an
22493
+ * occupancy figure that double-counts the disk.
22494
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22495
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22496
+ * is retiring and staring at.
22497
+ *
22498
+ * So this is its own contract with its own quantity, and the quantity is
22499
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22500
+ * would ever be willing to delete it. A provider that can only answer
22501
+ * "evictable" must not register here — a number that silently means different
22502
+ * things per class is worse than no number.
22503
+ *
22504
+ * ## Absence is an answer
22505
+ *
22506
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22507
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22508
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22509
+ * consuming side has to be written out loud instead of appearing by accident.
22510
+ *
22511
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22512
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22513
+ */
22514
+ /** One provider's occupancy answer for one location. */
22515
+ var StorageOccupancyReportSchema = object({
22516
+ locationId: string(),
22517
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22518
+ * not net of what it is willing to delete. */
22519
+ ownedBytes: number().int().nonnegative(),
22520
+ /** When the provider last actually measured this. The orchestrator carries it
22521
+ * through so a UI can say how old the figure is instead of implying "now". */
22522
+ measuredAtMs: number().int().nonnegative()
22523
+ });
22524
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22402
22525
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22403
22526
  providerId: string().min(1),
22404
22527
  displayName: string().min(1),
@@ -24306,88 +24429,6 @@ onStatusChanged: { data: object({
24306
24429
  volatileStateFields: ["lastUpdated"]
24307
24430
  };
24308
24431
  /**
24309
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
24310
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24311
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
24312
- * one Home Assistant projection.
24313
- */
24314
- var NetworkLinkStatusSchema = object({
24315
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24316
- type: _enum([
24317
- "wifi",
24318
- "ethernet",
24319
- "cellular",
24320
- "unknown"
24321
- ]),
24322
- /**
24323
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
24324
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24325
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24326
- * one whose reading has not landed must not be drawn at 0 %. Consumers
24327
- * SKIP a null rather than coerce it.
24328
- */
24329
- signalPercent: number().min(0).max(100).nullable(),
24330
- /** Raw received signal strength in dBm, when the firmware reports one. */
24331
- rssiDbm: number().optional(),
24332
- /** Network name of a wireless link, when the firmware reports it. */
24333
- ssid: string().optional(),
24334
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24335
- lastUpdated: number()
24336
- });
24337
- var networkLinkCapability = {
24338
- name: "network-link",
24339
- scope: "device",
24340
- deviceNative: true,
24341
- mode: "singleton",
24342
- deviceTypes: [
24343
- DeviceType.Camera,
24344
- DeviceType.Sensor,
24345
- DeviceType.Button,
24346
- DeviceType.Switch,
24347
- DeviceType.Light,
24348
- DeviceType.Lock,
24349
- DeviceType.Siren
24350
- ],
24351
- methods: {},
24352
- events: {
24353
- /**
24354
- * Emitted whenever the cached status changes (a link switch, a signal
24355
- * reading that moved). Mirrored on the parent chain by the
24356
- * DeviceEventPropagator like `battery.onStatusChanged`.
24357
- */
24358
- onStatusChanged: { data: object({
24359
- deviceId: number(),
24360
- status: NetworkLinkStatusSchema
24361
- }) } },
24362
- status: {
24363
- schema: NetworkLinkStatusSchema,
24364
- kind: "push",
24365
- empty: {
24366
- type: "unknown",
24367
- signalPercent: null,
24368
- lastUpdated: 0
24369
- }
24370
- },
24371
- /**
24372
- * Runtime-state slice — every provider stores the same shape under
24373
- * `device.runtimeState['network-link']`, read once by the badge and the
24374
- * Home Assistant projector regardless of the driver.
24375
- */
24376
- runtimeState: NetworkLinkStatusSchema,
24377
- /**
24378
- * Runtime-state durability: **restored** — a link reading is slow to
24379
- * change and a sleeping battery camera may not report for hours; the
24380
- * restored slice is what the badge shows until the next read.
24381
- *
24382
- * See `RuntimeStateDurability`. Enforced by
24383
- * `scripts/check-runtime-state-durability.ts`.
24384
- */
24385
- durability: "restored",
24386
- /** Clock fields: written, but excluded from the compare that decides
24387
- * whether persisting is worth a SQLite commit. */
24388
- volatileStateFields: ["lastUpdated"]
24389
- };
24390
- /**
24391
24432
  * Generic boolean sensor — last-resort fallback when no domain-
24392
24433
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24393
24434
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -27934,6 +27975,369 @@ var nativeObjectDetectionCapability = {
27934
27975
  volatileStateFields: ["lastFetchedAt"]
27935
27976
  };
27936
27977
  /**
27978
+ * `navigation` — a device-scoped capability that natively expresses the FULL
27979
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
27980
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
27981
+ *
27982
+ * Why a NEW cap rather than overloading `ptz`:
27983
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27984
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27985
+ * The two are different physical models: PTZ is absolute-position + presets,
27986
+ * navigation is momentary drive nudges + discrete robot ACTIONS
27987
+ * (dock / spot-clean / follow-pet / go-to-point / …).
27988
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27989
+ * the reverse:
27990
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
27991
+ * / `getOptions`), and
27992
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27993
+ * robot camera shows up in the existing PTZ control path without every
27994
+ * PTZ provider learning about robots. The mapping lives in the adapter,
27995
+ * not here (see the addon design note):
27996
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27997
+ * ptz.stop() → navigation.stop()
27998
+ * ptz.goHome() → navigation.runAction('goHome')
27999
+ * ptz.getPresets() → navigation.listActions() (id→preset)
28000
+ * ptz.goToPreset(id) → navigation.runAction(id)
28001
+ *
28002
+ * ## Continuous drive
28003
+ *
28004
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
28005
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
28006
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
28007
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
28008
+ * coalesce them. The UI owns the cadence.
28009
+ *
28010
+ * ## The action dictionary
28011
+ *
28012
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
28013
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
28014
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
28015
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
28016
+ * vendor-specific list. `kind: 'action'` entries are triggered with
28017
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
28018
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
28019
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
28020
+ *
28021
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
28022
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
28023
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
28024
+ * every device handle. A future nodedreame publish adds a typed
28025
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
28026
+ * provider can then swap the raw calls for the typed methods with no change to
28027
+ * THIS contract.
28028
+ */
28029
+ /**
28030
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
28031
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
28032
+ * halts it.
28033
+ *
28034
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
28035
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
28036
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
28037
+ * vector by it (drivers without proportional drive ignore it).
28038
+ *
28039
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
28040
+ * axis alone; an all-undefined nudge is a no-op.
28041
+ */
28042
+ var NavigationMoveCommandSchema = object({
28043
+ pan: number().min(-1).max(1).optional(),
28044
+ tilt: number().min(-1).max(1).optional(),
28045
+ speed: number().min(0).max(1).optional()
28046
+ });
28047
+ /**
28048
+ * The enumerated discrete actions a navigation-capable robot can perform via
28049
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
28050
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
28051
+ * `playSound` (see the `sound` dictionary entries).
28052
+ */
28053
+ var NavigationActionIdSchema = _enum([
28054
+ "goHome",
28055
+ "locate",
28056
+ "spotClean",
28057
+ "findPet",
28058
+ "personFollow",
28059
+ "stop",
28060
+ "startClean",
28061
+ "pauseClean",
28062
+ "dockWash",
28063
+ "autoEmpty",
28064
+ "flashOn",
28065
+ "flashOff"
28066
+ ]);
28067
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
28068
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
28069
+ /**
28070
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
28071
+ * native panel and the PTZ mimic render as a button.
28072
+ *
28073
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
28074
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
28075
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
28076
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
28077
+ * - `label` — operator-facing English label.
28078
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
28079
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
28080
+ * PTZ render ONLY enabled entries. Data-driven: the provider
28081
+ * flips it from config, never by editing code.
28082
+ */
28083
+ var NavigationActionEntrySchema = object({
28084
+ id: string(),
28085
+ kind: NavigationEntryKindSchema,
28086
+ label: string(),
28087
+ icon: string(),
28088
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
28089
+ soundId: number().int().optional(),
28090
+ /** Per-device feature flag — render this entry only when true. */
28091
+ enabled: boolean()
28092
+ });
28093
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
28094
+ var NavigationPointSchema = object({
28095
+ x: number(),
28096
+ y: number()
28097
+ });
28098
+ /**
28099
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
28100
+ * The cap reports which are enabled so the UI / PTZ render only the controls
28101
+ * that are turned on for THIS device. Data-driven: the provider derives these
28102
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
28103
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
28104
+ * that are not dictionary entries.
28105
+ *
28106
+ * - `move` / `stop` — the momentary drive joystick.
28107
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
28108
+ * map-coordinate plumbing is wired.
28109
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
28110
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
28111
+ * - `light` — the on/off fill-light toggle (works anytime).
28112
+ * - `lightMode` — the auto/manual selector + manual level slider (a
28113
+ * camera-service control; needs an active stream).
28114
+ */
28115
+ var NavigationFeaturesSchema = object({
28116
+ move: boolean(),
28117
+ stop: boolean(),
28118
+ goToPoint: boolean(),
28119
+ runAction: boolean(),
28120
+ playSound: boolean(),
28121
+ light: boolean(),
28122
+ lightMode: boolean()
28123
+ });
28124
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
28125
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
28126
+ /**
28127
+ * Live navigation state so the UI can reflect what the robot is doing:
28128
+ * - `mode` — coarse activity (idle / cleaning / following / …).
28129
+ * - `following` — person/pet follow is currently armed.
28130
+ * - `flash` — the on-camera fill light is on.
28131
+ * - `lightMode` — auto vs manual fill-light mode.
28132
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
28133
+ * `lightMode === 'manual'`.
28134
+ */
28135
+ var NavigationStatusSchema = object({
28136
+ mode: _enum([
28137
+ "idle",
28138
+ "cleaning",
28139
+ "spot",
28140
+ "following",
28141
+ "goto",
28142
+ "returning",
28143
+ "paused",
28144
+ "unknown"
28145
+ ]),
28146
+ following: boolean(),
28147
+ flash: boolean(),
28148
+ lightMode: NavigationLightModeSchema,
28149
+ lightLevel: number().min(40).max(100),
28150
+ /** Ms epoch when the slice was last updated. */
28151
+ lastChangedAt: number()
28152
+ });
28153
+ /**
28154
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
28155
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
28156
+ * convention.
28157
+ */
28158
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
28159
+ var navigationCapability = {
28160
+ name: "navigation",
28161
+ scope: "device",
28162
+ deviceNative: true,
28163
+ mode: "singleton",
28164
+ deviceTypes: [DeviceType.Camera],
28165
+ deviceConfig: { ui: {
28166
+ kind: "widget",
28167
+ widgetId: "host/navigation-panel",
28168
+ tab: "navigation",
28169
+ topTab: true,
28170
+ label: "Navigation",
28171
+ order: 0
28172
+ } },
28173
+ methods: {
28174
+ /**
28175
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
28176
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
28177
+ * path) works for any authenticated user, not admin-only. The UI sends
28178
+ * these at ~1 Hz while a control is held; the provider forwards each one to
28179
+ * a single drive write WITHOUT debouncing.
28180
+ */
28181
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
28182
+ /** Halt all motion immediately (zero drive vector). */
28183
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
28184
+ /** Send the robot to a point on its live map. */
28185
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
28186
+ /**
28187
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
28188
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
28189
+ */
28190
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
28191
+ /**
28192
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
28193
+ * unsupported action ids are rejected by the provider.
28194
+ */
28195
+ runAction: method(object({
28196
+ deviceId: number(),
28197
+ actionId: NavigationActionIdSchema
28198
+ }), _void(), { kind: "mutation" }),
28199
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
28200
+ playSound: method(object({
28201
+ deviceId: number(),
28202
+ soundId: number().int()
28203
+ }), _void(), { kind: "mutation" }),
28204
+ /**
28205
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
28206
+ * works anytime, no active stream required).
28207
+ */
28208
+ setLightOn: method(object({
28209
+ deviceId: number(),
28210
+ on: boolean()
28211
+ }), _void(), { kind: "mutation" }),
28212
+ /**
28213
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
28214
+ * initial `level`. The auto/manual + level control is a CAMERA-service
28215
+ * action that generally needs an active camera stream/monitor session — the
28216
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
28217
+ */
28218
+ setLightMode: method(object({
28219
+ deviceId: number(),
28220
+ mode: NavigationLightModeSchema,
28221
+ level: number().min(40).max(100).optional()
28222
+ }), _void(), { kind: "mutation" }),
28223
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
28224
+ setLightLevel: method(object({
28225
+ deviceId: number(),
28226
+ level: number().min(40).max(100)
28227
+ }), _void(), { kind: "mutation" }),
28228
+ /**
28229
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
28230
+ * controls the UI shows (the per-entry flags for the dictionary come back on
28231
+ * `listActions`).
28232
+ */
28233
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
28234
+ },
28235
+ events: { onStatusChanged: { data: object({
28236
+ deviceId: number(),
28237
+ status: NavigationStatusSchema
28238
+ }) } },
28239
+ status: {
28240
+ schema: NavigationStatusSchema,
28241
+ kind: "push"
28242
+ },
28243
+ /**
28244
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
28245
+ * for live mode / follow / flash changes.
28246
+ */
28247
+ runtimeState: NavigationRuntimeStateSchema,
28248
+ /**
28249
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
28250
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
28251
+ * that. The live handle re-publishes on connect.
28252
+ *
28253
+ * See `RuntimeStateDurability`. Enforced by
28254
+ * `scripts/check-runtime-state-durability.ts`.
28255
+ */
28256
+ durability: "session"
28257
+ };
28258
+ /**
28259
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
28260
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
28261
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
28262
+ * one Home Assistant projection.
28263
+ */
28264
+ var NetworkLinkStatusSchema = object({
28265
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
28266
+ type: _enum([
28267
+ "wifi",
28268
+ "ethernet",
28269
+ "cellular",
28270
+ "unknown"
28271
+ ]),
28272
+ /**
28273
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
28274
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
28275
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
28276
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
28277
+ * SKIP a null rather than coerce it.
28278
+ */
28279
+ signalPercent: number().min(0).max(100).nullable(),
28280
+ /** Raw received signal strength in dBm, when the firmware reports one. */
28281
+ rssiDbm: number().optional(),
28282
+ /** Network name of a wireless link, when the firmware reports it. */
28283
+ ssid: string().optional(),
28284
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
28285
+ lastUpdated: number()
28286
+ });
28287
+ var networkLinkCapability = {
28288
+ name: "network-link",
28289
+ scope: "device",
28290
+ deviceNative: true,
28291
+ mode: "singleton",
28292
+ deviceTypes: [
28293
+ DeviceType.Camera,
28294
+ DeviceType.Sensor,
28295
+ DeviceType.Button,
28296
+ DeviceType.Switch,
28297
+ DeviceType.Light,
28298
+ DeviceType.Lock,
28299
+ DeviceType.Siren
28300
+ ],
28301
+ methods: {},
28302
+ events: {
28303
+ /**
28304
+ * Emitted whenever the cached status changes (a link switch, a signal
28305
+ * reading that moved). Mirrored on the parent chain by the
28306
+ * DeviceEventPropagator like `battery.onStatusChanged`.
28307
+ */
28308
+ onStatusChanged: { data: object({
28309
+ deviceId: number(),
28310
+ status: NetworkLinkStatusSchema
28311
+ }) } },
28312
+ status: {
28313
+ schema: NetworkLinkStatusSchema,
28314
+ kind: "push",
28315
+ empty: {
28316
+ type: "unknown",
28317
+ signalPercent: null,
28318
+ lastUpdated: 0
28319
+ }
28320
+ },
28321
+ /**
28322
+ * Runtime-state slice — every provider stores the same shape under
28323
+ * `device.runtimeState['network-link']`, read once by the badge and the
28324
+ * Home Assistant projector regardless of the driver.
28325
+ */
28326
+ runtimeState: NetworkLinkStatusSchema,
28327
+ /**
28328
+ * Runtime-state durability: **restored** — a link reading is slow to
28329
+ * change and a sleeping battery camera may not report for hours; the
28330
+ * restored slice is what the badge shows until the next read.
28331
+ *
28332
+ * See `RuntimeStateDurability`. Enforced by
28333
+ * `scripts/check-runtime-state-durability.ts`.
28334
+ */
28335
+ durability: "restored",
28336
+ /** Clock fields: written, but excluded from the compare that decides
28337
+ * whether persisting is worth a SQLite commit. */
28338
+ volatileStateFields: ["lastUpdated"]
28339
+ };
28340
+ /**
27937
28341
  * network-quality — system-scoped singleton capability tracking RTT,
27938
28342
  * jitter, and observed/peak bandwidth per device + per client.
27939
28343
  *
@@ -29514,287 +29918,6 @@ var ptzAutotrackCapability = {
29514
29918
  */
29515
29919
  durability: "session"
29516
29920
  };
29517
- /**
29518
- * `navigation` — a device-scoped capability that natively expresses the FULL
29519
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
29520
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
29521
- *
29522
- * Why a NEW cap rather than overloading `ptz`:
29523
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29524
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29525
- * The two are different physical models: PTZ is absolute-position + presets,
29526
- * navigation is momentary drive nudges + discrete robot ACTIONS
29527
- * (dock / spot-clean / follow-pet / go-to-point / …).
29528
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29529
- * the reverse:
29530
- * 1. a native CamStack navigation panel (data-driven from `listActions`
29531
- * / `getOptions`), and
29532
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29533
- * robot camera shows up in the existing PTZ control path without every
29534
- * PTZ provider learning about robots. The mapping lives in the adapter,
29535
- * not here (see the addon design note):
29536
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29537
- * ptz.stop() → navigation.stop()
29538
- * ptz.goHome() → navigation.runAction('goHome')
29539
- * ptz.getPresets() → navigation.listActions() (id→preset)
29540
- * ptz.goToPreset(id) → navigation.runAction(id)
29541
- *
29542
- * ## Continuous drive
29543
- *
29544
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29545
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29546
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29547
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29548
- * coalesce them. The UI owns the cadence.
29549
- *
29550
- * ## The action dictionary
29551
- *
29552
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29553
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29554
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29555
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29556
- * vendor-specific list. `kind: 'action'` entries are triggered with
29557
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29558
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
29559
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29560
- *
29561
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29562
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29563
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
29564
- * every device handle. A future nodedreame publish adds a typed
29565
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29566
- * provider can then swap the raw calls for the typed methods with no change to
29567
- * THIS contract.
29568
- */
29569
- /**
29570
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29571
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29572
- * halts it.
29573
- *
29574
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
29575
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29576
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29577
- * vector by it (drivers without proportional drive ignore it).
29578
- *
29579
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29580
- * axis alone; an all-undefined nudge is a no-op.
29581
- */
29582
- var NavigationMoveCommandSchema = object({
29583
- pan: number().min(-1).max(1).optional(),
29584
- tilt: number().min(-1).max(1).optional(),
29585
- speed: number().min(0).max(1).optional()
29586
- });
29587
- /**
29588
- * The enumerated discrete actions a navigation-capable robot can perform via
29589
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29590
- * subset it supports through `listActions`. Sounds are NOT here — they go through
29591
- * `playSound` (see the `sound` dictionary entries).
29592
- */
29593
- var NavigationActionIdSchema = _enum([
29594
- "goHome",
29595
- "locate",
29596
- "spotClean",
29597
- "findPet",
29598
- "personFollow",
29599
- "stop",
29600
- "startClean",
29601
- "pauseClean",
29602
- "dockWash",
29603
- "autoEmpty",
29604
- "flashOn",
29605
- "flashOff"
29606
- ]);
29607
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29608
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
29609
- /**
29610
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29611
- * native panel and the PTZ mimic render as a button.
29612
- *
29613
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29614
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29615
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
29616
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29617
- * - `label` — operator-facing English label.
29618
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29619
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29620
- * PTZ render ONLY enabled entries. Data-driven: the provider
29621
- * flips it from config, never by editing code.
29622
- */
29623
- var NavigationActionEntrySchema = object({
29624
- id: string(),
29625
- kind: NavigationEntryKindSchema,
29626
- label: string(),
29627
- icon: string(),
29628
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29629
- soundId: number().int().optional(),
29630
- /** Per-device feature flag — render this entry only when true. */
29631
- enabled: boolean()
29632
- });
29633
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
29634
- var NavigationPointSchema = object({
29635
- x: number(),
29636
- y: number()
29637
- });
29638
- /**
29639
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29640
- * The cap reports which are enabled so the UI / PTZ render only the controls
29641
- * that are turned on for THIS device. Data-driven: the provider derives these
29642
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29643
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29644
- * that are not dictionary entries.
29645
- *
29646
- * - `move` / `stop` — the momentary drive joystick.
29647
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29648
- * map-coordinate plumbing is wired.
29649
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29650
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29651
- * - `light` — the on/off fill-light toggle (works anytime).
29652
- * - `lightMode` — the auto/manual selector + manual level slider (a
29653
- * camera-service control; needs an active stream).
29654
- */
29655
- var NavigationFeaturesSchema = object({
29656
- move: boolean(),
29657
- stop: boolean(),
29658
- goToPoint: boolean(),
29659
- runAction: boolean(),
29660
- playSound: boolean(),
29661
- light: boolean(),
29662
- lightMode: boolean()
29663
- });
29664
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29665
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
29666
- /**
29667
- * Live navigation state so the UI can reflect what the robot is doing:
29668
- * - `mode` — coarse activity (idle / cleaning / following / …).
29669
- * - `following` — person/pet follow is currently armed.
29670
- * - `flash` — the on-camera fill light is on.
29671
- * - `lightMode` — auto vs manual fill-light mode.
29672
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
29673
- * `lightMode === 'manual'`.
29674
- */
29675
- var NavigationStatusSchema = object({
29676
- mode: _enum([
29677
- "idle",
29678
- "cleaning",
29679
- "spot",
29680
- "following",
29681
- "goto",
29682
- "returning",
29683
- "paused",
29684
- "unknown"
29685
- ]),
29686
- following: boolean(),
29687
- flash: boolean(),
29688
- lightMode: NavigationLightModeSchema,
29689
- lightLevel: number().min(40).max(100),
29690
- /** Ms epoch when the slice was last updated. */
29691
- lastChangedAt: number()
29692
- });
29693
- /**
29694
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29695
- * observable). Adds `lastFetchedAt` on top of the status shape per the
29696
- * convention.
29697
- */
29698
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29699
- var navigationCapability = {
29700
- name: "navigation",
29701
- scope: "device",
29702
- deviceNative: true,
29703
- mode: "singleton",
29704
- deviceTypes: [DeviceType.Camera],
29705
- deviceConfig: { ui: {
29706
- kind: "widget",
29707
- widgetId: "host/navigation-panel",
29708
- tab: "navigation",
29709
- topTab: true,
29710
- label: "Navigation",
29711
- order: 0
29712
- } },
29713
- methods: {
29714
- /**
29715
- * Momentary drive nudge (the robot moves). `protected` — mirrors
29716
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29717
- * path) works for any authenticated user, not admin-only. The UI sends
29718
- * these at ~1 Hz while a control is held; the provider forwards each one to
29719
- * a single drive write WITHOUT debouncing.
29720
- */
29721
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29722
- /** Halt all motion immediately (zero drive vector). */
29723
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29724
- /** Send the robot to a point on its live map. */
29725
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29726
- /**
29727
- * Enumerate the discrete controls THIS device supports (data-driven UI +
29728
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29729
- */
29730
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29731
- /**
29732
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29733
- * unsupported action ids are rejected by the provider.
29734
- */
29735
- runAction: method(object({
29736
- deviceId: number(),
29737
- actionId: NavigationActionIdSchema
29738
- }), _void(), { kind: "mutation" }),
29739
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29740
- playSound: method(object({
29741
- deviceId: number(),
29742
- soundId: number().int()
29743
- }), _void(), { kind: "mutation" }),
29744
- /**
29745
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29746
- * works anytime, no active stream required).
29747
- */
29748
- setLightOn: method(object({
29749
- deviceId: number(),
29750
- on: boolean()
29751
- }), _void(), { kind: "mutation" }),
29752
- /**
29753
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29754
- * initial `level`. The auto/manual + level control is a CAMERA-service
29755
- * action that generally needs an active camera stream/monitor session — the
29756
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
29757
- */
29758
- setLightMode: method(object({
29759
- deviceId: number(),
29760
- mode: NavigationLightModeSchema,
29761
- level: number().min(40).max(100).optional()
29762
- }), _void(), { kind: "mutation" }),
29763
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29764
- setLightLevel: method(object({
29765
- deviceId: number(),
29766
- level: number().min(40).max(100)
29767
- }), _void(), { kind: "mutation" }),
29768
- /**
29769
- * Per-device FEATURE-FLAG report for the general primitives — drives which
29770
- * controls the UI shows (the per-entry flags for the dictionary come back on
29771
- * `listActions`).
29772
- */
29773
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29774
- },
29775
- events: { onStatusChanged: { data: object({
29776
- deviceId: number(),
29777
- status: NavigationStatusSchema
29778
- }) } },
29779
- status: {
29780
- schema: NavigationStatusSchema,
29781
- kind: "push"
29782
- },
29783
- /**
29784
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29785
- * for live mode / follow / flash changes.
29786
- */
29787
- runtimeState: NavigationRuntimeStateSchema,
29788
- /**
29789
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
29790
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
29791
- * that. The live handle re-publishes on connect.
29792
- *
29793
- * See `RuntimeStateDurability`. Enforced by
29794
- * `scripts/check-runtime-state-durability.ts`.
29795
- */
29796
- durability: "session"
29797
- };
29798
29921
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29799
29922
  kind: "mutation",
29800
29923
  auth: "admin"
@@ -39257,6 +39380,12 @@ Object.freeze({
39257
39380
  addonId: null,
39258
39381
  access: "view"
39259
39382
  },
39383
+ "storage.listDrainProgress": {
39384
+ capName: "storage",
39385
+ capScope: "system",
39386
+ addonId: null,
39387
+ access: "view"
39388
+ },
39260
39389
  "storage.listLocationDeclarations": {
39261
39390
  capName: "storage",
39262
39391
  capScope: "system",
@@ -39401,6 +39530,12 @@ Object.freeze({
39401
39530
  addonId: null,
39402
39531
  access: "view"
39403
39532
  },
39533
+ "storageOccupancy.getOccupancy": {
39534
+ capName: "storage-occupancy",
39535
+ capScope: "system",
39536
+ addonId: null,
39537
+ access: "view"
39538
+ },
39404
39539
  "storageProvider.abortUpload": {
39405
39540
  capName: "storage-provider",
39406
39541
  capScope: "system",