@camstack/addon-provider-hikvision 1.2.87 → 1.2.88

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 +500 -365
  2. package/dist/addon.mjs +500 -365
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -7,7 +7,7 @@ import { networkInterfaces } from "node:os";
7
7
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
8
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
9
9
  //#endregion
10
- //#region ../types/dist/event-category-zAv7pMUz.mjs
10
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
11
11
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
12
12
  EventCategory["SystemBoot"] = "system.boot";
13
13
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -202,6 +202,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
202
202
  EventCategory["ProcessCrashed"] = "process.crashed";
203
203
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
204
204
  EventCategory["ProcessRestarted"] = "process.restarted";
205
+ /**
206
+ * The SET of storage locations changed — one was created, edited, enabled,
207
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
208
+ *
209
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
210
+ * it must also converge on its own periodic path, because a dropped event
211
+ * must not leave a node writing to yesterday's disk set forever. It exists
212
+ * because there was NO signal at all — an operator who added a second
213
+ * recordings disk in the admin UI got nothing, and the recorder kept its
214
+ * resolved locations until something else happened to re-resolve them
215
+ * (D387). Payload `StorageLocationsChangedPayload`.
216
+ */
217
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
205
218
  EventCategory["RecordingStarted"] = "recording.started";
206
219
  EventCategory["RecordingStopped"] = "recording.stopped";
207
220
  EventCategory["RecordingError"] = "recording.error";
@@ -8532,6 +8545,21 @@ var StorageCleanupJobSchema = object({
8532
8545
  });
8533
8546
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8534
8547
  /**
8548
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8549
+ * alias below is `z.infer<>` of it, never a second spelling.
8550
+ */
8551
+ var StorageLocationModeSchema = _enum([
8552
+ "active",
8553
+ "readonly",
8554
+ "drain",
8555
+ "disabled"
8556
+ ]);
8557
+ _enum([
8558
+ "normal",
8559
+ "never",
8560
+ "drain"
8561
+ ]);
8562
+ /**
8535
8563
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8536
8564
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8537
8565
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8597,6 +8625,21 @@ var StorageLocationSchema = object({
8597
8625
  * stops existing rather than being re-derived on every read.
8598
8626
  */
8599
8627
  enabled: boolean().optional(),
8628
+ /**
8629
+ * THE state of this location (D385), and the only authority on what may be
8630
+ * written, read or evicted here. Interpreted in exactly one place —
8631
+ * `storage-location-mode.ts` — which also folds the legacy
8632
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8633
+ * ambiguous.
8634
+ *
8635
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8636
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8637
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8638
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8639
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8640
+ * either, so the two cannot disagree.
8641
+ */
8642
+ mode: StorageLocationModeSchema.optional(),
8600
8643
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8601
8644
  * for node-local locations it can reach) — never persisted, absent when the
8602
8645
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8604,11 +8647,46 @@ var StorageLocationSchema = object({
8604
8647
  totalBytes: number(),
8605
8648
  availableBytes: number()
8606
8649
  }).nullable().optional(),
8650
+ /**
8651
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8652
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8653
+ * never persisted, never a filesystem walk.
8654
+ *
8655
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8656
+ * location yet — nobody stores here, the owning addon is down, or the first
8657
+ * refresh has not completed. A UI must omit the segment rather than draw it
8658
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8659
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8660
+ * be spelled out loud instead of appearing by accident.
8661
+ *
8662
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8663
+ * about the whole figure rather than about its freshest part.
8664
+ */
8665
+ owned: object({
8666
+ bytes: number().int().nonnegative(),
8667
+ measuredAtMs: number().int().nonnegative()
8668
+ }).optional(),
8607
8669
  createdAt: number(),
8608
8670
  updatedAt: number()
8609
8671
  });
8610
8672
  object({ isDefault: boolean().optional() });
