@camstack/addon-mqtt-broker 1.2.79 → 1.2.80
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.
- package/dist/mqtt-broker.addon.js +367 -232
- package/dist/mqtt-broker.addon.mjs +367 -232
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
39
39
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
40
40
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
41
41
|
//#endregion
|
|
42
|
-
//#region ../types/dist/event-category-
|
|
42
|
+
//#region ../types/dist/event-category-CnLqLOKs.mjs
|
|
43
43
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
44
44
|
EventCategory["SystemBoot"] = "system.boot";
|
|
45
45
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -234,6 +234,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
234
234
|
EventCategory["ProcessCrashed"] = "process.crashed";
|
|
235
235
|
EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
|
|
236
236
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
237
|
+
/**
|
|
238
|
+
* The SET of storage locations changed — one was created, edited, enabled,
|
|
239
|
+
* disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
|
|
240
|
+
*
|
|
241
|
+
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
242
|
+
* it must also converge on its own periodic path, because a dropped event
|
|
243
|
+
* must not leave a node writing to yesterday's disk set forever. It exists
|
|
244
|
+
* because there was NO signal at all — an operator who added a second
|
|
245
|
+
* recordings disk in the admin UI got nothing, and the recorder kept its
|
|
246
|
+
* resolved locations until something else happened to re-resolve them
|
|
247
|
+
* (D387). Payload `StorageLocationsChangedPayload`.
|
|
248
|
+
*/
|
|
249
|
+
EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
|
|
237
250
|
EventCategory["RecordingStarted"] = "recording.started";
|
|
238
251
|
EventCategory["RecordingStopped"] = "recording.stopped";
|
|
239
252
|
EventCategory["RecordingError"] = "recording.error";
|
|
@@ -8560,6 +8573,21 @@ var StorageCleanupJobSchema = object({
|
|
|
8560
8573
|
});
|
|
8561
8574
|
var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
|
|
8562
8575
|
/**
|
|
8576
|
+
* The one typed state of a storage location. Authoritative Zod schema — the TS
|
|
8577
|
+
* alias below is `z.infer<>` of it, never a second spelling.
|
|
8578
|
+
*/
|
|
8579
|
+
var StorageLocationModeSchema = _enum([
|
|
8580
|
+
"active",
|
|
8581
|
+
"readonly",
|
|
8582
|
+
"drain",
|
|
8583
|
+
"disabled"
|
|
8584
|
+
]);
|
|
8585
|
+
_enum([
|
|
8586
|
+
"normal",
|
|
8587
|
+
"never",
|
|
8588
|
+
"drain"
|
|
8589
|
+
]);
|
|
8590
|
+
/**
|
|
8563
8591
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8564
8592
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8565
8593
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8625,6 +8653,21 @@ var StorageLocationSchema = object({
|
|
|
8625
8653
|
* stops existing rather than being re-derived on every read.
|
|
8626
8654
|
*/
|
|
8627
8655
|
enabled: boolean().optional(),
|
|
8656
|
+
/**
|
|
8657
|
+
* THE state of this location (D385), and the only authority on what may be
|
|
8658
|
+
* written, read or evicted here. Interpreted in exactly one place —
|
|
8659
|
+
* `storage-location-mode.ts` — which also folds the legacy
|
|
8660
|
+
* `enabled` / `config.readOnly` pair into a mode so an old row is never
|
|
8661
|
+
* ambiguous.
|
|
8662
|
+
*
|
|
8663
|
+
* OPTIONAL only for the wire and for rows written before D385: absence is
|
|
8664
|
+
* resolved by `resolveLocationMode`, and the orchestrator stamps every
|
|
8665
|
+
* unstamped row ONCE at hydrate so absence stops existing rather than being
|
|
8666
|
+
* re-derived on every read. `enabled` survives one release as a DERIVED
|
|
8667
|
+
* mirror (`mode === 'active'`); `withLocationMode` is the only writer of
|
|
8668
|
+
* either, so the two cannot disagree.
|
|
8669
|
+
*/
|
|
8670
|
+
mode: StorageLocationModeSchema.optional(),
|
|
8628
8671
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
8629
8672
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
8630
8673
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -8632,11 +8675,46 @@ var StorageLocationSchema = object({
|
|
|
8632
8675
|
totalBytes: number(),
|
|
8633
8676
|
availableBytes: number()
|
|
8634
8677
|
}).nullable().optional(),
|
|
8678
|
+
/**
|
|
8679
|
+
* How much of that volume CamStack ITSELF holds on this location (D388) —
|
|
8680
|
+
* COMPUTED at read time from the `storage-occupancy` providers' own figures,
|
|
8681
|
+
* never persisted, never a filesystem walk.
|
|
8682
|
+
*
|
|
8683
|
+
* **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
|
|
8684
|
+
* location yet — nobody stores here, the owning addon is down, or the first
|
|
8685
|
+
* refresh has not completed. A UI must omit the segment rather than draw it
|
|
8686
|
+
* at zero, which would claim we occupy nothing (D315). It is an OBJECT and
|
|
8687
|
+
* not a bare number precisely so that a `?? 0` on the consuming side has to
|
|
8688
|
+
* be spelled out loud instead of appearing by accident.
|
|
8689
|
+
*
|
|
8690
|
+
* `measuredAtMs` is the OLDEST contributing measurement, so it is honest
|
|
8691
|
+
* about the whole figure rather than about its freshest part.
|
|
8692
|
+
*/
|
|
8693
|
+
owned: object({
|
|
8694
|
+
bytes: number().int().nonnegative(),
|
|
8695
|
+
measuredAtMs: number().int().nonnegative()
|
|
8696
|
+
}).optional(),
|
|
8635
8697
|
createdAt: number(),
|
|
8636
8698
|
updatedAt: number()
|
|
8637
8699
|
});
|
|
8638
8700
|
object({ isDefault: boolean().optional() });
|
|
8639
8701
|
/**
|
|
8702
|
+
* How far a `drain` has got (D386) — the read a UI renders, and nothing more.
|
|
8703
|
+
*
|
|
8704
|
+
* `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
|
|
8705
|
+
* OBSERVED and is `null` when it has observed none. Never a fabricated date: a
|
|
8706
|
+
* drain with no observed growth has no honest ETA, and inventing one is how an
|
|
8707
|
+
* operator learns not to believe the screen.
|
|
8708
|
+
*/
|
|
8709
|
+
var StorageDrainProgressSchema = object({
|
|
8710
|
+
locationId: string(),
|
|
8711
|
+
startedAtMs: number(),
|
|
8712
|
+
startBytes: number(),
|
|
8713
|
+
bytesRemaining: number(),
|
|
8714
|
+
drained: boolean(),
|
|
8715
|
+
estimatedEmptyAtMs: number().nullable()
|
|
8716
|
+
});
|
|
8717
|
+
/**
|
|
8640
8718
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8641
8719
|
* Either:
|
|
8642
8720
|
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
@@ -21665,7 +21743,7 @@ method(object({
|
|
|
21665
21743
|
}), _void(), {
|
|
21666
21744
|
kind: "mutation",
|
|
21667
21745
|
auth: "admin"
|
|
21668
|
-
}), method(object({ id: string() }), object({
|
|
21746
|
+
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
21669
21747
|
ok: boolean(),
|
|
21670
21748
|
error: string().optional()
|
|
21671
21749
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
@@ -21735,6 +21813,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
21735
21813
|
kind: "mutation",
|
|
21736
21814
|
auth: "admin"
|
|
21737
21815
|
}), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
|
|
21816
|
+
/**
|
|
21817
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
21818
|
+
* location (D388).
|
|
21819
|
+
*
|
|
21820
|
+
* ## Why this is not `storage-evictable`
|
|
21821
|
+
*
|
|
21822
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
21823
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
21824
|
+
* operator most wants a figure for:
|
|
21825
|
+
*
|
|
21826
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
21827
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
21828
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
21829
|
+
* occupancy figure that double-counts the disk.
|
|
21830
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
21831
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
21832
|
+
* is retiring and staring at.
|
|
21833
|
+
*
|
|
21834
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
21835
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
21836
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
21837
|
+
* "evictable" must not register here — a number that silently means different
|
|
21838
|
+
* things per class is worse than no number.
|
|
21839
|
+
*
|
|
21840
|
+
* ## Absence is an answer
|
|
21841
|
+
*
|
|
21842
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
21843
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
21844
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
21845
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
21846
|
+
*
|
|
21847
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
21848
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
21849
|
+
*/
|
|
21850
|
+
/** One provider's occupancy answer for one location. */
|
|
21851
|
+
var StorageOccupancyReportSchema = object({
|
|
21852
|
+
locationId: string(),
|
|
21853
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
21854
|
+
* not net of what it is willing to delete. */
|
|
21855
|
+
ownedBytes: number().int().nonnegative(),
|
|
21856
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
21857
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
21858
|
+
measuredAtMs: number().int().nonnegative()
|
|
21859
|
+
});
|
|
21860
|
+
method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
|
|
21738
21861
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21739
21862
|
providerId: string().min(1),
|
|
21740
21863
|
displayName: string().min(1),
|
|
@@ -23370,39 +23493,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
|
|
|
23370
23493
|
deviceId: number(),
|
|
23371
23494
|
status: BatteryStatusSchema
|
|
23372
23495
|
});
|
|
23373
|
-
/**
|
|
23374
|
-
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23375
|
-
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23376
|
-
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23377
|
-
* one Home Assistant projection.
|
|
23378
|
-
*/
|
|
23379
|
-
var NetworkLinkStatusSchema = object({
|
|
23380
|
-
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23381
|
-
type: _enum([
|
|
23382
|
-
"wifi",
|
|
23383
|
-
"ethernet",
|
|
23384
|
-
"cellular",
|
|
23385
|
-
"unknown"
|
|
23386
|
-
]),
|
|
23387
|
-
/**
|
|
23388
|
-
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23389
|
-
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23390
|
-
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23391
|
-
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23392
|
-
* SKIP a null rather than coerce it.
|
|
23393
|
-
*/
|
|
23394
|
-
signalPercent: number().min(0).max(100).nullable(),
|
|
23395
|
-
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23396
|
-
rssiDbm: number().optional(),
|
|
23397
|
-
/** Network name of a wireless link, when the firmware reports it. */
|
|
23398
|
-
ssid: string().optional(),
|
|
23399
|
-
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23400
|
-
lastUpdated: number()
|
|
23401
|
-
});
|
|
23402
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
23403
|
-
deviceId: number(),
|
|
23404
|
-
status: NetworkLinkStatusSchema
|
|
23405
|
-
});
|
|
23406
23496
|
object({
|
|
23407
23497
|
on: boolean(),
|
|
23408
23498
|
/** Ms epoch of the last transition. 0 if never observed. */
|
|
@@ -25756,6 +25846,236 @@ DeviceType.Camera, method(object({
|
|
|
25756
25846
|
detection: NativeDetectionSchema
|
|
25757
25847
|
});
|
|
25758
25848
|
/**
|
|
25849
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
25850
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
25851
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
25852
|
+
*
|
|
25853
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
25854
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
25855
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
25856
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
25857
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
25858
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
25859
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
25860
|
+
* the reverse:
|
|
25861
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
25862
|
+
* / `getOptions`), and
|
|
25863
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
25864
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
25865
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
25866
|
+
* not here (see the addon design note):
|
|
25867
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
25868
|
+
* ptz.stop() → navigation.stop()
|
|
25869
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
25870
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
25871
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
25872
|
+
*
|
|
25873
|
+
* ## Continuous drive
|
|
25874
|
+
*
|
|
25875
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
25876
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
25877
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
25878
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
25879
|
+
* coalesce them. The UI owns the cadence.
|
|
25880
|
+
*
|
|
25881
|
+
* ## The action dictionary
|
|
25882
|
+
*
|
|
25883
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
25884
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
25885
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
25886
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
25887
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
25888
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
25889
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
25890
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
25891
|
+
*
|
|
25892
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
25893
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
25894
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
25895
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
25896
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
25897
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
25898
|
+
* THIS contract.
|
|
25899
|
+
*/
|
|
25900
|
+
/**
|
|
25901
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
25902
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
25903
|
+
* halts it.
|
|
25904
|
+
*
|
|
25905
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
25906
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
25907
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
25908
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
25909
|
+
*
|
|
25910
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
25911
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
25912
|
+
*/
|
|
25913
|
+
var NavigationMoveCommandSchema = object({
|
|
25914
|
+
pan: number().min(-1).max(1).optional(),
|
|
25915
|
+
tilt: number().min(-1).max(1).optional(),
|
|
25916
|
+
speed: number().min(0).max(1).optional()
|
|
25917
|
+
});
|
|
25918
|
+
/**
|
|
25919
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
25920
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
25921
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
25922
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
25923
|
+
*/
|
|
25924
|
+
var NavigationActionIdSchema = _enum([
|
|
25925
|
+
"goHome",
|
|
25926
|
+
"locate",
|
|
25927
|
+
"spotClean",
|
|
25928
|
+
"findPet",
|
|
25929
|
+
"personFollow",
|
|
25930
|
+
"stop",
|
|
25931
|
+
"startClean",
|
|
25932
|
+
"pauseClean",
|
|
25933
|
+
"dockWash",
|
|
25934
|
+
"autoEmpty",
|
|
25935
|
+
"flashOn",
|
|
25936
|
+
"flashOff"
|
|
25937
|
+
]);
|
|
25938
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
25939
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
25940
|
+
/**
|
|
25941
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
25942
|
+
* native panel and the PTZ mimic render as a button.
|
|
25943
|
+
*
|
|
25944
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
25945
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
25946
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
25947
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
25948
|
+
* - `label` — operator-facing English label.
|
|
25949
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
25950
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
25951
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
25952
|
+
* flips it from config, never by editing code.
|
|
25953
|
+
*/
|
|
25954
|
+
var NavigationActionEntrySchema = object({
|
|
25955
|
+
id: string(),
|
|
25956
|
+
kind: NavigationEntryKindSchema,
|
|
25957
|
+
label: string(),
|
|
25958
|
+
icon: string(),
|
|
25959
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
25960
|
+
soundId: number().int().optional(),
|
|
25961
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
25962
|
+
enabled: boolean()
|
|
25963
|
+
});
|
|
25964
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
25965
|
+
var NavigationPointSchema = object({
|
|
25966
|
+
x: number(),
|
|
25967
|
+
y: number()
|
|
25968
|
+
});
|
|
25969
|
+
/**
|
|
25970
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
25971
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
25972
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
25973
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
25974
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
25975
|
+
* that are not dictionary entries.
|
|
25976
|
+
*
|
|
25977
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
25978
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
25979
|
+
* map-coordinate plumbing is wired.
|
|
25980
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
25981
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
25982
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
25983
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
25984
|
+
* camera-service control; needs an active stream).
|
|
25985
|
+
*/
|
|
25986
|
+
var NavigationFeaturesSchema = object({
|
|
25987
|
+
move: boolean(),
|
|
25988
|
+
stop: boolean(),
|
|
25989
|
+
goToPoint: boolean(),
|
|
25990
|
+
runAction: boolean(),
|
|
25991
|
+
playSound: boolean(),
|
|
25992
|
+
light: boolean(),
|
|
25993
|
+
lightMode: boolean()
|
|
25994
|
+
});
|
|
25995
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
25996
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
25997
|
+
/**
|
|
25998
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
25999
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
26000
|
+
* - `following` — person/pet follow is currently armed.
|
|
26001
|
+
* - `flash` — the on-camera fill light is on.
|
|
26002
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
26003
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
26004
|
+
* `lightMode === 'manual'`.
|
|
26005
|
+
*/
|
|
26006
|
+
var NavigationStatusSchema = object({
|
|
26007
|
+
mode: _enum([
|
|
26008
|
+
"idle",
|
|
26009
|
+
"cleaning",
|
|
26010
|
+
"spot",
|
|
26011
|
+
"following",
|
|
26012
|
+
"goto",
|
|
26013
|
+
"returning",
|
|
26014
|
+
"paused",
|
|
26015
|
+
"unknown"
|
|
26016
|
+
]),
|
|
26017
|
+
following: boolean(),
|
|
26018
|
+
flash: boolean(),
|
|
26019
|
+
lightMode: NavigationLightModeSchema,
|
|
26020
|
+
lightLevel: number().min(40).max(100),
|
|
26021
|
+
/** Ms epoch when the slice was last updated. */
|
|
26022
|
+
lastChangedAt: number()
|
|
26023
|
+
});
|
|
26024
|
+
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
26025
|
+
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({
|
|
26026
|
+
deviceId: number(),
|
|
26027
|
+
actionId: NavigationActionIdSchema
|
|
26028
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26029
|
+
deviceId: number(),
|
|
26030
|
+
soundId: number().int()
|
|
26031
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26032
|
+
deviceId: number(),
|
|
26033
|
+
on: boolean()
|
|
26034
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26035
|
+
deviceId: number(),
|
|
26036
|
+
mode: NavigationLightModeSchema,
|
|
26037
|
+
level: number().min(40).max(100).optional()
|
|
26038
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26039
|
+
deviceId: number(),
|
|
26040
|
+
level: number().min(40).max(100)
|
|
26041
|
+
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
26042
|
+
deviceId: number(),
|
|
26043
|
+
status: NavigationStatusSchema
|
|
26044
|
+
});
|
|
26045
|
+
/**
|
|
26046
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
26047
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
26048
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
26049
|
+
* one Home Assistant projection.
|
|
26050
|
+
*/
|
|
26051
|
+
var NetworkLinkStatusSchema = object({
|
|
26052
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
26053
|
+
type: _enum([
|
|
26054
|
+
"wifi",
|
|
26055
|
+
"ethernet",
|
|
26056
|
+
"cellular",
|
|
26057
|
+
"unknown"
|
|
26058
|
+
]),
|
|
26059
|
+
/**
|
|
26060
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
26061
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
26062
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
26063
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
26064
|
+
* SKIP a null rather than coerce it.
|
|
26065
|
+
*/
|
|
26066
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
26067
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
26068
|
+
rssiDbm: number().optional(),
|
|
26069
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
26070
|
+
ssid: string().optional(),
|
|
26071
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
26072
|
+
lastUpdated: number()
|
|
26073
|
+
});
|
|
26074
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
26075
|
+
deviceId: number(),
|
|
26076
|
+
status: NetworkLinkStatusSchema
|
|
26077
|
+
});
|
|
26078
|
+
/**
|
|
25759
26079
|
* network-quality — system-scoped singleton capability tracking RTT,
|
|
25760
26080
|
* jitter, and observed/peak bandwidth per device + per client.
|
|
25761
26081
|
*
|
|
@@ -26997,203 +27317,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
26997
27317
|
deviceId: number(),
|
|
26998
27318
|
status: PtzAutotrackStatusSchema
|
|
26999
27319
|
});
|
|
27000
|
-
/**
|
|
27001
|
-
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
27002
|
-
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
27003
|
-
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
27004
|
-
*
|
|
27005
|
-
* Why a NEW cap rather than overloading `ptz`:
|
|
27006
|
-
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
27007
|
-
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
27008
|
-
* The two are different physical models: PTZ is absolute-position + presets,
|
|
27009
|
-
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
27010
|
-
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
27011
|
-
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
27012
|
-
* the reverse:
|
|
27013
|
-
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
27014
|
-
* / `getOptions`), and
|
|
27015
|
-
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
27016
|
-
* robot camera shows up in the existing PTZ control path without every
|
|
27017
|
-
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
27018
|
-
* not here (see the addon design note):
|
|
27019
|
-
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
27020
|
-
* ptz.stop() → navigation.stop()
|
|
27021
|
-
* ptz.goHome() → navigation.runAction('goHome')
|
|
27022
|
-
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
27023
|
-
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
27024
|
-
*
|
|
27025
|
-
* ## Continuous drive
|
|
27026
|
-
*
|
|
27027
|
-
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
27028
|
-
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
27029
|
-
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
27030
|
-
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
27031
|
-
* coalesce them. The UI owns the cadence.
|
|
27032
|
-
*
|
|
27033
|
-
* ## The action dictionary
|
|
27034
|
-
*
|
|
27035
|
-
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
27036
|
-
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
27037
|
-
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
27038
|
-
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
27039
|
-
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
27040
|
-
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
27041
|
-
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
27042
|
-
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
27043
|
-
*
|
|
27044
|
-
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
27045
|
-
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
27046
|
-
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
27047
|
-
* every device handle. A future nodedreame publish adds a typed
|
|
27048
|
-
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
27049
|
-
* provider can then swap the raw calls for the typed methods with no change to
|
|
27050
|
-
* THIS contract.
|
|
27051
|
-
*/
|
|
27052
|
-
/**
|
|
27053
|
-
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
27054
|
-
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
27055
|
-
* halts it.
|
|
27056
|
-
*
|
|
27057
|
-
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
27058
|
-
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
27059
|
-
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
27060
|
-
* vector by it (drivers without proportional drive ignore it).
|
|
27061
|
-
*
|
|
27062
|
-
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
27063
|
-
* axis alone; an all-undefined nudge is a no-op.
|
|
27064
|
-
*/
|
|
27065
|
-
var NavigationMoveCommandSchema = object({
|
|
27066
|
-
pan: number().min(-1).max(1).optional(),
|
|
27067
|
-
tilt: number().min(-1).max(1).optional(),
|
|
27068
|
-
speed: number().min(0).max(1).optional()
|
|
27069
|
-
});
|
|
27070
|
-
/**
|
|
27071
|
-
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
27072
|
-
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
27073
|
-
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
27074
|
-
* `playSound` (see the `sound` dictionary entries).
|
|
27075
|
-
*/
|
|
27076
|
-
var NavigationActionIdSchema = _enum([
|
|
27077
|
-
"goHome",
|
|
27078
|
-
"locate",
|
|
27079
|
-
"spotClean",
|
|
27080
|
-
"findPet",
|
|
27081
|
-
"personFollow",
|
|
27082
|
-
"stop",
|
|
27083
|
-
"startClean",
|
|
27084
|
-
"pauseClean",
|
|
27085
|
-
"dockWash",
|
|
27086
|
-
"autoEmpty",
|
|
27087
|
-
"flashOn",
|
|
27088
|
-
"flashOff"
|
|
27089
|
-
]);
|
|
27090
|
-
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
27091
|
-
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
27092
|
-
/**
|
|
27093
|
-
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
27094
|
-
* native panel and the PTZ mimic render as a button.
|
|
27095
|
-
*
|
|
27096
|
-
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
27097
|
-
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
27098
|
-
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
27099
|
-
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
27100
|
-
* - `label` — operator-facing English label.
|
|
27101
|
-
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
27102
|
-
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
27103
|
-
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
27104
|
-
* flips it from config, never by editing code.
|
|
27105
|
-
*/
|
|
27106
|
-
var NavigationActionEntrySchema = object({
|
|
27107
|
-
id: string(),
|
|
27108
|
-
kind: NavigationEntryKindSchema,
|
|
27109
|
-
label: string(),
|
|
27110
|
-
icon: string(),
|
|
27111
|
-
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
27112
|
-
soundId: number().int().optional(),
|
|
27113
|
-
/** Per-device feature flag — render this entry only when true. */
|
|
27114
|
-
enabled: boolean()
|
|
27115
|
-
});
|
|
27116
|
-
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
27117
|
-
var NavigationPointSchema = object({
|
|
27118
|
-
x: number(),
|
|
27119
|
-
y: number()
|
|
27120
|
-
});
|
|
27121
|
-
/**
|
|
27122
|
-
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
27123
|
-
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
27124
|
-
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
27125
|
-
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
27126
|
-
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
27127
|
-
* that are not dictionary entries.
|
|
27128
|
-
*
|
|
27129
|
-
* - `move` / `stop` — the momentary drive joystick.
|
|
27130
|
-
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
27131
|
-
* map-coordinate plumbing is wired.
|
|
27132
|
-
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
27133
|
-
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
27134
|
-
* - `light` — the on/off fill-light toggle (works anytime).
|
|
27135
|
-
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
27136
|
-
* camera-service control; needs an active stream).
|
|
27137
|
-
*/
|
|
27138
|
-
var NavigationFeaturesSchema = object({
|
|
27139
|
-
move: boolean(),
|
|
27140
|
-
stop: boolean(),
|
|
27141
|
-
goToPoint: boolean(),
|
|
27142
|
-
runAction: boolean(),
|
|
27143
|
-
playSound: boolean(),
|
|
27144
|
-
light: boolean(),
|
|
27145
|
-
lightMode: boolean()
|
|
27146
|
-
});
|
|
27147
|
-
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
27148
|
-
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
27149
|
-
/**
|
|
27150
|
-
* Live navigation state so the UI can reflect what the robot is doing:
|
|
27151
|
-
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
27152
|
-
* - `following` — person/pet follow is currently armed.
|
|
27153
|
-
* - `flash` — the on-camera fill light is on.
|
|
27154
|
-
* - `lightMode` — auto vs manual fill-light mode.
|
|
27155
|
-
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
27156
|
-
* `lightMode === 'manual'`.
|
|
27157
|
-
*/
|
|
27158
|
-
var NavigationStatusSchema = object({
|
|
27159
|
-
mode: _enum([
|
|
27160
|
-
"idle",
|
|
27161
|
-
"cleaning",
|
|
27162
|
-
"spot",
|
|
27163
|
-
"following",
|
|
27164
|
-
"goto",
|
|
27165
|
-
"returning",
|
|
27166
|
-
"paused",
|
|
27167
|
-
"unknown"
|
|
27168
|
-
]),
|
|
27169
|
-
following: boolean(),
|
|
27170
|
-
flash: boolean(),
|
|
27171
|
-
lightMode: NavigationLightModeSchema,
|
|
27172
|
-
lightLevel: number().min(40).max(100),
|
|
27173
|
-
/** Ms epoch when the slice was last updated. */
|
|
27174
|
-
lastChangedAt: number()
|
|
27175
|
-
});
|
|
27176
|
-
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
27177
|
-
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({
|
|
27178
|
-
deviceId: number(),
|
|
27179
|
-
actionId: NavigationActionIdSchema
|
|
27180
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27181
|
-
deviceId: number(),
|
|
27182
|
-
soundId: number().int()
|
|
27183
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27184
|
-
deviceId: number(),
|
|
27185
|
-
on: boolean()
|
|
27186
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27187
|
-
deviceId: number(),
|
|
27188
|
-
mode: NavigationLightModeSchema,
|
|
27189
|
-
level: number().min(40).max(100).optional()
|
|
27190
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27191
|
-
deviceId: number(),
|
|
27192
|
-
level: number().min(40).max(100)
|
|
27193
|
-
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
27194
|
-
deviceId: number(),
|
|
27195
|
-
status: NavigationStatusSchema
|
|
27196
|
-
});
|
|
27197
27320
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
27198
27321
|
kind: "mutation",
|
|
27199
27322
|
auth: "admin"
|
|
@@ -34508,6 +34631,12 @@ Object.freeze({
|
|
|
34508
34631
|
addonId: null,
|
|
34509
34632
|
access: "view"
|
|
34510
34633
|
},
|
|
34634
|
+
"storage.listDrainProgress": {
|
|
34635
|
+
capName: "storage",
|
|
34636
|
+
capScope: "system",
|
|
34637
|
+
addonId: null,
|
|
34638
|
+
access: "view"
|
|
34639
|
+
},
|
|
34511
34640
|
"storage.listLocationDeclarations": {
|
|
34512
34641
|
capName: "storage",
|
|
34513
34642
|
capScope: "system",
|
|
@@ -34652,6 +34781,12 @@ Object.freeze({
|
|
|
34652
34781
|
addonId: null,
|
|
34653
34782
|
access: "view"
|
|
34654
34783
|
},
|
|
34784
|
+
"storageOccupancy.getOccupancy": {
|
|
34785
|
+
capName: "storage-occupancy",
|
|
34786
|
+
capScope: "system",
|
|
34787
|
+
addonId: null,
|
|
34788
|
+
access: "view"
|
|
34789
|
+
},
|
|
34655
34790
|
"storageProvider.abortUpload": {
|
|
34656
34791
|
capName: "storage-provider",
|
|
34657
34792
|
capScope: "system",
|