@camstack/addon-remote-storage 1.2.78 → 1.2.79
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/s3.addon.js +1 -1
- package/dist/s3.addon.mjs +1 -1
- package/dist/sftp.addon.js +1 -1
- package/dist/sftp.addon.mjs +1 -1
- package/dist/{shared-C5_1Zy4l.mjs → shared-75ieank1.mjs} +367 -232
- package/dist/{shared-D7aelvq0.js → shared-C7ZD8AjN.js} +367 -232
- package/dist/smb.addon.js +1 -1
- package/dist/smb.addon.mjs +1 -1
- package/dist/webdav.addon.js +1 -1
- package/dist/webdav.addon.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import * as path from "node:path";
|
|
3
|
-
//#region ../types/dist/event-category-
|
|
3
|
+
//#region ../types/dist/event-category-CnLqLOKs.mjs
|
|
4
4
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
5
5
|
EventCategory["SystemBoot"] = "system.boot";
|
|
6
6
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -195,6 +195,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
195
195
|
EventCategory["ProcessCrashed"] = "process.crashed";
|
|
196
196
|
EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
|
|
197
197
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
198
|
+
/**
|
|
199
|
+
* The SET of storage locations changed — one was created, edited, enabled,
|
|
200
|
+
* disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
|
|
201
|
+
*
|
|
202
|
+
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
203
|
+
* it must also converge on its own periodic path, because a dropped event
|
|
204
|
+
* must not leave a node writing to yesterday's disk set forever. It exists
|
|
205
|
+
* because there was NO signal at all — an operator who added a second
|
|
206
|
+
* recordings disk in the admin UI got nothing, and the recorder kept its
|
|
207
|
+
* resolved locations until something else happened to re-resolve them
|
|
208
|
+
* (D387). Payload `StorageLocationsChangedPayload`.
|
|
209
|
+
*/
|
|
210
|
+
EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
|
|
198
211
|
EventCategory["RecordingStarted"] = "recording.started";
|
|
199
212
|
EventCategory["RecordingStopped"] = "recording.stopped";
|
|
200
213
|
EventCategory["RecordingError"] = "recording.error";
|
|
@@ -8521,6 +8534,21 @@ var StorageCleanupJobSchema = object({
|
|
|
8521
8534
|
});
|
|
8522
8535
|
var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
|
|
8523
8536
|
/**
|
|
8537
|
+
* The one typed state of a storage location. Authoritative Zod schema — the TS
|
|
8538
|
+
* alias below is `z.infer<>` of it, never a second spelling.
|
|
8539
|
+
*/
|
|
8540
|
+
var StorageLocationModeSchema = _enum([
|
|
8541
|
+
"active",
|
|
8542
|
+
"readonly",
|
|
8543
|
+
"drain",
|
|
8544
|
+
"disabled"
|
|
8545
|
+
]);
|
|
8546
|
+
_enum([
|
|
8547
|
+
"normal",
|
|
8548
|
+
"never",
|
|
8549
|
+
"drain"
|
|
8550
|
+
]);
|
|
8551
|
+
/**
|
|
8524
8552
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8525
8553
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8526
8554
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8586,6 +8614,21 @@ var StorageLocationSchema = object({
|
|
|
8586
8614
|
* stops existing rather than being re-derived on every read.
|
|
8587
8615
|
*/
|
|
8588
8616
|
enabled: boolean().optional(),
|
|
8617
|
+
/**
|
|
8618
|
+
* THE state of this location (D385), and the only authority on what may be
|
|
8619
|
+
* written, read or evicted here. Interpreted in exactly one place —
|
|
8620
|
+
* `storage-location-mode.ts` — which also folds the legacy
|
|
8621
|
+
* `enabled` / `config.readOnly` pair into a mode so an old row is never
|
|
8622
|
+
* ambiguous.
|
|
8623
|
+
*
|
|
8624
|
+
* OPTIONAL only for the wire and for rows written before D385: absence is
|
|
8625
|
+
* resolved by `resolveLocationMode`, and the orchestrator stamps every
|
|
8626
|
+
* unstamped row ONCE at hydrate so absence stops existing rather than being
|
|
8627
|
+
* re-derived on every read. `enabled` survives one release as a DERIVED
|
|
8628
|
+
* mirror (`mode === 'active'`); `withLocationMode` is the only writer of
|
|
8629
|
+
* either, so the two cannot disagree.
|
|
8630
|
+
*/
|
|
8631
|
+
mode: StorageLocationModeSchema.optional(),
|
|
8589
8632
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
8590
8633
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
8591
8634
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -8593,11 +8636,46 @@ var StorageLocationSchema = object({
|
|
|
8593
8636
|
totalBytes: number(),
|
|
8594
8637
|
availableBytes: number()
|
|
8595
8638
|
}).nullable().optional(),
|
|
8639
|
+
/**
|
|
8640
|
+
* How much of that volume CamStack ITSELF holds on this location (D388) —
|
|
8641
|
+
* COMPUTED at read time from the `storage-occupancy` providers' own figures,
|
|
8642
|
+
* never persisted, never a filesystem walk.
|
|
8643
|
+
*
|
|
8644
|
+
* **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
|
|
8645
|
+
* location yet — nobody stores here, the owning addon is down, or the first
|
|
8646
|
+
* refresh has not completed. A UI must omit the segment rather than draw it
|
|
8647
|
+
* at zero, which would claim we occupy nothing (D315). It is an OBJECT and
|
|
8648
|
+
* not a bare number precisely so that a `?? 0` on the consuming side has to
|
|
8649
|
+
* be spelled out loud instead of appearing by accident.
|
|
8650
|
+
*
|
|
8651
|
+
* `measuredAtMs` is the OLDEST contributing measurement, so it is honest
|
|
8652
|
+
* about the whole figure rather than about its freshest part.
|
|
8653
|
+
*/
|
|
8654
|
+
owned: object({
|
|
8655
|
+
bytes: number().int().nonnegative(),
|
|
8656
|
+
measuredAtMs: number().int().nonnegative()
|
|
8657
|
+
}).optional(),
|
|
8596
8658
|
createdAt: number(),
|
|
8597
8659
|
updatedAt: number()
|
|
8598
8660
|
});
|
|
8599
8661
|
object({ isDefault: boolean().optional() });
|
|
8600
8662
|
/**
|
|
8663
|
+
* How far a `drain` has got (D386) — the read a UI renders, and nothing more.
|
|
8664
|
+
*
|
|
8665
|
+
* `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
|
|
8666
|
+
* OBSERVED and is `null` when it has observed none. Never a fabricated date: a
|
|
8667
|
+
* drain with no observed growth has no honest ETA, and inventing one is how an
|
|
8668
|
+
* operator learns not to believe the screen.
|
|
8669
|
+
*/
|
|
8670
|
+
var StorageDrainProgressSchema = object({
|
|
8671
|
+
locationId: string(),
|
|
8672
|
+
startedAtMs: number(),
|
|
8673
|
+
startBytes: number(),
|
|
8674
|
+
bytesRemaining: number(),
|
|
8675
|
+
drained: boolean(),
|
|
8676
|
+
estimatedEmptyAtMs: number().nullable()
|
|
8677
|
+
});
|
|
8678
|
+
/**
|
|
8601
8679
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8602
8680
|
* Either:
|
|
8603
8681
|
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
@@ -21558,7 +21636,7 @@ method(object({
|
|
|
21558
21636
|
}), _void(), {
|
|
21559
21637
|
kind: "mutation",
|
|
21560
21638
|
auth: "admin"
|
|
21561
|
-
}), method(object({ id: string() }), object({
|
|
21639
|
+
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
21562
21640
|
ok: boolean(),
|
|
21563
21641
|
error: string().optional()
|
|
21564
21642
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
@@ -21628,6 +21706,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
21628
21706
|
kind: "mutation",
|
|
21629
21707
|
auth: "admin"
|
|
21630
21708
|
}), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
|
|
21709
|
+
/**
|
|
21710
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
21711
|
+
* location (D388).
|
|
21712
|
+
*
|
|
21713
|
+
* ## Why this is not `storage-evictable`
|
|
21714
|
+
*
|
|
21715
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
21716
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
21717
|
+
* operator most wants a figure for:
|
|
21718
|
+
*
|
|
21719
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
21720
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
21721
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
21722
|
+
* occupancy figure that double-counts the disk.
|
|
21723
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
21724
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
21725
|
+
* is retiring and staring at.
|
|
21726
|
+
*
|
|
21727
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
21728
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
21729
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
21730
|
+
* "evictable" must not register here — a number that silently means different
|
|
21731
|
+
* things per class is worse than no number.
|
|
21732
|
+
*
|
|
21733
|
+
* ## Absence is an answer
|
|
21734
|
+
*
|
|
21735
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
21736
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
21737
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
21738
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
21739
|
+
*
|
|
21740
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
21741
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
21742
|
+
*/
|
|
21743
|
+
/** One provider's occupancy answer for one location. */
|
|
21744
|
+
var StorageOccupancyReportSchema = object({
|
|
21745
|
+
locationId: string(),
|
|
21746
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
21747
|
+
* not net of what it is willing to delete. */
|
|
21748
|
+
ownedBytes: number().int().nonnegative(),
|
|
21749
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
21750
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
21751
|
+
measuredAtMs: number().int().nonnegative()
|
|
21752
|
+
});
|
|
21753
|
+
method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
|
|
21631
21754
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21632
21755
|
providerId: string().min(1),
|
|
21633
21756
|
displayName: string().min(1),
|
|
@@ -23323,39 +23446,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
|
|
|
23323
23446
|
deviceId: number(),
|
|
23324
23447
|
status: BatteryStatusSchema
|
|
23325
23448
|
});
|
|
23326
|
-
/**
|
|
23327
|
-
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23328
|
-
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23329
|
-
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23330
|
-
* one Home Assistant projection.
|
|
23331
|
-
*/
|
|
23332
|
-
var NetworkLinkStatusSchema = object({
|
|
23333
|
-
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23334
|
-
type: _enum([
|
|
23335
|
-
"wifi",
|
|
23336
|
-
"ethernet",
|
|
23337
|
-
"cellular",
|
|
23338
|
-
"unknown"
|
|
23339
|
-
]),
|
|
23340
|
-
/**
|
|
23341
|
-
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23342
|
-
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23343
|
-
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23344
|
-
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23345
|
-
* SKIP a null rather than coerce it.
|
|
23346
|
-
*/
|
|
23347
|
-
signalPercent: number().min(0).max(100).nullable(),
|
|
23348
|
-
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23349
|
-
rssiDbm: number().optional(),
|
|
23350
|
-
/** Network name of a wireless link, when the firmware reports it. */
|
|
23351
|
-
ssid: string().optional(),
|
|
23352
|
-
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23353
|
-
lastUpdated: number()
|
|
23354
|
-
});
|
|
23355
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
23356
|
-
deviceId: number(),
|
|
23357
|
-
status: NetworkLinkStatusSchema
|
|
23358
|
-
});
|
|
23359
23449
|
object({
|
|
23360
23450
|
on: boolean(),
|
|
23361
23451
|
/** Ms epoch of the last transition. 0 if never observed. */
|
|
@@ -25709,6 +25799,236 @@ DeviceType.Camera, method(object({
|
|
|
25709
25799
|
detection: NativeDetectionSchema
|
|
25710
25800
|
});
|
|
25711
25801
|
/**
|
|
25802
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
25803
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
25804
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
25805
|
+
*
|
|
25806
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
25807
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
25808
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
25809
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
25810
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
25811
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
25812
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
25813
|
+
* the reverse:
|
|
25814
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
25815
|
+
* / `getOptions`), and
|
|
25816
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
25817
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
25818
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
25819
|
+
* not here (see the addon design note):
|
|
25820
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
25821
|
+
* ptz.stop() → navigation.stop()
|
|
25822
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
25823
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
25824
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
25825
|
+
*
|
|
25826
|
+
* ## Continuous drive
|
|
25827
|
+
*
|
|
25828
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
25829
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
25830
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
25831
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
25832
|
+
* coalesce them. The UI owns the cadence.
|
|
25833
|
+
*
|
|
25834
|
+
* ## The action dictionary
|
|
25835
|
+
*
|
|
25836
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
25837
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
25838
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
25839
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
25840
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
25841
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
25842
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
25843
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
25844
|
+
*
|
|
25845
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
25846
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
25847
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
25848
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
25849
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
25850
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
25851
|
+
* THIS contract.
|
|
25852
|
+
*/
|
|
25853
|
+
/**
|
|
25854
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
25855
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
25856
|
+
* halts it.
|
|
25857
|
+
*
|
|
25858
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
25859
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
25860
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
25861
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
25862
|
+
*
|
|
25863
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
25864
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
25865
|
+
*/
|
|
25866
|
+
var NavigationMoveCommandSchema = object({
|
|
25867
|
+
pan: number().min(-1).max(1).optional(),
|
|
25868
|
+
tilt: number().min(-1).max(1).optional(),
|
|
25869
|
+
speed: number().min(0).max(1).optional()
|
|
25870
|
+
});
|
|
25871
|
+
/**
|
|
25872
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
25873
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
25874
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
25875
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
25876
|
+
*/
|
|
25877
|
+
var NavigationActionIdSchema = _enum([
|
|
25878
|
+
"goHome",
|
|
25879
|
+
"locate",
|
|
25880
|
+
"spotClean",
|
|
25881
|
+
"findPet",
|
|
25882
|
+
"personFollow",
|
|
25883
|
+
"stop",
|
|
25884
|
+
"startClean",
|
|
25885
|
+
"pauseClean",
|
|
25886
|
+
"dockWash",
|
|
25887
|
+
"autoEmpty",
|
|
25888
|
+
"flashOn",
|
|
25889
|
+
"flashOff"
|
|
25890
|
+
]);
|
|
25891
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
25892
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
25893
|
+
/**
|
|
25894
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
25895
|
+
* native panel and the PTZ mimic render as a button.
|
|
25896
|
+
*
|
|
25897
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
25898
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
25899
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
25900
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
25901
|
+
* - `label` — operator-facing English label.
|
|
25902
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
25903
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
25904
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
25905
|
+
* flips it from config, never by editing code.
|
|
25906
|
+
*/
|
|
25907
|
+
var NavigationActionEntrySchema = object({
|
|
25908
|
+
id: string(),
|
|
25909
|
+
kind: NavigationEntryKindSchema,
|
|
25910
|
+
label: string(),
|
|
25911
|
+
icon: string(),
|
|
25912
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
25913
|
+
soundId: number().int().optional(),
|
|
25914
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
25915
|
+
enabled: boolean()
|
|
25916
|
+
});
|
|
25917
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
25918
|
+
var NavigationPointSchema = object({
|
|
25919
|
+
x: number(),
|
|
25920
|
+
y: number()
|
|
25921
|
+
});
|
|
25922
|
+
/**
|
|
25923
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
25924
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
25925
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
25926
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
25927
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
25928
|
+
* that are not dictionary entries.
|
|
25929
|
+
*
|
|
25930
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
25931
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
25932
|
+
* map-coordinate plumbing is wired.
|
|
25933
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
25934
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
25935
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
25936
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
25937
|
+
* camera-service control; needs an active stream).
|
|
25938
|
+
*/
|
|
25939
|
+
var NavigationFeaturesSchema = object({
|
|
25940
|
+
move: boolean(),
|
|
25941
|
+
stop: boolean(),
|
|
25942
|
+
goToPoint: boolean(),
|
|
25943
|
+
runAction: boolean(),
|
|
25944
|
+
playSound: boolean(),
|
|
25945
|
+
light: boolean(),
|
|
25946
|
+
lightMode: boolean()
|
|
25947
|
+
});
|
|
25948
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
25949
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
25950
|
+
/**
|
|
25951
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
25952
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
25953
|
+
* - `following` — person/pet follow is currently armed.
|
|
25954
|
+
* - `flash` — the on-camera fill light is on.
|
|
25955
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
25956
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
25957
|
+
* `lightMode === 'manual'`.
|
|
25958
|
+
*/
|
|
25959
|
+
var NavigationStatusSchema = object({
|
|
25960
|
+
mode: _enum([
|
|
25961
|
+
"idle",
|
|
25962
|
+
"cleaning",
|
|
25963
|
+
"spot",
|
|
25964
|
+
"following",
|
|
25965
|
+
"goto",
|
|
25966
|
+
"returning",
|
|
25967
|
+
"paused",
|
|
25968
|
+
"unknown"
|
|
25969
|
+
]),
|
|
25970
|
+
following: boolean(),
|
|
25971
|
+
flash: boolean(),
|
|
25972
|
+
lightMode: NavigationLightModeSchema,
|
|
25973
|
+
lightLevel: number().min(40).max(100),
|
|
25974
|
+
/** Ms epoch when the slice was last updated. */
|
|
25975
|
+
lastChangedAt: number()
|
|
25976
|
+
});
|
|
25977
|
+
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
25978
|
+
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({
|
|
25979
|
+
deviceId: number(),
|
|
25980
|
+
actionId: NavigationActionIdSchema
|
|
25981
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
25982
|
+
deviceId: number(),
|
|
25983
|
+
soundId: number().int()
|
|
25984
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
25985
|
+
deviceId: number(),
|
|
25986
|
+
on: boolean()
|
|
25987
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
25988
|
+
deviceId: number(),
|
|
25989
|
+
mode: NavigationLightModeSchema,
|
|
25990
|
+
level: number().min(40).max(100).optional()
|
|
25991
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
25992
|
+
deviceId: number(),
|
|
25993
|
+
level: number().min(40).max(100)
|
|
25994
|
+
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
25995
|
+
deviceId: number(),
|
|
25996
|
+
status: NavigationStatusSchema
|
|
25997
|
+
});
|
|
25998
|
+
/**
|
|
25999
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
26000
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
26001
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
26002
|
+
* one Home Assistant projection.
|
|
26003
|
+
*/
|
|
26004
|
+
var NetworkLinkStatusSchema = object({
|
|
26005
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
26006
|
+
type: _enum([
|
|
26007
|
+
"wifi",
|
|
26008
|
+
"ethernet",
|
|
26009
|
+
"cellular",
|
|
26010
|
+
"unknown"
|
|
26011
|
+
]),
|
|
26012
|
+
/**
|
|
26013
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
26014
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
26015
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
26016
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
26017
|
+
* SKIP a null rather than coerce it.
|
|
26018
|
+
*/
|
|
26019
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
26020
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
26021
|
+
rssiDbm: number().optional(),
|
|
26022
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
26023
|
+
ssid: string().optional(),
|
|
26024
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
26025
|
+
lastUpdated: number()
|
|
26026
|
+
});
|
|
26027
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
26028
|
+
deviceId: number(),
|
|
26029
|
+
status: NetworkLinkStatusSchema
|
|
26030
|
+
});
|
|
26031
|
+
/**
|
|
25712
26032
|
* network-quality — system-scoped singleton capability tracking RTT,
|
|
25713
26033
|
* jitter, and observed/peak bandwidth per device + per client.
|
|
25714
26034
|
*
|
|
@@ -26950,203 +27270,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
26950
27270
|
deviceId: number(),
|
|
26951
27271
|
status: PtzAutotrackStatusSchema
|
|
26952
27272
|
});
|
|
26953
|
-
/**
|
|
26954
|
-
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
26955
|
-
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
26956
|
-
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
26957
|
-
*
|
|
26958
|
-
* Why a NEW cap rather than overloading `ptz`:
|
|
26959
|
-
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
26960
|
-
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
26961
|
-
* The two are different physical models: PTZ is absolute-position + presets,
|
|
26962
|
-
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
26963
|
-
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
26964
|
-
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
26965
|
-
* the reverse:
|
|
26966
|
-
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
26967
|
-
* / `getOptions`), and
|
|
26968
|
-
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
26969
|
-
* robot camera shows up in the existing PTZ control path without every
|
|
26970
|
-
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
26971
|
-
* not here (see the addon design note):
|
|
26972
|
-
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
26973
|
-
* ptz.stop() → navigation.stop()
|
|
26974
|
-
* ptz.goHome() → navigation.runAction('goHome')
|
|
26975
|
-
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
26976
|
-
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
26977
|
-
*
|
|
26978
|
-
* ## Continuous drive
|
|
26979
|
-
*
|
|
26980
|
-
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
26981
|
-
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
26982
|
-
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
26983
|
-
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
26984
|
-
* coalesce them. The UI owns the cadence.
|
|
26985
|
-
*
|
|
26986
|
-
* ## The action dictionary
|
|
26987
|
-
*
|
|
26988
|
-
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
26989
|
-
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
26990
|
-
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
26991
|
-
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
26992
|
-
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
26993
|
-
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
26994
|
-
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
26995
|
-
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
26996
|
-
*
|
|
26997
|
-
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
26998
|
-
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
26999
|
-
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
27000
|
-
* every device handle. A future nodedreame publish adds a typed
|
|
27001
|
-
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
27002
|
-
* provider can then swap the raw calls for the typed methods with no change to
|
|
27003
|
-
* THIS contract.
|
|
27004
|
-
*/
|
|
27005
|
-
/**
|
|
27006
|
-
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
27007
|
-
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
27008
|
-
* halts it.
|
|
27009
|
-
*
|
|
27010
|
-
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
27011
|
-
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
27012
|
-
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
27013
|
-
* vector by it (drivers without proportional drive ignore it).
|
|
27014
|
-
*
|
|
27015
|
-
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
27016
|
-
* axis alone; an all-undefined nudge is a no-op.
|
|
27017
|
-
*/
|
|
27018
|
-
var NavigationMoveCommandSchema = object({
|
|
27019
|
-
pan: number().min(-1).max(1).optional(),
|
|
27020
|
-
tilt: number().min(-1).max(1).optional(),
|
|
27021
|
-
speed: number().min(0).max(1).optional()
|
|
27022
|
-
});
|
|
27023
|
-
/**
|
|
27024
|
-
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
27025
|
-
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
27026
|
-
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
27027
|
-
* `playSound` (see the `sound` dictionary entries).
|
|
27028
|
-
*/
|
|
27029
|
-
var NavigationActionIdSchema = _enum([
|
|
27030
|
-
"goHome",
|
|
27031
|
-
"locate",
|
|
27032
|
-
"spotClean",
|
|
27033
|
-
"findPet",
|
|
27034
|
-
"personFollow",
|
|
27035
|
-
"stop",
|
|
27036
|
-
"startClean",
|
|
27037
|
-
"pauseClean",
|
|
27038
|
-
"dockWash",
|
|
27039
|
-
"autoEmpty",
|
|
27040
|
-
"flashOn",
|
|
27041
|
-
"flashOff"
|
|
27042
|
-
]);
|
|
27043
|
-
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
27044
|
-
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
27045
|
-
/**
|
|
27046
|
-
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
27047
|
-
* native panel and the PTZ mimic render as a button.
|
|
27048
|
-
*
|
|
27049
|
-
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
27050
|
-
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
27051
|
-
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
27052
|
-
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
27053
|
-
* - `label` — operator-facing English label.
|
|
27054
|
-
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
27055
|
-
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
27056
|
-
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
27057
|
-
* flips it from config, never by editing code.
|
|
27058
|
-
*/
|
|
27059
|
-
var NavigationActionEntrySchema = object({
|
|
27060
|
-
id: string(),
|
|
27061
|
-
kind: NavigationEntryKindSchema,
|
|
27062
|
-
label: string(),
|
|
27063
|
-
icon: string(),
|
|
27064
|
-
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
27065
|
-
soundId: number().int().optional(),
|
|
27066
|
-
/** Per-device feature flag — render this entry only when true. */
|
|
27067
|
-
enabled: boolean()
|
|
27068
|
-
});
|
|
27069
|
-
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
27070
|
-
var NavigationPointSchema = object({
|
|
27071
|
-
x: number(),
|
|
27072
|
-
y: number()
|
|
27073
|
-
});
|
|
27074
|
-
/**
|
|
27075
|
-
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
27076
|
-
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
27077
|
-
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
27078
|
-
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
27079
|
-
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
27080
|
-
* that are not dictionary entries.
|
|
27081
|
-
*
|
|
27082
|
-
* - `move` / `stop` — the momentary drive joystick.
|
|
27083
|
-
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
27084
|
-
* map-coordinate plumbing is wired.
|
|
27085
|
-
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
27086
|
-
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
27087
|
-
* - `light` — the on/off fill-light toggle (works anytime).
|
|
27088
|
-
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
27089
|
-
* camera-service control; needs an active stream).
|
|
27090
|
-
*/
|
|
27091
|
-
var NavigationFeaturesSchema = object({
|
|
27092
|
-
move: boolean(),
|
|
27093
|
-
stop: boolean(),
|
|
27094
|
-
goToPoint: boolean(),
|
|
27095
|
-
runAction: boolean(),
|
|
27096
|
-
playSound: boolean(),
|
|
27097
|
-
light: boolean(),
|
|
27098
|
-
lightMode: boolean()
|
|
27099
|
-
});
|
|
27100
|
-
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
27101
|
-
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
27102
|
-
/**
|
|
27103
|
-
* Live navigation state so the UI can reflect what the robot is doing:
|
|
27104
|
-
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
27105
|
-
* - `following` — person/pet follow is currently armed.
|
|
27106
|
-
* - `flash` — the on-camera fill light is on.
|
|
27107
|
-
* - `lightMode` — auto vs manual fill-light mode.
|
|
27108
|
-
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
27109
|
-
* `lightMode === 'manual'`.
|
|
27110
|
-
*/
|
|
27111
|
-
var NavigationStatusSchema = object({
|
|
27112
|
-
mode: _enum([
|
|
27113
|
-
"idle",
|
|
27114
|
-
"cleaning",
|
|
27115
|
-
"spot",
|
|
27116
|
-
"following",
|
|
27117
|
-
"goto",
|
|
27118
|
-
"returning",
|
|
27119
|
-
"paused",
|
|
27120
|
-
"unknown"
|
|
27121
|
-
]),
|
|
27122
|
-
following: boolean(),
|
|
27123
|
-
flash: boolean(),
|
|
27124
|
-
lightMode: NavigationLightModeSchema,
|
|
27125
|
-
lightLevel: number().min(40).max(100),
|
|
27126
|
-
/** Ms epoch when the slice was last updated. */
|
|
27127
|
-
lastChangedAt: number()
|
|
27128
|
-
});
|
|
27129
|
-
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
27130
|
-
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({
|
|
27131
|
-
deviceId: number(),
|
|
27132
|
-
actionId: NavigationActionIdSchema
|
|
27133
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27134
|
-
deviceId: number(),
|
|
27135
|
-
soundId: number().int()
|
|
27136
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27137
|
-
deviceId: number(),
|
|
27138
|
-
on: boolean()
|
|
27139
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27140
|
-
deviceId: number(),
|
|
27141
|
-
mode: NavigationLightModeSchema,
|
|
27142
|
-
level: number().min(40).max(100).optional()
|
|
27143
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27144
|
-
deviceId: number(),
|
|
27145
|
-
level: number().min(40).max(100)
|
|
27146
|
-
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
27147
|
-
deviceId: number(),
|
|
27148
|
-
status: NavigationStatusSchema
|
|
27149
|
-
});
|
|
27150
27273
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
27151
27274
|
kind: "mutation",
|
|
27152
27275
|
auth: "admin"
|
|
@@ -34461,6 +34584,12 @@ Object.freeze({
|
|
|
34461
34584
|
addonId: null,
|
|
34462
34585
|
access: "view"
|
|
34463
34586
|
},
|
|
34587
|
+
"storage.listDrainProgress": {
|
|
34588
|
+
capName: "storage",
|
|
34589
|
+
capScope: "system",
|
|
34590
|
+
addonId: null,
|
|
34591
|
+
access: "view"
|
|
34592
|
+
},
|
|
34464
34593
|
"storage.listLocationDeclarations": {
|
|
34465
34594
|
capName: "storage",
|
|
34466
34595
|
capScope: "system",
|
|
@@ -34605,6 +34734,12 @@ Object.freeze({
|
|
|
34605
34734
|
addonId: null,
|
|
34606
34735
|
access: "view"
|
|
34607
34736
|
},
|
|
34737
|
+
"storageOccupancy.getOccupancy": {
|
|
34738
|
+
capName: "storage-occupancy",
|
|
34739
|
+
capScope: "system",
|
|
34740
|
+
addonId: null,
|
|
34741
|
+
access: "view"
|
|
34742
|
+
},
|
|
34608
34743
|
"storageProvider.abortUpload": {
|
|
34609
34744
|
capName: "storage-provider",
|
|
34610
34745
|
capScope: "system",
|