8611
8673
  /**
8674
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8675
+ *
8676
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8677
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8678
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8679
+ * operator learns not to believe the screen.
8680
+ */
8681
+ var StorageDrainProgressSchema = object({
8682
+ locationId: string(),
8683
+ startedAtMs: number(),
8684
+ startBytes: number(),
8685
+ bytesRemaining: number(),
8686
+ drained: boolean(),
8687
+ estimatedEmptyAtMs: number().nullable()
8688
+ });
8689
+ /**
8612
8690
  * Reference accepted by consumer-facing `api.storage.*` calls.
8613
8691
  * Either:
8614
8692
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -22353,7 +22431,7 @@ method(object({
22353
22431
  }), _void(), {
22354
22432
  kind: "mutation",
22355
22433
  auth: "admin"
22356
- }), method(object({ id: string() }), object({
22434
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
22357
22435
  ok: boolean(),
22358
22436
  error: string().optional()
22359
22437
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22423,6 +22501,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22423
22501
  kind: "mutation",
22424
22502
  auth: "admin"
22425
22503
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22504
+ /**
22505
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22506
+ * location (D388).
22507
+ *
22508
+ * ## Why this is not `storage-evictable`
22509
+ *
22510
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22511
+ * not, in two ways that both matter and both bite hardest on the locations an
22512
+ * operator most wants a figure for:
22513
+ *
22514
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22515
+ * and `recordingsLow:default` deliberately share one root and evict as one
22516
+ * oldest-first pool, so both answer with the SAME combined total. As an
22517
+ * occupancy figure that double-counts the disk.
22518
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22519
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22520
+ * is retiring and staring at.
22521
+ *
22522
+ * So this is its own contract with its own quantity, and the quantity is
22523
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22524
+ * would ever be willing to delete it. A provider that can only answer
22525
+ * "evictable" must not register here — a number that silently means different
22526
+ * things per class is worse than no number.
22527
+ *
22528
+ * ## Absence is an answer
22529
+ *
22530
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22531
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22532
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22533
+ * consuming side has to be written out loud instead of appearing by accident.
22534
+ *
22535
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22536
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22537
+ */
22538
+ /** One provider's occupancy answer for one location. */
22539
+ var StorageOccupancyReportSchema = object({
22540
+ locationId: string(),
22541
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22542
+ * not net of what it is willing to delete. */
22543
+ ownedBytes: number().int().nonnegative(),
22544
+ /** When the provider last actually measured this. The orchestrator carries it
22545
+ * through so a UI can say how old the figure is instead of implying "now". */
22546
+ measuredAtMs: number().int().nonnegative()
22547
+ });
22548
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22426
22549
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22427
22550
  providerId: string().min(1),
22428
22551
  displayName: string().min(1),
