@camstack/addon-ai 0.4.81 → 0.4.83

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.
Files changed (3) hide show
  1. package/dist/addon.js +385 -233
  2. package/dist/addon.mjs +385 -233
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -39,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
39
39
  }) : target, 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";
@@ -8766,6 +8779,21 @@ var StorageCleanupJobSchema = object({
8766
8779
  });
8767
8780
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8768
8781
  /**
8782
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8783
+ * alias below is `z.infer<>` of it, never a second spelling.
8784
+ */
8785
+ var StorageLocationModeSchema = _enum([
8786
+ "active",
8787
+ "readonly",
8788
+ "drain",
8789
+ "disabled"
8790
+ ]);
8791
+ _enum([
8792
+ "normal",
8793
+ "never",
8794
+ "drain"
8795
+ ]);
8796
+ /**
8769
8797
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8770
8798
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8771
8799
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8831,6 +8859,21 @@ var StorageLocationSchema = object({
8831
8859
  * stops existing rather than being re-derived on every read.
8832
8860
  */
8833
8861
  enabled: boolean().optional(),
8862
+ /**
8863
+ * THE state of this location (D385), and the only authority on what may be
8864
+ * written, read or evicted here. Interpreted in exactly one place —
8865
+ * `storage-location-mode.ts` — which also folds the legacy
8866
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8867
+ * ambiguous.
8868
+ *
8869
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8870
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8871
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8872
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8873
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8874
+ * either, so the two cannot disagree.
8875
+ */
8876
+ mode: StorageLocationModeSchema.optional(),
8834
8877
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8835
8878
  * for node-local locations it can reach) — never persisted, absent when the
8836
8879
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8838,11 +8881,46 @@ var StorageLocationSchema = object({
8838
8881
  totalBytes: number$1(),
8839
8882
  availableBytes: number$1()
8840
8883
  }).nullable().optional(),
8884
+ /**
8885
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8886
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8887
+ * never persisted, never a filesystem walk.
8888
+ *
8889
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8890
+ * location yet — nobody stores here, the owning addon is down, or the first
8891
+ * refresh has not completed. A UI must omit the segment rather than draw it
8892
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8893
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8894
+ * be spelled out loud instead of appearing by accident.
8895
+ *
8896
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8897
+ * about the whole figure rather than about its freshest part.
8898
+ */
8899
+ owned: object({
8900
+ bytes: number$1().int().nonnegative(),
8901
+ measuredAtMs: number$1().int().nonnegative()
8902
+ }).optional(),
8841
8903
  createdAt: number$1(),
8842
8904
  updatedAt: number$1()
8843
8905
  });
8844
8906
  object({ isDefault: boolean().optional() });
8845
8907
  /**
8908
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8909
+ *
8910
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8911
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8912
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8913
+ * operator learns not to believe the screen.
8914
+ */
8915
+ var StorageDrainProgressSchema = object({
8916
+ locationId: string(),
8917
+ startedAtMs: number$1(),
8918
+ startBytes: number$1(),
8919
+ bytesRemaining: number$1(),
8920
+ drained: boolean(),
8921
+ estimatedEmptyAtMs: number$1().nullable()
8922
+ });
8923
+ /**
8846
8924
  * Reference accepted by consumer-facing `api.storage.*` calls.
8847
8925
  * Either:
8848
8926
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -20377,8 +20455,25 @@ var occupancyRecheckFramesField = {
20377
20455
  * (analyzer attaches detected `regions[]`; onboard does not — the
20378
20456
  * camera typically only reports a binary signal plus an optional
20379
20457
  * channel/AI class which lives in dedicated event channels).
20458
+ *
20459
+ * - `onboard` — the camera's firmware said something moved.
20460
+ * - `analyzer` — this runner's frame-diff said so, and attaches `regions[]`.
20461
+ * - `device-activity` — the DEVICE said it is doing its job: the
20462
+ * `recording-signal` LEVEL the same device raises for the recorder
20463
+ * ([D380](../../../../docs/decisions/adr-0380-a-device-decided-recording-is-a-mode-with-no-schedule-seeded-once.md)),
20464
+ * republished as a motion source. It attaches **nothing** — no regions, no
20465
+ * class: the only fact it carries is that the device is active, and a robot
20466
+ * vacuum that is itself the moving object has no region worth sending. It is
20467
+ * a LEVEL, so unlike `onboard` it has a real falling edge, and unlike
20468
+ * `analyzer` it must not open the frame-diff side-channel — the runner's
20469
+ * `handleOnboardMotionAnalyzer` gate is `source === 'onboard'` and stays that
20470
+ * way ([D392](../../../../docs/decisions/adr-0392-a-device-that-says-it-is-working-is-a-motion-source-of-its-own.md)).
20380
20471
  */
