@camstack/addon-decoder-ffmpeg 1.2.69 → 1.2.71
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 +348 -1
- package/dist/index.mjs +348 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
});
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
6
6
|
let node_child_process = require("node:child_process");
|
|
7
|
-
//#region ../types/dist/event-category-
|
|
7
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
8
8
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
9
9
|
EventCategory["SystemBoot"] = "system.boot";
|
|
10
10
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -376,6 +376,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
376
376
|
*/
|
|
377
377
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
378
378
|
/**
|
|
379
|
+
* Cap event fired by every device that registers the `network-link`
|
|
380
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
381
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
382
|
+
* reading that moved.
|
|
383
|
+
*/
|
|
384
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
385
|
+
/**
|
|
379
386
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
380
387
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
381
388
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23312,6 +23319,39 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
|
|
|
23312
23319
|
deviceId: number(),
|
|
23313
23320
|
status: BatteryStatusSchema
|
|
23314
23321
|
});
|
|
23322
|
+
/**
|
|
23323
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23324
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23325
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23326
|
+
* one Home Assistant projection.
|
|
23327
|
+
*/
|
|
23328
|
+
var NetworkLinkStatusSchema = object({
|
|
23329
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23330
|
+
type: _enum([
|
|
23331
|
+
"wifi",
|
|
23332
|
+
"ethernet",
|
|
23333
|
+
"cellular",
|
|
23334
|
+
"unknown"
|
|
23335
|
+
]),
|
|
23336
|
+
/**
|
|
23337
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23338
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23339
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23340
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23341
|
+
* SKIP a null rather than coerce it.
|
|
23342
|
+
*/
|
|
23343
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23344
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23345
|
+
rssiDbm: number().optional(),
|
|
23346
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23347
|
+
ssid: string().optional(),
|
|
23348
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23349
|
+
lastUpdated: number()
|
|
23350
|
+
});
|
|
23351
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
23352
|
+
deviceId: number(),
|
|
23353
|
+
status: NetworkLinkStatusSchema
|
|
23354
|
+
});
|
|
23315
23355
|
object({
|
|
23316
23356
|
on: boolean(),
|
|
23317
23357
|
/** Ms epoch of the last transition. 0 if never observed. */
|
|
@@ -26906,6 +26946,203 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
26906
26946
|
deviceId: number(),
|
|
26907
26947
|
status: PtzAutotrackStatusSchema
|
|
26908
26948
|
});
|
|
26949
|
+
/**
|
|
26950
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
26951
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
26952
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
26953
|
+
*
|
|
26954
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
26955
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
26956
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
26957
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
26958
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
26959
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
26960
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
26961
|
+
* the reverse:
|
|
26962
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
26963
|
+
* / `getOptions`), and
|
|
26964
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
26965
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
26966
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
26967
|
+
* not here (see the addon design note):
|
|
26968
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
26969
|
+
* ptz.stop() → navigation.stop()
|
|
26970
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
26971
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
26972
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
26973
|
+
*
|
|
26974
|
+
* ## Continuous drive
|
|
26975
|
+
*
|
|
26976
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
26977
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
26978
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
26979
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
26980
|
+
* coalesce them. The UI owns the cadence.
|
|
26981
|
+
*
|
|
26982
|
+
* ## The action dictionary
|
|
26983
|
+
*
|
|
26984
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
26985
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
26986
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
26987
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
26988
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
26989
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
26990
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
26991
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
26992
|
+
*
|
|
26993
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
26994
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
26995
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
26996
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
26997
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
26998
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
26999
|
+
* THIS contract.
|
|
27000
|
+
*/
|
|
27001
|
+
/**
|
|
27002
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
27003
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
27004
|
+
* halts it.
|
|
27005
|
+
*
|
|
27006
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
27007
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
27008
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
27009
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
27010
|
+
*
|
|
27011
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
27012
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
27013
|
+
*/
|
|
27014
|
+
var NavigationMoveCommandSchema = object({
|
|
27015
|
+
pan: number().min(-1).max(1).optional(),
|
|
27016
|
+
tilt: number().min(-1).max(1).optional(),
|
|
27017
|
+
speed: number().min(0).max(1).optional()
|
|
27018
|
+
});
|
|
27019
|
+
/**
|
|
27020
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
27021
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
27022
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
27023
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
27024
|
+
*/
|
|
27025
|
+
var NavigationActionIdSchema = _enum([
|
|
27026
|
+
"goHome",
|
|
27027
|
+
"locate",
|
|
27028
|
+
"spotClean",
|
|
27029
|
+
"findPet",
|
|
27030
|
+
"personFollow",
|
|
27031
|
+
"stop",
|
|
27032
|
+
"startClean",
|
|
27033
|
+
"pauseClean",
|
|
27034
|
+
"dockWash",
|
|
27035
|
+
"autoEmpty",
|
|
27036
|
+
"flashOn",
|
|
27037
|
+
"flashOff"
|
|
27038
|
+
]);
|
|
27039
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
27040
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
27041
|
+
/**
|
|
27042
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
27043
|
+
* native panel and the PTZ mimic render as a button.
|
|
27044
|
+
*
|
|
27045
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
27046
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
27047
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
27048
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
27049
|
+
* - `label` — operator-facing English label.
|
|
27050
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
27051
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
27052
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
27053
|
+
* flips it from config, never by editing code.
|
|
27054
|
+
*/
|
|
27055
|
+
var NavigationActionEntrySchema = object({
|
|
27056
|
+
id: string(),
|
|
27057
|
+
kind: NavigationEntryKindSchema,
|
|
27058
|
+
label: string(),
|
|
27059
|
+
icon: string(),
|
|
27060
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
27061
|
+
soundId: number().int().optional(),
|
|
27062
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
27063
|
+
enabled: boolean()
|
|
27064
|
+
});
|
|
27065
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
27066
|
+
var NavigationPointSchema = object({
|
|
27067
|
+
x: number(),
|
|
27068
|
+
y: number()
|
|
27069
|
+
});
|
|
27070
|
+
/**
|
|
27071
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
27072
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
27073
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
27074
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
27075
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
27076
|
+
* that are not dictionary entries.
|
|
27077
|
+
*
|
|
27078
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
27079
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
27080
|
+
* map-coordinate plumbing is wired.
|
|
27081
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
27082
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
27083
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
27084
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
27085
|
+
* camera-service control; needs an active stream).
|
|
27086
|
+
*/
|
|
27087
|
+
var NavigationFeaturesSchema = object({
|
|
27088
|
+
move: boolean(),
|
|
27089
|
+
stop: boolean(),
|
|
27090
|
+
goToPoint: boolean(),
|
|
27091
|
+
runAction: boolean(),
|
|
27092
|
+
playSound: boolean(),
|
|
27093
|
+
light: boolean(),
|
|
27094
|
+
lightMode: boolean()
|
|
27095
|
+
});
|
|
27096
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
27097
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
27098
|
+
/**
|
|
27099
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
27100
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
27101
|
+
* - `following` — person/pet follow is currently armed.
|
|
27102
|
+
* - `flash` — the on-camera fill light is on.
|
|
27103
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
27104
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
27105
|
+
* `lightMode === 'manual'`.
|
|
27106
|
+
*/
|
|
27107
|
+
var NavigationStatusSchema = object({
|
|
27108
|
+
mode: _enum([
|
|
27109
|
+
"idle",
|
|
27110
|
+
"cleaning",
|
|
27111
|
+
"spot",
|
|
27112
|
+
"following",
|
|
27113
|
+
"goto",
|
|
27114
|
+
"returning",
|
|
27115
|
+
"paused",
|
|
27116
|
+
"unknown"
|
|
27117
|
+
]),
|
|
27118
|
+
following: boolean(),
|
|
27119
|
+
flash: boolean(),
|
|
27120
|
+
lightMode: NavigationLightModeSchema,
|
|
27121
|
+
lightLevel: number().min(40).max(100),
|
|
27122
|
+
/** Ms epoch when the slice was last updated. */
|
|
27123
|
+
lastChangedAt: number()
|
|
27124
|
+
});
|
|
27125
|
+
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
27126
|
+
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({
|
|
27127
|
+
deviceId: number(),
|
|
27128
|
+
actionId: NavigationActionIdSchema
|
|
27129
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27130
|
+
deviceId: number(),
|
|
27131
|
+
soundId: number().int()
|
|
27132
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27133
|
+
deviceId: number(),
|
|
27134
|
+
on: boolean()
|
|
27135
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27136
|
+
deviceId: number(),
|
|
27137
|
+
mode: NavigationLightModeSchema,
|
|
27138
|
+
level: number().min(40).max(100).optional()
|
|
27139
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27140
|
+
deviceId: number(),
|
|
27141
|
+
level: number().min(40).max(100)
|
|
27142
|
+
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
27143
|
+
deviceId: number(),
|
|
27144
|
+
status: NavigationStatusSchema
|
|
27145
|
+
});
|
|
26909
27146
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
26910
27147
|
kind: "mutation",
|
|
26911
27148
|
auth: "admin"
|
|
@@ -31970,6 +32207,66 @@ Object.freeze({
|
|
|
31970
32207
|
addonId: null,
|
|
31971
32208
|
access: "create"
|
|
31972
32209
|
},
|
|
32210
|
+
"navigation.getFeatures": {
|
|
32211
|
+
capName: "navigation",
|
|
32212
|
+
capScope: "device",
|
|
32213
|
+
addonId: null,
|
|
32214
|
+
access: "view"
|
|
32215
|
+
},
|
|
32216
|
+
"navigation.goToPoint": {
|
|
32217
|
+
capName: "navigation",
|
|
32218
|
+
capScope: "device",
|
|
32219
|
+
addonId: null,
|
|
32220
|
+
access: "create"
|
|
32221
|
+
},
|
|
32222
|
+
"navigation.listActions": {
|
|
32223
|
+
capName: "navigation",
|
|
32224
|
+
capScope: "device",
|
|
32225
|
+
addonId: null,
|
|
32226
|
+
access: "view"
|
|
32227
|
+
},
|
|
32228
|
+
"navigation.move": {
|
|
32229
|
+
capName: "navigation",
|
|
32230
|
+
capScope: "device",
|
|
32231
|
+
addonId: null,
|
|
32232
|
+
access: "create"
|
|
32233
|
+
},
|
|
32234
|
+
"navigation.playSound": {
|
|
32235
|
+
capName: "navigation",
|
|
32236
|
+
capScope: "device",
|
|
32237
|
+
addonId: null,
|
|
32238
|
+
access: "create"
|
|
32239
|
+
},
|
|
32240
|
+
"navigation.runAction": {
|
|
32241
|
+
capName: "navigation",
|
|
32242
|
+
capScope: "device",
|
|
32243
|
+
addonId: null,
|
|
32244
|
+
access: "create"
|
|
32245
|
+
},
|
|
32246
|
+
"navigation.setLightLevel": {
|
|
32247
|
+
capName: "navigation",
|
|
32248
|
+
capScope: "device",
|
|
32249
|
+
addonId: null,
|
|
32250
|
+
access: "create"
|
|
32251
|
+
},
|
|
32252
|
+
"navigation.setLightMode": {
|
|
32253
|
+
capName: "navigation",
|
|
32254
|
+
capScope: "device",
|
|
32255
|
+
addonId: null,
|
|
32256
|
+
access: "create"
|
|
32257
|
+
},
|
|
32258
|
+
"navigation.setLightOn": {
|
|
32259
|
+
capName: "navigation",
|
|
32260
|
+
capScope: "device",
|
|
32261
|
+
addonId: null,
|
|
32262
|
+
access: "create"
|
|
32263
|
+
},
|
|
32264
|
+
"navigation.stop": {
|
|
32265
|
+
capName: "navigation",
|
|
32266
|
+
capScope: "device",
|
|
32267
|
+
addonId: null,
|
|
32268
|
+
access: "create"
|
|
32269
|
+
},
|
|
31973
32270
|
"networkAccess.getEndpoint": {
|
|
31974
32271
|
capName: "network-access",
|
|
31975
32272
|
capScope: "system",
|
|
@@ -36065,6 +36362,56 @@ Object.freeze({
|
|
|
36065
36362
|
form: "single",
|
|
36066
36363
|
optional: false
|
|
36067
36364
|
}],
|
|
36365
|
+
"navigation.getFeatures": [{
|
|
36366
|
+
name: "deviceId",
|
|
36367
|
+
form: "single",
|
|
36368
|
+
optional: false
|
|
36369
|
+
}],
|
|
36370
|
+
"navigation.goToPoint": [{
|
|
36371
|
+
name: "deviceId",
|
|
36372
|
+
form: "single",
|
|
36373
|
+
optional: false
|
|
36374
|
+
}],
|
|
36375
|
+
"navigation.listActions": [{
|
|
36376
|
+
name: "deviceId",
|
|
36377
|
+
form: "single",
|
|
36378
|
+
optional: false
|
|
36379
|
+
}],
|
|
36380
|
+
"navigation.move": [{
|
|
36381
|
+
name: "deviceId",
|
|
36382
|
+
form: "single",
|
|
36383
|
+
optional: false
|
|
36384
|
+
}],
|
|
36385
|
+
"navigation.playSound": [{
|
|
36386
|
+
name: "deviceId",
|
|
36387
|
+
form: "single",
|
|
36388
|
+
optional: false
|
|
36389
|
+
}],
|
|
36390
|
+
"navigation.runAction": [{
|
|
36391
|
+
name: "deviceId",
|
|
36392
|
+
form: "single",
|
|
36393
|
+
optional: false
|
|
36394
|
+
}],
|
|
36395
|
+
"navigation.setLightLevel": [{
|
|
36396
|
+
name: "deviceId",
|
|
36397
|
+
form: "single",
|
|
36398
|
+
optional: false
|
|
36399
|
+
}],
|
|
36400
|
+
"navigation.setLightMode": [{
|
|
36401
|
+
name: "deviceId",
|
|
36402
|
+
form: "single",
|
|
36403
|
+
optional: false
|
|
36404
|
+
}],
|
|
36405
|
+
"navigation.setLightOn": [{
|
|
36406
|
+
name: "deviceId",
|
|
36407
|
+
form: "single",
|
|
36408
|
+
optional: false
|
|
36409
|
+
}],
|
|
36410
|
+
"navigation.stop": [{
|
|
36411
|
+
name: "deviceId",
|
|
36412
|
+
form: "single",
|
|
36413
|
+
optional: false
|
|
36414
|
+
}],
|
|
36068
36415
|
"networkQuality.getDeviceStats": [{
|
|
36069
36416
|
name: "deviceId",
|
|
36070
36417
|
form: "single",
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
|
-
//#region ../types/dist/event-category-
|
|
3
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
4
4
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
5
5
|
EventCategory["SystemBoot"] = "system.boot";
|
|
6
6
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -372,6 +372,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
372
372
|
*/
|
|
373
373
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
374
374
|
/**
|
|
375
|
+
* Cap event fired by every device that registers the `network-link`
|
|
376
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
377
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
378
|
+
* reading that moved.
|
|
379
|
+
*/
|
|
380
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
381
|
+
/**
|
|
375
382
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
376
383
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
377
384
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23308,6 +23315,39 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
|
|
|
23308
23315
|
deviceId: number(),
|
|
23309
23316
|
status: BatteryStatusSchema
|
|
23310
23317
|
});
|
|
23318
|
+
/**
|
|
23319
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23320
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23321
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23322
|
+
* one Home Assistant projection.
|
|
23323
|
+
*/
|
|
23324
|
+
var NetworkLinkStatusSchema = object({
|
|
23325
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23326
|
+
type: _enum([
|
|
23327
|
+
"wifi",
|
|
23328
|
+
"ethernet",
|
|
23329
|
+
"cellular",
|
|
23330
|
+
"unknown"
|
|
23331
|
+
]),
|
|
23332
|
+
/**
|
|
23333
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23334
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23335
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23336
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23337
|
+
* SKIP a null rather than coerce it.
|
|
23338
|
+
*/
|
|
23339
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23340
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23341
|
+
rssiDbm: number().optional(),
|
|
23342
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23343
|
+
ssid: string().optional(),
|
|
23344
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23345
|
+
lastUpdated: number()
|
|
23346
|
+
});
|
|
23347
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
23348
|
+
deviceId: number(),
|
|
23349
|
+
status: NetworkLinkStatusSchema
|
|
23350
|
+
});
|
|
23311
23351
|
object({
|
|
23312
23352
|
on: boolean(),
|
|
23313
23353
|
/** Ms epoch of the last transition. 0 if never observed. */
|
|
@@ -26902,6 +26942,203 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
26902
26942
|
deviceId: number(),
|
|
26903
26943
|
status: PtzAutotrackStatusSchema
|
|
26904
26944
|
});
|
|
26945
|
+
/**
|
|
26946
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
26947
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
26948
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
26949
|
+
*
|
|
26950
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
26951
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
26952
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
26953
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
26954
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
26955
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
26956
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
26957
|
+
* the reverse:
|
|
26958
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
26959
|
+
* / `getOptions`), and
|
|
26960
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
26961
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
26962
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
26963
|
+
* not here (see the addon design note):
|
|
26964
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
26965
|
+
* ptz.stop() → navigation.stop()
|
|
26966
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
26967
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
26968
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
26969
|
+
*
|
|
26970
|
+
* ## Continuous drive
|
|
26971
|
+
*
|
|
26972
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
26973
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
26974
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
26975
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
26976
|
+
* coalesce them. The UI owns the cadence.
|
|
26977
|
+
*
|
|
26978
|
+
* ## The action dictionary
|
|
26979
|
+
*
|
|
26980
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
26981
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
26982
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
26983
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
26984
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
26985
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
26986
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
26987
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
26988
|
+
*
|
|
26989
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
26990
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
26991
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
26992
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
26993
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
26994
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
26995
|
+
* THIS contract.
|
|
26996
|
+
*/
|
|
26997
|
+
/**
|
|
26998
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
26999
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
27000
|
+
* halts it.
|
|
27001
|
+
*
|
|
27002
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
27003
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
27004
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
27005
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
27006
|
+
*
|
|
27007
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
27008
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
27009
|
+
*/
|
|
27010
|
+
var NavigationMoveCommandSchema = object({
|
|
27011
|
+
pan: number().min(-1).max(1).optional(),
|
|
27012
|
+
tilt: number().min(-1).max(1).optional(),
|
|
27013
|
+
speed: number().min(0).max(1).optional()
|
|
27014
|
+
});
|
|
27015
|
+
/**
|
|
27016
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
27017
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
27018
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
27019
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
27020
|
+
*/
|
|
27021
|
+
var NavigationActionIdSchema = _enum([
|
|
27022
|
+
"goHome",
|
|
27023
|
+
"locate",
|
|
27024
|
+
"spotClean",
|
|
27025
|
+
"findPet",
|
|
27026
|
+
"personFollow",
|
|
27027
|
+
"stop",
|
|
27028
|
+
"startClean",
|
|
27029
|
+
"pauseClean",
|
|
27030
|
+
"dockWash",
|
|
27031
|
+
"autoEmpty",
|
|
27032
|
+
"flashOn",
|
|
27033
|
+
"flashOff"
|
|
27034
|
+
]);
|
|
27035
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
27036
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
27037
|
+
/**
|
|
27038
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
27039
|
+
* native panel and the PTZ mimic render as a button.
|
|
27040
|
+
*
|
|
27041
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
27042
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
27043
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
27044
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
27045
|
+
* - `label` — operator-facing English label.
|
|
27046
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
27047
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
27048
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
27049
|
+
* flips it from config, never by editing code.
|
|
27050
|
+
*/
|
|
27051
|
+
var NavigationActionEntrySchema = object({
|
|
27052
|
+
id: string(),
|
|
27053
|
+
kind: NavigationEntryKindSchema,
|
|
27054
|
+
label: string(),
|
|
27055
|
+
icon: string(),
|
|
27056
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
27057
|
+
soundId: number().int().optional(),
|
|
27058
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
27059
|
+
enabled: boolean()
|
|
27060
|
+
});
|
|
27061
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
27062
|
+
var NavigationPointSchema = object({
|
|
27063
|
+
x: number(),
|
|
27064
|
+
y: number()
|
|
27065
|
+
});
|
|
27066
|
+
/**
|
|
27067
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
27068
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
27069
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
27070
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
27071
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
27072
|
+
* that are not dictionary entries.
|
|
27073
|
+
*
|
|
27074
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
27075
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
27076
|
+
* map-coordinate plumbing is wired.
|
|
27077
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
27078
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
27079
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
27080
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
27081
|
+
* camera-service control; needs an active stream).
|
|
27082
|
+
*/
|
|
27083
|
+
var NavigationFeaturesSchema = object({
|
|
27084
|
+
move: boolean(),
|
|
27085
|
+
stop: boolean(),
|
|
27086
|
+
goToPoint: boolean(),
|
|
27087
|
+
runAction: boolean(),
|
|
27088
|
+
playSound: boolean(),
|
|
27089
|
+
light: boolean(),
|
|
27090
|
+
lightMode: boolean()
|
|
27091
|
+
});
|
|
27092
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
27093
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
27094
|
+
/**
|
|
27095
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
27096
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
27097
|
+
* - `following` — person/pet follow is currently armed.
|
|
27098
|
+
* - `flash` — the on-camera fill light is on.
|
|
27099
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
27100
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
27101
|
+
* `lightMode === 'manual'`.
|
|
27102
|
+
*/
|
|
27103
|
+
var NavigationStatusSchema = object({
|
|
27104
|
+
mode: _enum([
|
|
27105
|
+
"idle",
|
|
27106
|
+
"cleaning",
|
|
27107
|
+
"spot",
|
|
27108
|
+
"following",
|
|
27109
|
+
"goto",
|
|
27110
|
+
"returning",
|
|
27111
|
+
"paused",
|
|
27112
|
+
"unknown"
|
|
27113
|
+
]),
|
|
27114
|
+
following: boolean(),
|
|
27115
|
+
flash: boolean(),
|
|
27116
|
+
lightMode: NavigationLightModeSchema,
|
|
27117
|
+
lightLevel: number().min(40).max(100),
|
|
27118
|
+
/** Ms epoch when the slice was last updated. */
|
|
27119
|
+
lastChangedAt: number()
|
|
27120
|
+
});
|
|
27121
|
+
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
27122
|
+
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({
|
|
27123
|
+
deviceId: number(),
|
|
27124
|
+
actionId: NavigationActionIdSchema
|
|
27125
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27126
|
+
deviceId: number(),
|
|
27127
|
+
soundId: number().int()
|
|
27128
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27129
|
+
deviceId: number(),
|
|
27130
|
+
on: boolean()
|
|
27131
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27132
|
+
deviceId: number(),
|
|
27133
|
+
mode: NavigationLightModeSchema,
|
|
27134
|
+
level: number().min(40).max(100).optional()
|
|
27135
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27136
|
+
deviceId: number(),
|
|
27137
|
+
level: number().min(40).max(100)
|
|
27138
|
+
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
27139
|
+
deviceId: number(),
|
|
27140
|
+
status: NavigationStatusSchema
|
|
27141
|
+
});
|
|
26905
27142
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
26906
27143
|
kind: "mutation",
|
|
26907
27144
|
auth: "admin"
|
|
@@ -31966,6 +32203,66 @@ Object.freeze({
|
|
|
31966
32203
|
addonId: null,
|
|
31967
32204
|
access: "create"
|
|
31968
32205
|
},
|
|
32206
|
+
"navigation.getFeatures": {
|
|
32207
|
+
capName: "navigation",
|
|
32208
|
+
capScope: "device",
|
|
32209
|
+
addonId: null,
|
|
32210
|
+
access: "view"
|
|
32211
|
+
},
|
|
32212
|
+
"navigation.goToPoint": {
|
|
32213
|
+
capName: "navigation",
|
|
32214
|
+
capScope: "device",
|
|
32215
|
+
addonId: null,
|
|
32216
|
+
access: "create"
|
|
32217
|
+
},
|
|
32218
|
+
"navigation.listActions": {
|
|
32219
|
+
capName: "navigation",
|
|
32220
|
+
capScope: "device",
|
|
32221
|
+
addonId: null,
|
|
32222
|
+
access: "view"
|
|
32223
|
+
},
|
|
32224
|
+
"navigation.move": {
|
|
32225
|
+
capName: "navigation",
|
|
32226
|
+
capScope: "device",
|
|
32227
|
+
addonId: null,
|
|
32228
|
+
access: "create"
|
|
32229
|
+
},
|
|
32230
|
+
"navigation.playSound": {
|
|
32231
|
+
capName: "navigation",
|
|
32232
|
+
capScope: "device",
|
|
32233
|
+
addonId: null,
|
|
32234
|
+
access: "create"
|
|
32235
|
+
},
|
|
32236
|
+
"navigation.runAction": {
|
|
32237
|
+
capName: "navigation",
|
|
32238
|
+
capScope: "device",
|
|
32239
|
+
addonId: null,
|
|
32240
|
+
access: "create"
|
|
32241
|
+
},
|
|
32242
|
+
"navigation.setLightLevel": {
|
|
32243
|
+
capName: "navigation",
|
|
32244
|
+
capScope: "device",
|
|
32245
|
+
addonId: null,
|
|
32246
|
+
access: "create"
|
|
32247
|
+
},
|
|
32248
|
+
"navigation.setLightMode": {
|
|
32249
|
+
capName: "navigation",
|
|
32250
|
+
capScope: "device",
|
|
32251
|
+
addonId: null,
|
|
32252
|
+
access: "create"
|
|
32253
|
+
},
|
|
32254
|
+
"navigation.setLightOn": {
|
|
32255
|
+
capName: "navigation",
|
|
32256
|
+
capScope: "device",
|
|
32257
|
+
addonId: null,
|
|
32258
|
+
access: "create"
|
|
32259
|
+
},
|
|
32260
|
+
"navigation.stop": {
|
|
32261
|
+
capName: "navigation",
|
|
32262
|
+
capScope: "device",
|
|
32263
|
+
addonId: null,
|
|
32264
|
+
access: "create"
|
|
32265
|
+
},
|
|
31969
32266
|
"networkAccess.getEndpoint": {
|
|
31970
32267
|
capName: "network-access",
|
|
31971
32268
|
capScope: "system",
|
|
@@ -36061,6 +36358,56 @@ Object.freeze({
|
|
|
36061
36358
|
form: "single",
|
|
36062
36359
|
optional: false
|
|
36063
36360
|
}],
|
|
36361
|
+
"navigation.getFeatures": [{
|
|
36362
|
+
name: "deviceId",
|
|
36363
|
+
form: "single",
|
|
36364
|
+
optional: false
|
|
36365
|
+
}],
|
|
36366
|
+
"navigation.goToPoint": [{
|
|
36367
|
+
name: "deviceId",
|
|
36368
|
+
form: "single",
|
|
36369
|
+
optional: false
|
|
36370
|
+
}],
|
|
36371
|
+
"navigation.listActions": [{
|
|
36372
|
+
name: "deviceId",
|
|
36373
|
+
form: "single",
|
|
36374
|
+
optional: false
|
|
36375
|
+
}],
|
|
36376
|
+
"navigation.move": [{
|
|
36377
|
+
name: "deviceId",
|
|
36378
|
+
form: "single",
|
|
36379
|
+
optional: false
|
|
36380
|
+
}],
|
|
36381
|
+
"navigation.playSound": [{
|
|
36382
|
+
name: "deviceId",
|
|
36383
|
+
form: "single",
|
|
36384
|
+
optional: false
|
|
36385
|
+
}],
|
|
36386
|
+
"navigation.runAction": [{
|
|
36387
|
+
name: "deviceId",
|
|
36388
|
+
form: "single",
|
|
36389
|
+
optional: false
|
|
36390
|
+
}],
|
|
36391
|
+
"navigation.setLightLevel": [{
|
|
36392
|
+
name: "deviceId",
|
|
36393
|
+
form: "single",
|
|
36394
|
+
optional: false
|
|
36395
|
+
}],
|
|
36396
|
+
"navigation.setLightMode": [{
|
|
36397
|
+
name: "deviceId",
|
|
36398
|
+
form: "single",
|
|
36399
|
+
optional: false
|
|
36400
|
+
}],
|
|
36401
|
+
"navigation.setLightOn": [{
|
|
36402
|
+
name: "deviceId",
|
|
36403
|
+
form: "single",
|
|
36404
|
+
optional: false
|
|
36405
|
+
}],
|
|
36406
|
+
"navigation.stop": [{
|
|
36407
|
+
name: "deviceId",
|
|
36408
|
+
form: "single",
|
|
36409
|
+
optional: false
|
|
36410
|
+
}],
|
|
36064
36411
|
"networkQuality.getDeviceStats": [{
|
|
36065
36412
|
name: "deviceId",
|
|
36066
36413
|
form: "single",
|