@camstack/addon-agent-ui 1.2.84 → 1.2.86

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 (2) hide show
  1. package/dist/addon.js +387 -235
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
- //#region ../types/dist/event-category-zAv7pMUz.mjs
3
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -195,6 +195,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
195
195
  EventCategory["ProcessCrashed"] = "process.crashed";
196
196
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
197
197
  EventCategory["ProcessRestarted"] = "process.restarted";
198
+ /**
199
+ * The SET of storage locations changed — one was created, edited, enabled,
200
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
201
+ *
202
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
203
+ * it must also converge on its own periodic path, because a dropped event
204
+ * must not leave a node writing to yesterday's disk set forever. It exists
205
+ * because there was NO signal at all — an operator who added a second
206
+ * recordings disk in the admin UI got nothing, and the recorder kept its
207
+ * resolved locations until something else happened to re-resolve them
208
+ * (D387). Payload `StorageLocationsChangedPayload`.
209
+ */
210
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
198
211
  EventCategory["RecordingStarted"] = "recording.started";
199
212
  EventCategory["RecordingStopped"] = "recording.stopped";
200
213
  EventCategory["RecordingError"] = "recording.error";
@@ -8539,6 +8552,21 @@ var StorageCleanupJobSchema = object({
8539
8552
  });
8540
8553
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8541
8554
  /**
8555
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8556
+ * alias below is `z.infer<>` of it, never a second spelling.
8557
+ */
8558
+ var StorageLocationModeSchema = _enum([
8559
+ "active",
8560
+ "readonly",
8561
+ "drain",
8562
+ "disabled"
8563
+ ]);
8564
+ _enum([
8565
+ "normal",
8566
+ "never",
8567
+ "drain"
8568
+ ]);
8569
+ /**
8542
8570
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8543
8571
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8544
8572
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8604,6 +8632,21 @@ var StorageLocationSchema = object({
8604
8632
  * stops existing rather than being re-derived on every read.
8605
8633
  */
8606
8634
  enabled: boolean().optional(),
8635
+ /**
8636
+ * THE state of this location (D385), and the only authority on what may be
8637
+ * written, read or evicted here. Interpreted in exactly one place —
8638
+ * `storage-location-mode.ts` — which also folds the legacy
8639
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8640
+ * ambiguous.
8641
+ *
8642
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8643
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8644
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8645
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8646
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8647
+ * either, so the two cannot disagree.
8648
+ */
8649
+ mode: StorageLocationModeSchema.optional(),
8607
8650
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8608
8651
  * for node-local locations it can reach) — never persisted, absent when the
8609
8652
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8611,11 +8654,46 @@ var StorageLocationSchema = object({
8611
8654
  totalBytes: number(),
8612
8655
  availableBytes: number()
8613
8656
  }).nullable().optional(),
8657
+ /**
8658
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8659
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8660
+ * never persisted, never a filesystem walk.
8661
+ *
8662
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8663
+ * location yet — nobody stores here, the owning addon is down, or the first
8664
+ * refresh has not completed. A UI must omit the segment rather than draw it
8665
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8666
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8667
+ * be spelled out loud instead of appearing by accident.
8668
+ *
8669
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8670
+ * about the whole figure rather than about its freshest part.
8671
+ */
8672
+ owned: object({
8673
+ bytes: number().int().nonnegative(),
8674
+ measuredAtMs: number().int().nonnegative()
8675
+ }).optional(),
8614
8676
  createdAt: number(),
8615
8677
  updatedAt: number()
8616
8678
  });
8617
8679
  object({ isDefault: boolean().optional() });