20381
- var MotionSourceEnum = _enum(["onboard", "analyzer"]);
20472
+ var MotionSourceEnum = _enum([
20473
+ "onboard",
20474
+ "analyzer",
20475
+ "device-activity"
20476
+ ]);
20382
20477
  /**
20383
20478
  * List of motion sources active on a camera. Empty array is valid:
20384
20479
  * "no source" — happens for battery cams without firmware motion when
@@ -21897,7 +21992,7 @@ method(object({
21897
21992
  }), _void(), {
21898
21993
  kind: "mutation",
21899
21994
  auth: "admin"
21900
- }), method(object({ id: string() }), object({
21995
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21901
21996
  ok: boolean(),
21902
21997
  error: string().optional()
21903
21998
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21967,6 +22062,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21967
22062
  kind: "mutation",
21968
22063
  auth: "admin"
21969
22064
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22065
+ /**
22066
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22067
+ * location (D388).
22068
+ *
22069
+ * ## Why this is not `storage-evictable`
22070
+ *
22071
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22072
+ * not, in two ways that both matter and both bite hardest on the locations an
22073
+ * operator most wants a figure for:
22074
+ *
22075
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22076
+ * and `recordingsLow:default` deliberately share one root and evict as one
22077
+ * oldest-first pool, so both answer with the SAME combined total. As an
22078
+ * occupancy figure that double-counts the disk.
22079
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22080
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22081
+ * is retiring and staring at.
22082
+ *
22083
+ * So this is its own contract with its own quantity, and the quantity is
22084
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22085
+ * would ever be willing to delete it. A provider that can only answer
22086
+ * "evictable" must not register here — a number that silently means different
22087
+ * things per class is worse than no number.
22088
+ *
22089
+ * ## Absence is an answer
22090
+ *
22091
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22092
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22093
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22094
+ * consuming side has to be written out loud instead of appearing by accident.
22095
+ *
22096
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22097
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22098
+ */
22099
+ /** One provider's occupancy answer for one location. */
22100
+ var StorageOccupancyReportSchema = object({
22101
+ locationId: string(),
22102
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22103
+ * not net of what it is willing to delete. */
22104
+ ownedBytes: number$1().int().nonnegative(),
22105
+ /** When the provider last actually measured this. The orchestrator carries it
22106
+ * through so a UI can say how old the figure is instead of implying "now". */
22107
+ measuredAtMs: number$1().int().nonnegative()
22108
+ });
22109
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21970
22110
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21971
22111
  providerId: string().min(1),
21972
22112
  displayName: string().min(1),
@@ -23602,39 +23742,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23602
23742
  deviceId: number$1(),
23603
23743
  status: BatteryStatusSchema
23604
23744
  });
