@camstack/addon-provider-amcrest 0.2.81 → 0.2.82

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
@@ -22041,7 +22119,7 @@ method(object({
22041
22119
  }), _void(), {
22042
22120
  kind: "mutation",
22043
22121
  auth: "admin"
22044
- }), method(object({ id: string() }), object({
22122
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
22045
22123
  ok: boolean(),
22046
22124
  error: string().optional()
22047
22125
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22111,6 +22189,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22111
22189
  kind: "mutation",
22112
22190
  auth: "admin"
22113
22191
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22192
+ /**
22193
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22194
+ * location (D388).
22195
+ *
22196
+ * ## Why this is not `storage-evictable`
22197
+ *
22198
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22199
+ * not, in two ways that both matter and both bite hardest on the locations an
22200
+ * operator most wants a figure for:
22201
+ *
22202
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22203
+ * and `recordingsLow:default` deliberately share one root and evict as one
22204
+ * oldest-first pool, so both answer with the SAME combined total. As an
22205
+ * occupancy figure that double-counts the disk.
22206
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22207
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22208
+ * is retiring and staring at.
22209
+ *
22210
+ * So this is its own contract with its own quantity, and the quantity is
22211
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22212
+ * would ever be willing to delete it. A provider that can only answer
22213
+ * "evictable" must not register here — a number that silently means different
22214
+ * things per class is worse than no number.
22215
+ *
22216
+ * ## Absence is an answer
22217
+ *
22218
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22219
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22220
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22221
+ * consuming side has to be written out loud instead of appearing by accident.
22222
+ *
22223
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22224
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22225
+ */
22226
+ /** One provider's occupancy answer for one location. */
22227
+ var StorageOccupancyReportSchema = object({
22228
+ locationId: string(),
22229
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22230
+ * not net of what it is willing to delete. */
22231
+ ownedBytes: number().int().nonnegative(),
22232
+ /** When the provider last actually measured this. The orchestrator carries it
22233
+ * through so a UI can say how old the figure is instead of implying "now". */
22234
+ measuredAtMs: number().int().nonnegative()
22235
+ });
22236
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22114
22237
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22115
22238
  providerId: string().min(1),
22116
22239
  displayName: string().min(1),
@@ -23946,88 +24069,6 @@ onStatusChanged: { data: object({
23946
24069
  volatileStateFields: ["lastUpdated"]
23947
24070
  };
23948
24071
  /**
23949
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23950
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23951
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23952
- * one Home Assistant projection.
23953
- */
23954
- var NetworkLinkStatusSchema = object({
23955
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23956
- type: _enum([
23957
- "wifi",
23958
- "ethernet",
23959
- "cellular",
23960
- "unknown"
23961
- ]),
23962
- /**
23963
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23964
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23965
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23966
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23967
- * SKIP a null rather than coerce it.
23968
- */
23969
- signalPercent: number().min(0).max(100).nullable(),
23970
- /** Raw received signal strength in dBm, when the firmware reports one. */
23971
- rssiDbm: number().optional(),
23972
- /** Network name of a wireless link, when the firmware reports it. */
23973
- ssid: string().optional(),
23974
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23975
- lastUpdated: number()
23976
- });
23977
- var networkLinkCapability = {
23978
- name: "network-link",
23979
- scope: "device",
23980
- deviceNative: true,
23981
- mode: "singleton",
23982
- deviceTypes: [
23983
- DeviceType.Camera,
23984
- DeviceType.Sensor,
23985
- DeviceType.Button,
23986
- DeviceType.Switch,
23987
- DeviceType.Light,
23988
- DeviceType.Lock,
23989
- DeviceType.Siren
23990
- ],
23991
- methods: {},
23992
- events: {
23993
- /**
23994
- * Emitted whenever the cached status changes (a link switch, a signal
23995
- * reading that moved). Mirrored on the parent chain by the
23996
- * DeviceEventPropagator like `battery.onStatusChanged`.
23997
- */
23998
- onStatusChanged: { data: object({
23999
- deviceId: number(),
24000
- status: NetworkLinkStatusSchema
24001
- }) } },
24002
- status: {
24003
- schema: NetworkLinkStatusSchema,
24004
- kind: "push",
24005
- empty: {
24006
- type: "unknown",
24007
- signalPercent: null,
24008
- lastUpdated: 0
24009
- }
24010
- },
24011
- /**
24012
- * Runtime-state slice — every provider stores the same shape under
24013
- * `device.runtimeState['network-link']`, read once by the badge and the
24014
- * Home Assistant projector regardless of the driver.
24015
- */
24016
- runtimeState: NetworkLinkStatusSchema,
24017
- /**
24018
- * Runtime-state durability: **restored** — a link reading is slow to
24019
- * change and a sleeping battery camera may not report for hours; the
24020
- * restored slice is what the badge shows until the next read.
24021
- *
24022
- * See `RuntimeStateDurability`. Enforced by
24023
- * `scripts/check-runtime-state-durability.ts`.
24024
- */
24025
- durability: "restored",
24026
- /** Clock fields: written, but excluded from the compare that decides
24027
- * whether persisting is worth a SQLite commit. */
24028
- volatileStateFields: ["lastUpdated"]
24029
- };
24030
- /**
24031
24072
  * Generic boolean sensor — last-resort fallback when no domain-
24032
24073
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24033
24074
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -27557,6 +27598,369 @@ var nativeObjectDetectionCapability = {
27557
27598
  volatileStateFields: ["lastFetchedAt"]
27558
27599
  };
27559
27600
  /**
27601
+ * `navigation` — a device-scoped capability that natively expresses the FULL
27602
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
27603
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
27604
+ *
27605
+ * Why a NEW cap rather than overloading `ptz`:
27606
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27607
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27608
+ * The two are different physical models: PTZ is absolute-position + presets,
27609
+ * navigation is momentary drive nudges + discrete robot ACTIONS
27610
+ * (dock / spot-clean / follow-pet / go-to-point / …).
27611
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27612
+ * the reverse:
27613
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
27614
+ * / `getOptions`), and
27615
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27616
+ * robot camera shows up in the existing PTZ control path without every
27617
+ * PTZ provider learning about robots. The mapping lives in the adapter,
27618
+ * not here (see the addon design note):
27619
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27620
+ * ptz.stop() → navigation.stop()
27621
+ * ptz.goHome() → navigation.runAction('goHome')
27622
+ * ptz.getPresets() → navigation.listActions() (id→preset)
27623
+ * ptz.goToPreset(id) → navigation.runAction(id)
27624
+ *
27625
+ * ## Continuous drive
27626
+ *
27627
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27628
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27629
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27630
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27631
+ * coalesce them. The UI owns the cadence.
27632
+ *
27633
+ * ## The action dictionary
27634
+ *
27635
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27636
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27637
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27638
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27639
+ * vendor-specific list. `kind: 'action'` entries are triggered with
27640
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27641
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
27642
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27643
+ *
27644
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27645
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27646
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
27647
+ * every device handle. A future nodedreame publish adds a typed
27648
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27649
+ * provider can then swap the raw calls for the typed methods with no change to
27650
+ * THIS contract.
27651
+ */
27652
+ /**
27653
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27654
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27655
+ * halts it.
27656
+ *
27657
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
27658
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27659
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27660
+ * vector by it (drivers without proportional drive ignore it).
27661
+ *
27662
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27663
+ * axis alone; an all-undefined nudge is a no-op.
27664
+ */
27665
+ var NavigationMoveCommandSchema = object({
27666
+ pan: number().min(-1).max(1).optional(),
27667
+ tilt: number().min(-1).max(1).optional(),
27668
+ speed: number().min(0).max(1).optional()
27669
+ });
27670
+ /**
27671
+ * The enumerated discrete actions a navigation-capable robot can perform via
27672
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27673
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
27674
+ * `playSound` (see the `sound` dictionary entries).
27675
+ */
27676
+ var NavigationActionIdSchema = _enum([
27677
+ "goHome",
27678
+ "locate",
27679
+ "spotClean",
27680
+ "findPet",
27681
+ "personFollow",
27682
+ "stop",
27683
+ "startClean",
27684
+ "pauseClean",
27685
+ "dockWash",
27686
+ "autoEmpty",
27687
+ "flashOn",
27688
+ "flashOff"
27689
+ ]);
27690
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27691
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
27692
+ /**
27693
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27694
+ * native panel and the PTZ mimic render as a button.
27695
+ *
27696
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27697
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27698
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
27699
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27700
+ * - `label` — operator-facing English label.
27701
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27702
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27703
+ * PTZ render ONLY enabled entries. Data-driven: the provider
27704
+ * flips it from config, never by editing code.
27705
+ */
27706
+ var NavigationActionEntrySchema = object({
27707
+ id: string(),
27708
+ kind: NavigationEntryKindSchema,
27709
+ label: string(),
27710
+ icon: string(),
27711
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27712
+ soundId: number().int().optional(),
27713
+ /** Per-device feature flag — render this entry only when true. */
27714
+ enabled: boolean()
27715
+ });
27716
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
27717
+ var NavigationPointSchema = object({
27718
+ x: number(),
27719
+ y: number()
27720
+ });
27721
+ /**
27722
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27723
+ * The cap reports which are enabled so the UI / PTZ render only the controls
27724
+ * that are turned on for THIS device. Data-driven: the provider derives these
27725
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27726
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27727
+ * that are not dictionary entries.
27728
+ *
27729
+ * - `move` / `stop` — the momentary drive joystick.
27730
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27731
+ * map-coordinate plumbing is wired.
27732
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27733
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27734
+ * - `light` — the on/off fill-light toggle (works anytime).
27735
+ * - `lightMode` — the auto/manual selector + manual level slider (a
27736
+ * camera-service control; needs an active stream).
27737
+ */
27738
+ var NavigationFeaturesSchema = object({
27739
+ move: boolean(),
27740
+ stop: boolean(),
27741
+ goToPoint: boolean(),
27742
+ runAction: boolean(),
27743
+ playSound: boolean(),
27744
+ light: boolean(),
27745
+ lightMode: boolean()
27746
+ });
27747
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27748
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
27749
+ /**
27750
+ * Live navigation state so the UI can reflect what the robot is doing:
27751
+ * - `mode` — coarse activity (idle / cleaning / following / …).
27752
+ * - `following` — person/pet follow is currently armed.
27753
+ * - `flash` — the on-camera fill light is on.
27754
+ * - `lightMode` — auto vs manual fill-light mode.
27755
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
27756
+ * `lightMode === 'manual'`.
27757
+ */
27758
+ var NavigationStatusSchema = object({
27759
+ mode: _enum([
27760
+ "idle",
27761
+ "cleaning",
27762
+ "spot",
27763
+ "following",
27764
+ "goto",
27765
+ "returning",
27766
+ "paused",
27767
+ "unknown"
27768
+ ]),
27769
+ following: boolean(),
27770
+ flash: boolean(),
27771
+ lightMode: NavigationLightModeSchema,
27772
+ lightLevel: number().min(40).max(100),
27773
+ /** Ms epoch when the slice was last updated. */
27774
+ lastChangedAt: number()
27775
+ });
27776
+ /**
27777
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
27778
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
27779
+ * convention.
27780
+ */
27781
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
27782
+ var navigationCapability = {
27783
+ name: "navigation",
27784
+ scope: "device",
27785
+ deviceNative: true,
27786
+ mode: "singleton",
27787
+ deviceTypes: [DeviceType.Camera],
27788
+ deviceConfig: { ui: {
27789
+ kind: "widget",
27790
+ widgetId: "host/navigation-panel",
27791
+ tab: "navigation",
27792
+ topTab: true,
27793
+ label: "Navigation",
27794
+ order: 0
27795
+ } },
27796
+ methods: {
27797
+ /**
27798
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
27799
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
27800
+ * path) works for any authenticated user, not admin-only. The UI sends
27801
+ * these at ~1 Hz while a control is held; the provider forwards each one to
27802
+ * a single drive write WITHOUT debouncing.
27803
+ */
27804
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27805
+ /** Halt all motion immediately (zero drive vector). */
27806
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
27807
+ /** Send the robot to a point on its live map. */
27808
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27809
+ /**
27810
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
27811
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
27812
+ */
27813
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
27814
+ /**
27815
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
27816
+ * unsupported action ids are rejected by the provider.
27817
+ */
27818
+ runAction: method(object({
27819
+ deviceId: number(),
27820
+ actionId: NavigationActionIdSchema
27821
+ }), _void(), { kind: "mutation" }),
27822
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
27823
+ playSound: method(object({
27824
+ deviceId: number(),
27825
+ soundId: number().int()
27826
+ }), _void(), { kind: "mutation" }),
27827
+ /**
27828
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
27829
+ * works anytime, no active stream required).
27830
+ */
27831
+ setLightOn: method(object({
27832
+ deviceId: number(),
27833
+ on: boolean()
27834
+ }), _void(), { kind: "mutation" }),
27835
+ /**
27836
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
27837
+ * initial `level`. The auto/manual + level control is a CAMERA-service
27838
+ * action that generally needs an active camera stream/monitor session — the
27839
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
27840
+ */
27841
+ setLightMode: method(object({
27842
+ deviceId: number(),
27843
+ mode: NavigationLightModeSchema,
27844
+ level: number().min(40).max(100).optional()
27845
+ }), _void(), { kind: "mutation" }),
27846
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
27847
+ setLightLevel: method(object({
27848
+ deviceId: number(),
27849
+ level: number().min(40).max(100)
27850
+ }), _void(), { kind: "mutation" }),
27851
+ /**
27852
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
27853
+ * controls the UI shows (the per-entry flags for the dictionary come back on
27854
+ * `listActions`).
27855
+ */
27856
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
27857
+ },
27858
+ events: { onStatusChanged: { data: object({
27859
+ deviceId: number(),
27860
+ status: NavigationStatusSchema
27861
+ }) } },
27862
+ status: {
27863
+ schema: NavigationStatusSchema,
27864
+ kind: "push"
27865
+ },
27866
+ /**
27867
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
27868
+ * for live mode / follow / flash changes.
27869
+ */
27870
+ runtimeState: NavigationRuntimeStateSchema,
27871
+ /**
27872
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
27873
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
27874
+ * that. The live handle re-publishes on connect.
27875
+ *
27876
+ * See `RuntimeStateDurability`. Enforced by
27877
+ * `scripts/check-runtime-state-durability.ts`.
27878
+ */
27879
+ durability: "session"
27880
+ };
27881
+ /**
27882
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
27883
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
27884
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
27885
+ * one Home Assistant projection.
27886
+ */
27887
+ var NetworkLinkStatusSchema = object({
27888
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
27889
+ type: _enum([
27890
+ "wifi",
27891
+ "ethernet",
27892
+ "cellular",
27893
+ "unknown"
27894
+ ]),
27895
+ /**
27896
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
27897
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
27898
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
27899
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
27900
+ * SKIP a null rather than coerce it.
27901
+ */
27902
+ signalPercent: number().min(0).max(100).nullable(),
27903
+ /** Raw received signal strength in dBm, when the firmware reports one. */
27904
+ rssiDbm: number().optional(),
27905
+ /** Network name of a wireless link, when the firmware reports it. */
27906
+ ssid: string().optional(),
27907
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
27908
+ lastUpdated: number()
27909
+ });
27910
+ var networkLinkCapability = {
27911
+ name: "network-link",
27912
+ scope: "device",
27913
+ deviceNative: true,
27914
+ mode: "singleton",
27915
+ deviceTypes: [
27916
+ DeviceType.Camera,
27917
+ DeviceType.Sensor,
27918
+ DeviceType.Button,
27919
+ DeviceType.Switch,
27920
+ DeviceType.Light,
27921
+ DeviceType.Lock,
27922
+ DeviceType.Siren
27923
+ ],
27924
+ methods: {},
27925
+ events: {
27926
+ /**
27927
+ * Emitted whenever the cached status changes (a link switch, a signal
27928
+ * reading that moved). Mirrored on the parent chain by the
27929
+ * DeviceEventPropagator like `battery.onStatusChanged`.
27930
+ */
27931
+ onStatusChanged: { data: object({
27932
+ deviceId: number(),
27933
+ status: NetworkLinkStatusSchema
27934
+ }) } },
27935
+ status: {
27936
+ schema: NetworkLinkStatusSchema,
27937
+ kind: "push",
27938
+ empty: {
27939
+ type: "unknown",
27940
+ signalPercent: null,
27941
+ lastUpdated: 0
27942
+ }
27943
+ },
27944
+ /**
27945
+ * Runtime-state slice — every provider stores the same shape under
27946
+ * `device.runtimeState['network-link']`, read once by the badge and the
27947
+ * Home Assistant projector regardless of the driver.
27948
+ */
27949
+ runtimeState: NetworkLinkStatusSchema,
27950
+ /**
27951
+ * Runtime-state durability: **restored** — a link reading is slow to
27952
+ * change and a sleeping battery camera may not report for hours; the
27953
+ * restored slice is what the badge shows until the next read.
27954
+ *
27955
+ * See `RuntimeStateDurability`. Enforced by
27956
+ * `scripts/check-runtime-state-durability.ts`.
27957
+ */
27958
+ durability: "restored",
27959
+ /** Clock fields: written, but excluded from the compare that decides
27960
+ * whether persisting is worth a SQLite commit. */
27961
+ volatileStateFields: ["lastUpdated"]
27962
+ };
27963
+ /**
27560
27964
  * network-quality — system-scoped singleton capability tracking RTT,
27561
27965
  * jitter, and observed/peak bandwidth per device + per client.
27562
27966
  *
@@ -29245,287 +29649,6 @@ var ptzAutotrackCapability = {
29245
29649
  */
29246
29650
  durability: "session"
29247
29651
  };
29248
- /**
29249
- * `navigation` — a device-scoped capability that natively expresses the FULL
29250
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
29251
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
29252
- *
29253
- * Why a NEW cap rather than overloading `ptz`:
29254
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29255
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29256
- * The two are different physical models: PTZ is absolute-position + presets,
29257
- * navigation is momentary drive nudges + discrete robot ACTIONS
29258
- * (dock / spot-clean / follow-pet / go-to-point / …).
29259
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29260
- * the reverse:
29261
- * 1. a native CamStack navigation panel (data-driven from `listActions`
29262
- * / `getOptions`), and
29263
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29264
- * robot camera shows up in the existing PTZ control path without every
29265
- * PTZ provider learning about robots. The mapping lives in the adapter,
29266
- * not here (see the addon design note):
29267
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29268
- * ptz.stop() → navigation.stop()
29269
- * ptz.goHome() → navigation.runAction('goHome')
29270
- * ptz.getPresets() → navigation.listActions() (id→preset)
29271
- * ptz.goToPreset(id) → navigation.runAction(id)
29272
- *
29273
- * ## Continuous drive
29274
- *
29275
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29276
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29277
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29278
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29279
- * coalesce them. The UI owns the cadence.
29280
- *
29281
- * ## The action dictionary
29282
- *
29283
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29284
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29285
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29286
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29287
- * vendor-specific list. `kind: 'action'` entries are triggered with
29288
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29289
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
29290
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29291
- *
29292
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29293
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29294
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
29295
- * every device handle. A future nodedreame publish adds a typed
29296
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29297
- * provider can then swap the raw calls for the typed methods with no change to
29298
- * THIS contract.
29299
- */
29300
- /**
29301
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29302
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29303
- * halts it.
29304
- *
29305
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
29306
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29307
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29308
- * vector by it (drivers without proportional drive ignore it).
29309
- *
29310
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29311
- * axis alone; an all-undefined nudge is a no-op.
29312
- */
29313
- var NavigationMoveCommandSchema = object({
29314
- pan: number().min(-1).max(1).optional(),
29315
- tilt: number().min(-1).max(1).optional(),
29316
- speed: number().min(0).max(1).optional()
29317
- });
29318
- /**
29319
- * The enumerated discrete actions a navigation-capable robot can perform via
29320
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29321
- * subset it supports through `listActions`. Sounds are NOT here — they go through
29322
- * `playSound` (see the `sound` dictionary entries).
29323
- */
29324
- var NavigationActionIdSchema = _enum([
29325
- "goHome",
29326
- "locate",
29327
- "spotClean",
29328
- "findPet",
29329
- "personFollow",
29330
- "stop",
29331
- "startClean",
29332
- "pauseClean",
29333
- "dockWash",
29334
- "autoEmpty",
29335
- "flashOn",
29336
- "flashOff"
29337
- ]);
29338
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29339
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
29340
- /**
29341
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29342
- * native panel and the PTZ mimic render as a button.
29343
- *
29344
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29345
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29346
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
29347
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29348
- * - `label` — operator-facing English label.
29349
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29350
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29351
- * PTZ render ONLY enabled entries. Data-driven: the provider
29352
- * flips it from config, never by editing code.
29353
- */
29354
- var NavigationActionEntrySchema = object({
29355
- id: string(),
29356
- kind: NavigationEntryKindSchema,
29357
- label: string(),
29358
- icon: string(),
29359
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29360
- soundId: number().int().optional(),
29361
- /** Per-device feature flag — render this entry only when true. */
29362
- enabled: boolean()
29363
- });
29364
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
29365
- var NavigationPointSchema = object({
29366
- x: number(),
29367
- y: number()
29368
- });
29369
- /**
29370
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29371
- * The cap reports which are enabled so the UI / PTZ render only the controls
29372
- * that are turned on for THIS device. Data-driven: the provider derives these
29373
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29374
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29375
- * that are not dictionary entries.
29376
- *
29377
- * - `move` / `stop` — the momentary drive joystick.
29378
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29379
- * map-coordinate plumbing is wired.
29380
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29381
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29382
- * - `light` — the on/off fill-light toggle (works anytime).
29383
- * - `lightMode` — the auto/manual selector + manual level slider (a
29384
- * camera-service control; needs an active stream).
29385
- */
29386
- var NavigationFeaturesSchema = object({
29387
- move: boolean(),
29388
- stop: boolean(),
29389
- goToPoint: boolean(),
29390
- runAction: boolean(),
29391
- playSound: boolean(),
29392
- light: boolean(),
29393
- lightMode: boolean()
29394
- });
29395
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29396
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
29397
- /**
29398
- * Live navigation state so the UI can reflect what the robot is doing:
29399
- * - `mode` — coarse activity (idle / cleaning / following / …).
29400
- * - `following` — person/pet follow is currently armed.
29401
- * - `flash` — the on-camera fill light is on.
29402
- * - `lightMode` — auto vs manual fill-light mode.
29403
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
29404
- * `lightMode === 'manual'`.
29405
- */
29406
- var NavigationStatusSchema = object({
29407
- mode: _enum([
29408
- "idle",
29409
- "cleaning",
29410
- "spot",
29411
- "following",
29412
- "goto",
29413
- "returning",
29414
- "paused",
29415
- "unknown"
29416
- ]),
29417
- following: boolean(),
29418
- flash: boolean(),
29419
- lightMode: NavigationLightModeSchema,
29420
- lightLevel: number().min(40).max(100),
29421
- /** Ms epoch when the slice was last updated. */
29422
- lastChangedAt: number()
29423
- });
29424
- /**
29425
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29426
- * observable). Adds `lastFetchedAt` on top of the status shape per the
29427
- * convention.
29428
- */
29429
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29430
- var navigationCapability = {
29431
- name: "navigation",
29432
- scope: "device",
29433
- deviceNative: true,
29434
- mode: "singleton",
29435
- deviceTypes: [DeviceType.Camera],
29436
- deviceConfig: { ui: {
29437
- kind: "widget",
29438
- widgetId: "host/navigation-panel",
29439
- tab: "navigation",
29440
- topTab: true,
29441
- label: "Navigation",
29442
- order: 0
29443
- } },
29444
- methods: {
29445
- /**
29446
- * Momentary drive nudge (the robot moves). `protected` — mirrors
29447
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29448
- * path) works for any authenticated user, not admin-only. The UI sends
29449
- * these at ~1 Hz while a control is held; the provider forwards each one to
29450
- * a single drive write WITHOUT debouncing.
29451
- */
29452
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29453
- /** Halt all motion immediately (zero drive vector). */
29454
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29455
- /** Send the robot to a point on its live map. */
29456
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29457
- /**
29458
- * Enumerate the discrete controls THIS device supports (data-driven UI +
29459
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29460
- */
29461
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29462
- /**
29463
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29464
- * unsupported action ids are rejected by the provider.
29465
- */
29466
- runAction: method(object({
29467
- deviceId: number(),
29468
- actionId: NavigationActionIdSchema
29469
- }), _void(), { kind: "mutation" }),
29470
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29471
- playSound: method(object({
29472
- deviceId: number(),
29473
- soundId: number().int()
29474
- }), _void(), { kind: "mutation" }),
29475
- /**
29476
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29477
- * works anytime, no active stream required).
29478
- */
29479
- setLightOn: method(object({
29480
- deviceId: number(),
29481
- on: boolean()
29482
- }), _void(), { kind: "mutation" }),
29483
- /**
29484
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29485
- * initial `level`. The auto/manual + level control is a CAMERA-service
29486
- * action that generally needs an active camera stream/monitor session — the
29487
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
29488
- */
29489
- setLightMode: method(object({
29490
- deviceId: number(),
29491
- mode: NavigationLightModeSchema,
29492
- level: number().min(40).max(100).optional()
29493
- }), _void(), { kind: "mutation" }),
29494
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29495
- setLightLevel: method(object({
29496
- deviceId: number(),
29497
- level: number().min(40).max(100)
29498
- }), _void(), { kind: "mutation" }),
29499
- /**
29500
- * Per-device FEATURE-FLAG report for the general primitives — drives which
29501
- * controls the UI shows (the per-entry flags for the dictionary come back on
29502
- * `listActions`).
29503
- */
29504
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29505
- },
29506
- events: { onStatusChanged: { data: object({
29507
- deviceId: number(),
29508
- status: NavigationStatusSchema
29509
- }) } },
29510
- status: {
29511
- schema: NavigationStatusSchema,
29512
- kind: "push"
29513
- },
29514
- /**
29515
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29516
- * for live mode / follow / flash changes.
29517
- */
29518
- runtimeState: NavigationRuntimeStateSchema,
29519
- /**
29520
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
29521
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
29522
- * that. The live handle re-publishes on connect.
29523
- *
29524
- * See `RuntimeStateDurability`. Enforced by
29525
- * `scripts/check-runtime-state-durability.ts`.
29526
- */
29527
- durability: "session"
29528
- };
29529
29652
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29530
29653
  kind: "mutation",
29531
29654
  auth: "admin"
@@ -39392,6 +39515,12 @@ Object.freeze({
39392
39515
  addonId: null,
39393
39516
  access: "view"
39394
39517
  },
39518
+ "storage.listDrainProgress": {
39519
+ capName: "storage",
39520
+ capScope: "system",
39521
+ addonId: null,
39522
+ access: "view"
39523
+ },
39395
39524
  "storage.listLocationDeclarations": {
39396
39525
  capName: "storage",
39397
39526
  capScope: "system",
@@ -39536,6 +39665,12 @@ Object.freeze({
39536
39665
  addonId: null,
39537
39666
  access: "view"
39538
39667
  },
39668
+ "storageOccupancy.getOccupancy": {
39669
+ capName: "storage-occupancy",
39670
+ capScope: "system",
39671
+ addonId: null,
39672
+ access: "view"
39673
+ },
39539
39674
  "storageProvider.abortUpload": {
39540
39675
  capName: "storage-provider",
39541
39676
  capScope: "system",