8618
8680
  /**
8681
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8682
+ *
8683
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8684
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8685
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8686
+ * operator learns not to believe the screen.
8687
+ */
8688
+ var StorageDrainProgressSchema = object({
8689
+ locationId: string(),
8690
+ startedAtMs: number(),
8691
+ startBytes: number(),
8692
+ bytesRemaining: number(),
8693
+ drained: boolean(),
8694
+ estimatedEmptyAtMs: number().nullable()
8695
+ });
8696
+ /**
8619
8697
  * Reference accepted by consumer-facing `api.storage.*` calls.
8620
8698
  * Either:
8621
8699
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -20056,8 +20134,25 @@ var occupancyRecheckFramesField = {
20056
20134
  * (analyzer attaches detected `regions[]`; onboard does not — the
20057
20135
  * camera typically only reports a binary signal plus an optional
20058
20136
  * channel/AI class which lives in dedicated event channels).
20059
- */
20060
- var MotionSourceEnum = _enum(["onboard", "analyzer"]);
20137
+ *
20138
+ * - `onboard` — the camera's firmware said something moved.
20139
+ * - `analyzer` — this runner's frame-diff said so, and attaches `regions[]`.
20140
+ * - `device-activity` — the DEVICE said it is doing its job: the
20141
+ * `recording-signal` LEVEL the same device raises for the recorder
20142
+ * ([D380](../../../../docs/decisions/adr-0380-a-device-decided-recording-is-a-mode-with-no-schedule-seeded-once.md)),
20143
+ * republished as a motion source. It attaches **nothing** — no regions, no
20144
+ * class: the only fact it carries is that the device is active, and a robot
20145
+ * vacuum that is itself the moving object has no region worth sending. It is
20146
+ * a LEVEL, so unlike `onboard` it has a real falling edge, and unlike
20147
+ * `analyzer` it must not open the frame-diff side-channel — the runner's
20148
+ * `handleOnboardMotionAnalyzer` gate is `source === 'onboard'` and stays that
20149
+ * way ([D392](../../../../docs/decisions/adr-0392-a-device-that-says-it-is-working-is-a-motion-source-of-its-own.md)).
20150
+ */
20151
+ var MotionSourceEnum = _enum([
20152
+ "onboard",
20153
+ "analyzer",
20154
+ "device-activity"
20155
+ ]);
20061
20156
  /**
20062
20157
  * List of motion sources active on a camera. Empty array is valid:
20063
20158
  * "no source" — happens for battery cams without firmware motion when
@@ -21576,7 +21671,7 @@ method(object({
21576
21671
  }), _void(), {
21577
21672
  kind: "mutation",
21578
21673
  auth: "admin"
21579
- }), method(object({ id: string() }), object({
21674
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21580
21675
  ok: boolean(),
21581
21676
  error: string().optional()
21582
21677
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21646,6 +21741,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21646
21741
  kind: "mutation",
21647
21742
  auth: "admin"
21648
21743
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21744
+ /**
21745
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21746
+ * location (D388).
21747
+ *
21748
+ * ## Why this is not `storage-evictable`
21749
+ *
21750
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21751
+ * not, in two ways that both matter and both bite hardest on the locations an
21752
+ * operator most wants a figure for:
21753
+ *
21754
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21755
+ * and `recordingsLow:default` deliberately share one root and evict as one
21756
+ * oldest-first pool, so both answer with the SAME combined total. As an
21757
+ * occupancy figure that double-counts the disk.
21758
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21759
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21760
+ * is retiring and staring at.
21761
+ *
21762
+ * So this is its own contract with its own quantity, and the quantity is
21763
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21764
+ * would ever be willing to delete it. A provider that can only answer
21765
+ * "evictable" must not register here — a number that silently means different
21766
+ * things per class is worse than no number.
21767
+ *
21768
+ * ## Absence is an answer
21769
+ *
21770
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21771
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21772
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21773
+ * consuming side has to be written out loud instead of appearing by accident.
21774
+ *
21775
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21776
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21777
+ */
21778
+ /** One provider's occupancy answer for one location. */
21779
+ var StorageOccupancyReportSchema = object({
21780
+ locationId: string(),
21781
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21782
+ * not net of what it is willing to delete. */
21783
+ ownedBytes: number().int().nonnegative(),
21784
+ /** When the provider last actually measured this. The orchestrator carries it
21785
+ * through so a UI can say how old the figure is instead of implying "now". */
21786
+ measuredAtMs: number().int().nonnegative()
21787
+ });
21788
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21649
21789
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21650
21790
  providerId: string().min(1),
21651
21791
  displayName: string().min(1),
@@ -23281,39 +23421,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23281
23421
  deviceId: number(),
23282
23422
  status: BatteryStatusSchema
23283
23423
  });