23605
- /**
23606
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23607
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23608
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23609
- * one Home Assistant projection.
23610
- */
23611
- var NetworkLinkStatusSchema = object({
23612
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23613
- type: _enum([
23614
- "wifi",
23615
- "ethernet",
23616
- "cellular",
23617
- "unknown"
23618
- ]),
23619
- /**
23620
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23621
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23622
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23623
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23624
- * SKIP a null rather than coerce it.
23625
- */
23626
- signalPercent: number$1().min(0).max(100).nullable(),
23627
- /** Raw received signal strength in dBm, when the firmware reports one. */
23628
- rssiDbm: number$1().optional(),
23629
- /** Network name of a wireless link, when the firmware reports it. */
23630
- ssid: string().optional(),
23631
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23632
- lastUpdated: number$1()
23633
- });
23634
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23635
- deviceId: number$1(),
23636
- status: NetworkLinkStatusSchema
23637
- });
23638
23745
  object({
23639
23746
  on: boolean(),
23640
23747
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25988,6 +26095,236 @@ DeviceType.Camera, method(object({
25988
26095
  detection: NativeDetectionSchema
25989
26096
  });
25990
26097
  /**
26098
+ * `navigation` — a device-scoped capability that natively expresses the FULL
26099
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
26100
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
26101
+ *
26102
+ * Why a NEW cap rather than overloading `ptz`:
26103
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
26104
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
26105
+ * The two are different physical models: PTZ is absolute-position + presets,
26106
+ * navigation is momentary drive nudges + discrete robot ACTIONS
26107
+ * (dock / spot-clean / follow-pet / go-to-point / …).
26108
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
26109
+ * the reverse:
26110
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
26111
+ * / `getOptions`), and
26112
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
26113
+ * robot camera shows up in the existing PTZ control path without every
26114
+ * PTZ provider learning about robots. The mapping lives in the adapter,
26115
+ * not here (see the addon design note):
26116
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
26117
+ * ptz.stop() → navigation.stop()
26118
+ * ptz.goHome() → navigation.runAction('goHome')
26119
+ * ptz.getPresets() → navigation.listActions() (id→preset)
26120
+ * ptz.goToPreset(id) → navigation.runAction(id)
26121
+ *
26122
+ * ## Continuous drive
26123
+ *
26124
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
26125
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
26126
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
26127
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
26128
+ * coalesce them. The UI owns the cadence.
26129
+ *
26130
+ * ## The action dictionary
26131
+ *
26132
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
26133
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
26134
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
26135
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
26136
+ * vendor-specific list. `kind: 'action'` entries are triggered with
26137
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
26138
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
26139
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26140
+ *
26141
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26142
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26143
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
26144
+ * every device handle. A future nodedreame publish adds a typed
26145
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
26146
+ * provider can then swap the raw calls for the typed methods with no change to
26147
+ * THIS contract.
26148
+ */
26149
+ /**
26150
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
26151
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
26152
+ * halts it.
26153
+ *
26154
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
26155
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26156
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26157
+ * vector by it (drivers without proportional drive ignore it).
26158
+ *
26159
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26160
+ * axis alone; an all-undefined nudge is a no-op.
26161
+ */
26162
+ var NavigationMoveCommandSchema = object({
26163
+ pan: number$1().min(-1).max(1).optional(),
26164
+ tilt: number$1().min(-1).max(1).optional(),
26165
+ speed: number$1().min(0).max(1).optional()
26166
+ });
26167
+ /**
26168
+ * The enumerated discrete actions a navigation-capable robot can perform via
26169
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26170
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26171
+ * `playSound` (see the `sound` dictionary entries).
26172
+ */
26173
+ var NavigationActionIdSchema = _enum([
26174
+ "goHome",
26175
+ "locate",
26176
+ "spotClean",
26177
+ "findPet",
26178
+ "personFollow",
26179
+ "stop",
26180
+ "startClean",
26181
+ "pauseClean",
26182
+ "dockWash",
26183
+ "autoEmpty",
26184
+ "flashOn",
26185
+ "flashOff"
26186
+ ]);
26187
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
26188
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
26189
+ /**
26190
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
26191
+ * native panel and the PTZ mimic render as a button.
26192
+ *
26193
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
26194
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
26195
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
26196
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
26197
+ * - `label` — operator-facing English label.
26198
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
26199
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
26200
+ * PTZ render ONLY enabled entries. Data-driven: the provider
26201
+ * flips it from config, never by editing code.
26202
+ */
26203
+ var NavigationActionEntrySchema = object({
26204
+ id: string(),
26205
+ kind: NavigationEntryKindSchema,
26206
+ label: string(),
26207
+ icon: string(),
26208
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
26209
+ soundId: number$1().int().optional(),
26210
+ /** Per-device feature flag — render this entry only when true. */
26211
+ enabled: boolean()
26212
+ });
26213
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
26214
+ var NavigationPointSchema = object({
26215
+ x: number$1(),
26216
+ y: number$1()
26217
+ });
26218
+ /**
26219
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
26220
+ * The cap reports which are enabled so the UI / PTZ render only the controls
26221
+ * that are turned on for THIS device. Data-driven: the provider derives these
26222
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
26223
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
26224
+ * that are not dictionary entries.
26225
+ *
26226
+ * - `move` / `stop` — the momentary drive joystick.
26227
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26228
+ * map-coordinate plumbing is wired.
26229
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26230
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26231
+ * - `light` — the on/off fill-light toggle (works anytime).
26232
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26233
+ * camera-service control; needs an active stream).
26234
+ */
26235
+ var NavigationFeaturesSchema = object({
26236
+ move: boolean(),
26237
+ stop: boolean(),
26238
+ goToPoint: boolean(),
26239
+ runAction: boolean(),
26240
+ playSound: boolean(),
26241
+ light: boolean(),
26242
+ lightMode: boolean()
26243
+ });
26244
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26245
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26246
+ /**
26247
+ * Live navigation state so the UI can reflect what the robot is doing:
26248
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26249
+ * - `following` — person/pet follow is currently armed.
26250
+ * - `flash` — the on-camera fill light is on.
26251
+ * - `lightMode` — auto vs manual fill-light mode.
26252
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26253
+ * `lightMode === 'manual'`.
26254
+ */
26255
+ var NavigationStatusSchema = object({
26256
+ mode: _enum([
26257
+ "idle",
26258
+ "cleaning",
26259
+ "spot",
26260
+ "following",
26261
+ "goto",
26262
+ "returning",
26263
+ "paused",
26264
+ "unknown"
26265
+ ]),
26266
+ following: boolean(),
26267
+ flash: boolean(),
26268
+ lightMode: NavigationLightModeSchema,
26269
+ lightLevel: number$1().min(40).max(100),
26270
+ /** Ms epoch when the slice was last updated. */
26271
+ lastChangedAt: number$1()
26272
+ });
26273
+ NavigationStatusSchema.extend({ lastFetchedAt: number$1() });
26274
+ DeviceType.Camera, method(NavigationMoveCommandSchema.extend({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(NavigationPointSchema.extend({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), array(NavigationActionEntrySchema)), method(object({
26275
+ deviceId: number$1(),
26276
+ actionId: NavigationActionIdSchema
26277
+ }), _void(), { kind: "mutation" }), method(object({
26278
+ deviceId: number$1(),
26279
+ soundId: number$1().int()
26280
+ }), _void(), { kind: "mutation" }), method(object({
26281
+ deviceId: number$1(),
26282
+ on: boolean()
26283
+ }), _void(), { kind: "mutation" }), method(object({
26284
+ deviceId: number$1(),
26285
+ mode: NavigationLightModeSchema,
26286
+ level: number$1().min(40).max(100).optional()
26287
+ }), _void(), { kind: "mutation" }), method(object({
26288
+ deviceId: number$1(),
26289
+ level: number$1().min(40).max(100)
26290
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), NavigationFeaturesSchema), object({
26291
+ deviceId: number$1(),
26292
+ status: NavigationStatusSchema
26293
+ });
26294
+ /**
26295
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26296
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26297
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26298
+ * one Home Assistant projection.
26299
+ */
26300
+ var NetworkLinkStatusSchema = object({
26301
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26302
+ type: _enum([
26303
+ "wifi",
26304
+ "ethernet",
26305
+ "cellular",
26306
+ "unknown"
26307
+ ]),
26308
+ /**
26309
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26310
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26311
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26312
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26313
+ * SKIP a null rather than coerce it.
26314
+ */
26315
+ signalPercent: number$1().min(0).max(100).nullable(),
26316
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26317
+ rssiDbm: number$1().optional(),
26318
+ /** Network name of a wireless link, when the firmware reports it. */
26319
+ ssid: string().optional(),
26320
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26321
+ lastUpdated: number$1()
26322
+ });
26323
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26324
+ deviceId: number$1(),
26325
+ status: NetworkLinkStatusSchema
26326
+ });
26327
+ /**
25991
26328
  * network-quality — system-scoped singleton capability tracking RTT,
25992
26329
  * jitter, and observed/peak bandwidth per device + per client.
25993
26330
  *
@@ -27229,203 +27566,6 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), PtzAutotrackStatusSc
27229
27566
  deviceId: number$1(),
27230
27567
  status: PtzAutotrackStatusSchema
27231
27568
  });
27232
- /**
27233
- * `navigation` — a device-scoped capability that natively expresses the FULL
27234
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
27235
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
27236
- *
27237
- * Why a NEW cap rather than overloading `ptz`:
27238
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27239
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27240
- * The two are different physical models: PTZ is absolute-position + presets,
27241
- * navigation is momentary drive nudges + discrete robot ACTIONS
27242
- * (dock / spot-clean / follow-pet / go-to-point / …).
27243
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27244
- * the reverse:
27245
- * 1. a native CamStack navigation panel (data-driven from `listActions`
27246
- * / `getOptions`), and
27247
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27248
- * robot camera shows up in the existing PTZ control path without every
27249
- * PTZ provider learning about robots. The mapping lives in the adapter,
27250
- * not here (see the addon design note):
27251
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27252
- * ptz.stop() → navigation.stop()
27253
- * ptz.goHome() → navigation.runAction('goHome')
27254
- * ptz.getPresets() → navigation.listActions() (id→preset)
27255
- * ptz.goToPreset(id) → navigation.runAction(id)
27256
- *
27257
- * ## Continuous drive
27258
- *
27259
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27260
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27261
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27262
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27263
- * coalesce them. The UI owns the cadence.
27264
- *
27265
- * ## The action dictionary
27266
- *
27267
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27268
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27269
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27270
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27271
- * vendor-specific list. `kind: 'action'` entries are triggered with
27272
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27273
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27274
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27275
- *
27276
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27277
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27278
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27279
- * every device handle. A future nodedreame publish adds a typed
27280
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27281
- * provider can then swap the raw calls for the typed methods with no change to
27282
- * THIS contract.
27283
- */
27284
- /**
27285
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27286
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27287
- * halts it.
27288
- *
27289
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27290
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27291
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27292
- * vector by it (drivers without proportional drive ignore it).
27293
- *
27294
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27295
- * axis alone; an all-undefined nudge is a no-op.
27296
- */
27297
- var NavigationMoveCommandSchema = object({
27298
- pan: number$1().min(-1).max(1).optional(),
27299
- tilt: number$1().min(-1).max(1).optional(),
27300
- speed: number$1().min(0).max(1).optional()
27301
- });
27302
- /**
27303
- * The enumerated discrete actions a navigation-capable robot can perform via
27304
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27305
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27306
- * `playSound` (see the `sound` dictionary entries).
27307
- */
27308
- var NavigationActionIdSchema = _enum([
27309
- "goHome",
27310
- "locate",
27311
- "spotClean",
27312
- "findPet",
27313
- "personFollow",
27314
- "stop",
27315
- "startClean",
27316
- "pauseClean",
27317
- "dockWash",
27318
- "autoEmpty",
27319
- "flashOn",
27320
- "flashOff"
27321
- ]);
27322
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27323
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27324
- /**
27325
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27326
- * native panel and the PTZ mimic render as a button.
27327
- *
27328
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27329
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27330
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27331
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27332
- * - `label` — operator-facing English label.
27333
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27334
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27335
- * PTZ render ONLY enabled entries. Data-driven: the provider
27336
- * flips it from config, never by editing code.
27337
- */
27338
- var NavigationActionEntrySchema = object({
27339
- id: string(),
27340
- kind: NavigationEntryKindSchema,
27341
- label: string(),
27342
- icon: string(),
27343
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27344
- soundId: number$1().int().optional(),
27345
- /** Per-device feature flag — render this entry only when true. */
27346
- enabled: boolean()
27347
- });
27348
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27349
- var NavigationPointSchema = object({
27350
- x: number$1(),
27351
- y: number$1()
27352
- });
27353
- /**
27354
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27355
- * The cap reports which are enabled so the UI / PTZ render only the controls
27356
- * that are turned on for THIS device. Data-driven: the provider derives these
27357
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27358
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27359
- * that are not dictionary entries.
27360
- *
27361
- * - `move` / `stop` — the momentary drive joystick.
27362
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27363
- * map-coordinate plumbing is wired.
27364
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27365
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27366
- * - `light` — the on/off fill-light toggle (works anytime).
27367
- * - `lightMode` — the auto/manual selector + manual level slider (a
27368
- * camera-service control; needs an active stream).
27369
- */
27370
- var NavigationFeaturesSchema = object({
27371
- move: boolean(),
27372
- stop: boolean(),
27373
- goToPoint: boolean(),
27374
- runAction: boolean(),
27375
- playSound: boolean(),
27376
- light: boolean(),
27377
- lightMode: boolean()
27378
- });
27379
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27380
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27381
- /**
27382
- * Live navigation state so the UI can reflect what the robot is doing:
27383
- * - `mode` — coarse activity (idle / cleaning / following / …).
27384
- * - `following` — person/pet follow is currently armed.
27385
- * - `flash` — the on-camera fill light is on.
27386
- * - `lightMode` — auto vs manual fill-light mode.
27387
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27388
- * `lightMode === 'manual'`.
27389
- */
27390
- var NavigationStatusSchema = object({
27391
- mode: _enum([
27392
- "idle",
27393
- "cleaning",
27394
- "spot",
27395
- "following",
27396
- "goto",
27397
- "returning",
27398
- "paused",
27399
- "unknown"
27400
- ]),
27401
- following: boolean(),
27402
- flash: boolean(),
27403
- lightMode: NavigationLightModeSchema,
27404
- lightLevel: number$1().min(40).max(100),
27405
- /** Ms epoch when the slice was last updated. */
27406
- lastChangedAt: number$1()
27407
- });
27408
- NavigationStatusSchema.extend({ lastFetchedAt: number$1() });
27409
- DeviceType.Camera, method(NavigationMoveCommandSchema.extend({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(NavigationPointSchema.extend({ deviceId: number$1() }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), array(NavigationActionEntrySchema)), method(object({
27410
- deviceId: number$1(),
27411
- actionId: NavigationActionIdSchema
27412
- }), _void(), { kind: "mutation" }), method(object({
27413
- deviceId: number$1(),
27414
- soundId: number$1().int()
27415
- }), _void(), { kind: "mutation" }), method(object({
27416
- deviceId: number$1(),
27417
- on: boolean()
27418
- }), _void(), { kind: "mutation" }), method(object({
27419
- deviceId: number$1(),
27420
- mode: NavigationLightModeSchema,
27421
- level: number$1().min(40).max(100).optional()
27422
- }), _void(), { kind: "mutation" }), method(object({
27423
- deviceId: number$1(),
27424
- level: number$1().min(40).max(100)
27425
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), NavigationFeaturesSchema), object({
27426
- deviceId: number$1(),
27427
- status: NavigationStatusSchema
27428
- });
27429
27569
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number$1().int().nonnegative() }), object({ success: literal(true) }), {
27430
27570
  kind: "mutation",
27431
27571
  auth: "admin"
@@ -34740,6 +34880,12 @@ Object.freeze({
34740
34880
  addonId: null,
34741
34881
  access: "view"
34742
34882
  },
34883
+ "storage.listDrainProgress": {
34884
+ capName: "storage",
34885
+ capScope: "system",
34886
+ addonId: null,
34887
+ access: "view"
34888
+ },
34743
34889
  "storage.listLocationDeclarations": {
34744
34890
  capName: "storage",
34745
34891
  capScope: "system",
@@ -34884,6 +35030,12 @@ Object.freeze({
34884
35030
  addonId: null,
34885
35031
  access: "view"
34886
35032
  },
35033
+ "storageOccupancy.getOccupancy": {
35034
+ capName: "storage-occupancy",
35035
+ capScope: "system",
35036
+ addonId: null,
35037
+ access: "view"
35038
+ },
34887
35039
  "storageProvider.abortUpload": {
34888
35040
  capName: "storage-provider",
34889
35041
  capScope: "system",