@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.js CHANGED
@@ -12,7 +12,7 @@ let _camstack_system_addon_utils = require("@camstack/system/addon-utils");
12
12
  let node_fs_promises = require("node:fs/promises");
13
13
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
14
14
  let node_child_process = require("node:child_process");
15
- //#region ../types/dist/event-category-zAv7pMUz.mjs
15
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
16
16
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
17
17
  EventCategory["SystemBoot"] = "system.boot";
18
18
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -207,6 +207,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
207
207
  EventCategory["ProcessCrashed"] = "process.crashed";
208
208
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
209
209
  EventCategory["ProcessRestarted"] = "process.restarted";
210
+ /**
211
+ * The SET of storage locations changed — one was created, edited, enabled,
212
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
213
+ *
214
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
215
+ * it must also converge on its own periodic path, because a dropped event
216
+ * must not leave a node writing to yesterday's disk set forever. It exists
217
+ * because there was NO signal at all — an operator who added a second
218
+ * recordings disk in the admin UI got nothing, and the recorder kept its
219
+ * resolved locations until something else happened to re-resolve them
220
+ * (D387). Payload `StorageLocationsChangedPayload`.
221
+ */
222
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
210
223
  EventCategory["RecordingStarted"] = "recording.started";
211
224
  EventCategory["RecordingStopped"] = "recording.stopped";
212
225
  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$1(),
8812
8855
  availableBytes: number$1()
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$1().int().nonnegative(),
8874
+ measuredAtMs: number$1().int().nonnegative()
8875
+ }).optional(),
8814
8876
  createdAt: number$1(),
8815
8877
  updatedAt: number$1()
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$1(),
8891
+ startBytes: number$1(),
8892
+ bytesRemaining: number$1(),
8893
+ drained: boolean(),
8894
+ estimatedEmptyAtMs: number$1().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
@@ -20350,8 +20428,25 @@ var occupancyRecheckFramesField = {
20350
20428
  * (analyzer attaches detected `regions[]`; onboard does not — the
20351
20429
  * camera typically only reports a binary signal plus an optional
20352
20430
  * channel/AI class which lives in dedicated event channels).
20431
+ *
20432
+ * - `onboard` — the camera's firmware said something moved.
20433
+ * - `analyzer` — this runner's frame-diff said so, and attaches `regions[]`.
20434
+ * - `device-activity` — the DEVICE said it is doing its job: the
20435
+ * `recording-signal` LEVEL the same device raises for the recorder
20436
+ * ([D380](../../../../docs/decisions/adr-0380-a-device-decided-recording-is-a-mode-with-no-schedule-seeded-once.md)),
20437
+ * republished as a motion source. It attaches **nothing** — no regions, no
20438
+ * class: the only fact it carries is that the device is active, and a robot
20439
+ * vacuum that is itself the moving object has no region worth sending. It is
20440
+ * a LEVEL, so unlike `onboard` it has a real falling edge, and unlike
20441
+ * `analyzer` it must not open the frame-diff side-channel — the runner's
20442
+ * `handleOnboardMotionAnalyzer` gate is `source === 'onboard'` and stays that
20443
+ * way ([D392](../../../../docs/decisions/adr-0392-a-device-that-says-it-is-working-is-a-motion-source-of-its-own.md)).
20353
20444
  */
20354
- var MotionSourceEnum = _enum(["onboard", "analyzer"]);
20445
+ var MotionSourceEnum = _enum([
20446
+ "onboard",
20447
+ "analyzer",
20448
+ "device-activity"
20449
+ ]);
20355
20450
  /**
20356
20451
  * List of motion sources active on a camera. Empty array is valid:
20357
20452
  * "no source" — happens for battery cams without firmware motion when
@@ -21870,7 +21965,7 @@ method(object({
21870
21965
  }), _void(), {
21871
21966
  kind: "mutation",
21872
21967
  auth: "admin"
21873
- }), method(object({ id: string() }), object({
21968
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21874
21969
  ok: boolean(),
21875
21970
  error: string().optional()
21876
21971
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21940,6 +22035,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21940
22035
  kind: "mutation",
21941
22036
  auth: "admin"
21942
22037
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22038
+ /**
22039
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22040
+ * location (D388).
22041
+ *
22042
+ * ## Why this is not `storage-evictable`
22043
+ *
22044
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22045
+ * not, in two ways that both matter and both bite hardest on the locations an
22046
+ * operator most wants a figure for:
22047
+ *
22048
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22049
+ * and `recordingsLow:default` deliberately share one root and evict as one
22050
+ * oldest-first pool, so both answer with the SAME combined total. As an
22051
+ * occupancy figure that double-counts the disk.
22052
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22053
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22054
+ * is retiring and staring at.
22055
+ *
22056
+ * So this is its own contract with its own quantity, and the quantity is
22057
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22058
+ * would ever be willing to delete it. A provider that can only answer
22059
+ * "evictable" must not register here — a number that silently means different
22060
+ * things per class is worse than no number.
22061
+ *
22062
+ * ## Absence is an answer
22063
+ *
22064
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22065
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22066
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22067
+ * consuming side has to be written out loud instead of appearing by accident.
22068
+ *
22069
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22070
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22071
+ */
22072
+ /** One provider's occupancy answer for one location. */
22073
+ var StorageOccupancyReportSchema = object({
22074
+ locationId: string(),
22075
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22076
+ * not net of what it is willing to delete. */
22077
+ ownedBytes: number$1().int().nonnegative(),
22078
+ /** When the provider last actually measured this. The orchestrator carries it
22079
+ * through so a UI can say how old the figure is instead of implying "now". */
22080
+ measuredAtMs: number$1().int().nonnegative()
22081
+ });
22082
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21943
22083
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21944
22084
  providerId: string().min(1),
21945
22085
  displayName: string().min(1),
@@ -23575,39 +23715,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23575
23715
  deviceId: number$1(),
23576
23716
  status: BatteryStatusSchema
23577
23717
  });