23284
- /**
23285
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23286
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23287
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23288
- * one Home Assistant projection.
23289
- */
23290
- var NetworkLinkStatusSchema = object({
23291
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23292
- type: _enum([
23293
- "wifi",
23294
- "ethernet",
23295
- "cellular",
23296
- "unknown"
23297
- ]),
23298
- /**
23299
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23300
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23301
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23302
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23303
- * SKIP a null rather than coerce it.
23304
- */
23305
- signalPercent: number().min(0).max(100).nullable(),
23306
- /** Raw received signal strength in dBm, when the firmware reports one. */
23307
- rssiDbm: number().optional(),
23308
- /** Network name of a wireless link, when the firmware reports it. */
23309
- ssid: string().optional(),
23310
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23311
- lastUpdated: number()
23312
- });
23313
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23314
- deviceId: number(),
23315
- status: NetworkLinkStatusSchema
23316
- });
23317
23424
  object({
23318
23425
  on: boolean(),
23319
23426
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25667,6 +25774,236 @@ DeviceType.Camera, method(object({
25667
25774
  detection: NativeDetectionSchema
25668
25775
  });
25669
25776
  /**
25777
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25778
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25779
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25780
+ *
25781
+ * Why a NEW cap rather than overloading `ptz`:
25782
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25783
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25784
+ * The two are different physical models: PTZ is absolute-position + presets,
25785
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25786
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25787
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25788
+ * the reverse:
25789
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25790
+ * / `getOptions`), and
25791
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25792
+ * robot camera shows up in the existing PTZ control path without every
25793
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25794
+ * not here (see the addon design note):
25795
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25796
+ * ptz.stop() → navigation.stop()
25797
+ * ptz.goHome() → navigation.runAction('goHome')
25798
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25799
+ * ptz.goToPreset(id) → navigation.runAction(id)
25800
+ *
25801
+ * ## Continuous drive
25802
+ *
25803
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25804
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25805
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25806
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25807
+ * coalesce them. The UI owns the cadence.
25808
+ *
25809
+ * ## The action dictionary
25810
+ *
25811
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
25812
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
25813
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
25814
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
25815
+ * vendor-specific list. `kind: 'action'` entries are triggered with
25816
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
25817
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
25818
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
25819
+ *
25820
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
25821
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
25822
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
25823
+ * every device handle. A future nodedreame publish adds a typed
25824
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
25825
+ * provider can then swap the raw calls for the typed methods with no change to
25826
+ * THIS contract.
25827
+ */
25828
+ /**
25829
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
25830
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
25831
+ * halts it.
25832
+ *
25833
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
25834
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
25835
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
25836
+ * vector by it (drivers without proportional drive ignore it).
25837
+ *
25838
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
25839
+ * axis alone; an all-undefined nudge is a no-op.
25840
+ */
25841
+ var NavigationMoveCommandSchema = object({
25842
+ pan: number().min(-1).max(1).optional(),
25843
+ tilt: number().min(-1).max(1).optional(),
25844
+ speed: number().min(0).max(1).optional()
25845
+ });
25846
+ /**
25847
+ * The enumerated discrete actions a navigation-capable robot can perform via
25848
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
25849
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
25850
+ * `playSound` (see the `sound` dictionary entries).
25851
+ */
25852
+ var NavigationActionIdSchema = _enum([
25853
+ "goHome",
25854
+ "locate",
25855
+ "spotClean",
25856
+ "findPet",
25857
+ "personFollow",
25858
+ "stop",
25859
+ "startClean",
25860
+ "pauseClean",
25861
+ "dockWash",
25862
+ "autoEmpty",
25863
+ "flashOn",
25864
+ "flashOff"
25865
+ ]);
25866
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
25867
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
25868
+ /**
25869
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
25870
+ * native panel and the PTZ mimic render as a button.
25871
+ *
25872
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
25873
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
25874
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
25875
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
25876
+ * - `label` — operator-facing English label.
25877
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
25878
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
25879
+ * PTZ render ONLY enabled entries. Data-driven: the provider
25880
+ * flips it from config, never by editing code.
25881
+ */
25882
+ var NavigationActionEntrySchema = object({
25883
+ id: string(),
25884
+ kind: NavigationEntryKindSchema,
25885
+ label: string(),
25886
+ icon: string(),
25887
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
25888
+ soundId: number().int().optional(),
25889
+ /** Per-device feature flag — render this entry only when true. */
25890
+ enabled: boolean()
25891
+ });
25892
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
25893
+ var NavigationPointSchema = object({
25894
+ x: number(),
25895
+ y: number()
25896
+ });
25897
+ /**
25898
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
25899
+ * The cap reports which are enabled so the UI / PTZ render only the controls
25900
+ * that are turned on for THIS device. Data-driven: the provider derives these
25901
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
25902
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
25903
+ * that are not dictionary entries.
25904
+ *
25905
+ * - `move` / `stop` — the momentary drive joystick.
25906
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
25907
+ * map-coordinate plumbing is wired.
25908
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
25909
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
25910
+ * - `light` — the on/off fill-light toggle (works anytime).
25911
+ * - `lightMode` — the auto/manual selector + manual level slider (a
25912
+ * camera-service control; needs an active stream).
25913
+ */
25914
+ var NavigationFeaturesSchema = object({
25915
+ move: boolean(),
25916
+ stop: boolean(),
25917
+ goToPoint: boolean(),
25918
+ runAction: boolean(),
25919
+ playSound: boolean(),
25920
+ light: boolean(),
25921
+ lightMode: boolean()
25922
+ });
25923
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
25924
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
25925
+ /**
25926
+ * Live navigation state so the UI can reflect what the robot is doing:
25927
+ * - `mode` — coarse activity (idle / cleaning / following / …).
25928
+ * - `following` — person/pet follow is currently armed.
25929
+ * - `flash` — the on-camera fill light is on.
25930
+ * - `lightMode` — auto vs manual fill-light mode.
25931
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
25932
+ * `lightMode === 'manual'`.
25933
+ */
25934
+ var NavigationStatusSchema = object({
25935
+ mode: _enum([
25936
+ "idle",
25937
+ "cleaning",
25938
+ "spot",
25939
+ "following",
25940
+ "goto",
25941
+ "returning",
25942
+ "paused",
25943
+ "unknown"
25944
+ ]),
25945
+ following: boolean(),
25946
+ flash: boolean(),
25947
+ lightMode: NavigationLightModeSchema,
25948
+ lightLevel: number().min(40).max(100),
25949
+ /** Ms epoch when the slice was last updated. */
25950
+ lastChangedAt: number()
25951
+ });
25952
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
25953
+ DeviceType.Camera, method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(NavigationActionEntrySchema)), method(object({
25954
+ deviceId: number(),
25955
+ actionId: NavigationActionIdSchema
25956
+ }), _void(), { kind: "mutation" }), method(object({
25957
+ deviceId: number(),
25958
+ soundId: number().int()
25959
+ }), _void(), { kind: "mutation" }), method(object({
25960
+ deviceId: number(),
25961
+ on: boolean()
25962
+ }), _void(), { kind: "mutation" }), method(object({
25963
+ deviceId: number(),
25964
+ mode: NavigationLightModeSchema,
25965
+ level: number().min(40).max(100).optional()
25966
+ }), _void(), { kind: "mutation" }), method(object({
25967
+ deviceId: number(),
25968
+ level: number().min(40).max(100)
25969
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
25970
+ deviceId: number(),
25971
+ status: NavigationStatusSchema
25972
+ });
25973
+ /**
25974
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
25975
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
25976
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
25977
+ * one Home Assistant projection.
25978
+ */
25979
+ var NetworkLinkStatusSchema = object({
25980
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
25981
+ type: _enum([
25982
+ "wifi",
25983
+ "ethernet",
25984
+ "cellular",
25985
+ "unknown"
25986
+ ]),
25987
+ /**
25988
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
25989
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
25990
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
25991
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
25992
+ * SKIP a null rather than coerce it.
25993
+ */
25994
+ signalPercent: number().min(0).max(100).nullable(),
25995
+ /** Raw received signal strength in dBm, when the firmware reports one. */
25996
+ rssiDbm: number().optional(),
25997
+ /** Network name of a wireless link, when the firmware reports it. */
25998
+ ssid: string().optional(),
25999
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26000
+ lastUpdated: number()
26001
+ });
26002
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26003
+ deviceId: number(),
26004
+ status: NetworkLinkStatusSchema
26005
+ });
26006
+ /**
25670
26007
  * network-quality — system-scoped singleton capability tracking RTT,
25671
26008
  * jitter, and observed/peak bandwidth per device + per client.
25672
26009
  *
@@ -26908,203 +27245,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
26908
27245
  deviceId: number(),
26909
27246
  status: PtzAutotrackStatusSchema
26910
27247
  });
26911
- /**
26912
- * `navigation` — a device-scoped capability that natively expresses the FULL
26913
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
26914
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
26915
- *
26916
- * Why a NEW cap rather than overloading `ptz`:
26917
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
26918
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
26919
- * The two are different physical models: PTZ is absolute-position + presets,
26920
- * navigation is momentary drive nudges + discrete robot ACTIONS
26921
- * (dock / spot-clean / follow-pet / go-to-point / …).
26922
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
26923
- * the reverse:
26924
- * 1. a native CamStack navigation panel (data-driven from `listActions`
26925
- * / `getOptions`), and
26926
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
26927
- * robot camera shows up in the existing PTZ control path without every
26928
- * PTZ provider learning about robots. The mapping lives in the adapter,
26929
- * not here (see the addon design note):
26930
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
26931
- * ptz.stop() → navigation.stop()
26932
- * ptz.goHome() → navigation.runAction('goHome')
26933
- * ptz.getPresets() → navigation.listActions() (id→preset)
26934
- * ptz.goToPreset(id) → navigation.runAction(id)
26935
- *
26936
- * ## Continuous drive
26937
- *
26938
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
26939
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
26940
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
26941
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
26942
- * coalesce them. The UI owns the cadence.
26943
- *
26944
- * ## The action dictionary
26945
- *
26946
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
26947
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
26948
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
26949
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
26950
- * vendor-specific list. `kind: 'action'` entries are triggered with
26951
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
26952
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
26953
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26954
- *
26955
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26956
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26957
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
26958
- * every device handle. A future nodedreame publish adds a typed
26959
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
26960
- * provider can then swap the raw calls for the typed methods with no change to
26961
- * THIS contract.
26962
- */
26963
- /**
26964
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
26965
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
26966
- * halts it.
26967
- *
26968
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
26969
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26970
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26971
- * vector by it (drivers without proportional drive ignore it).
26972
- *
26973
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26974
- * axis alone; an all-undefined nudge is a no-op.
26975
- */
26976
- var NavigationMoveCommandSchema = object({
26977
- pan: number().min(-1).max(1).optional(),
26978
- tilt: number().min(-1).max(1).optional(),
26979
- speed: number().min(0).max(1).optional()
26980
- });
26981
- /**
26982
- * The enumerated discrete actions a navigation-capable robot can perform via
26983
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26984
- * subset it supports through `listActions`. Sounds are NOT here — they go through
26985
- * `playSound` (see the `sound` dictionary entries).
26986
- */
26987
- var NavigationActionIdSchema = _enum([
26988
- "goHome",
26989
- "locate",
26990
- "spotClean",
26991
- "findPet",
26992
- "personFollow",
26993
- "stop",
26994
- "startClean",
26995
- "pauseClean",
26996
- "dockWash",
26997
- "autoEmpty",
26998
- "flashOn",
26999
- "flashOff"
27000
- ]);
27001
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27002
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27003
- /**
27004
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27005
- * native panel and the PTZ mimic render as a button.
27006
- *
27007
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27008
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27009
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27010
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27011
- * - `label` — operator-facing English label.
27012
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27013
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27014
- * PTZ render ONLY enabled entries. Data-driven: the provider
27015
- * flips it from config, never by editing code.
27016
- */
27017
- var NavigationActionEntrySchema = object({
27018
- id: string(),
27019
- kind: NavigationEntryKindSchema,
27020
- label: string(),
27021
- icon: string(),
27022
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27023
- soundId: number().int().optional(),
27024
- /** Per-device feature flag — render this entry only when true. */
27025
- enabled: boolean()
27026
- });
27027
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27028
- var NavigationPointSchema = object({
27029
- x: number(),
27030
- y: number()
27031
- });
27032
- /**
27033
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27034
- * The cap reports which are enabled so the UI / PTZ render only the controls
27035
- * that are turned on for THIS device. Data-driven: the provider derives these
27036
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27037
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27038
- * that are not dictionary entries.
27039
- *
27040
- * - `move` / `stop` — the momentary drive joystick.
27041
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27042
- * map-coordinate plumbing is wired.
27043
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27044
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27045
- * - `light` — the on/off fill-light toggle (works anytime).
27046
- * - `lightMode` — the auto/manual selector + manual level slider (a
27047
- * camera-service control; needs an active stream).
27048
- */
27049
- var NavigationFeaturesSchema = object({
27050
- move: boolean(),
27051
- stop: boolean(),
27052
- goToPoint: boolean(),
27053
- runAction: boolean(),
27054
- playSound: boolean(),
27055
- light: boolean(),
27056
- lightMode: boolean()
27057
- });
27058
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27059
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27060
- /**
27061
- * Live navigation state so the UI can reflect what the robot is doing:
27062
- * - `mode` — coarse activity (idle / cleaning / following / …).
27063
- * - `following` — person/pet follow is currently armed.
27064
- * - `flash` — the on-camera fill light is on.
27065
- * - `lightMode` — auto vs manual fill-light mode.
27066
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27067
- * `lightMode === 'manual'`.
27068
- */
27069
- var NavigationStatusSchema = object({
27070
- mode: _enum([
27071
- "idle",
27072
- "cleaning",
27073
- "spot",
27074
- "following",
27075
- "goto",
27076
- "returning",
27077
- "paused",
27078
- "unknown"
27079
- ]),
27080
- following: boolean(),
27081
- flash: boolean(),
27082
- lightMode: NavigationLightModeSchema,
27083
- lightLevel: number().min(40).max(100),
27084
- /** Ms epoch when the slice was last updated. */
27085
- lastChangedAt: number()
27086
- });
27087
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27088
- DeviceType.Camera, method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(NavigationActionEntrySchema)), method(object({
27089
- deviceId: number(),
27090
- actionId: NavigationActionIdSchema
27091
- }), _void(), { kind: "mutation" }), method(object({
27092
- deviceId: number(),
27093
- soundId: number().int()
27094
- }), _void(), { kind: "mutation" }), method(object({
27095
- deviceId: number(),
27096
- on: boolean()
27097
- }), _void(), { kind: "mutation" }), method(object({
27098
- deviceId: number(),
27099
- mode: NavigationLightModeSchema,
27100
- level: number().min(40).max(100).optional()
27101
- }), _void(), { kind: "mutation" }), method(object({
27102
- deviceId: number(),
27103
- level: number().min(40).max(100)
27104
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27105
- deviceId: number(),
27106
- status: NavigationStatusSchema
27107
- });
27108
27248
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27109
27249
  kind: "mutation",
27110
27250
  auth: "admin"
@@ -34419,6 +34559,12 @@ Object.freeze({
34419
34559
  addonId: null,
34420
34560
  access: "view"
34421
34561
  },
34562
+ "storage.listDrainProgress": {
34563
+ capName: "storage",
34564
+ capScope: "system",
34565
+ addonId: null,
34566
+ access: "view"
34567
+ },
34422
34568
  "storage.listLocationDeclarations": {
34423
34569
  capName: "storage",
34424
34570
  capScope: "system",
@@ -34563,6 +34709,12 @@ Object.freeze({
34563
34709
  addonId: null,
34564
34710
  access: "view"
34565
34711
  },
34712
+ "storageOccupancy.getOccupancy": {
34713
+ capName: "storage-occupancy",
34714
+ capScope: "system",
34715
+ addonId: null,
34716
+ access: "view"
34717
+ },
34566
34718
  "storageProvider.abortUpload": {
34567
34719
  capName: "storage-provider",
34568
34720
  capScope: "system",
@@ -37964,7 +38116,7 @@ var AgentUIAddon = class extends BaseAddon {
37964
38116
  capability: adminUiCapability,
37965
38117
  provider: {
37966
38118
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
37967
- getVersion: async () => ({ version: "1.2.84" })
38119
+ getVersion: async () => ({ version: "1.2.86" })
37968
38120
  }
37969
38121
  }];
37970
38122
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.2.84",
3
+ "version": "1.2.86",
4
4
  "description": "Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",