@@ -24258,88 +24381,6 @@ onStatusChanged: { data: object({
24258
24381
  volatileStateFields: ["lastUpdated"]
24259
24382
  };
24260
24383
  /**
24261
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
24262
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24263
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
24264
- * one Home Assistant projection.
24265
- */
24266
- var NetworkLinkStatusSchema = object({
24267
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24268
- type: _enum([
24269
- "wifi",
24270
- "ethernet",
24271
- "cellular",
24272
- "unknown"
24273
- ]),
24274
- /**
24275
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
24276
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24277
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24278
- * one whose reading has not landed must not be drawn at 0 %. Consumers
24279
- * SKIP a null rather than coerce it.
24280
- */
24281
- signalPercent: number().min(0).max(100).nullable(),
24282
- /** Raw received signal strength in dBm, when the firmware reports one. */
24283
- rssiDbm: number().optional(),
24284
- /** Network name of a wireless link, when the firmware reports it. */
24285
- ssid: string().optional(),
24286
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24287
- lastUpdated: number()
24288
- });
24289
- var networkLinkCapability = {
24290
- name: "network-link",
24291
- scope: "device",
24292
- deviceNative: true,
24293
- mode: "singleton",
24294
- deviceTypes: [
24295
- DeviceType.Camera,
24296
- DeviceType.Sensor,
24297
- DeviceType.Button,
24298
- DeviceType.Switch,
24299
- DeviceType.Light,
24300
- DeviceType.Lock,
24301
- DeviceType.Siren
24302
- ],
24303
- methods: {},
24304
- events: {
24305
- /**
24306
- * Emitted whenever the cached status changes (a link switch, a signal
24307
- * reading that moved). Mirrored on the parent chain by the
24308
- * DeviceEventPropagator like `battery.onStatusChanged`.
24309
- */
24310
- onStatusChanged: { data: object({
24311
- deviceId: number(),
24312
- status: NetworkLinkStatusSchema
24313
- }) } },
24314
- status: {
24315
- schema: NetworkLinkStatusSchema,
24316
- kind: "push",
24317
- empty: {
24318
- type: "unknown",
24319
- signalPercent: null,
24320
- lastUpdated: 0
24321
- }
24322
- },
24323
- /**
24324
- * Runtime-state slice — every provider stores the same shape under
24325
- * `device.runtimeState['network-link']`, read once by the badge and the
24326
- * Home Assistant projector regardless of the driver.
24327
- */
24328
- runtimeState: NetworkLinkStatusSchema,
24329
- /**
24330
- * Runtime-state durability: **restored** — a link reading is slow to
24331
- * change and a sleeping battery camera may not report for hours; the
24332
- * restored slice is what the badge shows until the next read.
24333
- *
24334
- * See `RuntimeStateDurability`. Enforced by
24335
- * `scripts/check-runtime-state-durability.ts`.
24336
- */
24337
- durability: "restored",
24338
- /** Clock fields: written, but excluded from the compare that decides
24339
- * whether persisting is worth a SQLite commit. */
24340
- volatileStateFields: ["lastUpdated"]
24341
- };
24342
- /**
24343
24384
  * Generic boolean sensor — last-resort fallback when no domain-
24344
24385
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24345
24386
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -27869,6 +27910,369 @@ var nativeObjectDetectionCapability = {
27869
27910
  volatileStateFields: ["lastFetchedAt"]
27870
27911
  };
27871
27912
  /**
27913
+ * `navigation` — a device-scoped capability that natively expresses the FULL
27914
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
27915
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
27916
+ *
27917
+ * Why a NEW cap rather than overloading `ptz`:
27918
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27919
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27920
+ * The two are different physical models: PTZ is absolute-position + presets,
27921
+ * navigation is momentary drive nudges + discrete robot ACTIONS
27922
+ * (dock / spot-clean / follow-pet / go-to-point / …).
27923
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27924
+ * the reverse:
27925
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
27926
+ * / `getOptions`), and
27927
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27928
+ * robot camera shows up in the existing PTZ control path without every
27929
+ * PTZ provider learning about robots. The mapping lives in the adapter,
27930
+ * not here (see the addon design note):
27931
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27932
+ * ptz.stop() → navigation.stop()
27933
+ * ptz.goHome() → navigation.runAction('goHome')
27934
+ * ptz.getPresets() → navigation.listActions() (id→preset)
27935
+ * ptz.goToPreset(id) → navigation.runAction(id)
27936
+ *
27937
+ * ## Continuous drive
27938
+ *
27939
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27940
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27941
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27942
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27943
+ * coalesce them. The UI owns the cadence.
27944
+ *
27945
+ * ## The action dictionary
27946
+ *
27947
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27948
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27949
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27950
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27951
+ * vendor-specific list. `kind: 'action'` entries are triggered with
27952
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27953
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
27954
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27955
+ *
27956
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27957
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27958
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
27959
+ * every device handle. A future nodedreame publish adds a typed
27960
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27961
+ * provider can then swap the raw calls for the typed methods with no change to
27962
+ * THIS contract.
27963
+ */
27964
+ /**
27965
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27966
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27967
+ * halts it.
27968
+ *
27969
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
27970
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27971
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27972
+ * vector by it (drivers without proportional drive ignore it).
27973
+ *
27974
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27975
+ * axis alone; an all-undefined nudge is a no-op.
27976
+ */
27977
+ var NavigationMoveCommandSchema = object({
27978
+ pan: number().min(-1).max(1).optional(),
27979
+ tilt: number().min(-1).max(1).optional(),
27980
+ speed: number().min(0).max(1).optional()
27981
+ });
27982
+ /**
27983
+ * The enumerated discrete actions a navigation-capable robot can perform via
27984
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27985
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
27986
+ * `playSound` (see the `sound` dictionary entries).
27987
+ */
27988
+ var NavigationActionIdSchema = _enum([
27989
+ "goHome",
27990
+ "locate",
27991
+ "spotClean",
27992
+ "findPet",
27993
+ "personFollow",
27994
+ "stop",
27995
+ "startClean",
27996
+ "pauseClean",
27997
+ "dockWash",
27998
+ "autoEmpty",
27999
+ "flashOn",
28000
+ "flashOff"
28001
+ ]);
28002
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
28003
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
28004
+ /**
28005
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
28006
+ * native panel and the PTZ mimic render as a button.
28007
+ *
28008
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
28009
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
28010
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
28011
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
28012
+ * - `label` — operator-facing English label.
28013
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
28014
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
28015
+ * PTZ render ONLY enabled entries. Data-driven: the provider
28016
+ * flips it from config, never by editing code.
28017
+ */
28018
+ var NavigationActionEntrySchema = object({
28019
+ id: string(),
28020
+ kind: NavigationEntryKindSchema,
28021
+ label: string(),
28022
+ icon: string(),
28023
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
28024
+ soundId: number().int().optional(),
28025
+ /** Per-device feature flag — render this entry only when true. */
28026
+ enabled: boolean()
28027
+ });
28028
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
28029
+ var NavigationPointSchema = object({
28030
+ x: number(),
28031
+ y: number()
28032
+ });
28033
+ /**
28034
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
28035
+ * The cap reports which are enabled so the UI / PTZ render only the controls
28036
+ * that are turned on for THIS device. Data-driven: the provider derives these
28037
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
28038
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
28039
+ * that are not dictionary entries.
28040
+ *
28041
+ * - `move` / `stop` — the momentary drive joystick.
28042
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
28043
+ * map-coordinate plumbing is wired.
28044
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
28045
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
28046
+ * - `light` — the on/off fill-light toggle (works anytime).
28047
+ * - `lightMode` — the auto/manual selector + manual level slider (a
28048
+ * camera-service control; needs an active stream).
28049
+ */
28050
+ var NavigationFeaturesSchema = object({
28051
+ move: boolean(),
28052
+ stop: boolean(),
28053
+ goToPoint: boolean(),
28054
+ runAction: boolean(),
28055
+ playSound: boolean(),
28056
+ light: boolean(),
28057
+ lightMode: boolean()
28058
+ });
28059
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
28060
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
28061
+ /**
28062
+ * Live navigation state so the UI can reflect what the robot is doing:
28063
+ * - `mode` — coarse activity (idle / cleaning / following / …).
28064
+ * - `following` — person/pet follow is currently armed.
28065
+ * - `flash` — the on-camera fill light is on.
28066
+ * - `lightMode` — auto vs manual fill-light mode.
28067
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
28068
+ * `lightMode === 'manual'`.
28069
+ */
28070
+ var NavigationStatusSchema = object({
28071
+ mode: _enum([
28072
+ "idle",
28073
+ "cleaning",
28074
+ "spot",
28075
+ "following",
28076
+ "goto",
28077
+ "returning",
28078
+ "paused",
28079
+ "unknown"
28080
+ ]),
28081
+ following: boolean(),
28082
+ flash: boolean(),
28083
+ lightMode: NavigationLightModeSchema,
28084
+ lightLevel: number().min(40).max(100),
28085
+ /** Ms epoch when the slice was last updated. */
28086
+ lastChangedAt: number()
28087
+ });
28088
+ /**
28089
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
28090
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
28091
+ * convention.
28092
+ */
28093
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
28094
+ var navigationCapability = {
28095
+ name: "navigation",
28096
+ scope: "device",
28097
+ deviceNative: true,
28098
+ mode: "singleton",
28099
+ deviceTypes: [DeviceType.Camera],
28100
+ deviceConfig: { ui: {
28101
+ kind: "widget",
28102
+ widgetId: "host/navigation-panel",
28103
+ tab: "navigation",
28104
+ topTab: true,
28105
+ label: "Navigation",
28106
+ order: 0
28107
+ } },
28108
+ methods: {
28109
+ /**
28110
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
28111
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
28112
+ * path) works for any authenticated user, not admin-only. The UI sends
28113
+ * these at ~1 Hz while a control is held; the provider forwards each one to
28114
+ * a single drive write WITHOUT debouncing.
28115
+ */
28116
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
28117
+ /** Halt all motion immediately (zero drive vector). */
28118
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
28119
+ /** Send the robot to a point on its live map. */
28120
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
28121
+ /**
28122
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
28123
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
28124
+ */
28125
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
28126
+ /**
28127
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
28128
+ * unsupported action ids are rejected by the provider.
28129
+ */
28130
+ runAction: method(object({
28131
+ deviceId: number(),
28132
+ actionId: NavigationActionIdSchema
28133
+ }), _void(), { kind: "mutation" }),
28134
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
28135
+ playSound: method(object({
28136
+ deviceId: number(),
28137
+ soundId: number().int()
28138
+ }), _void(), { kind: "mutation" }),
28139
+ /**
28140
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
28141
+ * works anytime, no active stream required).
28142
+ */
28143
+ setLightOn: method(object({
28144
+ deviceId: number(),
28145
+ on: boolean()
28146
+ }), _void(), { kind: "mutation" }),
28147
+ /**
28148
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
28149
+ * initial `level`. The auto/manual + level control is a CAMERA-service
28150
+ * action that generally needs an active camera stream/monitor session — the
28151
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
28152
+ */
28153
+ setLightMode: method(object({
28154
+ deviceId: number(),
28155
+ mode: NavigationLightModeSchema,
28156
+ level: number().min(40).max(100).optional()
28157
+ }), _void(), { kind: "mutation" }),
28158
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
28159
+ setLightLevel: method(object({
28160
+ deviceId: number(),
28161
+ level: number().min(40).max(100)
28162
+ }), _void(), { kind: "mutation" }),
28163
+ /**
28164
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
28165
+ * controls the UI shows (the per-entry flags for the dictionary come back on
28166
+ * `listActions`).
28167
+ */
28168
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
28169
+ },
28170
+ events: { onStatusChanged: { data: object({
28171
+ deviceId: number(),
28172
+ status: NavigationStatusSchema
28173
+ }) } },
28174
+ status: {
28175
+ schema: NavigationStatusSchema,
28176
+ kind: "push"
28177
+ },
28178
+ /**
28179
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
28180
+ * for live mode / follow / flash changes.
28181
+ */
28182
+ runtimeState: NavigationRuntimeStateSchema,
28183
+ /**
28184
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
28185
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
28186
+ * that. The live handle re-publishes on connect.
28187
+ *
28188
+ * See `RuntimeStateDurability`. Enforced by
28189
+ * `scripts/check-runtime-state-durability.ts`.
28190
+ */
28191
+ durability: "session"
28192
+ };
28193
+ /**
28194
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
28195
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
28196
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
28197
+ * one Home Assistant projection.
28198
+ */
28199
+ var NetworkLinkStatusSchema = object({
28200
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
28201
+ type: _enum([
28202
+ "wifi",
28203
+ "ethernet",
28204
+ "cellular",
28205
+ "unknown"
28206
+ ]),
28207
+ /**
28208
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
28209
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
28210
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
28211
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
28212
+ * SKIP a null rather than coerce it.
28213
+ */
28214
+ signalPercent: number().min(0).max(100).nullable(),
28215
+ /** Raw received signal strength in dBm, when the firmware reports one. */
28216
+ rssiDbm: number().optional(),
28217
+ /** Network name of a wireless link, when the firmware reports it. */
28218
+ ssid: string().optional(),
28219
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
28220
+ lastUpdated: number()
28221
+ });
28222
+ var networkLinkCapability = {
28223
+ name: "network-link",
28224
+ scope: "device",
28225
+ deviceNative: true,
28226
+ mode: "singleton",
28227
+ deviceTypes: [
28228
+ DeviceType.Camera,
28229
+ DeviceType.Sensor,
28230
+ DeviceType.Button,
28231
+ DeviceType.Switch,
28232
+ DeviceType.Light,
28233
+ DeviceType.Lock,
28234
+ DeviceType.Siren
28235
+ ],
28236
+ methods: {},
28237
+ events: {
28238
+ /**
28239
+ * Emitted whenever the cached status changes (a link switch, a signal
28240
+ * reading that moved). Mirrored on the parent chain by the
28241
+ * DeviceEventPropagator like `battery.onStatusChanged`.
28242
+ */
28243
+ onStatusChanged: { data: object({
28244
+ deviceId: number(),
28245
+ status: NetworkLinkStatusSchema
28246
+ }) } },
28247
+ status: {
28248
+ schema: NetworkLinkStatusSchema,
28249
+ kind: "push",
28250
+ empty: {
28251
+ type: "unknown",
28252
+ signalPercent: null,
28253
+ lastUpdated: 0
28254
+ }
28255
+ },
28256
+ /**
28257
+ * Runtime-state slice — every provider stores the same shape under
28258
+ * `device.runtimeState['network-link']`, read once by the badge and the
28259
+ * Home Assistant projector regardless of the driver.
28260
+ */
28261
+ runtimeState: NetworkLinkStatusSchema,
28262
+ /**
28263
+ * Runtime-state durability: **restored** — a link reading is slow to
28264
+ * change and a sleeping battery camera may not report for hours; the
28265
+ * restored slice is what the badge shows until the next read.
28266
+ *
28267
+ * See `RuntimeStateDurability`. Enforced by
28268
+ * `scripts/check-runtime-state-durability.ts`.
28269
+ */
28270
+ durability: "restored",
28271
+ /** Clock fields: written, but excluded from the compare that decides
28272
+ * whether persisting is worth a SQLite commit. */
28273
+ volatileStateFields: ["lastUpdated"]
28274
+ };
28275
+ /**
27872
28276
  * network-quality — system-scoped singleton capability tracking RTT,
27873
28277
  * jitter, and observed/peak bandwidth per device + per client.
27874
28278
  *
@@ -29558,287 +29962,6 @@ var ptzAutotrackCapability = {
29558
29962
  durability: "session"
29559
29963
  };
29560
29964
  /**
29561
- * `navigation` — a device-scoped capability that natively expresses the FULL
29562
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
29563
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
29564
- *
29565
- * Why a NEW cap rather than overloading `ptz`:
29566
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29567
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29568
- * The two are different physical models: PTZ is absolute-position + presets,
29569
- * navigation is momentary drive nudges + discrete robot ACTIONS
29570
- * (dock / spot-clean / follow-pet / go-to-point / …).
29571
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29572
- * the reverse:
29573
- * 1. a native CamStack navigation panel (data-driven from `listActions`
29574
- * / `getOptions`), and
29575
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29576
- * robot camera shows up in the existing PTZ control path without every
29577
- * PTZ provider learning about robots. The mapping lives in the adapter,
29578
- * not here (see the addon design note):
29579
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29580
- * ptz.stop() → navigation.stop()
29581
- * ptz.goHome() → navigation.runAction('goHome')
29582
- * ptz.getPresets() → navigation.listActions() (id→preset)
29583
- * ptz.goToPreset(id) → navigation.runAction(id)
29584
- *
29585
- * ## Continuous drive
29586
- *
29587
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29588
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29589
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29590
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29591
- * coalesce them. The UI owns the cadence.
29592
- *
29593
- * ## The action dictionary
29594
- *
29595
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29596
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29597
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29598
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29599
- * vendor-specific list. `kind: 'action'` entries are triggered with
29600
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29601
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
29602
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29603
- *
29604
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29605
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29606
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
29607
- * every device handle. A future nodedreame publish adds a typed
29608
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29609
- * provider can then swap the raw calls for the typed methods with no change to
29610
- * THIS contract.
29611
- */
29612
- /**
29613
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29614
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29615
- * halts it.
29616
- *
29617
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
29618
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29619
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29620
- * vector by it (drivers without proportional drive ignore it).
29621
- *
29622
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29623
- * axis alone; an all-undefined nudge is a no-op.
29624
- */
29625
- var NavigationMoveCommandSchema = object({
29626
- pan: number().min(-1).max(1).optional(),
29627
- tilt: number().min(-1).max(1).optional(),
29628
- speed: number().min(0).max(1).optional()
29629
- });
29630
- /**
29631
- * The enumerated discrete actions a navigation-capable robot can perform via
29632
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29633
- * subset it supports through `listActions`. Sounds are NOT here — they go through
29634
- * `playSound` (see the `sound` dictionary entries).
29635
- */
29636
- var NavigationActionIdSchema = _enum([
29637
- "goHome",
29638
- "locate",
29639
- "spotClean",
29640
- "findPet",
29641
- "personFollow",
29642
- "stop",
29643
- "startClean",
29644
- "pauseClean",
29645
- "dockWash",
29646
- "autoEmpty",
29647
- "flashOn",
29648
- "flashOff"
29649
- ]);
29650
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29651
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
29652
- /**
29653
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29654
- * native panel and the PTZ mimic render as a button.
29655
- *
29656
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29657
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29658
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
29659
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29660
- * - `label` — operator-facing English label.
29661
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29662
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29663
- * PTZ render ONLY enabled entries. Data-driven: the provider
29664
- * flips it from config, never by editing code.
29665
- */
29666
- var NavigationActionEntrySchema = object({
29667
- id: string(),
29668
- kind: NavigationEntryKindSchema,
29669
- label: string(),
29670
- icon: string(),
29671
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29672
- soundId: number().int().optional(),
29673
- /** Per-device feature flag — render this entry only when true. */
29674
- enabled: boolean()
29675
- });
29676
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
29677
- var NavigationPointSchema = object({
29678
- x: number(),
29679
- y: number()
29680
- });
29681
- /**
29682
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29683
- * The cap reports which are enabled so the UI / PTZ render only the controls
29684
- * that are turned on for THIS device. Data-driven: the provider derives these
29685
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29686
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29687
- * that are not dictionary entries.
29688
- *
29689
- * - `move` / `stop` — the momentary drive joystick.
29690
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29691
- * map-coordinate plumbing is wired.
29692
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29693
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29694
- * - `light` — the on/off fill-light toggle (works anytime).
29695
- * - `lightMode` — the auto/manual selector + manual level slider (a
29696
- * camera-service control; needs an active stream).
29697
- */
29698
- var NavigationFeaturesSchema = object({
29699
- move: boolean(),
29700
- stop: boolean(),
29701
- goToPoint: boolean(),
29702
- runAction: boolean(),
29703
- playSound: boolean(),
29704
- light: boolean(),
29705
- lightMode: boolean()
29706
- });
29707
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29708
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
29709
- /**
29710
- * Live navigation state so the UI can reflect what the robot is doing:
29711
- * - `mode` — coarse activity (idle / cleaning / following / …).
29712
- * - `following` — person/pet follow is currently armed.
29713
- * - `flash` — the on-camera fill light is on.
29714
- * - `lightMode` — auto vs manual fill-light mode.
29715
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
29716
- * `lightMode === 'manual'`.
29717
- */
29718
- var NavigationStatusSchema = object({
29719
- mode: _enum([
29720
- "idle",
29721
- "cleaning",
29722
- "spot",
29723
- "following",
29724
- "goto",
29725
- "returning",
29726
- "paused",
29727
- "unknown"
29728
- ]),
29729
- following: boolean(),
29730
- flash: boolean(),
29731
- lightMode: NavigationLightModeSchema,
29732
- lightLevel: number().min(40).max(100),
29733
- /** Ms epoch when the slice was last updated. */
29734
- lastChangedAt: number()
29735
- });
29736
- /**
29737
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29738
- * observable). Adds `lastFetchedAt` on top of the status shape per the
29739
- * convention.
29740
- */
29741
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29742
- var navigationCapability = {
29743
- name: "navigation",
29744
- scope: "device",
29745
- deviceNative: true,
29746
- mode: "singleton",
29747
- deviceTypes: [DeviceType.Camera],
29748
- deviceConfig: { ui: {
29749
- kind: "widget",
29750
- widgetId: "host/navigation-panel",
29751
- tab: "navigation",
29752
- topTab: true,
29753
- label: "Navigation",
29754
- order: 0
29755
- } },
29756
- methods: {
29757
- /**
29758
- * Momentary drive nudge (the robot moves). `protected` — mirrors
29759
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29760
- * path) works for any authenticated user, not admin-only. The UI sends
29761
- * these at ~1 Hz while a control is held; the provider forwards each one to
29762
- * a single drive write WITHOUT debouncing.
29763
- */
29764
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29765
- /** Halt all motion immediately (zero drive vector). */
29766
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29767
- /** Send the robot to a point on its live map. */
29768
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29769
- /**
29770
- * Enumerate the discrete controls THIS device supports (data-driven UI +
29771
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29772
- */
29773
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29774
- /**
29775
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29776
- * unsupported action ids are rejected by the provider.
29777
- */
29778
- runAction: method(object({
29779
- deviceId: number(),
29780
- actionId: NavigationActionIdSchema
29781
- }), _void(), { kind: "mutation" }),
29782
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29783
- playSound: method(object({
29784
- deviceId: number(),
29785
- soundId: number().int()
29786
- }), _void(), { kind: "mutation" }),
29787
- /**
29788
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29789
- * works anytime, no active stream required).
29790
- */
29791
- setLightOn: method(object({
29792
- deviceId: number(),
29793
- on: boolean()
29794
- }), _void(), { kind: "mutation" }),
29795
- /**
29796
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29797
- * initial `level`. The auto/manual + level control is a CAMERA-service
29798
- * action that generally needs an active camera stream/monitor session — the
29799
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
29800
- */
29801
- setLightMode: method(object({
29802
- deviceId: number(),
29803
- mode: NavigationLightModeSchema,
29804
- level: number().min(40).max(100).optional()
29805
- }), _void(), { kind: "mutation" }),
29806
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29807
- setLightLevel: method(object({
29808
- deviceId: number(),
29809
- level: number().min(40).max(100)
29810
- }), _void(), { kind: "mutation" }),
29811
- /**
29812
- * Per-device FEATURE-FLAG report for the general primitives — drives which
29813
- * controls the UI shows (the per-entry flags for the dictionary come back on
29814
- * `listActions`).
29815
- */
29816
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29817
- },
29818
- events: { onStatusChanged: { data: object({
29819
- deviceId: number(),
29820
- status: NavigationStatusSchema
29821
- }) } },
29822
- status: {
29823
- schema: NavigationStatusSchema,
29824
- kind: "push"
29825
- },
29826
- /**
29827
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29828
- * for live mode / follow / flash changes.
29829
- */
29830
- runtimeState: NavigationRuntimeStateSchema,
29831
- /**
29832
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
29833
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
29834
- * that. The live handle re-publishes on connect.
29835
- *
29836
- * See `RuntimeStateDurability`. Enforced by
29837
- * `scripts/check-runtime-state-durability.ts`.
29838
- */
29839
- durability: "session"
29840
- };
29841
- /**
29842
29965
  * reboot — device-scoped capability for "soft" device reboots (firmware
29843
29966
  * reboot via vendor protocol; cameras, NVRs, doorbells). Surfaces a
29844
29967
  * single mutation so the UI can offer a confirm-and-reboot button for
@@ -39756,6 +39879,12 @@ Object.freeze({
39756
39879
  addonId: null,
39757
39880
  access: "view"
39758
39881
  },
39882
+ "storage.listDrainProgress": {
39883
+ capName: "storage",
39884
+ capScope: "system",
39885
+ addonId: null,
39886
+ access: "view"
39887
+ },
39759
39888
  "storage.listLocationDeclarations": {
39760
39889
  capName: "storage",
39761
39890
  capScope: "system",
@@ -39900,6 +40029,12 @@ Object.freeze({
39900
40029
  addonId: null,
39901
40030
  access: "view"
39902
40031
  },
40032
+ "storageOccupancy.getOccupancy": {
40033
+ capName: "storage-occupancy",
40034
+ capScope: "system",
40035
+ addonId: null,
40036
+ access: "view"
40037
+ },
39903
40038
  "storageProvider.abortUpload": {
39904
40039
  capName: "storage-provider",
39905
40040
  capScope: "system",