23578
- /**
23579
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23580
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23581
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23582
- * one Home Assistant projection.
23583
- */
23584
- var NetworkLinkStatusSchema = object({
23585
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23586
- type: _enum([
23587
- "wifi",
23588
- "ethernet",
23589
- "cellular",
23590
- "unknown"
23591
- ]),
23592
- /**
23593
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23594
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23595
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23596
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23597
- * SKIP a null rather than coerce it.
23598
- */
23599
- signalPercent: number$1().min(0).max(100).nullable(),
23600
- /** Raw received signal strength in dBm, when the firmware reports one. */
23601
- rssiDbm: number$1().optional(),
23602
- /** Network name of a wireless link, when the firmware reports it. */
23603
- ssid: string().optional(),
23604
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23605
- lastUpdated: number$1()
23606
- });
23607
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23608
- deviceId: number$1(),
23609
- status: NetworkLinkStatusSchema
23610
- });
23611
23718
  object({
23612
23719
  on: boolean(),
23613
23720
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25961,6 +26068,236 @@ DeviceType.Camera, method(object({
25961
26068
  detection: NativeDetectionSchema
25962
26069
  });
25963
26070
  /**
26071
+ * `navigation` — a device-scoped capability that natively expresses the FULL
26072
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
26073
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
26074
+ *
26075
+ * Why a NEW cap rather than overloading `ptz`:
26076
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
26077
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
26078
+ * The two are different physical models: PTZ is absolute-position + presets,
26079
+ * navigation is momentary drive nudges + discrete robot ACTIONS
26080
+ * (dock / spot-clean / follow-pet / go-to-point / …).
26081
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
26082
+ * the reverse:
26083
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
26084
+ * / `getOptions`), and
26085
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
26086
+ * robot camera shows up in the existing PTZ control path without every
26087
+ * PTZ provider learning about robots. The mapping lives in the adapter,
26088
+ * not here (see the addon design note):
26089
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
26090
+ * ptz.stop() → navigation.stop()
26091
+ * ptz.goHome() → navigation.runAction('goHome')
26092
+ * ptz.getPresets() → navigation.listActions() (id→preset)
26093
+ * ptz.goToPreset(id) → navigation.runAction(id)
26094
+ *
26095
+ * ## Continuous drive
26096
+ *
26097
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
26098
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
26099
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
26100
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
26101
+ * coalesce them. The UI owns the cadence.
26102
+ *
26103
+ * ## The action dictionary
26104
+ *
26105
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
26106
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
26107
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
26108
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
26109
+ * vendor-specific list. `kind: 'action'` entries are triggered with
26110
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
26111
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
26112
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26113
+ *
26114
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26115
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26116
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
26117
+ * every device handle. A future nodedreame publish adds a typed
26118
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
26119
+ * provider can then swap the raw calls for the typed methods with no change to
26120
+ * THIS contract.
26121
+ */
26122
+ /**
26123
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
26124
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
26125
+ * halts it.
26126
+ *
26127
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
26128
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26129
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26130
+ * vector by it (drivers without proportional drive ignore it).
26131
+ *
26132
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26133
+ * axis alone; an all-undefined nudge is a no-op.
26134
+ */
26135
+ var NavigationMoveCommandSchema = object({
26136
+ pan: number$1().min(-1).max(1).optional(),
26137
+ tilt: number$1().min(-1).max(1).optional(),
26138
+ speed: number$1().min(0).max(1).optional()
26139
+ });
26140
+ /**
26141
+ * The enumerated discrete actions a navigation-capable robot can perform via
26142
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26143
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26144
+ * `playSound` (see the `sound` dictionary entries).
26145
+ */
26146
+ var NavigationActionIdSchema = _enum([
26147
+ "goHome",
26148
+ "locate",
26149
+ "spotClean",
26150
+ "findPet",
26151
+ "personFollow",
26152
+ "stop",
26153
+ "startClean",
26154
+ "pauseClean",
26155
+ "dockWash",
26156
+ "autoEmpty",
26157
+ "flashOn",
26158
+ "flashOff"
26159
+ ]);
26160
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
26161
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
26162
+ /**
26163
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
26164
+ * native panel and the PTZ mimic render as a button.
26165
+ *
26166
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
26167
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
26168
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
26169
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
26170
+ * - `label` — operator-facing English label.
26171
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
26172
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
26173
+ * PTZ render ONLY enabled entries. Data-driven: the provider
26174
+ * flips it from config, never by editing code.
26175
+ */
26176
+ var NavigationActionEntrySchema = object({
26177
+ id: string(),
26178
+ kind: NavigationEntryKindSchema,
26179
+ label: string(),
26180
+ icon: string(),
26181
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
26182
+ soundId: number$1().int().optional(),
26183
+ /** Per-device feature flag — render this entry only when true. */
26184
+ enabled: boolean()
26185
+ });
26186
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
26187
+ var NavigationPointSchema = object({
26188
+ x: number$1(),
26189
+ y: number$1()
26190
+ });
26191
+ /**
26192
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
26193
+ * The cap reports which are enabled so the UI / PTZ render only the controls
26194
+ * that are turned on for THIS device. Data-driven: the provider derives these
26195
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
26196
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
26197
+ * that are not dictionary entries.
26198
+ *
26199
+ * - `move` / `stop` — the momentary drive joystick.
26200
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26201
+ * map-coordinate plumbing is wired.
26202
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26203
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26204
+ * - `light` — the on/off fill-light toggle (works anytime).
26205
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26206
+ * camera-service control; needs an active stream).
26207
+ */
26208
+ var NavigationFeaturesSchema = object({
26209
+ move: boolean(),
26210
+ stop: boolean(),
26211
+ goToPoint: boolean(),
26212
+ runAction: boolean(),
26213
+ playSound: boolean(),
26214
+ light: boolean(),
26215
+ lightMode: boolean()
26216
+ });
26217
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26218
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26219
+ /**
26220
+ * Live navigation state so the UI can reflect what the robot is doing:
26221
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26222
+ * - `following` — person/pet follow is currently armed.
26223
+ * - `flash` — the on-camera fill light is on.
26224
+ * - `lightMode` — auto vs manual fill-light mode.
26225
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26226
+ * `lightMode === 'manual'`.
26227
+ */
26228
+ var NavigationStatusSchema = object({
26229
+ mode: _enum([
26230
+ "idle",
26231
+ "cleaning",
26232
+ "spot",
26233
+ "following",
26234
+ "goto",
26235
+ "returning",
26236
+ "paused",
26237
+ "unknown"
26238
+ ]),
26239
+ following: boolean(),
26240
+ flash: boolean(),
26241
+ lightMode: NavigationLightModeSchema,
26242
+ lightLevel: number$1().min(40).max(100),
26243
+ /** Ms epoch when the slice was last updated. */
26244
+ lastChangedAt: number$1()
26245
+ });
26246
+ NavigationStatusSchema.extend({ lastFetchedAt: number$1() });
26247
+ 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({
26248
+ deviceId: number$1(),
26249
+ actionId: NavigationActionIdSchema
26250
+ }), _void(), { kind: "mutation" }), method(object({
26251
+ deviceId: number$1(),
26252
+ soundId: number$1().int()
26253
+ }), _void(), { kind: "mutation" }), method(object({
26254
+ deviceId: number$1(),
26255
+ on: boolean()
26256
+ }), _void(), { kind: "mutation" }), method(object({
26257
+ deviceId: number$1(),
26258
+ mode: NavigationLightModeSchema,
26259
+ level: number$1().min(40).max(100).optional()
26260
+ }), _void(), { kind: "mutation" }), method(object({
26261
+ deviceId: number$1(),
26262
+ level: number$1().min(40).max(100)
26263
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), NavigationFeaturesSchema), object({
26264
+ deviceId: number$1(),
26265
+ status: NavigationStatusSchema
26266
+ });
26267
+ /**
26268
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26269
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26270
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26271
+ * one Home Assistant projection.
26272
+ */
26273
+ var NetworkLinkStatusSchema = object({
26274
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26275
+ type: _enum([
26276
+ "wifi",
26277
+ "ethernet",
26278
+ "cellular",
26279
+ "unknown"
26280
+ ]),
26281
+ /**
26282
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26283
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26284
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26285
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26286
+ * SKIP a null rather than coerce it.
26287
+ */
26288
+ signalPercent: number$1().min(0).max(100).nullable(),
26289
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26290
+ rssiDbm: number$1().optional(),
26291
+ /** Network name of a wireless link, when the firmware reports it. */
26292
+ ssid: string().optional(),
26293
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26294
+ lastUpdated: number$1()
26295
+ });
26296
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26297
+ deviceId: number$1(),
26298
+ status: NetworkLinkStatusSchema
26299
+ });
26300
+ /**
25964
26301
  * network-quality — system-scoped singleton capability tracking RTT,
25965
26302
  * jitter, and observed/peak bandwidth per device + per client.
25966
26303
  *
@@ -27202,203 +27539,6 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), PtzAutotrackStatusSc
27202
27539
  deviceId: number$1(),
27203
27540
  status: PtzAutotrackStatusSchema
27204
27541
  });
27205
- /**
27206
- * `navigation` — a device-scoped capability that natively expresses the FULL
27207
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
27208
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
27209
- *
27210
- * Why a NEW cap rather than overloading `ptz`:
27211
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27212
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27213
- * The two are different physical models: PTZ is absolute-position + presets,
27214
- * navigation is momentary drive nudges + discrete robot ACTIONS
27215
- * (dock / spot-clean / follow-pet / go-to-point / …).
27216
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27217
- * the reverse:
27218
- * 1. a native CamStack navigation panel (data-driven from `listActions`
27219
- * / `getOptions`), and
27220
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27221
- * robot camera shows up in the existing PTZ control path without every
27222
- * PTZ provider learning about robots. The mapping lives in the adapter,
27223
- * not here (see the addon design note):
27224
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27225
- * ptz.stop() → navigation.stop()
27226
- * ptz.goHome() → navigation.runAction('goHome')
27227
- * ptz.getPresets() → navigation.listActions() (id→preset)
27228
- * ptz.goToPreset(id) → navigation.runAction(id)
27229
- *
27230
- * ## Continuous drive
27231
- *
27232
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27233
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27234
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27235
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27236
- * coalesce them. The UI owns the cadence.
27237
- *
27238
- * ## The action dictionary
27239
- *
27240
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27241
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27242
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27243
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27244
- * vendor-specific list. `kind: 'action'` entries are triggered with
27245
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27246
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27247
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27248
- *
27249
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27250
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27251
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27252
- * every device handle. A future nodedreame publish adds a typed
27253
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27254
- * provider can then swap the raw calls for the typed methods with no change to
27255
- * THIS contract.
27256
- */
27257
- /**
27258
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27259
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27260
- * halts it.
27261
- *
27262
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27263
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27264
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27265
- * vector by it (drivers without proportional drive ignore it).
27266
- *
27267
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27268
- * axis alone; an all-undefined nudge is a no-op.
27269
- */
27270
- var NavigationMoveCommandSchema = object({
27271
- pan: number$1().min(-1).max(1).optional(),
27272
- tilt: number$1().min(-1).max(1).optional(),
27273
- speed: number$1().min(0).max(1).optional()
27274
- });
27275
- /**
27276
- * The enumerated discrete actions a navigation-capable robot can perform via
27277
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27278
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27279
- * `playSound` (see the `sound` dictionary entries).
27280
- */
27281
- var NavigationActionIdSchema = _enum([
27282
- "goHome",
27283
- "locate",
27284
- "spotClean",
27285
- "findPet",
27286
- "personFollow",
27287
- "stop",
27288
- "startClean",
27289
- "pauseClean",
27290
- "dockWash",
27291
- "autoEmpty",
27292
- "flashOn",
27293
- "flashOff"
27294
- ]);
27295
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27296
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27297
- /**
27298
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27299
- * native panel and the PTZ mimic render as a button.
27300
- *
27301
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27302
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27303
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27304
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27305
- * - `label` — operator-facing English label.
27306
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27307
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27308
- * PTZ render ONLY enabled entries. Data-driven: the provider
27309
- * flips it from config, never by editing code.
27310
- */
27311
- var NavigationActionEntrySchema = object({
27312
- id: string(),
27313
- kind: NavigationEntryKindSchema,
27314
- label: string(),
27315
- icon: string(),
27316
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27317
- soundId: number$1().int().optional(),
27318
- /** Per-device feature flag — render this entry only when true. */
27319
- enabled: boolean()
27320
- });
27321
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27322
- var NavigationPointSchema = object({
27323
- x: number$1(),
27324
- y: number$1()
27325
- });
27326
- /**
27327
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27328
- * The cap reports which are enabled so the UI / PTZ render only the controls
27329
- * that are turned on for THIS device. Data-driven: the provider derives these
27330
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27331
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27332
- * that are not dictionary entries.
27333
- *
27334
- * - `move` / `stop` — the momentary drive joystick.
27335
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27336
- * map-coordinate plumbing is wired.
27337
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27338
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27339
- * - `light` — the on/off fill-light toggle (works anytime).
27340
- * - `lightMode` — the auto/manual selector + manual level slider (a
27341
- * camera-service control; needs an active stream).
27342
- */
27343
- var NavigationFeaturesSchema = object({
27344
- move: boolean(),
27345
- stop: boolean(),
27346
- goToPoint: boolean(),
27347
- runAction: boolean(),
27348
- playSound: boolean(),
27349
- light: boolean(),
27350
- lightMode: boolean()
27351
- });
27352
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27353
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27354
- /**
27355
- * Live navigation state so the UI can reflect what the robot is doing:
27356
- * - `mode` — coarse activity (idle / cleaning / following / …).
27357
- * - `following` — person/pet follow is currently armed.
27358
- * - `flash` — the on-camera fill light is on.
27359
- * - `lightMode` — auto vs manual fill-light mode.
27360
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27361
- * `lightMode === 'manual'`.
27362
- */
27363
- var NavigationStatusSchema = object({
27364
- mode: _enum([
27365
- "idle",
27366
- "cleaning",
27367
- "spot",
27368
- "following",
27369
- "goto",
27370
- "returning",
27371
- "paused",
27372
- "unknown"
27373
- ]),
27374
- following: boolean(),
27375
- flash: boolean(),
27376
- lightMode: NavigationLightModeSchema,
27377
- lightLevel: number$1().min(40).max(100),
27378
- /** Ms epoch when the slice was last updated. */
27379
- lastChangedAt: number$1()
27380
- });
27381
- NavigationStatusSchema.extend({ lastFetchedAt: number$1() });
27382
- 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({
27383
- deviceId: number$1(),
27384
- actionId: NavigationActionIdSchema
27385
- }), _void(), { kind: "mutation" }), method(object({
27386
- deviceId: number$1(),
27387
- soundId: number$1().int()
27388
- }), _void(), { kind: "mutation" }), method(object({
27389
- deviceId: number$1(),
27390
- on: boolean()
27391
- }), _void(), { kind: "mutation" }), method(object({
27392
- deviceId: number$1(),
27393
- mode: NavigationLightModeSchema,
27394
- level: number$1().min(40).max(100).optional()
27395
- }), _void(), { kind: "mutation" }), method(object({
27396
- deviceId: number$1(),
27397
- level: number$1().min(40).max(100)
27398
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number$1() }), NavigationFeaturesSchema), object({
27399
- deviceId: number$1(),
27400
- status: NavigationStatusSchema
27401
- });
27402
27542
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number$1().int().nonnegative() }), object({ success: literal(true) }), {
27403
27543
  kind: "mutation",
27404
27544
  auth: "admin"
@@ -34713,6 +34853,12 @@ Object.freeze({
34713
34853
  addonId: null,
34714
34854
  access: "view"
34715
34855
  },
34856
+ "storage.listDrainProgress": {
34857
+ capName: "storage",
34858
+ capScope: "system",
34859
+ addonId: null,
34860
+ access: "view"
34861
+ },
34716
34862
  "storage.listLocationDeclarations": {
34717
34863
  capName: "storage",
34718
34864
  capScope: "system",
@@ -34857,6 +35003,12 @@ Object.freeze({
34857
35003
  addonId: null,
34858
35004
  access: "view"
34859
35005
  },
35006
+ "storageOccupancy.getOccupancy": {
35007
+ capName: "storage-occupancy",
35008
+ capScope: "system",
35009
+ addonId: null,
35010
+ access: "view"
35011
+ },
34860
35012
  "storageProvider.abortUpload": {
34861
35013
  capName: "storage-provider",
34862
35014
  capScope: "system",