@camstack/addon-decoder-nodeav 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/index.js +367 -232
- package/dist/index.mjs +367 -232
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
6
|
-
//#region ../types/dist/event-category-
|
|
6
|
+
//#region ../types/dist/event-category-CnLqLOKs.mjs
|
|
7
7
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
8
8
|
EventCategory["SystemBoot"] = "system.boot";
|
|
9
9
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -198,6 +198,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
198
198
|
EventCategory["ProcessCrashed"] = "process.crashed";
|
|
199
199
|
EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
|
|
200
200
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
201
|
+
/**
|
|
202
|
+
* The SET of storage locations changed — one was created, edited, enabled,
|
|
203
|
+
* disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
|
|
204
|
+
*
|
|
205
|
+
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
206
|
+
* it must also converge on its own periodic path, because a dropped event
|
|
207
|
+
* must not leave a node writing to yesterday's disk set forever. It exists
|
|
208
|
+
* because there was NO signal at all — an operator who added a second
|
|
209
|
+
* recordings disk in the admin UI got nothing, and the recorder kept its
|
|
210
|
+
* resolved locations until something else happened to re-resolve them
|
|
211
|
+
* (D387). Payload `StorageLocationsChangedPayload`.
|
|
212
|
+
*/
|
|
213
|
+
EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
|
|
201
214
|
EventCategory["RecordingStarted"] = "recording.started";
|
|
202
215
|
EventCategory["RecordingStopped"] = "recording.stopped";
|
|
203
216
|
EventCategory["RecordingError"] = "recording.error";
|
|
@@ -8536,6 +8549,21 @@ var StorageCleanupJobSchema = object({
|
|
|
8536
8549
|
});
|
|
8537
8550
|
var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
|
|
8538
8551
|
/**
|
|
8552
|
+
* The one typed state of a storage location. Authoritative Zod schema — the TS
|
|
8553
|
+
* alias below is `z.infer<>` of it, never a second spelling.
|
|
8554
|
+
*/
|
|
8555
|
+
var StorageLocationModeSchema = _enum([
|
|
8556
|
+
"active",
|
|
8557
|
+
"readonly",
|
|
8558
|
+
"drain",
|
|
8559
|
+
"disabled"
|
|
8560
|
+
]);
|
|
8561
|
+
_enum([
|
|
8562
|
+
"normal",
|
|
8563
|
+
"never",
|
|
8564
|
+
"drain"
|
|
8565
|
+
]);
|
|
8566
|
+
/**
|
|
8539
8567
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8540
8568
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8541
8569
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8601,6 +8629,21 @@ var StorageLocationSchema = object({
|
|
|
8601
8629
|
* stops existing rather than being re-derived on every read.
|
|
8602
8630
|
*/
|
|
8603
8631
|
enabled: boolean().optional(),
|
|
8632
|
+
/**
|
|
8633
|
+
* THE state of this location (D385), and the only authority on what may be
|
|
8634
|
+
* written, read or evicted here. Interpreted in exactly one place —
|
|
8635
|
+
* `storage-location-mode.ts` — which also folds the legacy
|
|
8636
|
+
* `enabled` / `config.readOnly` pair into a mode so an old row is never
|
|
8637
|
+
* ambiguous.
|
|
8638
|
+
*
|
|
8639
|
+
* OPTIONAL only for the wire and for rows written before D385: absence is
|
|
8640
|
+
* resolved by `resolveLocationMode`, and the orchestrator stamps every
|
|
8641
|
+
* unstamped row ONCE at hydrate so absence stops existing rather than being
|
|
8642
|
+
* re-derived on every read. `enabled` survives one release as a DERIVED
|
|
8643
|
+
* mirror (`mode === 'active'`); `withLocationMode` is the only writer of
|
|
8644
|
+
* either, so the two cannot disagree.
|
|
8645
|
+
*/
|
|
8646
|
+
mode: StorageLocationModeSchema.optional(),
|
|
8604
8647
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
8605
8648
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
8606
8649
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -8608,11 +8651,46 @@ var StorageLocationSchema = object({
|
|
|
8608
8651
|
totalBytes: number(),
|
|
8609
8652
|
availableBytes: number()
|
|
8610
8653
|
}).nullable().optional(),
|
|
8654
|
+
/**
|
|
8655
|
+
* How much of that volume CamStack ITSELF holds on this location (D388) —
|
|
8656
|
+
* COMPUTED at read time from the `storage-occupancy` providers' own figures,
|
|
8657
|
+
* never persisted, never a filesystem walk.
|
|
8658
|
+
*
|
|
8659
|
+
* **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
|
|
8660
|
+
* location yet — nobody stores here, the owning addon is down, or the first
|
|
8661
|
+
* refresh has not completed. A UI must omit the segment rather than draw it
|
|
8662
|
+
* at zero, which would claim we occupy nothing (D315). It is an OBJECT and
|
|
8663
|
+
* not a bare number precisely so that a `?? 0` on the consuming side has to
|
|
8664
|
+
* be spelled out loud instead of appearing by accident.
|
|
8665
|
+
*
|
|
8666
|
+
* `measuredAtMs` is the OLDEST contributing measurement, so it is honest
|
|
8667
|
+
* about the whole figure rather than about its freshest part.
|
|
8668
|
+
*/
|
|
8669
|
+
owned: object({
|
|
8670
|
+
bytes: number().int().nonnegative(),
|
|
8671
|
+
measuredAtMs: number().int().nonnegative()
|
|
8672
|
+
}).optional(),
|
|
8611
8673
|
createdAt: number(),
|
|
8612
8674
|
updatedAt: number()
|
|
8613
8675
|
});
|
|
8614
8676
|
object({ isDefault: boolean().optional() });
|
|
8615
8677
|
/**
|
|
8678
|
+
* How far a `drain` has got (D386) — the read a UI renders, and nothing more.
|
|
8679
|
+
*
|
|
8680
|
+
* `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
|
|
8681
|
+
* OBSERVED and is `null` when it has observed none. Never a fabricated date: a
|
|
8682
|
+
* drain with no observed growth has no honest ETA, and inventing one is how an
|
|
8683
|
+
* operator learns not to believe the screen.
|
|
8684
|
+
*/
|
|
8685
|
+
var StorageDrainProgressSchema = object({
|
|
8686
|
+
locationId: string(),
|
|
8687
|
+
startedAtMs: number(),
|
|
8688
|
+
startBytes: number(),
|
|
8689
|
+
bytesRemaining: number(),
|
|
8690
|
+
drained: boolean(),
|
|
8691
|
+
estimatedEmptyAtMs: number().nullable()
|
|
8692
|
+
});
|
|
8693
|
+
/**
|
|
8616
8694
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8617
8695
|
* Either:
|
|
8618
8696
|
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
@@ -21703,7 +21781,7 @@ method(object({
|
|
|
21703
21781
|
}), _void(), {
|
|
21704
21782
|
kind: "mutation",
|
|
21705
21783
|
auth: "admin"
|
|
21706
|
-
}), method(object({ id: string() }), object({
|
|
21784
|
+
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
21707
21785
|
ok: boolean(),
|
|
21708
21786
|
error: string().optional()
|
|
21709
21787
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
@@ -21773,6 +21851,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
21773
21851
|
kind: "mutation",
|
|
21774
21852
|
auth: "admin"
|
|
21775
21853
|
}), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
|
|
21854
|
+
/**
|
|
21855
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
21856
|
+
* location (D388).
|
|
21857
|
+
*
|
|
21858
|
+
* ## Why this is not `storage-evictable`
|
|
21859
|
+
*
|
|
21860
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
21861
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
21862
|
+
* operator most wants a figure for:
|
|
21863
|
+
*
|
|
21864
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
21865
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
21866
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
21867
|
+
* occupancy figure that double-counts the disk.
|
|
21868
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
21869
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
21870
|
+
* is retiring and staring at.
|
|
21871
|
+
*
|
|
21872
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
21873
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
21874
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
21875
|
+
* "evictable" must not register here — a number that silently means different
|
|
21876
|
+
* things per class is worse than no number.
|
|
21877
|
+
*
|
|
21878
|
+
* ## Absence is an answer
|
|
21879
|
+
*
|
|
21880
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
21881
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
21882
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
21883
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
21884
|
+
*
|
|
21885
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
21886
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
21887
|
+
*/
|
|
21888
|
+
/** One provider's occupancy answer for one location. */
|
|
21889
|
+
var StorageOccupancyReportSchema = object({
|
|
21890
|
+
locationId: string(),
|
|
21891
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
21892
|
+
* not net of what it is willing to delete. */
|
|
21893
|
+
ownedBytes: number().int().nonnegative(),
|
|
21894
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
21895
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
21896
|
+
measuredAtMs: number().int().nonnegative()
|
|
21897
|
+
});
|
|
21898
|
+
method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
|
|
21776
21899
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21777
21900
|
providerId: string().min(1),
|
|
21778
21901
|
displayName: string().min(1),
|
|
@@ -23408,39 +23531,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
|
|
|
23408
23531
|
deviceId: number(),
|
|
23409
23532
|
status: BatteryStatusSchema
|
|
23410
23533
|
});
|
|
23411
|
-
/**
|
|
23412
|
-
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23413
|
-
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23414
|
-
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23415
|
-
* one Home Assistant projection.
|
|
23416
|
-
*/
|
|
23417
|
-
var NetworkLinkStatusSchema = object({
|
|
23418
|
-
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23419
|
-
type: _enum([
|
|
23420
|
-
"wifi",
|
|
23421
|
-
"ethernet",
|
|
23422
|
-
"cellular",
|
|
23423
|
-
"unknown"
|
|
23424
|
-
]),
|
|
23425
|
-
/**
|
|
23426
|
-
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23427
|
-
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23428
|
-
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23429
|
-
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23430
|
-
* SKIP a null rather than coerce it.
|
|
23431
|
-
*/
|
|
23432
|
-
signalPercent: number().min(0).max(100).nullable(),
|
|
23433
|
-
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23434
|
-
rssiDbm: number().optional(),
|
|
23435
|
-
/** Network name of a wireless link, when the firmware reports it. */
|
|
23436
|
-
ssid: string().optional(),
|
|
23437
|
-
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23438
|
-
lastUpdated: number()
|
|
23439
|
-
});
|
|
23440
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
23441
|
-
deviceId: number(),
|
|
23442
|
-
status: NetworkLinkStatusSchema
|
|
23443
|
-
});
|
|
23444
23534
|
object({
|
|
23445
23535
|
on: boolean(),
|
|
23446
23536
|
/** Ms epoch of the last transition. 0 if never observed. */
|
|
@@ -25794,6 +25884,236 @@ DeviceType.Camera, method(object({
|
|
|
25794
25884
|
detection: NativeDetectionSchema
|
|
25795
25885
|
});
|
|
25796
25886
|
/**
|
|
25887
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
25888
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
25889
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
25890
|
+
*
|
|
25891
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
25892
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
25893
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
25894
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
25895
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
25896
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
25897
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
25898
|
+
* the reverse:
|
|
25899
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
25900
|
+
* / `getOptions`), and
|
|
25901
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
25902
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
25903
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
25904
|
+
* not here (see the addon design note):
|
|
25905
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
25906
|
+
* ptz.stop() → navigation.stop()
|
|
25907
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
25908
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
25909
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
25910
|
+
*
|
|
25911
|
+
* ## Continuous drive
|
|
25912
|
+
*
|
|
25913
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
25914
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
25915
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
25916
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
25917
|
+
* coalesce them. The UI owns the cadence.
|
|
25918
|
+
*
|
|
25919
|
+
* ## The action dictionary
|
|
25920
|
+
*
|
|
25921
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
25922
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
25923
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
25924
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
25925
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
25926
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
25927
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
25928
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
25929
|
+
*
|
|
25930
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
25931
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
25932
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
25933
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
25934
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
25935
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
25936
|
+
* THIS contract.
|
|
25937
|
+
*/
|
|
25938
|
+
/**
|
|
25939
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
25940
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
25941
|
+
* halts it.
|
|
25942
|
+
*
|
|
25943
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
25944
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
25945
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
25946
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
25947
|
+
*
|
|
25948
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
25949
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
25950
|
+
*/
|
|
25951
|
+
var NavigationMoveCommandSchema = object({
|
|
25952
|
+
pan: number().min(-1).max(1).optional(),
|
|
25953
|
+
tilt: number().min(-1).max(1).optional(),
|
|
25954
|
+
speed: number().min(0).max(1).optional()
|
|
25955
|
+
});
|
|
25956
|
+
/**
|
|
25957
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
25958
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
25959
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
25960
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
25961
|
+
*/
|
|
25962
|
+
var NavigationActionIdSchema = _enum([
|
|
25963
|
+
"goHome",
|
|
25964
|
+
"locate",
|
|
25965
|
+
"spotClean",
|
|
25966
|
+
"findPet",
|
|
25967
|
+
"personFollow",
|
|
25968
|
+
"stop",
|
|
25969
|
+
"startClean",
|
|
25970
|
+
"pauseClean",
|
|
25971
|
+
"dockWash",
|
|
25972
|
+
"autoEmpty",
|
|
25973
|
+
"flashOn",
|
|
25974
|
+
"flashOff"
|
|
25975
|
+
]);
|
|
25976
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
25977
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
25978
|
+
/**
|
|
25979
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
25980
|
+
* native panel and the PTZ mimic render as a button.
|
|
25981
|
+
*
|
|
25982
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
25983
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
25984
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
25985
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
25986
|
+
* - `label` — operator-facing English label.
|
|
25987
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
25988
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
25989
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
25990
|
+
* flips it from config, never by editing code.
|
|
25991
|
+
*/
|
|
25992
|
+
var NavigationActionEntrySchema = object({
|
|
25993
|
+
id: string(),
|
|
25994
|
+
kind: NavigationEntryKindSchema,
|
|
25995
|
+
label: string(),
|
|
25996
|
+
icon: string(),
|
|
25997
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
25998
|
+
soundId: number().int().optional(),
|
|
25999
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
26000
|
+
enabled: boolean()
|
|
26001
|
+
});
|
|
26002
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
26003
|
+
var NavigationPointSchema = object({
|
|
26004
|
+
x: number(),
|
|
26005
|
+
y: number()
|
|
26006
|
+
});
|
|
26007
|
+
/**
|
|
26008
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
26009
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
26010
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
26011
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
26012
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
26013
|
+
* that are not dictionary entries.
|
|
26014
|
+
*
|
|
26015
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
26016
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
26017
|
+
* map-coordinate plumbing is wired.
|
|
26018
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
26019
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
26020
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
26021
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
26022
|
+
* camera-service control; needs an active stream).
|
|
26023
|
+
*/
|
|
26024
|
+
var NavigationFeaturesSchema = object({
|
|
26025
|
+
move: boolean(),
|
|
26026
|
+
stop: boolean(),
|
|
26027
|
+
goToPoint: boolean(),
|
|
26028
|
+
runAction: boolean(),
|
|
26029
|
+
playSound: boolean(),
|
|
26030
|
+
light: boolean(),
|
|
26031
|
+
lightMode: boolean()
|
|
26032
|
+
});
|
|
26033
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
26034
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
26035
|
+
/**
|
|
26036
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
26037
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
26038
|
+
* - `following` — person/pet follow is currently armed.
|
|
26039
|
+
* - `flash` — the on-camera fill light is on.
|
|
26040
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
26041
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
26042
|
+
* `lightMode === 'manual'`.
|
|
26043
|
+
*/
|
|
26044
|
+
var NavigationStatusSchema = object({
|
|
26045
|
+
mode: _enum([
|
|
26046
|
+
"idle",
|
|
26047
|
+
"cleaning",
|
|
26048
|
+
"spot",
|
|
26049
|
+
"following",
|
|
26050
|
+
"goto",
|
|
26051
|
+
"returning",
|
|
26052
|
+
"paused",
|
|
26053
|
+
"unknown"
|
|
26054
|
+
]),
|
|
26055
|
+
following: boolean(),
|
|
26056
|
+
flash: boolean(),
|
|
26057
|
+
lightMode: NavigationLightModeSchema,
|
|
26058
|
+
lightLevel: number().min(40).max(100),
|
|
26059
|
+
/** Ms epoch when the slice was last updated. */
|
|
26060
|
+
lastChangedAt: number()
|
|
26061
|
+
});
|
|
26062
|
+
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
26063
|
+
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({
|
|
26064
|
+
deviceId: number(),
|
|
26065
|
+
actionId: NavigationActionIdSchema
|
|
26066
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26067
|
+
deviceId: number(),
|
|
26068
|
+
soundId: number().int()
|
|
26069
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26070
|
+
deviceId: number(),
|
|
26071
|
+
on: boolean()
|
|
26072
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26073
|
+
deviceId: number(),
|
|
26074
|
+
mode: NavigationLightModeSchema,
|
|
26075
|
+
level: number().min(40).max(100).optional()
|
|
26076
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26077
|
+
deviceId: number(),
|
|
26078
|
+
level: number().min(40).max(100)
|
|
26079
|
+
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
26080
|
+
deviceId: number(),
|
|
26081
|
+
status: NavigationStatusSchema
|
|
26082
|
+
});
|
|
26083
|
+
/**
|
|
26084
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
26085
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
26086
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
26087
|
+
* one Home Assistant projection.
|
|
26088
|
+
*/
|
|
26089
|
+
var NetworkLinkStatusSchema = object({
|
|
26090
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
26091
|
+
type: _enum([
|
|
26092
|
+
"wifi",
|
|
26093
|
+
"ethernet",
|
|
26094
|
+
"cellular",
|
|
26095
|
+
"unknown"
|
|
26096
|
+
]),
|
|
26097
|
+
/**
|
|
26098
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
26099
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
26100
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
26101
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
26102
|
+
* SKIP a null rather than coerce it.
|
|
26103
|
+
*/
|
|
26104
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
26105
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
26106
|
+
rssiDbm: number().optional(),
|
|
26107
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
26108
|
+
ssid: string().optional(),
|
|
26109
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
26110
|
+
lastUpdated: number()
|
|
26111
|
+
});
|
|
26112
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
26113
|
+
deviceId: number(),
|
|
26114
|
+
status: NetworkLinkStatusSchema
|
|
26115
|
+
});
|
|
26116
|
+
/**
|
|
25797
26117
|
* network-quality — system-scoped singleton capability tracking RTT,
|
|
25798
26118
|
* jitter, and observed/peak bandwidth per device + per client.
|
|
25799
26119
|
*
|
|
@@ -27035,203 +27355,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
27035
27355
|
deviceId: number(),
|
|
27036
27356
|
status: PtzAutotrackStatusSchema
|
|
27037
27357
|
});
|
|
27038
|
-
/**
|
|
27039
|
-
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
27040
|
-
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
27041
|
-
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
27042
|
-
*
|
|
27043
|
-
* Why a NEW cap rather than overloading `ptz`:
|
|
27044
|
-
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
27045
|
-
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
27046
|
-
* The two are different physical models: PTZ is absolute-position + presets,
|
|
27047
|
-
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
27048
|
-
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
27049
|
-
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
27050
|
-
* the reverse:
|
|
27051
|
-
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
27052
|
-
* / `getOptions`), and
|
|
27053
|
-
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
27054
|
-
* robot camera shows up in the existing PTZ control path without every
|
|
27055
|
-
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
27056
|
-
* not here (see the addon design note):
|
|
27057
|
-
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
27058
|
-
* ptz.stop() → navigation.stop()
|
|
27059
|
-
* ptz.goHome() → navigation.runAction('goHome')
|
|
27060
|
-
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
27061
|
-
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
27062
|
-
*
|
|
27063
|
-
* ## Continuous drive
|
|
27064
|
-
*
|
|
27065
|
-
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
27066
|
-
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
27067
|
-
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
27068
|
-
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
27069
|
-
* coalesce them. The UI owns the cadence.
|
|
27070
|
-
*
|
|
27071
|
-
* ## The action dictionary
|
|
27072
|
-
*
|
|
27073
|
-
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
27074
|
-
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
27075
|
-
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
27076
|
-
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
27077
|
-
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
27078
|
-
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
27079
|
-
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
27080
|
-
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
27081
|
-
*
|
|
27082
|
-
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
27083
|
-
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
27084
|
-
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
27085
|
-
* every device handle. A future nodedreame publish adds a typed
|
|
27086
|
-
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
27087
|
-
* provider can then swap the raw calls for the typed methods with no change to
|
|
27088
|
-
* THIS contract.
|
|
27089
|
-
*/
|
|
27090
|
-
/**
|
|
27091
|
-
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
27092
|
-
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
27093
|
-
* halts it.
|
|
27094
|
-
*
|
|
27095
|
-
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
27096
|
-
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
27097
|
-
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
27098
|
-
* vector by it (drivers without proportional drive ignore it).
|
|
27099
|
-
*
|
|
27100
|
-
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
27101
|
-
* axis alone; an all-undefined nudge is a no-op.
|
|
27102
|
-
*/
|
|
27103
|
-
var NavigationMoveCommandSchema = object({
|
|
27104
|
-
pan: number().min(-1).max(1).optional(),
|
|
27105
|
-
tilt: number().min(-1).max(1).optional(),
|
|
27106
|
-
speed: number().min(0).max(1).optional()
|
|
27107
|
-
});
|
|
27108
|
-
/**
|
|
27109
|
-
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
27110
|
-
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
27111
|
-
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
27112
|
-
* `playSound` (see the `sound` dictionary entries).
|
|
27113
|
-
*/
|
|
27114
|
-
var NavigationActionIdSchema = _enum([
|
|
27115
|
-
"goHome",
|
|
27116
|
-
"locate",
|
|
27117
|
-
"spotClean",
|
|
27118
|
-
"findPet",
|
|
27119
|
-
"personFollow",
|
|
27120
|
-
"stop",
|
|
27121
|
-
"startClean",
|
|
27122
|
-
"pauseClean",
|
|
27123
|
-
"dockWash",
|
|
27124
|
-
"autoEmpty",
|
|
27125
|
-
"flashOn",
|
|
27126
|
-
"flashOff"
|
|
27127
|
-
]);
|
|
27128
|
-
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
27129
|
-
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
27130
|
-
/**
|
|
27131
|
-
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
27132
|
-
* native panel and the PTZ mimic render as a button.
|
|
27133
|
-
*
|
|
27134
|
-
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
27135
|
-
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
27136
|
-
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
27137
|
-
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
27138
|
-
* - `label` — operator-facing English label.
|
|
27139
|
-
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
27140
|
-
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
27141
|
-
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
27142
|
-
* flips it from config, never by editing code.
|
|
27143
|
-
*/
|
|
27144
|
-
var NavigationActionEntrySchema = object({
|
|
27145
|
-
id: string(),
|
|
27146
|
-
kind: NavigationEntryKindSchema,
|
|
27147
|
-
label: string(),
|
|
27148
|
-
icon: string(),
|
|
27149
|
-
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
27150
|
-
soundId: number().int().optional(),
|
|
27151
|
-
/** Per-device feature flag — render this entry only when true. */
|
|
27152
|
-
enabled: boolean()
|
|
27153
|
-
});
|
|
27154
|
-
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
27155
|
-
var NavigationPointSchema = object({
|
|
27156
|
-
x: number(),
|
|
27157
|
-
y: number()
|
|
27158
|
-
});
|
|
27159
|
-
/**
|
|
27160
|
-
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
27161
|
-
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
27162
|
-
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
27163
|
-
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
27164
|
-
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
27165
|
-
* that are not dictionary entries.
|
|
27166
|
-
*
|
|
27167
|
-
* - `move` / `stop` — the momentary drive joystick.
|
|
27168
|
-
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
27169
|
-
* map-coordinate plumbing is wired.
|
|
27170
|
-
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
27171
|
-
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
27172
|
-
* - `light` — the on/off fill-light toggle (works anytime).
|
|
27173
|
-
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
27174
|
-
* camera-service control; needs an active stream).
|
|
27175
|
-
*/
|
|
27176
|
-
var NavigationFeaturesSchema = object({
|
|
27177
|
-
move: boolean(),
|
|
27178
|
-
stop: boolean(),
|
|
27179
|
-
goToPoint: boolean(),
|
|
27180
|
-
runAction: boolean(),
|
|
27181
|
-
playSound: boolean(),
|
|
27182
|
-
light: boolean(),
|
|
27183
|
-
lightMode: boolean()
|
|
27184
|
-
});
|
|
27185
|
-
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
27186
|
-
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
27187
|
-
/**
|
|
27188
|
-
* Live navigation state so the UI can reflect what the robot is doing:
|
|
27189
|
-
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
27190
|
-
* - `following` — person/pet follow is currently armed.
|
|
27191
|
-
* - `flash` — the on-camera fill light is on.
|
|
27192
|
-
* - `lightMode` — auto vs manual fill-light mode.
|
|
27193
|
-
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
27194
|
-
* `lightMode === 'manual'`.
|
|
27195
|
-
*/
|
|
27196
|
-
var NavigationStatusSchema = object({
|
|
27197
|
-
mode: _enum([
|
|
27198
|
-
"idle",
|
|
27199
|
-
"cleaning",
|
|
27200
|
-
"spot",
|
|
27201
|
-
"following",
|
|
27202
|
-
"goto",
|
|
27203
|
-
"returning",
|
|
27204
|
-
"paused",
|
|
27205
|
-
"unknown"
|
|
27206
|
-
]),
|
|
27207
|
-
following: boolean(),
|
|
27208
|
-
flash: boolean(),
|
|
27209
|
-
lightMode: NavigationLightModeSchema,
|
|
27210
|
-
lightLevel: number().min(40).max(100),
|
|
27211
|
-
/** Ms epoch when the slice was last updated. */
|
|
27212
|
-
lastChangedAt: number()
|
|
27213
|
-
});
|
|
27214
|
-
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
27215
|
-
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({
|
|
27216
|
-
deviceId: number(),
|
|
27217
|
-
actionId: NavigationActionIdSchema
|
|
27218
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27219
|
-
deviceId: number(),
|
|
27220
|
-
soundId: number().int()
|
|
27221
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27222
|
-
deviceId: number(),
|
|
27223
|
-
on: boolean()
|
|
27224
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27225
|
-
deviceId: number(),
|
|
27226
|
-
mode: NavigationLightModeSchema,
|
|
27227
|
-
level: number().min(40).max(100).optional()
|
|
27228
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27229
|
-
deviceId: number(),
|
|
27230
|
-
level: number().min(40).max(100)
|
|
27231
|
-
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
27232
|
-
deviceId: number(),
|
|
27233
|
-
status: NavigationStatusSchema
|
|
27234
|
-
});
|
|
27235
27358
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
27236
27359
|
kind: "mutation",
|
|
27237
27360
|
auth: "admin"
|
|
@@ -34546,6 +34669,12 @@ Object.freeze({
|
|
|
34546
34669
|
addonId: null,
|
|
34547
34670
|
access: "view"
|
|
34548
34671
|
},
|
|
34672
|
+
"storage.listDrainProgress": {
|
|
34673
|
+
capName: "storage",
|
|
34674
|
+
capScope: "system",
|
|
34675
|
+
addonId: null,
|
|
34676
|
+
access: "view"
|
|
34677
|
+
},
|
|
34549
34678
|
"storage.listLocationDeclarations": {
|
|
34550
34679
|
capName: "storage",
|
|
34551
34680
|
capScope: "system",
|
|
@@ -34690,6 +34819,12 @@ Object.freeze({
|
|
|
34690
34819
|
addonId: null,
|
|
34691
34820
|
access: "view"
|
|
34692
34821
|
},
|
|
34822
|
+
"storageOccupancy.getOccupancy": {
|
|
34823
|
+
capName: "storage-occupancy",
|
|
34824
|
+
capScope: "system",
|
|
34825
|
+
addonId: null,
|
|
34826
|
+
access: "view"
|
|
34827
|
+
},
|
|
34693
34828
|
"storageProvider.abortUpload": {
|
|
34694
34829
|
capName: "storage-provider",
|
|
34695
34830
|
capScope: "system",
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
//#region ../types/dist/event-category-
|
|
2
|
+
//#region ../types/dist/event-category-CnLqLOKs.mjs
|
|
3
3
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4
4
|
EventCategory["SystemBoot"] = "system.boot";
|
|
5
5
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -194,6 +194,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
194
194
|
EventCategory["ProcessCrashed"] = "process.crashed";
|
|
195
195
|
EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
|
|
196
196
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
197
|
+
/**
|
|
198
|
+
* The SET of storage locations changed — one was created, edited, enabled,
|
|
199
|
+
* disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
|
|
200
|
+
*
|
|
201
|
+
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
202
|
+
* it must also converge on its own periodic path, because a dropped event
|
|
203
|
+
* must not leave a node writing to yesterday's disk set forever. It exists
|
|
204
|
+
* because there was NO signal at all — an operator who added a second
|
|
205
|
+
* recordings disk in the admin UI got nothing, and the recorder kept its
|
|
206
|
+
* resolved locations until something else happened to re-resolve them
|
|
207
|
+
* (D387). Payload `StorageLocationsChangedPayload`.
|
|
208
|
+
*/
|
|
209
|
+
EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
|
|
197
210
|
EventCategory["RecordingStarted"] = "recording.started";
|
|
198
211
|
EventCategory["RecordingStopped"] = "recording.stopped";
|
|
199
212
|
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
|
|
@@ -21699,7 +21777,7 @@ method(object({
|
|
|
21699
21777
|
}), _void(), {
|
|
21700
21778
|
kind: "mutation",
|
|
21701
21779
|
auth: "admin"
|
|
21702
|
-
}), method(object({ id: string() }), object({
|
|
21780
|
+
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
21703
21781
|
ok: boolean(),
|
|
21704
21782
|
error: string().optional()
|
|
21705
21783
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
@@ -21769,6 +21847,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
21769
21847
|
kind: "mutation",
|
|
21770
21848
|
auth: "admin"
|
|
21771
21849
|
}), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
|
|
21850
|
+
/**
|
|
21851
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
21852
|
+
* location (D388).
|
|
21853
|
+
*
|
|
21854
|
+
* ## Why this is not `storage-evictable`
|
|
21855
|
+
*
|
|
21856
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
21857
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
21858
|
+
* operator most wants a figure for:
|
|
21859
|
+
*
|
|
21860
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
21861
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
21862
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
21863
|
+
* occupancy figure that double-counts the disk.
|
|
21864
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
21865
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
21866
|
+
* is retiring and staring at.
|
|
21867
|
+
*
|
|
21868
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
21869
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
21870
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
21871
|
+
* "evictable" must not register here — a number that silently means different
|
|
21872
|
+
* things per class is worse than no number.
|
|
21873
|
+
*
|
|
21874
|
+
* ## Absence is an answer
|
|
21875
|
+
*
|
|
21876
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
21877
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
21878
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
21879
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
21880
|
+
*
|
|
21881
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
21882
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
21883
|
+
*/
|
|
21884
|
+
/** One provider's occupancy answer for one location. */
|
|
21885
|
+
var StorageOccupancyReportSchema = object({
|
|
21886
|
+
locationId: string(),
|
|
21887
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
21888
|
+
* not net of what it is willing to delete. */
|
|
21889
|
+
ownedBytes: number().int().nonnegative(),
|
|
21890
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
21891
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
21892
|
+
measuredAtMs: number().int().nonnegative()
|
|
21893
|
+
});
|
|
21894
|
+
method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
|
|
21772
21895
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21773
21896
|
providerId: string().min(1),
|
|
21774
21897
|
displayName: string().min(1),
|
|
@@ -23404,39 +23527,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
|
|
|
23404
23527
|
deviceId: number(),
|
|
23405
23528
|
status: BatteryStatusSchema
|
|
23406
23529
|
});
|
|
23407
|
-
/**
|
|
23408
|
-
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23409
|
-
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23410
|
-
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23411
|
-
* one Home Assistant projection.
|
|
23412
|
-
*/
|
|
23413
|
-
var NetworkLinkStatusSchema = object({
|
|
23414
|
-
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23415
|
-
type: _enum([
|
|
23416
|
-
"wifi",
|
|
23417
|
-
"ethernet",
|
|
23418
|
-
"cellular",
|
|
23419
|
-
"unknown"
|
|
23420
|
-
]),
|
|
23421
|
-
/**
|
|
23422
|
-
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23423
|
-
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23424
|
-
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23425
|
-
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23426
|
-
* SKIP a null rather than coerce it.
|
|
23427
|
-
*/
|
|
23428
|
-
signalPercent: number().min(0).max(100).nullable(),
|
|
23429
|
-
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23430
|
-
rssiDbm: number().optional(),
|
|
23431
|
-
/** Network name of a wireless link, when the firmware reports it. */
|
|
23432
|
-
ssid: string().optional(),
|
|
23433
|
-
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23434
|
-
lastUpdated: number()
|
|
23435
|
-
});
|
|
23436
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
23437
|
-
deviceId: number(),
|
|
23438
|
-
status: NetworkLinkStatusSchema
|
|
23439
|
-
});
|
|
23440
23530
|
object({
|
|
23441
23531
|
on: boolean(),
|
|
23442
23532
|
/** Ms epoch of the last transition. 0 if never observed. */
|
|
@@ -25790,6 +25880,236 @@ DeviceType.Camera, method(object({
|
|
|
25790
25880
|
detection: NativeDetectionSchema
|
|
25791
25881
|
});
|
|
25792
25882
|
/**
|
|
25883
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
25884
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
25885
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
25886
|
+
*
|
|
25887
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
25888
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
25889
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
25890
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
25891
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
25892
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
25893
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
25894
|
+
* the reverse:
|
|
25895
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
25896
|
+
* / `getOptions`), and
|
|
25897
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
25898
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
25899
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
25900
|
+
* not here (see the addon design note):
|
|
25901
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
25902
|
+
* ptz.stop() → navigation.stop()
|
|
25903
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
25904
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
25905
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
25906
|
+
*
|
|
25907
|
+
* ## Continuous drive
|
|
25908
|
+
*
|
|
25909
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
25910
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
25911
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
25912
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
25913
|
+
* coalesce them. The UI owns the cadence.
|
|
25914
|
+
*
|
|
25915
|
+
* ## The action dictionary
|
|
25916
|
+
*
|
|
25917
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
25918
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
25919
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
25920
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
25921
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
25922
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
25923
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
25924
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
25925
|
+
*
|
|
25926
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
25927
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
25928
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
25929
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
25930
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
25931
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
25932
|
+
* THIS contract.
|
|
25933
|
+
*/
|
|
25934
|
+
/**
|
|
25935
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
25936
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
25937
|
+
* halts it.
|
|
25938
|
+
*
|
|
25939
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
25940
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
25941
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
25942
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
25943
|
+
*
|
|
25944
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
25945
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
25946
|
+
*/
|
|
25947
|
+
var NavigationMoveCommandSchema = object({
|
|
25948
|
+
pan: number().min(-1).max(1).optional(),
|
|
25949
|
+
tilt: number().min(-1).max(1).optional(),
|
|
25950
|
+
speed: number().min(0).max(1).optional()
|
|
25951
|
+
});
|
|
25952
|
+
/**
|
|
25953
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
25954
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
25955
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
25956
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
25957
|
+
*/
|
|
25958
|
+
var NavigationActionIdSchema = _enum([
|
|
25959
|
+
"goHome",
|
|
25960
|
+
"locate",
|
|
25961
|
+
"spotClean",
|
|
25962
|
+
"findPet",
|
|
25963
|
+
"personFollow",
|
|
25964
|
+
"stop",
|
|
25965
|
+
"startClean",
|
|
25966
|
+
"pauseClean",
|
|
25967
|
+
"dockWash",
|
|
25968
|
+
"autoEmpty",
|
|
25969
|
+
"flashOn",
|
|
25970
|
+
"flashOff"
|
|
25971
|
+
]);
|
|
25972
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
25973
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
25974
|
+
/**
|
|
25975
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
25976
|
+
* native panel and the PTZ mimic render as a button.
|
|
25977
|
+
*
|
|
25978
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
25979
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
25980
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
25981
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
25982
|
+
* - `label` — operator-facing English label.
|
|
25983
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
25984
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
25985
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
25986
|
+
* flips it from config, never by editing code.
|
|
25987
|
+
*/
|
|
25988
|
+
var NavigationActionEntrySchema = object({
|
|
25989
|
+
id: string(),
|
|
25990
|
+
kind: NavigationEntryKindSchema,
|
|
25991
|
+
label: string(),
|
|
25992
|
+
icon: string(),
|
|
25993
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
25994
|
+
soundId: number().int().optional(),
|
|
25995
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
25996
|
+
enabled: boolean()
|
|
25997
|
+
});
|
|
25998
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
25999
|
+
var NavigationPointSchema = object({
|
|
26000
|
+
x: number(),
|
|
26001
|
+
y: number()
|
|
26002
|
+
});
|
|
26003
|
+
/**
|
|
26004
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
26005
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
26006
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
26007
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
26008
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
26009
|
+
* that are not dictionary entries.
|
|
26010
|
+
*
|
|
26011
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
26012
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
26013
|
+
* map-coordinate plumbing is wired.
|
|
26014
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
26015
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
26016
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
26017
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
26018
|
+
* camera-service control; needs an active stream).
|
|
26019
|
+
*/
|
|
26020
|
+
var NavigationFeaturesSchema = object({
|
|
26021
|
+
move: boolean(),
|
|
26022
|
+
stop: boolean(),
|
|
26023
|
+
goToPoint: boolean(),
|
|
26024
|
+
runAction: boolean(),
|
|
26025
|
+
playSound: boolean(),
|
|
26026
|
+
light: boolean(),
|
|
26027
|
+
lightMode: boolean()
|
|
26028
|
+
});
|
|
26029
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
26030
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
26031
|
+
/**
|
|
26032
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
26033
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
26034
|
+
* - `following` — person/pet follow is currently armed.
|
|
26035
|
+
* - `flash` — the on-camera fill light is on.
|
|
26036
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
26037
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
26038
|
+
* `lightMode === 'manual'`.
|
|
26039
|
+
*/
|
|
26040
|
+
var NavigationStatusSchema = object({
|
|
26041
|
+
mode: _enum([
|
|
26042
|
+
"idle",
|
|
26043
|
+
"cleaning",
|
|
26044
|
+
"spot",
|
|
26045
|
+
"following",
|
|
26046
|
+
"goto",
|
|
26047
|
+
"returning",
|
|
26048
|
+
"paused",
|
|
26049
|
+
"unknown"
|
|
26050
|
+
]),
|
|
26051
|
+
following: boolean(),
|
|
26052
|
+
flash: boolean(),
|
|
26053
|
+
lightMode: NavigationLightModeSchema,
|
|
26054
|
+
lightLevel: number().min(40).max(100),
|
|
26055
|
+
/** Ms epoch when the slice was last updated. */
|
|
26056
|
+
lastChangedAt: number()
|
|
26057
|
+
});
|
|
26058
|
+
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
26059
|
+
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({
|
|
26060
|
+
deviceId: number(),
|
|
26061
|
+
actionId: NavigationActionIdSchema
|
|
26062
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26063
|
+
deviceId: number(),
|
|
26064
|
+
soundId: number().int()
|
|
26065
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26066
|
+
deviceId: number(),
|
|
26067
|
+
on: boolean()
|
|
26068
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26069
|
+
deviceId: number(),
|
|
26070
|
+
mode: NavigationLightModeSchema,
|
|
26071
|
+
level: number().min(40).max(100).optional()
|
|
26072
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26073
|
+
deviceId: number(),
|
|
26074
|
+
level: number().min(40).max(100)
|
|
26075
|
+
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
26076
|
+
deviceId: number(),
|
|
26077
|
+
status: NavigationStatusSchema
|
|
26078
|
+
});
|
|
26079
|
+
/**
|
|
26080
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
26081
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
26082
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
26083
|
+
* one Home Assistant projection.
|
|
26084
|
+
*/
|
|
26085
|
+
var NetworkLinkStatusSchema = object({
|
|
26086
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
26087
|
+
type: _enum([
|
|
26088
|
+
"wifi",
|
|
26089
|
+
"ethernet",
|
|
26090
|
+
"cellular",
|
|
26091
|
+
"unknown"
|
|
26092
|
+
]),
|
|
26093
|
+
/**
|
|
26094
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
26095
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
26096
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
26097
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
26098
|
+
* SKIP a null rather than coerce it.
|
|
26099
|
+
*/
|
|
26100
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
26101
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
26102
|
+
rssiDbm: number().optional(),
|
|
26103
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
26104
|
+
ssid: string().optional(),
|
|
26105
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
26106
|
+
lastUpdated: number()
|
|
26107
|
+
});
|
|
26108
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
26109
|
+
deviceId: number(),
|
|
26110
|
+
status: NetworkLinkStatusSchema
|
|
26111
|
+
});
|
|
26112
|
+
/**
|
|
25793
26113
|
* network-quality — system-scoped singleton capability tracking RTT,
|
|
25794
26114
|
* jitter, and observed/peak bandwidth per device + per client.
|
|
25795
26115
|
*
|
|
@@ -27031,203 +27351,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
27031
27351
|
deviceId: number(),
|
|
27032
27352
|
status: PtzAutotrackStatusSchema
|
|
27033
27353
|
});
|
|
27034
|
-
/**
|
|
27035
|
-
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
27036
|
-
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
27037
|
-
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
27038
|
-
*
|
|
27039
|
-
* Why a NEW cap rather than overloading `ptz`:
|
|
27040
|
-
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
27041
|
-
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
27042
|
-
* The two are different physical models: PTZ is absolute-position + presets,
|
|
27043
|
-
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
27044
|
-
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
27045
|
-
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
27046
|
-
* the reverse:
|
|
27047
|
-
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
27048
|
-
* / `getOptions`), and
|
|
27049
|
-
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
27050
|
-
* robot camera shows up in the existing PTZ control path without every
|
|
27051
|
-
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
27052
|
-
* not here (see the addon design note):
|
|
27053
|
-
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
27054
|
-
* ptz.stop() → navigation.stop()
|
|
27055
|
-
* ptz.goHome() → navigation.runAction('goHome')
|
|
27056
|
-
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
27057
|
-
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
27058
|
-
*
|
|
27059
|
-
* ## Continuous drive
|
|
27060
|
-
*
|
|
27061
|
-
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
27062
|
-
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
27063
|
-
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
27064
|
-
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
27065
|
-
* coalesce them. The UI owns the cadence.
|
|
27066
|
-
*
|
|
27067
|
-
* ## The action dictionary
|
|
27068
|
-
*
|
|
27069
|
-
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
27070
|
-
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
27071
|
-
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
27072
|
-
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
27073
|
-
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
27074
|
-
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
27075
|
-
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
27076
|
-
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
27077
|
-
*
|
|
27078
|
-
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
27079
|
-
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
27080
|
-
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
27081
|
-
* every device handle. A future nodedreame publish adds a typed
|
|
27082
|
-
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
27083
|
-
* provider can then swap the raw calls for the typed methods with no change to
|
|
27084
|
-
* THIS contract.
|
|
27085
|
-
*/
|
|
27086
|
-
/**
|
|
27087
|
-
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
27088
|
-
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
27089
|
-
* halts it.
|
|
27090
|
-
*
|
|
27091
|
-
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
27092
|
-
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
27093
|
-
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
27094
|
-
* vector by it (drivers without proportional drive ignore it).
|
|
27095
|
-
*
|
|
27096
|
-
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
27097
|
-
* axis alone; an all-undefined nudge is a no-op.
|
|
27098
|
-
*/
|
|
27099
|
-
var NavigationMoveCommandSchema = object({
|
|
27100
|
-
pan: number().min(-1).max(1).optional(),
|
|
27101
|
-
tilt: number().min(-1).max(1).optional(),
|
|
27102
|
-
speed: number().min(0).max(1).optional()
|
|
27103
|
-
});
|
|
27104
|
-
/**
|
|
27105
|
-
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
27106
|
-
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
27107
|
-
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
27108
|
-
* `playSound` (see the `sound` dictionary entries).
|
|
27109
|
-
*/
|
|
27110
|
-
var NavigationActionIdSchema = _enum([
|
|
27111
|
-
"goHome",
|
|
27112
|
-
"locate",
|
|
27113
|
-
"spotClean",
|
|
27114
|
-
"findPet",
|
|
27115
|
-
"personFollow",
|
|
27116
|
-
"stop",
|
|
27117
|
-
"startClean",
|
|
27118
|
-
"pauseClean",
|
|
27119
|
-
"dockWash",
|
|
27120
|
-
"autoEmpty",
|
|
27121
|
-
"flashOn",
|
|
27122
|
-
"flashOff"
|
|
27123
|
-
]);
|
|
27124
|
-
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
27125
|
-
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
27126
|
-
/**
|
|
27127
|
-
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
27128
|
-
* native panel and the PTZ mimic render as a button.
|
|
27129
|
-
*
|
|
27130
|
-
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
27131
|
-
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
27132
|
-
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
27133
|
-
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
27134
|
-
* - `label` — operator-facing English label.
|
|
27135
|
-
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
27136
|
-
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
27137
|
-
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
27138
|
-
* flips it from config, never by editing code.
|
|
27139
|
-
*/
|
|
27140
|
-
var NavigationActionEntrySchema = object({
|
|
27141
|
-
id: string(),
|
|
27142
|
-
kind: NavigationEntryKindSchema,
|
|
27143
|
-
label: string(),
|
|
27144
|
-
icon: string(),
|
|
27145
|
-
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
27146
|
-
soundId: number().int().optional(),
|
|
27147
|
-
/** Per-device feature flag — render this entry only when true. */
|
|
27148
|
-
enabled: boolean()
|
|
27149
|
-
});
|
|
27150
|
-
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
27151
|
-
var NavigationPointSchema = object({
|
|
27152
|
-
x: number(),
|
|
27153
|
-
y: number()
|
|
27154
|
-
});
|
|
27155
|
-
/**
|
|
27156
|
-
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
27157
|
-
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
27158
|
-
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
27159
|
-
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
27160
|
-
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
27161
|
-
* that are not dictionary entries.
|
|
27162
|
-
*
|
|
27163
|
-
* - `move` / `stop` — the momentary drive joystick.
|
|
27164
|
-
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
27165
|
-
* map-coordinate plumbing is wired.
|
|
27166
|
-
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
27167
|
-
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
27168
|
-
* - `light` — the on/off fill-light toggle (works anytime).
|
|
27169
|
-
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
27170
|
-
* camera-service control; needs an active stream).
|
|
27171
|
-
*/
|
|
27172
|
-
var NavigationFeaturesSchema = object({
|
|
27173
|
-
move: boolean(),
|
|
27174
|
-
stop: boolean(),
|
|
27175
|
-
goToPoint: boolean(),
|
|
27176
|
-
runAction: boolean(),
|
|
27177
|
-
playSound: boolean(),
|
|
27178
|
-
light: boolean(),
|
|
27179
|
-
lightMode: boolean()
|
|
27180
|
-
});
|
|
27181
|
-
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
27182
|
-
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
27183
|
-
/**
|
|
27184
|
-
* Live navigation state so the UI can reflect what the robot is doing:
|
|
27185
|
-
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
27186
|
-
* - `following` — person/pet follow is currently armed.
|
|
27187
|
-
* - `flash` — the on-camera fill light is on.
|
|
27188
|
-
* - `lightMode` — auto vs manual fill-light mode.
|
|
27189
|
-
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
27190
|
-
* `lightMode === 'manual'`.
|
|
27191
|
-
*/
|
|
27192
|
-
var NavigationStatusSchema = object({
|
|
27193
|
-
mode: _enum([
|
|
27194
|
-
"idle",
|
|
27195
|
-
"cleaning",
|
|
27196
|
-
"spot",
|
|
27197
|
-
"following",
|
|
27198
|
-
"goto",
|
|
27199
|
-
"returning",
|
|
27200
|
-
"paused",
|
|
27201
|
-
"unknown"
|
|
27202
|
-
]),
|
|
27203
|
-
following: boolean(),
|
|
27204
|
-
flash: boolean(),
|
|
27205
|
-
lightMode: NavigationLightModeSchema,
|
|
27206
|
-
lightLevel: number().min(40).max(100),
|
|
27207
|
-
/** Ms epoch when the slice was last updated. */
|
|
27208
|
-
lastChangedAt: number()
|
|
27209
|
-
});
|
|
27210
|
-
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
27211
|
-
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({
|
|
27212
|
-
deviceId: number(),
|
|
27213
|
-
actionId: NavigationActionIdSchema
|
|
27214
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27215
|
-
deviceId: number(),
|
|
27216
|
-
soundId: number().int()
|
|
27217
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27218
|
-
deviceId: number(),
|
|
27219
|
-
on: boolean()
|
|
27220
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27221
|
-
deviceId: number(),
|
|
27222
|
-
mode: NavigationLightModeSchema,
|
|
27223
|
-
level: number().min(40).max(100).optional()
|
|
27224
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27225
|
-
deviceId: number(),
|
|
27226
|
-
level: number().min(40).max(100)
|
|
27227
|
-
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
27228
|
-
deviceId: number(),
|
|
27229
|
-
status: NavigationStatusSchema
|
|
27230
|
-
});
|
|
27231
27354
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
27232
27355
|
kind: "mutation",
|
|
27233
27356
|
auth: "admin"
|
|
@@ -34542,6 +34665,12 @@ Object.freeze({
|
|
|
34542
34665
|
addonId: null,
|
|
34543
34666
|
access: "view"
|
|
34544
34667
|
},
|
|
34668
|
+
"storage.listDrainProgress": {
|
|
34669
|
+
capName: "storage",
|
|
34670
|
+
capScope: "system",
|
|
34671
|
+
addonId: null,
|
|
34672
|
+
access: "view"
|
|
34673
|
+
},
|
|
34545
34674
|
"storage.listLocationDeclarations": {
|
|
34546
34675
|
capName: "storage",
|
|
34547
34676
|
capScope: "system",
|
|
@@ -34686,6 +34815,12 @@ Object.freeze({
|
|
|
34686
34815
|
addonId: null,
|
|
34687
34816
|
access: "view"
|
|
34688
34817
|
},
|
|
34818
|
+
"storageOccupancy.getOccupancy": {
|
|
34819
|
+
capName: "storage-occupancy",
|
|
34820
|
+
capScope: "system",
|
|
34821
|
+
addonId: null,
|
|
34822
|
+
access: "view"
|
|
34823
|
+
},
|
|
34689
34824
|
"storageProvider.abortUpload": {
|
|
34690
34825
|
capName: "storage-provider",
|
|
34691
34826
|
capScope: "system",
|