@camstack/addon-provider-petkit 0.2.79 → 0.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/addon.js +500 -365
- package/dist/addon.mjs +500 -365
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1101,7 +1101,7 @@ var Nodepetkit = class {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
};
|
|
1103
1103
|
//#endregion
|
|
1104
|
-
//#region ../types/dist/event-category-
|
|
1104
|
+
//#region ../types/dist/event-category-CnLqLOKs.mjs
|
|
1105
1105
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
1106
1106
|
EventCategory["SystemBoot"] = "system.boot";
|
|
1107
1107
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -1296,6 +1296,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
1296
1296
|
EventCategory["ProcessCrashed"] = "process.crashed";
|
|
1297
1297
|
EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
|
|
1298
1298
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
1299
|
+
/**
|
|
1300
|
+
* The SET of storage locations changed — one was created, edited, enabled,
|
|
1301
|
+
* disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
|
|
1302
|
+
*
|
|
1303
|
+
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
1304
|
+
* it must also converge on its own periodic path, because a dropped event
|
|
1305
|
+
* must not leave a node writing to yesterday's disk set forever. It exists
|
|
1306
|
+
* because there was NO signal at all — an operator who added a second
|
|
1307
|
+
* recordings disk in the admin UI got nothing, and the recorder kept its
|
|
1308
|
+
* resolved locations until something else happened to re-resolve them
|
|
1309
|
+
* (D387). Payload `StorageLocationsChangedPayload`.
|
|
1310
|
+
*/
|
|
1311
|
+
EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
|
|
1299
1312
|
EventCategory["RecordingStarted"] = "recording.started";
|
|
1300
1313
|
EventCategory["RecordingStopped"] = "recording.stopped";
|
|
1301
1314
|
EventCategory["RecordingError"] = "recording.error";
|
|
@@ -9638,6 +9651,21 @@ var StorageCleanupJobSchema = object({
|
|
|
9638
9651
|
});
|
|
9639
9652
|
var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
|
|
9640
9653
|
/**
|
|
9654
|
+
* The one typed state of a storage location. Authoritative Zod schema — the TS
|
|
9655
|
+
* alias below is `z.infer<>` of it, never a second spelling.
|
|
9656
|
+
*/
|
|
9657
|
+
var StorageLocationModeSchema = _enum([
|
|
9658
|
+
"active",
|
|
9659
|
+
"readonly",
|
|
9660
|
+
"drain",
|
|
9661
|
+
"disabled"
|
|
9662
|
+
]);
|
|
9663
|
+
_enum([
|
|
9664
|
+
"normal",
|
|
9665
|
+
"never",
|
|
9666
|
+
"drain"
|
|
9667
|
+
]);
|
|
9668
|
+
/**
|
|
9641
9669
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
9642
9670
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
9643
9671
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -9703,6 +9731,21 @@ var StorageLocationSchema = object({
|
|
|
9703
9731
|
* stops existing rather than being re-derived on every read.
|
|
9704
9732
|
*/
|
|
9705
9733
|
enabled: boolean().optional(),
|
|
9734
|
+
/**
|
|
9735
|
+
* THE state of this location (D385), and the only authority on what may be
|
|
9736
|
+
* written, read or evicted here. Interpreted in exactly one place —
|
|
9737
|
+
* `storage-location-mode.ts` — which also folds the legacy
|
|
9738
|
+
* `enabled` / `config.readOnly` pair into a mode so an old row is never
|
|
9739
|
+
* ambiguous.
|
|
9740
|
+
*
|
|
9741
|
+
* OPTIONAL only for the wire and for rows written before D385: absence is
|
|
9742
|
+
* resolved by `resolveLocationMode`, and the orchestrator stamps every
|
|
9743
|
+
* unstamped row ONCE at hydrate so absence stops existing rather than being
|
|
9744
|
+
* re-derived on every read. `enabled` survives one release as a DERIVED
|
|
9745
|
+
* mirror (`mode === 'active'`); `withLocationMode` is the only writer of
|
|
9746
|
+
* either, so the two cannot disagree.
|
|
9747
|
+
*/
|
|
9748
|
+
mode: StorageLocationModeSchema.optional(),
|
|
9706
9749
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
9707
9750
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
9708
9751
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -9710,11 +9753,46 @@ var StorageLocationSchema = object({
|
|
|
9710
9753
|
totalBytes: number(),
|
|
9711
9754
|
availableBytes: number()
|
|
9712
9755
|
}).nullable().optional(),
|
|
9756
|
+
/**
|
|
9757
|
+
* How much of that volume CamStack ITSELF holds on this location (D388) —
|
|
9758
|
+
* COMPUTED at read time from the `storage-occupancy` providers' own figures,
|
|
9759
|
+
* never persisted, never a filesystem walk.
|
|
9760
|
+
*
|
|
9761
|
+
* **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
|
|
9762
|
+
* location yet — nobody stores here, the owning addon is down, or the first
|
|
9763
|
+
* refresh has not completed. A UI must omit the segment rather than draw it
|
|
9764
|
+
* at zero, which would claim we occupy nothing (D315). It is an OBJECT and
|
|
9765
|
+
* not a bare number precisely so that a `?? 0` on the consuming side has to
|
|
9766
|
+
* be spelled out loud instead of appearing by accident.
|
|
9767
|
+
*
|
|
9768
|
+
* `measuredAtMs` is the OLDEST contributing measurement, so it is honest
|
|
9769
|
+
* about the whole figure rather than about its freshest part.
|
|
9770
|
+
*/
|
|
9771
|
+
owned: object({
|
|
9772
|
+
bytes: number().int().nonnegative(),
|
|
9773
|
+
measuredAtMs: number().int().nonnegative()
|
|
9774
|
+
}).optional(),
|
|
9713
9775
|
createdAt: number(),
|
|
9714
9776
|
updatedAt: number()
|
|
9715
9777
|
});
|
|
9716
9778
|
object({ isDefault: boolean().optional() });
|
|
9717
9779
|
/**
|
|
9780
|
+
* How far a `drain` has got (D386) — the read a UI renders, and nothing more.
|
|
9781
|
+
*
|
|
9782
|
+
* `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
|
|
9783
|
+
* OBSERVED and is `null` when it has observed none. Never a fabricated date: a
|
|
9784
|
+
* drain with no observed growth has no honest ETA, and inventing one is how an
|
|
9785
|
+
* operator learns not to believe the screen.
|
|
9786
|
+
*/
|
|
9787
|
+
var StorageDrainProgressSchema = object({
|
|
9788
|
+
locationId: string(),
|
|
9789
|
+
startedAtMs: number(),
|
|
9790
|
+
startBytes: number(),
|
|
9791
|
+
bytesRemaining: number(),
|
|
9792
|
+
drained: boolean(),
|
|
9793
|
+
estimatedEmptyAtMs: number().nullable()
|
|
9794
|
+
});
|
|
9795
|
+
/**
|
|
9718
9796
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
9719
9797
|
* Either:
|
|
9720
9798
|
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
@@ -23060,7 +23138,7 @@ method(object({
|
|
|
23060
23138
|
}), _void(), {
|
|
23061
23139
|
kind: "mutation",
|
|
23062
23140
|
auth: "admin"
|
|
23063
|
-
}), method(object({ id: string() }), object({
|
|
23141
|
+
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
23064
23142
|
ok: boolean(),
|
|
23065
23143
|
error: string().optional()
|
|
23066
23144
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
@@ -23130,6 +23208,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
23130
23208
|
kind: "mutation",
|
|
23131
23209
|
auth: "admin"
|
|
23132
23210
|
}), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
|
|
23211
|
+
/**
|
|
23212
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
23213
|
+
* location (D388).
|
|
23214
|
+
*
|
|
23215
|
+
* ## Why this is not `storage-evictable`
|
|
23216
|
+
*
|
|
23217
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
23218
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
23219
|
+
* operator most wants a figure for:
|
|
23220
|
+
*
|
|
23221
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
23222
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
23223
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
23224
|
+
* occupancy figure that double-counts the disk.
|
|
23225
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
23226
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
23227
|
+
* is retiring and staring at.
|
|
23228
|
+
*
|
|
23229
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
23230
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
23231
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
23232
|
+
* "evictable" must not register here — a number that silently means different
|
|
23233
|
+
* things per class is worse than no number.
|
|
23234
|
+
*
|
|
23235
|
+
* ## Absence is an answer
|
|
23236
|
+
*
|
|
23237
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
23238
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
23239
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
23240
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
23241
|
+
*
|
|
23242
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
23243
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
23244
|
+
*/
|
|
23245
|
+
/** One provider's occupancy answer for one location. */
|
|
23246
|
+
var StorageOccupancyReportSchema = object({
|
|
23247
|
+
locationId: string(),
|
|
23248
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
23249
|
+
* not net of what it is willing to delete. */
|
|
23250
|
+
ownedBytes: number().int().nonnegative(),
|
|
23251
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
23252
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
23253
|
+
measuredAtMs: number().int().nonnegative()
|
|
23254
|
+
});
|
|
23255
|
+
method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
|
|
23133
23256
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
23134
23257
|
providerId: string().min(1),
|
|
23135
23258
|
displayName: string().min(1),
|
|
@@ -24965,88 +25088,6 @@ onStatusChanged: { data: object({
|
|
|
24965
25088
|
volatileStateFields: ["lastUpdated"]
|
|
24966
25089
|
};
|
|
24967
25090
|
/**
|
|
24968
|
-
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
24969
|
-
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
24970
|
-
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
24971
|
-
* one Home Assistant projection.
|
|
24972
|
-
*/
|
|
24973
|
-
var NetworkLinkStatusSchema = object({
|
|
24974
|
-
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
24975
|
-
type: _enum([
|
|
24976
|
-
"wifi",
|
|
24977
|
-
"ethernet",
|
|
24978
|
-
"cellular",
|
|
24979
|
-
"unknown"
|
|
24980
|
-
]),
|
|
24981
|
-
/**
|
|
24982
|
-
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
24983
|
-
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
24984
|
-
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
24985
|
-
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
24986
|
-
* SKIP a null rather than coerce it.
|
|
24987
|
-
*/
|
|
24988
|
-
signalPercent: number().min(0).max(100).nullable(),
|
|
24989
|
-
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
24990
|
-
rssiDbm: number().optional(),
|
|
24991
|
-
/** Network name of a wireless link, when the firmware reports it. */
|
|
24992
|
-
ssid: string().optional(),
|
|
24993
|
-
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
24994
|
-
lastUpdated: number()
|
|
24995
|
-
});
|
|
24996
|
-
var networkLinkCapability = {
|
|
24997
|
-
name: "network-link",
|
|
24998
|
-
scope: "device",
|
|
24999
|
-
deviceNative: true,
|
|
25000
|
-
mode: "singleton",
|
|
25001
|
-
deviceTypes: [
|
|
25002
|
-
DeviceType.Camera,
|
|
25003
|
-
DeviceType.Sensor,
|
|
25004
|
-
DeviceType.Button,
|
|
25005
|
-
DeviceType.Switch,
|
|
25006
|
-
DeviceType.Light,
|
|
25007
|
-
DeviceType.Lock,
|
|
25008
|
-
DeviceType.Siren
|
|
25009
|
-
],
|
|
25010
|
-
methods: {},
|
|
25011
|
-
events: {
|
|
25012
|
-
/**
|
|
25013
|
-
* Emitted whenever the cached status changes (a link switch, a signal
|
|
25014
|
-
* reading that moved). Mirrored on the parent chain by the
|
|
25015
|
-
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
25016
|
-
*/
|
|
25017
|
-
onStatusChanged: { data: object({
|
|
25018
|
-
deviceId: number(),
|
|
25019
|
-
status: NetworkLinkStatusSchema
|
|
25020
|
-
}) } },
|
|
25021
|
-
status: {
|
|
25022
|
-
schema: NetworkLinkStatusSchema,
|
|
25023
|
-
kind: "push",
|
|
25024
|
-
empty: {
|
|
25025
|
-
type: "unknown",
|
|
25026
|
-
signalPercent: null,
|
|
25027
|
-
lastUpdated: 0
|
|
25028
|
-
}
|
|
25029
|
-
},
|
|
25030
|
-
/**
|
|
25031
|
-
* Runtime-state slice — every provider stores the same shape under
|
|
25032
|
-
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
25033
|
-
* Home Assistant projector regardless of the driver.
|
|
25034
|
-
*/
|
|
25035
|
-
runtimeState: NetworkLinkStatusSchema,
|
|
25036
|
-
/**
|
|
25037
|
-
* Runtime-state durability: **restored** — a link reading is slow to
|
|
25038
|
-
* change and a sleeping battery camera may not report for hours; the
|
|
25039
|
-
* restored slice is what the badge shows until the next read.
|
|
25040
|
-
*
|
|
25041
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
25042
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
25043
|
-
*/
|
|
25044
|
-
durability: "restored",
|
|
25045
|
-
/** Clock fields: written, but excluded from the compare that decides
|
|
25046
|
-
* whether persisting is worth a SQLite commit. */
|
|
25047
|
-
volatileStateFields: ["lastUpdated"]
|
|
25048
|
-
};
|
|
25049
|
-
/**
|
|
25050
25091
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
25051
25092
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
25052
25093
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -28584,6 +28625,369 @@ var nativeObjectDetectionCapability = {
|
|
|
28584
28625
|
volatileStateFields: ["lastFetchedAt"]
|
|
28585
28626
|
};
|
|
28586
28627
|
/**
|
|
28628
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
28629
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
28630
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
28631
|
+
*
|
|
28632
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
28633
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
28634
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
28635
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
28636
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
28637
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
28638
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
28639
|
+
* the reverse:
|
|
28640
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
28641
|
+
* / `getOptions`), and
|
|
28642
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
28643
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
28644
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
28645
|
+
* not here (see the addon design note):
|
|
28646
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
28647
|
+
* ptz.stop() → navigation.stop()
|
|
28648
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
28649
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
28650
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
28651
|
+
*
|
|
28652
|
+
* ## Continuous drive
|
|
28653
|
+
*
|
|
28654
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
28655
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
28656
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
28657
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
28658
|
+
* coalesce them. The UI owns the cadence.
|
|
28659
|
+
*
|
|
28660
|
+
* ## The action dictionary
|
|
28661
|
+
*
|
|
28662
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
28663
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
28664
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
28665
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
28666
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
28667
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
28668
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
28669
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
28670
|
+
*
|
|
28671
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
28672
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
28673
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
28674
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
28675
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
28676
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
28677
|
+
* THIS contract.
|
|
28678
|
+
*/
|
|
28679
|
+
/**
|
|
28680
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
28681
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
28682
|
+
* halts it.
|
|
28683
|
+
*
|
|
28684
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
28685
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
28686
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
28687
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
28688
|
+
*
|
|
28689
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
28690
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
28691
|
+
*/
|
|
28692
|
+
var NavigationMoveCommandSchema = object({
|
|
28693
|
+
pan: number().min(-1).max(1).optional(),
|
|
28694
|
+
tilt: number().min(-1).max(1).optional(),
|
|
28695
|
+
speed: number().min(0).max(1).optional()
|
|
28696
|
+
});
|
|
28697
|
+
/**
|
|
28698
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
28699
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
28700
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
28701
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
28702
|
+
*/
|
|
28703
|
+
var NavigationActionIdSchema = _enum([
|
|
28704
|
+
"goHome",
|
|
28705
|
+
"locate",
|
|
28706
|
+
"spotClean",
|
|
28707
|
+
"findPet",
|
|
28708
|
+
"personFollow",
|
|
28709
|
+
"stop",
|
|
28710
|
+
"startClean",
|
|
28711
|
+
"pauseClean",
|
|
28712
|
+
"dockWash",
|
|
28713
|
+
"autoEmpty",
|
|
28714
|
+
"flashOn",
|
|
28715
|
+
"flashOff"
|
|
28716
|
+
]);
|
|
28717
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
28718
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
28719
|
+
/**
|
|
28720
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
28721
|
+
* native panel and the PTZ mimic render as a button.
|
|
28722
|
+
*
|
|
28723
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
28724
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
28725
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
28726
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
28727
|
+
* - `label` — operator-facing English label.
|
|
28728
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
28729
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
28730
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
28731
|
+
* flips it from config, never by editing code.
|
|
28732
|
+
*/
|
|
28733
|
+
var NavigationActionEntrySchema = object({
|
|
28734
|
+
id: string(),
|
|
28735
|
+
kind: NavigationEntryKindSchema,
|
|
28736
|
+
label: string(),
|
|
28737
|
+
icon: string(),
|
|
28738
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
28739
|
+
soundId: number().int().optional(),
|
|
28740
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
28741
|
+
enabled: boolean()
|
|
28742
|
+
});
|
|
28743
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
28744
|
+
var NavigationPointSchema = object({
|
|
28745
|
+
x: number(),
|
|
28746
|
+
y: number()
|
|
28747
|
+
});
|
|
28748
|
+
/**
|
|
28749
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
28750
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
28751
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
28752
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
28753
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
28754
|
+
* that are not dictionary entries.
|
|
28755
|
+
*
|
|
28756
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
28757
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
28758
|
+
* map-coordinate plumbing is wired.
|
|
28759
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
28760
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
28761
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
28762
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
28763
|
+
* camera-service control; needs an active stream).
|
|
28764
|
+
*/
|
|
28765
|
+
var NavigationFeaturesSchema = object({
|
|
28766
|
+
move: boolean(),
|
|
28767
|
+
stop: boolean(),
|
|
28768
|
+
goToPoint: boolean(),
|
|
28769
|
+
runAction: boolean(),
|
|
28770
|
+
playSound: boolean(),
|
|
28771
|
+
light: boolean(),
|
|
28772
|
+
lightMode: boolean()
|
|
28773
|
+
});
|
|
28774
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
28775
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
28776
|
+
/**
|
|
28777
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
28778
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
28779
|
+
* - `following` — person/pet follow is currently armed.
|
|
28780
|
+
* - `flash` — the on-camera fill light is on.
|
|
28781
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
28782
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
28783
|
+
* `lightMode === 'manual'`.
|
|
28784
|
+
*/
|
|
28785
|
+
var NavigationStatusSchema = object({
|
|
28786
|
+
mode: _enum([
|
|
28787
|
+
"idle",
|
|
28788
|
+
"cleaning",
|
|
28789
|
+
"spot",
|
|
28790
|
+
"following",
|
|
28791
|
+
"goto",
|
|
28792
|
+
"returning",
|
|
28793
|
+
"paused",
|
|
28794
|
+
"unknown"
|
|
28795
|
+
]),
|
|
28796
|
+
following: boolean(),
|
|
28797
|
+
flash: boolean(),
|
|
28798
|
+
lightMode: NavigationLightModeSchema,
|
|
28799
|
+
lightLevel: number().min(40).max(100),
|
|
28800
|
+
/** Ms epoch when the slice was last updated. */
|
|
28801
|
+
lastChangedAt: number()
|
|
28802
|
+
});
|
|
28803
|
+
/**
|
|
28804
|
+
* Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
|
|
28805
|
+
* observable). Adds `lastFetchedAt` on top of the status shape per the
|
|
28806
|
+
* convention.
|
|
28807
|
+
*/
|
|
28808
|
+
var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
28809
|
+
var navigationCapability = {
|
|
28810
|
+
name: "navigation",
|
|
28811
|
+
scope: "device",
|
|
28812
|
+
deviceNative: true,
|
|
28813
|
+
mode: "singleton",
|
|
28814
|
+
deviceTypes: [DeviceType.Camera],
|
|
28815
|
+
deviceConfig: { ui: {
|
|
28816
|
+
kind: "widget",
|
|
28817
|
+
widgetId: "host/navigation-panel",
|
|
28818
|
+
tab: "navigation",
|
|
28819
|
+
topTab: true,
|
|
28820
|
+
label: "Navigation",
|
|
28821
|
+
order: 0
|
|
28822
|
+
} },
|
|
28823
|
+
methods: {
|
|
28824
|
+
/**
|
|
28825
|
+
* Momentary drive nudge (the robot moves). `protected` — mirrors
|
|
28826
|
+
* `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
|
|
28827
|
+
* path) works for any authenticated user, not admin-only. The UI sends
|
|
28828
|
+
* these at ~1 Hz while a control is held; the provider forwards each one to
|
|
28829
|
+
* a single drive write WITHOUT debouncing.
|
|
28830
|
+
*/
|
|
28831
|
+
move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
28832
|
+
/** Halt all motion immediately (zero drive vector). */
|
|
28833
|
+
stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
28834
|
+
/** Send the robot to a point on its live map. */
|
|
28835
|
+
goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
28836
|
+
/**
|
|
28837
|
+
* Enumerate the discrete controls THIS device supports (data-driven UI +
|
|
28838
|
+
* PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
|
|
28839
|
+
*/
|
|
28840
|
+
listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
|
|
28841
|
+
/**
|
|
28842
|
+
* Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
|
|
28843
|
+
* unsupported action ids are rejected by the provider.
|
|
28844
|
+
*/
|
|
28845
|
+
runAction: method(object({
|
|
28846
|
+
deviceId: number(),
|
|
28847
|
+
actionId: NavigationActionIdSchema
|
|
28848
|
+
}), _void(), { kind: "mutation" }),
|
|
28849
|
+
/** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
|
|
28850
|
+
playSound: method(object({
|
|
28851
|
+
deviceId: number(),
|
|
28852
|
+
soundId: number().int()
|
|
28853
|
+
}), _void(), { kind: "mutation" }),
|
|
28854
|
+
/**
|
|
28855
|
+
* Turn the on-camera fill light on / off (the `OpenFullLight` control —
|
|
28856
|
+
* works anytime, no active stream required).
|
|
28857
|
+
*/
|
|
28858
|
+
setLightOn: method(object({
|
|
28859
|
+
deviceId: number(),
|
|
28860
|
+
on: boolean()
|
|
28861
|
+
}), _void(), { kind: "mutation" }),
|
|
28862
|
+
/**
|
|
28863
|
+
* Set the fill-light mode (auto vs manual). `manual` optionally carries the
|
|
28864
|
+
* initial `level`. The auto/manual + level control is a CAMERA-service
|
|
28865
|
+
* action that generally needs an active camera stream/monitor session — the
|
|
28866
|
+
* UI shows the manual level slider ONLY when `mode === 'manual'`.
|
|
28867
|
+
*/
|
|
28868
|
+
setLightMode: method(object({
|
|
28869
|
+
deviceId: number(),
|
|
28870
|
+
mode: NavigationLightModeSchema,
|
|
28871
|
+
level: number().min(40).max(100).optional()
|
|
28872
|
+
}), _void(), { kind: "mutation" }),
|
|
28873
|
+
/** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
|
|
28874
|
+
setLightLevel: method(object({
|
|
28875
|
+
deviceId: number(),
|
|
28876
|
+
level: number().min(40).max(100)
|
|
28877
|
+
}), _void(), { kind: "mutation" }),
|
|
28878
|
+
/**
|
|
28879
|
+
* Per-device FEATURE-FLAG report for the general primitives — drives which
|
|
28880
|
+
* controls the UI shows (the per-entry flags for the dictionary come back on
|
|
28881
|
+
* `listActions`).
|
|
28882
|
+
*/
|
|
28883
|
+
getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
|
|
28884
|
+
},
|
|
28885
|
+
events: { onStatusChanged: { data: object({
|
|
28886
|
+
deviceId: number(),
|
|
28887
|
+
status: NavigationStatusSchema
|
|
28888
|
+
}) } },
|
|
28889
|
+
status: {
|
|
28890
|
+
schema: NavigationStatusSchema,
|
|
28891
|
+
kind: "push"
|
|
28892
|
+
},
|
|
28893
|
+
/**
|
|
28894
|
+
* Runtime-state slice mirrored by the kernel. The navigation panel watches it
|
|
28895
|
+
* for live mode / follow / flash changes.
|
|
28896
|
+
*/
|
|
28897
|
+
runtimeState: NavigationRuntimeStateSchema,
|
|
28898
|
+
/**
|
|
28899
|
+
* Runtime-state durability: **session** — like `vacuum-control`, a restored
|
|
28900
|
+
* `mode: cleaning` / `following: true` is a robot that is not actually doing
|
|
28901
|
+
* that. The live handle re-publishes on connect.
|
|
28902
|
+
*
|
|
28903
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
28904
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
28905
|
+
*/
|
|
28906
|
+
durability: "session"
|
|
28907
|
+
};
|
|
28908
|
+
/**
|
|
28909
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
28910
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
28911
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
28912
|
+
* one Home Assistant projection.
|
|
28913
|
+
*/
|
|
28914
|
+
var NetworkLinkStatusSchema = object({
|
|
28915
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
28916
|
+
type: _enum([
|
|
28917
|
+
"wifi",
|
|
28918
|
+
"ethernet",
|
|
28919
|
+
"cellular",
|
|
28920
|
+
"unknown"
|
|
28921
|
+
]),
|
|
28922
|
+
/**
|
|
28923
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
28924
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
28925
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
28926
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
28927
|
+
* SKIP a null rather than coerce it.
|
|
28928
|
+
*/
|
|
28929
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
28930
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
28931
|
+
rssiDbm: number().optional(),
|
|
28932
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
28933
|
+
ssid: string().optional(),
|
|
28934
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
28935
|
+
lastUpdated: number()
|
|
28936
|
+
});
|
|
28937
|
+
var networkLinkCapability = {
|
|
28938
|
+
name: "network-link",
|
|
28939
|
+
scope: "device",
|
|
28940
|
+
deviceNative: true,
|
|
28941
|
+
mode: "singleton",
|
|
28942
|
+
deviceTypes: [
|
|
28943
|
+
DeviceType.Camera,
|
|
28944
|
+
DeviceType.Sensor,
|
|
28945
|
+
DeviceType.Button,
|
|
28946
|
+
DeviceType.Switch,
|
|
28947
|
+
DeviceType.Light,
|
|
28948
|
+
DeviceType.Lock,
|
|
28949
|
+
DeviceType.Siren
|
|
28950
|
+
],
|
|
28951
|
+
methods: {},
|
|
28952
|
+
events: {
|
|
28953
|
+
/**
|
|
28954
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
28955
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
28956
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
28957
|
+
*/
|
|
28958
|
+
onStatusChanged: { data: object({
|
|
28959
|
+
deviceId: number(),
|
|
28960
|
+
status: NetworkLinkStatusSchema
|
|
28961
|
+
}) } },
|
|
28962
|
+
status: {
|
|
28963
|
+
schema: NetworkLinkStatusSchema,
|
|
28964
|
+
kind: "push",
|
|
28965
|
+
empty: {
|
|
28966
|
+
type: "unknown",
|
|
28967
|
+
signalPercent: null,
|
|
28968
|
+
lastUpdated: 0
|
|
28969
|
+
}
|
|
28970
|
+
},
|
|
28971
|
+
/**
|
|
28972
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
28973
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
28974
|
+
* Home Assistant projector regardless of the driver.
|
|
28975
|
+
*/
|
|
28976
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
28977
|
+
/**
|
|
28978
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
28979
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
28980
|
+
* restored slice is what the badge shows until the next read.
|
|
28981
|
+
*
|
|
28982
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
28983
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
28984
|
+
*/
|
|
28985
|
+
durability: "restored",
|
|
28986
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
28987
|
+
* whether persisting is worth a SQLite commit. */
|
|
28988
|
+
volatileStateFields: ["lastUpdated"]
|
|
28989
|
+
};
|
|
28990
|
+
/**
|
|
28587
28991
|
* network-quality — system-scoped singleton capability tracking RTT,
|
|
28588
28992
|
* jitter, and observed/peak bandwidth per device + per client.
|
|
28589
28993
|
*
|
|
@@ -30164,287 +30568,6 @@ var ptzAutotrackCapability = {
|
|
|
30164
30568
|
*/
|
|
30165
30569
|
durability: "session"
|
|
30166
30570
|
};
|
|
30167
|
-
/**
|
|
30168
|
-
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
30169
|
-
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
30170
|
-
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
30171
|
-
*
|
|
30172
|
-
* Why a NEW cap rather than overloading `ptz`:
|
|
30173
|
-
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
30174
|
-
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
30175
|
-
* The two are different physical models: PTZ is absolute-position + presets,
|
|
30176
|
-
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
30177
|
-
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
30178
|
-
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
30179
|
-
* the reverse:
|
|
30180
|
-
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
30181
|
-
* / `getOptions`), and
|
|
30182
|
-
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
30183
|
-
* robot camera shows up in the existing PTZ control path without every
|
|
30184
|
-
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
30185
|
-
* not here (see the addon design note):
|
|
30186
|
-
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
30187
|
-
* ptz.stop() → navigation.stop()
|
|
30188
|
-
* ptz.goHome() → navigation.runAction('goHome')
|
|
30189
|
-
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
30190
|
-
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
30191
|
-
*
|
|
30192
|
-
* ## Continuous drive
|
|
30193
|
-
*
|
|
30194
|
-
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
30195
|
-
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
30196
|
-
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
30197
|
-
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
30198
|
-
* coalesce them. The UI owns the cadence.
|
|
30199
|
-
*
|
|
30200
|
-
* ## The action dictionary
|
|
30201
|
-
*
|
|
30202
|
-
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
30203
|
-
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
30204
|
-
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
30205
|
-
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
30206
|
-
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
30207
|
-
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
30208
|
-
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
30209
|
-
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
30210
|
-
*
|
|
30211
|
-
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
30212
|
-
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
30213
|
-
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
30214
|
-
* every device handle. A future nodedreame publish adds a typed
|
|
30215
|
-
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
30216
|
-
* provider can then swap the raw calls for the typed methods with no change to
|
|
30217
|
-
* THIS contract.
|
|
30218
|
-
*/
|
|
30219
|
-
/**
|
|
30220
|
-
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
30221
|
-
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
30222
|
-
* halts it.
|
|
30223
|
-
*
|
|
30224
|
-
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
30225
|
-
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
30226
|
-
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
30227
|
-
* vector by it (drivers without proportional drive ignore it).
|
|
30228
|
-
*
|
|
30229
|
-
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
30230
|
-
* axis alone; an all-undefined nudge is a no-op.
|
|
30231
|
-
*/
|
|
30232
|
-
var NavigationMoveCommandSchema = object({
|
|
30233
|
-
pan: number().min(-1).max(1).optional(),
|
|
30234
|
-
tilt: number().min(-1).max(1).optional(),
|
|
30235
|
-
speed: number().min(0).max(1).optional()
|
|
30236
|
-
});
|
|
30237
|
-
/**
|
|
30238
|
-
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
30239
|
-
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
30240
|
-
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
30241
|
-
* `playSound` (see the `sound` dictionary entries).
|
|
30242
|
-
*/
|
|
30243
|
-
var NavigationActionIdSchema = _enum([
|
|
30244
|
-
"goHome",
|
|
30245
|
-
"locate",
|
|
30246
|
-
"spotClean",
|
|
30247
|
-
"findPet",
|
|
30248
|
-
"personFollow",
|
|
30249
|
-
"stop",
|
|
30250
|
-
"startClean",
|
|
30251
|
-
"pauseClean",
|
|
30252
|
-
"dockWash",
|
|
30253
|
-
"autoEmpty",
|
|
30254
|
-
"flashOn",
|
|
30255
|
-
"flashOff"
|
|
30256
|
-
]);
|
|
30257
|
-
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
30258
|
-
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
30259
|
-
/**
|
|
30260
|
-
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
30261
|
-
* native panel and the PTZ mimic render as a button.
|
|
30262
|
-
*
|
|
30263
|
-
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
30264
|
-
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
30265
|
-
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
30266
|
-
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
30267
|
-
* - `label` — operator-facing English label.
|
|
30268
|
-
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
30269
|
-
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
30270
|
-
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
30271
|
-
* flips it from config, never by editing code.
|
|
30272
|
-
*/
|
|
30273
|
-
var NavigationActionEntrySchema = object({
|
|
30274
|
-
id: string(),
|
|
30275
|
-
kind: NavigationEntryKindSchema,
|
|
30276
|
-
label: string(),
|
|
30277
|
-
icon: string(),
|
|
30278
|
-
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
30279
|
-
soundId: number().int().optional(),
|
|
30280
|
-
/** Per-device feature flag — render this entry only when true. */
|
|
30281
|
-
enabled: boolean()
|
|
30282
|
-
});
|
|
30283
|
-
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
30284
|
-
var NavigationPointSchema = object({
|
|
30285
|
-
x: number(),
|
|
30286
|
-
y: number()
|
|
30287
|
-
});
|
|
30288
|
-
/**
|
|
30289
|
-
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
30290
|
-
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
30291
|
-
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
30292
|
-
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
30293
|
-
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
30294
|
-
* that are not dictionary entries.
|
|
30295
|
-
*
|
|
30296
|
-
* - `move` / `stop` — the momentary drive joystick.
|
|
30297
|
-
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
30298
|
-
* map-coordinate plumbing is wired.
|
|
30299
|
-
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
30300
|
-
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
30301
|
-
* - `light` — the on/off fill-light toggle (works anytime).
|
|
30302
|
-
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
30303
|
-
* camera-service control; needs an active stream).
|
|
30304
|
-
*/
|
|
30305
|
-
var NavigationFeaturesSchema = object({
|
|
30306
|
-
move: boolean(),
|
|
30307
|
-
stop: boolean(),
|
|
30308
|
-
goToPoint: boolean(),
|
|
30309
|
-
runAction: boolean(),
|
|
30310
|
-
playSound: boolean(),
|
|
30311
|
-
light: boolean(),
|
|
30312
|
-
lightMode: boolean()
|
|
30313
|
-
});
|
|
30314
|
-
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
30315
|
-
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
30316
|
-
/**
|
|
30317
|
-
* Live navigation state so the UI can reflect what the robot is doing:
|
|
30318
|
-
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
30319
|
-
* - `following` — person/pet follow is currently armed.
|
|
30320
|
-
* - `flash` — the on-camera fill light is on.
|
|
30321
|
-
* - `lightMode` — auto vs manual fill-light mode.
|
|
30322
|
-
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
30323
|
-
* `lightMode === 'manual'`.
|
|
30324
|
-
*/
|
|
30325
|
-
var NavigationStatusSchema = object({
|
|
30326
|
-
mode: _enum([
|
|
30327
|
-
"idle",
|
|
30328
|
-
"cleaning",
|
|
30329
|
-
"spot",
|
|
30330
|
-
"following",
|
|
30331
|
-
"goto",
|
|
30332
|
-
"returning",
|
|
30333
|
-
"paused",
|
|
30334
|
-
"unknown"
|
|
30335
|
-
]),
|
|
30336
|
-
following: boolean(),
|
|
30337
|
-
flash: boolean(),
|
|
30338
|
-
lightMode: NavigationLightModeSchema,
|
|
30339
|
-
lightLevel: number().min(40).max(100),
|
|
30340
|
-
/** Ms epoch when the slice was last updated. */
|
|
30341
|
-
lastChangedAt: number()
|
|
30342
|
-
});
|
|
30343
|
-
/**
|
|
30344
|
-
* Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
|
|
30345
|
-
* observable). Adds `lastFetchedAt` on top of the status shape per the
|
|
30346
|
-
* convention.
|
|
30347
|
-
*/
|
|
30348
|
-
var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
30349
|
-
var navigationCapability = {
|
|
30350
|
-
name: "navigation",
|
|
30351
|
-
scope: "device",
|
|
30352
|
-
deviceNative: true,
|
|
30353
|
-
mode: "singleton",
|
|
30354
|
-
deviceTypes: [DeviceType.Camera],
|
|
30355
|
-
deviceConfig: { ui: {
|
|
30356
|
-
kind: "widget",
|
|
30357
|
-
widgetId: "host/navigation-panel",
|
|
30358
|
-
tab: "navigation",
|
|
30359
|
-
topTab: true,
|
|
30360
|
-
label: "Navigation",
|
|
30361
|
-
order: 0
|
|
30362
|
-
} },
|
|
30363
|
-
methods: {
|
|
30364
|
-
/**
|
|
30365
|
-
* Momentary drive nudge (the robot moves). `protected` — mirrors
|
|
30366
|
-
* `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
|
|
30367
|
-
* path) works for any authenticated user, not admin-only. The UI sends
|
|
30368
|
-
* these at ~1 Hz while a control is held; the provider forwards each one to
|
|
30369
|
-
* a single drive write WITHOUT debouncing.
|
|
30370
|
-
*/
|
|
30371
|
-
move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
30372
|
-
/** Halt all motion immediately (zero drive vector). */
|
|
30373
|
-
stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
30374
|
-
/** Send the robot to a point on its live map. */
|
|
30375
|
-
goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
30376
|
-
/**
|
|
30377
|
-
* Enumerate the discrete controls THIS device supports (data-driven UI +
|
|
30378
|
-
* PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
|
|
30379
|
-
*/
|
|
30380
|
-
listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
|
|
30381
|
-
/**
|
|
30382
|
-
* Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
|
|
30383
|
-
* unsupported action ids are rejected by the provider.
|
|
30384
|
-
*/
|
|
30385
|
-
runAction: method(object({
|
|
30386
|
-
deviceId: number(),
|
|
30387
|
-
actionId: NavigationActionIdSchema
|
|
30388
|
-
}), _void(), { kind: "mutation" }),
|
|
30389
|
-
/** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
|
|
30390
|
-
playSound: method(object({
|
|
30391
|
-
deviceId: number(),
|
|
30392
|
-
soundId: number().int()
|
|
30393
|
-
}), _void(), { kind: "mutation" }),
|
|
30394
|
-
/**
|
|
30395
|
-
* Turn the on-camera fill light on / off (the `OpenFullLight` control —
|
|
30396
|
-
* works anytime, no active stream required).
|
|
30397
|
-
*/
|
|
30398
|
-
setLightOn: method(object({
|
|
30399
|
-
deviceId: number(),
|
|
30400
|
-
on: boolean()
|
|
30401
|
-
}), _void(), { kind: "mutation" }),
|
|
30402
|
-
/**
|
|
30403
|
-
* Set the fill-light mode (auto vs manual). `manual` optionally carries the
|
|
30404
|
-
* initial `level`. The auto/manual + level control is a CAMERA-service
|
|
30405
|
-
* action that generally needs an active camera stream/monitor session — the
|
|
30406
|
-
* UI shows the manual level slider ONLY when `mode === 'manual'`.
|
|
30407
|
-
*/
|
|
30408
|
-
setLightMode: method(object({
|
|
30409
|
-
deviceId: number(),
|
|
30410
|
-
mode: NavigationLightModeSchema,
|
|
30411
|
-
level: number().min(40).max(100).optional()
|
|
30412
|
-
}), _void(), { kind: "mutation" }),
|
|
30413
|
-
/** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
|
|
30414
|
-
setLightLevel: method(object({
|
|
30415
|
-
deviceId: number(),
|
|
30416
|
-
level: number().min(40).max(100)
|
|
30417
|
-
}), _void(), { kind: "mutation" }),
|
|
30418
|
-
/**
|
|
30419
|
-
* Per-device FEATURE-FLAG report for the general primitives — drives which
|
|
30420
|
-
* controls the UI shows (the per-entry flags for the dictionary come back on
|
|
30421
|
-
* `listActions`).
|
|
30422
|
-
*/
|
|
30423
|
-
getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
|
|
30424
|
-
},
|
|
30425
|
-
events: { onStatusChanged: { data: object({
|
|
30426
|
-
deviceId: number(),
|
|
30427
|
-
status: NavigationStatusSchema
|
|
30428
|
-
}) } },
|
|
30429
|
-
status: {
|
|
30430
|
-
schema: NavigationStatusSchema,
|
|
30431
|
-
kind: "push"
|
|
30432
|
-
},
|
|
30433
|
-
/**
|
|
30434
|
-
* Runtime-state slice mirrored by the kernel. The navigation panel watches it
|
|
30435
|
-
* for live mode / follow / flash changes.
|
|
30436
|
-
*/
|
|
30437
|
-
runtimeState: NavigationRuntimeStateSchema,
|
|
30438
|
-
/**
|
|
30439
|
-
* Runtime-state durability: **session** — like `vacuum-control`, a restored
|
|
30440
|
-
* `mode: cleaning` / `following: true` is a robot that is not actually doing
|
|
30441
|
-
* that. The live handle re-publishes on connect.
|
|
30442
|
-
*
|
|
30443
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
30444
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
30445
|
-
*/
|
|
30446
|
-
durability: "session"
|
|
30447
|
-
};
|
|
30448
30571
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
30449
30572
|
kind: "mutation",
|
|
30450
30573
|
auth: "admin"
|
|
@@ -39907,6 +40030,12 @@ Object.freeze({
|
|
|
39907
40030
|
addonId: null,
|
|
39908
40031
|
access: "view"
|
|
39909
40032
|
},
|
|
40033
|
+
"storage.listDrainProgress": {
|
|
40034
|
+
capName: "storage",
|
|
40035
|
+
capScope: "system",
|
|
40036
|
+
addonId: null,
|
|
40037
|
+
access: "view"
|
|
40038
|
+
},
|
|
39910
40039
|
"storage.listLocationDeclarations": {
|
|
39911
40040
|
capName: "storage",
|
|
39912
40041
|
capScope: "system",
|
|
@@ -40051,6 +40180,12 @@ Object.freeze({
|
|
|
40051
40180
|
addonId: null,
|
|
40052
40181
|
access: "view"
|
|
40053
40182
|
},
|
|
40183
|
+
"storageOccupancy.getOccupancy": {
|
|
40184
|
+
capName: "storage-occupancy",
|
|
40185
|
+
capScope: "system",
|
|
40186
|
+
addonId: null,
|
|
40187
|
+
access: "view"
|
|
40188
|
+
},
|
|
40054
40189
|
"storageProvider.abortUpload": {
|
|
40055
40190
|
capName: "storage-provider",
|
|
40056
40191
|
capScope: "system",
|