@camstack/addon-post-analysis 1.2.197 → 1.2.199
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/{dist-DT2v4pR9.mjs → dist-BrszC4uJ.mjs} +600 -366
- package/dist/{dist-CnbZ-uNd.js → dist-fmXXxa9D.js} +623 -365
- package/dist/embedding-encoder/index.js +1 -1
- package/dist/embedding-encoder/index.mjs +1 -1
- package/dist/pipeline-analytics/_stub.js +1 -1
- package/dist/pipeline-analytics/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-BQGYsovE.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-CTKbm1Jm.mjs} +3 -3
- package/dist/pipeline-analytics/{_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-COgVCsnc.mjs → _virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BsBwoxCb.mjs} +1 -1
- package/dist/pipeline-analytics/{hostInit-ChHoZKeK.mjs → hostInit-DXFji_c2.mjs} +3 -3
- package/dist/pipeline-analytics/index.js +174 -32
- package/dist/pipeline-analytics/index.mjs +174 -32
- package/dist/pipeline-analytics/remoteEntry.js +1 -1
- package/package.json +5 -1
|
@@ -29,7 +29,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
enumerable: true
|
|
30
30
|
}) : target, mod));
|
|
31
31
|
//#endregion
|
|
32
|
-
//#region ../types/dist/event-category-
|
|
32
|
+
//#region ../types/dist/event-category-CnLqLOKs.mjs
|
|
33
33
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
34
34
|
EventCategory["SystemBoot"] = "system.boot";
|
|
35
35
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -224,6 +224,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
224
224
|
EventCategory["ProcessCrashed"] = "process.crashed";
|
|
225
225
|
EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
|
|
226
226
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
227
|
+
/**
|
|
228
|
+
* The SET of storage locations changed — one was created, edited, enabled,
|
|
229
|
+
* disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
|
|
230
|
+
*
|
|
231
|
+
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
232
|
+
* it must also converge on its own periodic path, because a dropped event
|
|
233
|
+
* must not leave a node writing to yesterday's disk set forever. It exists
|
|
234
|
+
* because there was NO signal at all — an operator who added a second
|
|
235
|
+
* recordings disk in the admin UI got nothing, and the recorder kept its
|
|
236
|
+
* resolved locations until something else happened to re-resolve them
|
|
237
|
+
* (D387). Payload `StorageLocationsChangedPayload`.
|
|
238
|
+
*/
|
|
239
|
+
EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
|
|
227
240
|
EventCategory["RecordingStarted"] = "recording.started";
|
|
228
241
|
EventCategory["RecordingStopped"] = "recording.stopped";
|
|
229
242
|
EventCategory["RecordingError"] = "recording.error";
|
|
@@ -8811,6 +8824,100 @@ var StorageCleanupJobSchema = object({
|
|
|
8811
8824
|
});
|
|
8812
8825
|
var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
|
|
8813
8826
|
/**
|
|
8827
|
+
* The storage-location STATE MODEL (D385) — one typed state, one policy module.
|
|
8828
|
+
*
|
|
8829
|
+
* A location's state used to be split across two authorities: the typed
|
|
8830
|
+
* `enabled` field (THE write switch since D383) and an untyped `config.readOnly`
|
|
8831
|
+
* key. They did not mean the same thing — `enabled: false` was still evicted
|
|
8832
|
+
* under disk pressure while `config.readOnly` was deliberately excluded — and
|
|
8833
|
+
* neither name said which. Every consumer re-derived the difference, and the
|
|
8834
|
+
* three questions that actually matter were answered in six places.
|
|
8835
|
+
*
|
|
8836
|
+
* This module is the ONLY place in the repo allowed to interpret the state. It
|
|
8837
|
+
* answers three questions and nothing else:
|
|
8838
|
+
*
|
|
8839
|
+
* - may this location be WRITTEN to? {@link modeMayWrite}
|
|
8840
|
+
* - may this location be READ? {@link modeMayRead}
|
|
8841
|
+
* - what is its eviction policy? {@link evictionPolicyForMode}
|
|
8842
|
+
*
|
|
8843
|
+
* | mode | write | read | eviction |
|
|
8844
|
+
* | ---------- | ----- | ---- | ------------------------------ |
|
|
8845
|
+
* | `active` | yes | yes | `normal` (pressure + usage cap) |
|
|
8846
|
+
* | `readonly` | no | yes | `never` |
|
|
8847
|
+
* | `drain` | no | yes | `drain` (paced, until empty) |
|
|
8848
|
+
* | `disabled` | no | no | `never` |
|
|
8849
|
+
*
|
|
8850
|
+
* `scripts/check-storage-location-mode-single-owner.ts` fails the build when
|
|
8851
|
+
* anything outside this module reads `config['readOnly']` or compares `enabled`
|
|
8852
|
+
* directly. A rule nothing checks has already been broken somewhere.
|
|
8853
|
+
*/
|
|
8854
|
+
var STORAGE_LOCATION_MODES = [
|
|
8855
|
+
"active",
|
|
8856
|
+
"readonly",
|
|
8857
|
+
"drain",
|
|
8858
|
+
"disabled"
|
|
8859
|
+
];
|
|
8860
|
+
/**
|
|
8861
|
+
* The one typed state of a storage location. Authoritative Zod schema — the TS
|
|
8862
|
+
* alias below is `z.infer<>` of it, never a second spelling.
|
|
8863
|
+
*/
|
|
8864
|
+
var StorageLocationModeSchema = _enum(STORAGE_LOCATION_MODES);
|
|
8865
|
+
_enum([
|
|
8866
|
+
"normal",
|
|
8867
|
+
"never",
|
|
8868
|
+
"drain"
|
|
8869
|
+
]);
|
|
8870
|
+
/** Is this mode a write target? Only `active` is. */
|
|
8871
|
+
function modeMayWrite(mode) {
|
|
8872
|
+
return mode === "active";
|
|
8873
|
+
}
|
|
8874
|
+
/** What eviction may do here. See {@link StorageEvictionPolicy}. */
|
|
8875
|
+
function evictionPolicyForMode(mode) {
|
|
8876
|
+
switch (mode) {
|
|
8877
|
+
case "active": return "normal";
|
|
8878
|
+
case "drain": return "drain";
|
|
8879
|
+
case "readonly":
|
|
8880
|
+
case "disabled": return "never";
|
|
8881
|
+
}
|
|
8882
|
+
}
|
|
8883
|
+
/**
|
|
8884
|
+
* The mode a LEGACY row implies, or `null` when it implies nothing — the row is
|
|
8885
|
+
* already stamped, or it carried neither flag.
|
|
8886
|
+
*
|
|
8887
|
+
* Both legacy flags fold to `readonly`, which is the CONSERVATIVE direction: a
|
|
8888
|
+
* state change must never start deleting footage on its own, and it must never
|
|
8889
|
+
* make footage that was still being served disappear. `enabled: false` used to
|
|
8890
|
+
* leave the location evictable under pressure; folding it to `readonly` stops
|
|
8891
|
+
* that, which is a strictly safer answer than the one it replaces.
|
|
8892
|
+
*/
|
|
8893
|
+
function legacyModeOf(location) {
|
|
8894
|
+
if (location.mode !== void 0) return null;
|
|
8895
|
+
if (location.config["readOnly"] === true) return "readonly";
|
|
8896
|
+
if (location.enabled === false) return "readonly";
|
|
8897
|
+
return null;
|
|
8898
|
+
}
|
|
8899
|
+
/**
|
|
8900
|
+
* The state of a location, stamped or folded. THE one interpretation: a row
|
|
8901
|
+
* that predates D385 is never ambiguous, and a stamped `mode` always wins over
|
|
8902
|
+
* whatever the legacy pair still says.
|
|
8903
|
+
*/
|
|
8904
|
+
function resolveLocationMode(location) {
|
|
8905
|
+
return (isStorageLocationMode(location.mode) ? location.mode : void 0) ?? legacyModeOf(location) ?? "active";
|
|
8906
|
+
}
|
|
8907
|
+
/** Is this one of the four states? The stamped value crosses a wire, and a
|
|
8908
|
+
* value nobody defined must not be rendered as if it were a state. */
|
|
8909
|
+
function isStorageLocationMode(value) {
|
|
8910
|
+
return STORAGE_LOCATION_MODES.some((mode) => mode === value);
|
|
8911
|
+
}
|
|
8912
|
+
/** May this location be written to? */
|
|
8913
|
+
function mayWriteToLocation(location) {
|
|
8914
|
+
return modeMayWrite(resolveLocationMode(location));
|
|
8915
|
+
}
|
|
8916
|
+
/** What eviction may do to this location. */
|
|
8917
|
+
function evictionPolicyOfLocation(location) {
|
|
8918
|
+
return evictionPolicyForMode(resolveLocationMode(location));
|
|
8919
|
+
}
|
|
8920
|
+
/**
|
|
8814
8921
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8815
8922
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8816
8923
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8876,6 +8983,21 @@ var StorageLocationSchema = object({
|
|
|
8876
8983
|
* stops existing rather than being re-derived on every read.
|
|
8877
8984
|
*/
|
|
8878
8985
|
enabled: boolean().optional(),
|
|
8986
|
+
/**
|
|
8987
|
+
* THE state of this location (D385), and the only authority on what may be
|
|
8988
|
+
* written, read or evicted here. Interpreted in exactly one place —
|
|
8989
|
+
* `storage-location-mode.ts` — which also folds the legacy
|
|
8990
|
+
* `enabled` / `config.readOnly` pair into a mode so an old row is never
|
|
8991
|
+
* ambiguous.
|
|
8992
|
+
*
|
|
8993
|
+
* OPTIONAL only for the wire and for rows written before D385: absence is
|
|
8994
|
+
* resolved by `resolveLocationMode`, and the orchestrator stamps every
|
|
8995
|
+
* unstamped row ONCE at hydrate so absence stops existing rather than being
|
|
8996
|
+
* re-derived on every read. `enabled` survives one release as a DERIVED
|
|
8997
|
+
* mirror (`mode === 'active'`); `withLocationMode` is the only writer of
|
|
8998
|
+
* either, so the two cannot disagree.
|
|
8999
|
+
*/
|
|
9000
|
+
mode: StorageLocationModeSchema.optional(),
|
|
8879
9001
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
8880
9002
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
8881
9003
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -8883,11 +9005,46 @@ var StorageLocationSchema = object({
|
|
|
8883
9005
|
totalBytes: number(),
|
|
8884
9006
|
availableBytes: number()
|
|
8885
9007
|
}).nullable().optional(),
|
|
9008
|
+
/**
|
|
9009
|
+
* How much of that volume CamStack ITSELF holds on this location (D388) —
|
|
9010
|
+
* COMPUTED at read time from the `storage-occupancy` providers' own figures,
|
|
9011
|
+
* never persisted, never a filesystem walk.
|
|
9012
|
+
*
|
|
9013
|
+
* **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
|
|
9014
|
+
* location yet — nobody stores here, the owning addon is down, or the first
|
|
9015
|
+
* refresh has not completed. A UI must omit the segment rather than draw it
|
|
9016
|
+
* at zero, which would claim we occupy nothing (D315). It is an OBJECT and
|
|
9017
|
+
* not a bare number precisely so that a `?? 0` on the consuming side has to
|
|
9018
|
+
* be spelled out loud instead of appearing by accident.
|
|
9019
|
+
*
|
|
9020
|
+
* `measuredAtMs` is the OLDEST contributing measurement, so it is honest
|
|
9021
|
+
* about the whole figure rather than about its freshest part.
|
|
9022
|
+
*/
|
|
9023
|
+
owned: object({
|
|
9024
|
+
bytes: number().int().nonnegative(),
|
|
9025
|
+
measuredAtMs: number().int().nonnegative()
|
|
9026
|
+
}).optional(),
|
|
8886
9027
|
createdAt: number(),
|
|
8887
9028
|
updatedAt: number()
|
|
8888
9029
|
});
|
|
8889
9030
|
object({ isDefault: boolean().optional() });
|
|
8890
9031
|
/**
|
|
9032
|
+
* How far a `drain` has got (D386) — the read a UI renders, and nothing more.
|
|
9033
|
+
*
|
|
9034
|
+
* `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
|
|
9035
|
+
* OBSERVED and is `null` when it has observed none. Never a fabricated date: a
|
|
9036
|
+
* drain with no observed growth has no honest ETA, and inventing one is how an
|
|
9037
|
+
* operator learns not to believe the screen.
|
|
9038
|
+
*/
|
|
9039
|
+
var StorageDrainProgressSchema = object({
|
|
9040
|
+
locationId: string(),
|
|
9041
|
+
startedAtMs: number(),
|
|
9042
|
+
startBytes: number(),
|
|
9043
|
+
bytesRemaining: number(),
|
|
9044
|
+
drained: boolean(),
|
|
9045
|
+
estimatedEmptyAtMs: number().nullable()
|
|
9046
|
+
});
|
|
9047
|
+
/**
|
|
8891
9048
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8892
9049
|
* Either:
|
|
8893
9050
|
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
@@ -23530,7 +23687,7 @@ method(object({
|
|
|
23530
23687
|
}), _void(), {
|
|
23531
23688
|
kind: "mutation",
|
|
23532
23689
|
auth: "admin"
|
|
23533
|
-
}), method(object({ id: string() }), object({
|
|
23690
|
+
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
23534
23691
|
ok: boolean(),
|
|
23535
23692
|
error: string().optional()
|
|
23536
23693
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
@@ -23600,6 +23757,71 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
23600
23757
|
kind: "mutation",
|
|
23601
23758
|
auth: "admin"
|
|
23602
23759
|
}), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
|
|
23760
|
+
/**
|
|
23761
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
23762
|
+
* location (D388).
|
|
23763
|
+
*
|
|
23764
|
+
* ## Why this is not `storage-evictable`
|
|
23765
|
+
*
|
|
23766
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
23767
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
23768
|
+
* operator most wants a figure for:
|
|
23769
|
+
*
|
|
23770
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
23771
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
23772
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
23773
|
+
* occupancy figure that double-counts the disk.
|
|
23774
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
23775
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
23776
|
+
* is retiring and staring at.
|
|
23777
|
+
*
|
|
23778
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
23779
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
23780
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
23781
|
+
* "evictable" must not register here — a number that silently means different
|
|
23782
|
+
* things per class is worse than no number.
|
|
23783
|
+
*
|
|
23784
|
+
* ## Absence is an answer
|
|
23785
|
+
*
|
|
23786
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
23787
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
23788
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
23789
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
23790
|
+
*
|
|
23791
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
23792
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
23793
|
+
*/
|
|
23794
|
+
/** One provider's occupancy answer for one location. */
|
|
23795
|
+
var StorageOccupancyReportSchema = object({
|
|
23796
|
+
locationId: string(),
|
|
23797
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
23798
|
+
* not net of what it is willing to delete. */
|
|
23799
|
+
ownedBytes: number().int().nonnegative(),
|
|
23800
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
23801
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
23802
|
+
measuredAtMs: number().int().nonnegative()
|
|
23803
|
+
});
|
|
23804
|
+
var storageOccupancyCapability = {
|
|
23805
|
+
name: "storage-occupancy",
|
|
23806
|
+
scope: "system",
|
|
23807
|
+
mode: "collection",
|
|
23808
|
+
internal: true,
|
|
23809
|
+
methods: {
|
|
23810
|
+
/**
|
|
23811
|
+
* Occupancy for the given locations, in ONE round trip.
|
|
23812
|
+
*
|
|
23813
|
+
* A provider answers only for the locations it actually holds bytes on and
|
|
23814
|
+
* OMITS the rest — an omitted location is "I hold nothing measurable here",
|
|
23815
|
+
* which the orchestrator merges as a contribution of nothing rather than as
|
|
23816
|
+
* a claim that the location is empty. Only a location no provider reports
|
|
23817
|
+
* at all stays unknown.
|
|
23818
|
+
*
|
|
23819
|
+
* This must be CHEAP and must never walk a filesystem: it is on the admin
|
|
23820
|
+
* UI's `listLocations` path. The owner keeps its own figure fresh (D224) and
|
|
23821
|
+
* answers from what it already has.
|
|
23822
|
+
*/
|
|
23823
|
+
getOccupancy: method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" }) }
|
|
23824
|
+
};
|
|
23603
23825
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
23604
23826
|
providerId: string().min(1),
|
|
23605
23827
|
displayName: string().min(1),
|
|
@@ -25449,88 +25671,6 @@ onStatusChanged: { data: object({
|
|
|
25449
25671
|
volatileStateFields: ["lastUpdated"]
|
|
25450
25672
|
};
|
|
25451
25673
|
/**
|
|
25452
|
-
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
25453
|
-
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
25454
|
-
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
25455
|
-
* one Home Assistant projection.
|
|
25456
|
-
*/
|
|
25457
|
-
var NetworkLinkStatusSchema = object({
|
|
25458
|
-
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
25459
|
-
type: _enum([
|
|
25460
|
-
"wifi",
|
|
25461
|
-
"ethernet",
|
|
25462
|
-
"cellular",
|
|
25463
|
-
"unknown"
|
|
25464
|
-
]),
|
|
25465
|
-
/**
|
|
25466
|
-
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
25467
|
-
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
25468
|
-
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
25469
|
-
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
25470
|
-
* SKIP a null rather than coerce it.
|
|
25471
|
-
*/
|
|
25472
|
-
signalPercent: number().min(0).max(100).nullable(),
|
|
25473
|
-
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
25474
|
-
rssiDbm: number().optional(),
|
|
25475
|
-
/** Network name of a wireless link, when the firmware reports it. */
|
|
25476
|
-
ssid: string().optional(),
|
|
25477
|
-
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
25478
|
-
lastUpdated: number()
|
|
25479
|
-
});
|
|
25480
|
-
var networkLinkCapability = {
|
|
25481
|
-
name: "network-link",
|
|
25482
|
-
scope: "device",
|
|
25483
|
-
deviceNative: true,
|
|
25484
|
-
mode: "singleton",
|
|
25485
|
-
deviceTypes: [
|
|
25486
|
-
DeviceType.Camera,
|
|
25487
|
-
DeviceType.Sensor,
|
|
25488
|
-
DeviceType.Button,
|
|
25489
|
-
DeviceType.Switch,
|
|
25490
|
-
DeviceType.Light,
|
|
25491
|
-
DeviceType.Lock,
|
|
25492
|
-
DeviceType.Siren
|
|
25493
|
-
],
|
|
25494
|
-
methods: {},
|
|
25495
|
-
events: {
|
|
25496
|
-
/**
|
|
25497
|
-
* Emitted whenever the cached status changes (a link switch, a signal
|
|
25498
|
-
* reading that moved). Mirrored on the parent chain by the
|
|
25499
|
-
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
25500
|
-
*/
|
|
25501
|
-
onStatusChanged: { data: object({
|
|
25502
|
-
deviceId: number(),
|
|
25503
|
-
status: NetworkLinkStatusSchema
|
|
25504
|
-
}) } },
|
|
25505
|
-
status: {
|
|
25506
|
-
schema: NetworkLinkStatusSchema,
|
|
25507
|
-
kind: "push",
|
|
25508
|
-
empty: {
|
|
25509
|
-
type: "unknown",
|
|
25510
|
-
signalPercent: null,
|
|
25511
|
-
lastUpdated: 0
|
|
25512
|
-
}
|
|
25513
|
-
},
|
|
25514
|
-
/**
|
|
25515
|
-
* Runtime-state slice — every provider stores the same shape under
|
|
25516
|
-
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
25517
|
-
* Home Assistant projector regardless of the driver.
|
|
25518
|
-
*/
|
|
25519
|
-
runtimeState: NetworkLinkStatusSchema,
|
|
25520
|
-
/**
|
|
25521
|
-
* Runtime-state durability: **restored** — a link reading is slow to
|
|
25522
|
-
* change and a sleeping battery camera may not report for hours; the
|
|
25523
|
-
* restored slice is what the badge shows until the next read.
|
|
25524
|
-
*
|
|
25525
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
25526
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
25527
|
-
*/
|
|
25528
|
-
durability: "restored",
|
|
25529
|
-
/** Clock fields: written, but excluded from the compare that decides
|
|
25530
|
-
* whether persisting is worth a SQLite commit. */
|
|
25531
|
-
volatileStateFields: ["lastUpdated"]
|
|
25532
|
-
};
|
|
25533
|
-
/**
|
|
25534
25674
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
25535
25675
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
25536
25676
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -29086,6 +29226,369 @@ var nativeObjectDetectionCapability = {
|
|
|
29086
29226
|
volatileStateFields: ["lastFetchedAt"]
|
|
29087
29227
|
};
|
|
29088
29228
|
/**
|
|
29229
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
29230
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
29231
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
29232
|
+
*
|
|
29233
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
29234
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
29235
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
29236
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
29237
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
29238
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
29239
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
29240
|
+
* the reverse:
|
|
29241
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
29242
|
+
* / `getOptions`), and
|
|
29243
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
29244
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
29245
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
29246
|
+
* not here (see the addon design note):
|
|
29247
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
29248
|
+
* ptz.stop() → navigation.stop()
|
|
29249
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
29250
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
29251
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
29252
|
+
*
|
|
29253
|
+
* ## Continuous drive
|
|
29254
|
+
*
|
|
29255
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
29256
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
29257
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
29258
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
29259
|
+
* coalesce them. The UI owns the cadence.
|
|
29260
|
+
*
|
|
29261
|
+
* ## The action dictionary
|
|
29262
|
+
*
|
|
29263
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
29264
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
29265
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
29266
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
29267
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
29268
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
29269
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
29270
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
29271
|
+
*
|
|
29272
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
29273
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
29274
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
29275
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
29276
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
29277
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
29278
|
+
* THIS contract.
|
|
29279
|
+
*/
|
|
29280
|
+
/**
|
|
29281
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
29282
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
29283
|
+
* halts it.
|
|
29284
|
+
*
|
|
29285
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
29286
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
29287
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
29288
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
29289
|
+
*
|
|
29290
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
29291
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
29292
|
+
*/
|
|
29293
|
+
var NavigationMoveCommandSchema = object({
|
|
29294
|
+
pan: number().min(-1).max(1).optional(),
|
|
29295
|
+
tilt: number().min(-1).max(1).optional(),
|
|
29296
|
+
speed: number().min(0).max(1).optional()
|
|
29297
|
+
});
|
|
29298
|
+
/**
|
|
29299
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
29300
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
29301
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
29302
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
29303
|
+
*/
|
|
29304
|
+
var NavigationActionIdSchema = _enum([
|
|
29305
|
+
"goHome",
|
|
29306
|
+
"locate",
|
|
29307
|
+
"spotClean",
|
|
29308
|
+
"findPet",
|
|
29309
|
+
"personFollow",
|
|
29310
|
+
"stop",
|
|
29311
|
+
"startClean",
|
|
29312
|
+
"pauseClean",
|
|
29313
|
+
"dockWash",
|
|
29314
|
+
"autoEmpty",
|
|
29315
|
+
"flashOn",
|
|
29316
|
+
"flashOff"
|
|
29317
|
+
]);
|
|
29318
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
29319
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
29320
|
+
/**
|
|
29321
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
29322
|
+
* native panel and the PTZ mimic render as a button.
|
|
29323
|
+
*
|
|
29324
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
29325
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
29326
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
29327
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
29328
|
+
* - `label` — operator-facing English label.
|
|
29329
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
29330
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
29331
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
29332
|
+
* flips it from config, never by editing code.
|
|
29333
|
+
*/
|
|
29334
|
+
var NavigationActionEntrySchema = object({
|
|
29335
|
+
id: string(),
|
|
29336
|
+
kind: NavigationEntryKindSchema,
|
|
29337
|
+
label: string(),
|
|
29338
|
+
icon: string(),
|
|
29339
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
29340
|
+
soundId: number().int().optional(),
|
|
29341
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
29342
|
+
enabled: boolean()
|
|
29343
|
+
});
|
|
29344
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
29345
|
+
var NavigationPointSchema = object({
|
|
29346
|
+
x: number(),
|
|
29347
|
+
y: number()
|
|
29348
|
+
});
|
|
29349
|
+
/**
|
|
29350
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
29351
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
29352
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
29353
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
29354
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
29355
|
+
* that are not dictionary entries.
|
|
29356
|
+
*
|
|
29357
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
29358
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
29359
|
+
* map-coordinate plumbing is wired.
|
|
29360
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
29361
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
29362
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
29363
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
29364
|
+
* camera-service control; needs an active stream).
|
|
29365
|
+
*/
|
|
29366
|
+
var NavigationFeaturesSchema = object({
|
|
29367
|
+
move: boolean(),
|
|
29368
|
+
stop: boolean(),
|
|
29369
|
+
goToPoint: boolean(),
|
|
29370
|
+
runAction: boolean(),
|
|
29371
|
+
playSound: boolean(),
|
|
29372
|
+
light: boolean(),
|
|
29373
|
+
lightMode: boolean()
|
|
29374
|
+
});
|
|
29375
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
29376
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
29377
|
+
/**
|
|
29378
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
29379
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
29380
|
+
* - `following` — person/pet follow is currently armed.
|
|
29381
|
+
* - `flash` — the on-camera fill light is on.
|
|
29382
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
29383
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
29384
|
+
* `lightMode === 'manual'`.
|
|
29385
|
+
*/
|
|
29386
|
+
var NavigationStatusSchema = object({
|
|
29387
|
+
mode: _enum([
|
|
29388
|
+
"idle",
|
|
29389
|
+
"cleaning",
|
|
29390
|
+
"spot",
|
|
29391
|
+
"following",
|
|
29392
|
+
"goto",
|
|
29393
|
+
"returning",
|
|
29394
|
+
"paused",
|
|
29395
|
+
"unknown"
|
|
29396
|
+
]),
|
|
29397
|
+
following: boolean(),
|
|
29398
|
+
flash: boolean(),
|
|
29399
|
+
lightMode: NavigationLightModeSchema,
|
|
29400
|
+
lightLevel: number().min(40).max(100),
|
|
29401
|
+
/** Ms epoch when the slice was last updated. */
|
|
29402
|
+
lastChangedAt: number()
|
|
29403
|
+
});
|
|
29404
|
+
/**
|
|
29405
|
+
* Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
|
|
29406
|
+
* observable). Adds `lastFetchedAt` on top of the status shape per the
|
|
29407
|
+
* convention.
|
|
29408
|
+
*/
|
|
29409
|
+
var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
29410
|
+
var navigationCapability = {
|
|
29411
|
+
name: "navigation",
|
|
29412
|
+
scope: "device",
|
|
29413
|
+
deviceNative: true,
|
|
29414
|
+
mode: "singleton",
|
|
29415
|
+
deviceTypes: [DeviceType.Camera],
|
|
29416
|
+
deviceConfig: { ui: {
|
|
29417
|
+
kind: "widget",
|
|
29418
|
+
widgetId: "host/navigation-panel",
|
|
29419
|
+
tab: "navigation",
|
|
29420
|
+
topTab: true,
|
|
29421
|
+
label: "Navigation",
|
|
29422
|
+
order: 0
|
|
29423
|
+
} },
|
|
29424
|
+
methods: {
|
|
29425
|
+
/**
|
|
29426
|
+
* Momentary drive nudge (the robot moves). `protected` — mirrors
|
|
29427
|
+
* `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
|
|
29428
|
+
* path) works for any authenticated user, not admin-only. The UI sends
|
|
29429
|
+
* these at ~1 Hz while a control is held; the provider forwards each one to
|
|
29430
|
+
* a single drive write WITHOUT debouncing.
|
|
29431
|
+
*/
|
|
29432
|
+
move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29433
|
+
/** Halt all motion immediately (zero drive vector). */
|
|
29434
|
+
stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29435
|
+
/** Send the robot to a point on its live map. */
|
|
29436
|
+
goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29437
|
+
/**
|
|
29438
|
+
* Enumerate the discrete controls THIS device supports (data-driven UI +
|
|
29439
|
+
* PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
|
|
29440
|
+
*/
|
|
29441
|
+
listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
|
|
29442
|
+
/**
|
|
29443
|
+
* Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
|
|
29444
|
+
* unsupported action ids are rejected by the provider.
|
|
29445
|
+
*/
|
|
29446
|
+
runAction: method(object({
|
|
29447
|
+
deviceId: number(),
|
|
29448
|
+
actionId: NavigationActionIdSchema
|
|
29449
|
+
}), _void(), { kind: "mutation" }),
|
|
29450
|
+
/** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
|
|
29451
|
+
playSound: method(object({
|
|
29452
|
+
deviceId: number(),
|
|
29453
|
+
soundId: number().int()
|
|
29454
|
+
}), _void(), { kind: "mutation" }),
|
|
29455
|
+
/**
|
|
29456
|
+
* Turn the on-camera fill light on / off (the `OpenFullLight` control —
|
|
29457
|
+
* works anytime, no active stream required).
|
|
29458
|
+
*/
|
|
29459
|
+
setLightOn: method(object({
|
|
29460
|
+
deviceId: number(),
|
|
29461
|
+
on: boolean()
|
|
29462
|
+
}), _void(), { kind: "mutation" }),
|
|
29463
|
+
/**
|
|
29464
|
+
* Set the fill-light mode (auto vs manual). `manual` optionally carries the
|
|
29465
|
+
* initial `level`. The auto/manual + level control is a CAMERA-service
|
|
29466
|
+
* action that generally needs an active camera stream/monitor session — the
|
|
29467
|
+
* UI shows the manual level slider ONLY when `mode === 'manual'`.
|
|
29468
|
+
*/
|
|
29469
|
+
setLightMode: method(object({
|
|
29470
|
+
deviceId: number(),
|
|
29471
|
+
mode: NavigationLightModeSchema,
|
|
29472
|
+
level: number().min(40).max(100).optional()
|
|
29473
|
+
}), _void(), { kind: "mutation" }),
|
|
29474
|
+
/** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
|
|
29475
|
+
setLightLevel: method(object({
|
|
29476
|
+
deviceId: number(),
|
|
29477
|
+
level: number().min(40).max(100)
|
|
29478
|
+
}), _void(), { kind: "mutation" }),
|
|
29479
|
+
/**
|
|
29480
|
+
* Per-device FEATURE-FLAG report for the general primitives — drives which
|
|
29481
|
+
* controls the UI shows (the per-entry flags for the dictionary come back on
|
|
29482
|
+
* `listActions`).
|
|
29483
|
+
*/
|
|
29484
|
+
getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
|
|
29485
|
+
},
|
|
29486
|
+
events: { onStatusChanged: { data: object({
|
|
29487
|
+
deviceId: number(),
|
|
29488
|
+
status: NavigationStatusSchema
|
|
29489
|
+
}) } },
|
|
29490
|
+
status: {
|
|
29491
|
+
schema: NavigationStatusSchema,
|
|
29492
|
+
kind: "push"
|
|
29493
|
+
},
|
|
29494
|
+
/**
|
|
29495
|
+
* Runtime-state slice mirrored by the kernel. The navigation panel watches it
|
|
29496
|
+
* for live mode / follow / flash changes.
|
|
29497
|
+
*/
|
|
29498
|
+
runtimeState: NavigationRuntimeStateSchema,
|
|
29499
|
+
/**
|
|
29500
|
+
* Runtime-state durability: **session** — like `vacuum-control`, a restored
|
|
29501
|
+
* `mode: cleaning` / `following: true` is a robot that is not actually doing
|
|
29502
|
+
* that. The live handle re-publishes on connect.
|
|
29503
|
+
*
|
|
29504
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
29505
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
29506
|
+
*/
|
|
29507
|
+
durability: "session"
|
|
29508
|
+
};
|
|
29509
|
+
/**
|
|
29510
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
29511
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
29512
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
29513
|
+
* one Home Assistant projection.
|
|
29514
|
+
*/
|
|
29515
|
+
var NetworkLinkStatusSchema = object({
|
|
29516
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
29517
|
+
type: _enum([
|
|
29518
|
+
"wifi",
|
|
29519
|
+
"ethernet",
|
|
29520
|
+
"cellular",
|
|
29521
|
+
"unknown"
|
|
29522
|
+
]),
|
|
29523
|
+
/**
|
|
29524
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
29525
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
29526
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
29527
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
29528
|
+
* SKIP a null rather than coerce it.
|
|
29529
|
+
*/
|
|
29530
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
29531
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
29532
|
+
rssiDbm: number().optional(),
|
|
29533
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
29534
|
+
ssid: string().optional(),
|
|
29535
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
29536
|
+
lastUpdated: number()
|
|
29537
|
+
});
|
|
29538
|
+
var networkLinkCapability = {
|
|
29539
|
+
name: "network-link",
|
|
29540
|
+
scope: "device",
|
|
29541
|
+
deviceNative: true,
|
|
29542
|
+
mode: "singleton",
|
|
29543
|
+
deviceTypes: [
|
|
29544
|
+
DeviceType.Camera,
|
|
29545
|
+
DeviceType.Sensor,
|
|
29546
|
+
DeviceType.Button,
|
|
29547
|
+
DeviceType.Switch,
|
|
29548
|
+
DeviceType.Light,
|
|
29549
|
+
DeviceType.Lock,
|
|
29550
|
+
DeviceType.Siren
|
|
29551
|
+
],
|
|
29552
|
+
methods: {},
|
|
29553
|
+
events: {
|
|
29554
|
+
/**
|
|
29555
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
29556
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
29557
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
29558
|
+
*/
|
|
29559
|
+
onStatusChanged: { data: object({
|
|
29560
|
+
deviceId: number(),
|
|
29561
|
+
status: NetworkLinkStatusSchema
|
|
29562
|
+
}) } },
|
|
29563
|
+
status: {
|
|
29564
|
+
schema: NetworkLinkStatusSchema,
|
|
29565
|
+
kind: "push",
|
|
29566
|
+
empty: {
|
|
29567
|
+
type: "unknown",
|
|
29568
|
+
signalPercent: null,
|
|
29569
|
+
lastUpdated: 0
|
|
29570
|
+
}
|
|
29571
|
+
},
|
|
29572
|
+
/**
|
|
29573
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
29574
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
29575
|
+
* Home Assistant projector regardless of the driver.
|
|
29576
|
+
*/
|
|
29577
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
29578
|
+
/**
|
|
29579
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
29580
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
29581
|
+
* restored slice is what the badge shows until the next read.
|
|
29582
|
+
*
|
|
29583
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
29584
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
29585
|
+
*/
|
|
29586
|
+
durability: "restored",
|
|
29587
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
29588
|
+
* whether persisting is worth a SQLite commit. */
|
|
29589
|
+
volatileStateFields: ["lastUpdated"]
|
|
29590
|
+
};
|
|
29591
|
+
/**
|
|
29089
29592
|
* network-quality — system-scoped singleton capability tracking RTT,
|
|
29090
29593
|
* jitter, and observed/peak bandwidth per device + per client.
|
|
29091
29594
|
*
|
|
@@ -30700,287 +31203,6 @@ var ptzAutotrackCapability = {
|
|
|
30700
31203
|
*/
|
|
30701
31204
|
durability: "session"
|
|
30702
31205
|
};
|
|
30703
|
-
/**
|
|
30704
|
-
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
30705
|
-
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
30706
|
-
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
30707
|
-
*
|
|
30708
|
-
* Why a NEW cap rather than overloading `ptz`:
|
|
30709
|
-
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
30710
|
-
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
30711
|
-
* The two are different physical models: PTZ is absolute-position + presets,
|
|
30712
|
-
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
30713
|
-
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
30714
|
-
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
30715
|
-
* the reverse:
|
|
30716
|
-
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
30717
|
-
* / `getOptions`), and
|
|
30718
|
-
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
30719
|
-
* robot camera shows up in the existing PTZ control path without every
|
|
30720
|
-
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
30721
|
-
* not here (see the addon design note):
|
|
30722
|
-
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
30723
|
-
* ptz.stop() → navigation.stop()
|
|
30724
|
-
* ptz.goHome() → navigation.runAction('goHome')
|
|
30725
|
-
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
30726
|
-
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
30727
|
-
*
|
|
30728
|
-
* ## Continuous drive
|
|
30729
|
-
*
|
|
30730
|
-
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
30731
|
-
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
30732
|
-
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
30733
|
-
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
30734
|
-
* coalesce them. The UI owns the cadence.
|
|
30735
|
-
*
|
|
30736
|
-
* ## The action dictionary
|
|
30737
|
-
*
|
|
30738
|
-
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
30739
|
-
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
30740
|
-
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
30741
|
-
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
30742
|
-
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
30743
|
-
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
30744
|
-
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
30745
|
-
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
30746
|
-
*
|
|
30747
|
-
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
30748
|
-
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
30749
|
-
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
30750
|
-
* every device handle. A future nodedreame publish adds a typed
|
|
30751
|
-
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
30752
|
-
* provider can then swap the raw calls for the typed methods with no change to
|
|
30753
|
-
* THIS contract.
|
|
30754
|
-
*/
|
|
30755
|
-
/**
|
|
30756
|
-
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
30757
|
-
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
30758
|
-
* halts it.
|
|
30759
|
-
*
|
|
30760
|
-
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
30761
|
-
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
30762
|
-
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
30763
|
-
* vector by it (drivers without proportional drive ignore it).
|
|
30764
|
-
*
|
|
30765
|
-
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
30766
|
-
* axis alone; an all-undefined nudge is a no-op.
|
|
30767
|
-
*/
|
|
30768
|
-
var NavigationMoveCommandSchema = object({
|
|
30769
|
-
pan: number().min(-1).max(1).optional(),
|
|
30770
|
-
tilt: number().min(-1).max(1).optional(),
|
|
30771
|
-
speed: number().min(0).max(1).optional()
|
|
30772
|
-
});
|
|
30773
|
-
/**
|
|
30774
|
-
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
30775
|
-
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
30776
|
-
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
30777
|
-
* `playSound` (see the `sound` dictionary entries).
|
|
30778
|
-
*/
|
|
30779
|
-
var NavigationActionIdSchema = _enum([
|
|
30780
|
-
"goHome",
|
|
30781
|
-
"locate",
|
|
30782
|
-
"spotClean",
|
|
30783
|
-
"findPet",
|
|
30784
|
-
"personFollow",
|
|
30785
|
-
"stop",
|
|
30786
|
-
"startClean",
|
|
30787
|
-
"pauseClean",
|
|
30788
|
-
"dockWash",
|
|
30789
|
-
"autoEmpty",
|
|
30790
|
-
"flashOn",
|
|
30791
|
-
"flashOff"
|
|
30792
|
-
]);
|
|
30793
|
-
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
30794
|
-
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
30795
|
-
/**
|
|
30796
|
-
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
30797
|
-
* native panel and the PTZ mimic render as a button.
|
|
30798
|
-
*
|
|
30799
|
-
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
30800
|
-
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
30801
|
-
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
30802
|
-
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
30803
|
-
* - `label` — operator-facing English label.
|
|
30804
|
-
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
30805
|
-
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
30806
|
-
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
30807
|
-
* flips it from config, never by editing code.
|
|
30808
|
-
*/
|
|
30809
|
-
var NavigationActionEntrySchema = object({
|
|
30810
|
-
id: string(),
|
|
30811
|
-
kind: NavigationEntryKindSchema,
|
|
30812
|
-
label: string(),
|
|
30813
|
-
icon: string(),
|
|
30814
|
-
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
30815
|
-
soundId: number().int().optional(),
|
|
30816
|
-
/** Per-device feature flag — render this entry only when true. */
|
|
30817
|
-
enabled: boolean()
|
|
30818
|
-
});
|
|
30819
|
-
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
30820
|
-
var NavigationPointSchema = object({
|
|
30821
|
-
x: number(),
|
|
30822
|
-
y: number()
|
|
30823
|
-
});
|
|
30824
|
-
/**
|
|
30825
|
-
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
30826
|
-
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
30827
|
-
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
30828
|
-
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
30829
|
-
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
30830
|
-
* that are not dictionary entries.
|
|
30831
|
-
*
|
|
30832
|
-
* - `move` / `stop` — the momentary drive joystick.
|
|
30833
|
-
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
30834
|
-
* map-coordinate plumbing is wired.
|
|
30835
|
-
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
30836
|
-
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
30837
|
-
* - `light` — the on/off fill-light toggle (works anytime).
|
|
30838
|
-
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
30839
|
-
* camera-service control; needs an active stream).
|
|
30840
|
-
*/
|
|
30841
|
-
var NavigationFeaturesSchema = object({
|
|
30842
|
-
move: boolean(),
|
|
30843
|
-
stop: boolean(),
|
|
30844
|
-
goToPoint: boolean(),
|
|
30845
|
-
runAction: boolean(),
|
|
30846
|
-
playSound: boolean(),
|
|
30847
|
-
light: boolean(),
|
|
30848
|
-
lightMode: boolean()
|
|
30849
|
-
});
|
|
30850
|
-
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
30851
|
-
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
30852
|
-
/**
|
|
30853
|
-
* Live navigation state so the UI can reflect what the robot is doing:
|
|
30854
|
-
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
30855
|
-
* - `following` — person/pet follow is currently armed.
|
|
30856
|
-
* - `flash` — the on-camera fill light is on.
|
|
30857
|
-
* - `lightMode` — auto vs manual fill-light mode.
|
|
30858
|
-
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
30859
|
-
* `lightMode === 'manual'`.
|
|
30860
|
-
*/
|
|
30861
|
-
var NavigationStatusSchema = object({
|
|
30862
|
-
mode: _enum([
|
|
30863
|
-
"idle",
|
|
30864
|
-
"cleaning",
|
|
30865
|
-
"spot",
|
|
30866
|
-
"following",
|
|
30867
|
-
"goto",
|
|
30868
|
-
"returning",
|
|
30869
|
-
"paused",
|
|
30870
|
-
"unknown"
|
|
30871
|
-
]),
|
|
30872
|
-
following: boolean(),
|
|
30873
|
-
flash: boolean(),
|
|
30874
|
-
lightMode: NavigationLightModeSchema,
|
|
30875
|
-
lightLevel: number().min(40).max(100),
|
|
30876
|
-
/** Ms epoch when the slice was last updated. */
|
|
30877
|
-
lastChangedAt: number()
|
|
30878
|
-
});
|
|
30879
|
-
/**
|
|
30880
|
-
* Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
|
|
30881
|
-
* observable). Adds `lastFetchedAt` on top of the status shape per the
|
|
30882
|
-
* convention.
|
|
30883
|
-
*/
|
|
30884
|
-
var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
30885
|
-
var navigationCapability = {
|
|
30886
|
-
name: "navigation",
|
|
30887
|
-
scope: "device",
|
|
30888
|
-
deviceNative: true,
|
|
30889
|
-
mode: "singleton",
|
|
30890
|
-
deviceTypes: [DeviceType.Camera],
|
|
30891
|
-
deviceConfig: { ui: {
|
|
30892
|
-
kind: "widget",
|
|
30893
|
-
widgetId: "host/navigation-panel",
|
|
30894
|
-
tab: "navigation",
|
|
30895
|
-
topTab: true,
|
|
30896
|
-
label: "Navigation",
|
|
30897
|
-
order: 0
|
|
30898
|
-
} },
|
|
30899
|
-
methods: {
|
|
30900
|
-
/**
|
|
30901
|
-
* Momentary drive nudge (the robot moves). `protected` — mirrors
|
|
30902
|
-
* `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
|
|
30903
|
-
* path) works for any authenticated user, not admin-only. The UI sends
|
|
30904
|
-
* these at ~1 Hz while a control is held; the provider forwards each one to
|
|
30905
|
-
* a single drive write WITHOUT debouncing.
|
|
30906
|
-
*/
|
|
30907
|
-
move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
30908
|
-
/** Halt all motion immediately (zero drive vector). */
|
|
30909
|
-
stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
30910
|
-
/** Send the robot to a point on its live map. */
|
|
30911
|
-
goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
30912
|
-
/**
|
|
30913
|
-
* Enumerate the discrete controls THIS device supports (data-driven UI +
|
|
30914
|
-
* PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
|
|
30915
|
-
*/
|
|
30916
|
-
listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
|
|
30917
|
-
/**
|
|
30918
|
-
* Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
|
|
30919
|
-
* unsupported action ids are rejected by the provider.
|
|
30920
|
-
*/
|
|
30921
|
-
runAction: method(object({
|
|
30922
|
-
deviceId: number(),
|
|
30923
|
-
actionId: NavigationActionIdSchema
|
|
30924
|
-
}), _void(), { kind: "mutation" }),
|
|
30925
|
-
/** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
|
|
30926
|
-
playSound: method(object({
|
|
30927
|
-
deviceId: number(),
|
|
30928
|
-
soundId: number().int()
|
|
30929
|
-
}), _void(), { kind: "mutation" }),
|
|
30930
|
-
/**
|
|
30931
|
-
* Turn the on-camera fill light on / off (the `OpenFullLight` control —
|
|
30932
|
-
* works anytime, no active stream required).
|
|
30933
|
-
*/
|
|
30934
|
-
setLightOn: method(object({
|
|
30935
|
-
deviceId: number(),
|
|
30936
|
-
on: boolean()
|
|
30937
|
-
}), _void(), { kind: "mutation" }),
|
|
30938
|
-
/**
|
|
30939
|
-
* Set the fill-light mode (auto vs manual). `manual` optionally carries the
|
|
30940
|
-
* initial `level`. The auto/manual + level control is a CAMERA-service
|
|
30941
|
-
* action that generally needs an active camera stream/monitor session — the
|
|
30942
|
-
* UI shows the manual level slider ONLY when `mode === 'manual'`.
|
|
30943
|
-
*/
|
|
30944
|
-
setLightMode: method(object({
|
|
30945
|
-
deviceId: number(),
|
|
30946
|
-
mode: NavigationLightModeSchema,
|
|
30947
|
-
level: number().min(40).max(100).optional()
|
|
30948
|
-
}), _void(), { kind: "mutation" }),
|
|
30949
|
-
/** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
|
|
30950
|
-
setLightLevel: method(object({
|
|
30951
|
-
deviceId: number(),
|
|
30952
|
-
level: number().min(40).max(100)
|
|
30953
|
-
}), _void(), { kind: "mutation" }),
|
|
30954
|
-
/**
|
|
30955
|
-
* Per-device FEATURE-FLAG report for the general primitives — drives which
|
|
30956
|
-
* controls the UI shows (the per-entry flags for the dictionary come back on
|
|
30957
|
-
* `listActions`).
|
|
30958
|
-
*/
|
|
30959
|
-
getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
|
|
30960
|
-
},
|
|
30961
|
-
events: { onStatusChanged: { data: object({
|
|
30962
|
-
deviceId: number(),
|
|
30963
|
-
status: NavigationStatusSchema
|
|
30964
|
-
}) } },
|
|
30965
|
-
status: {
|
|
30966
|
-
schema: NavigationStatusSchema,
|
|
30967
|
-
kind: "push"
|
|
30968
|
-
},
|
|
30969
|
-
/**
|
|
30970
|
-
* Runtime-state slice mirrored by the kernel. The navigation panel watches it
|
|
30971
|
-
* for live mode / follow / flash changes.
|
|
30972
|
-
*/
|
|
30973
|
-
runtimeState: NavigationRuntimeStateSchema,
|
|
30974
|
-
/**
|
|
30975
|
-
* Runtime-state durability: **session** — like `vacuum-control`, a restored
|
|
30976
|
-
* `mode: cleaning` / `following: true` is a robot that is not actually doing
|
|
30977
|
-
* that. The live handle re-publishes on connect.
|
|
30978
|
-
*
|
|
30979
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
30980
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
30981
|
-
*/
|
|
30982
|
-
durability: "session"
|
|
30983
|
-
};
|
|
30984
31206
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
30985
31207
|
kind: "mutation",
|
|
30986
31208
|
auth: "admin"
|
|
@@ -40244,6 +40466,12 @@ Object.freeze({
|
|
|
40244
40466
|
addonId: null,
|
|
40245
40467
|
access: "view"
|
|
40246
40468
|
},
|
|
40469
|
+
"storage.listDrainProgress": {
|
|
40470
|
+
capName: "storage",
|
|
40471
|
+
capScope: "system",
|
|
40472
|
+
addonId: null,
|
|
40473
|
+
access: "view"
|
|
40474
|
+
},
|
|
40247
40475
|
"storage.listLocationDeclarations": {
|
|
40248
40476
|
capName: "storage",
|
|
40249
40477
|
capScope: "system",
|
|
@@ -40388,6 +40616,12 @@ Object.freeze({
|
|
|
40388
40616
|
addonId: null,
|
|
40389
40617
|
access: "view"
|
|
40390
40618
|
},
|
|
40619
|
+
"storageOccupancy.getOccupancy": {
|
|
40620
|
+
capName: "storage-occupancy",
|
|
40621
|
+
capScope: "system",
|
|
40622
|
+
addonId: null,
|
|
40623
|
+
access: "view"
|
|
40624
|
+
},
|
|
40391
40625
|
"storageProvider.abortUpload": {
|
|
40392
40626
|
capName: "storage-provider",
|
|
40393
40627
|
capScope: "system",
|
|
@@ -44829,6 +45063,12 @@ Object.defineProperty(exports, "evaluateSensorEdge", {
|
|
|
44829
45063
|
return evaluateSensorEdge;
|
|
44830
45064
|
}
|
|
44831
45065
|
});
|
|
45066
|
+
Object.defineProperty(exports, "evictionPolicyOfLocation", {
|
|
45067
|
+
enumerable: true,
|
|
45068
|
+
get: function() {
|
|
45069
|
+
return evictionPolicyOfLocation;
|
|
45070
|
+
}
|
|
45071
|
+
});
|
|
44832
45072
|
Object.defineProperty(exports, "faceGalleryCapability", {
|
|
44833
45073
|
enumerable: true,
|
|
44834
45074
|
get: function() {
|
|
@@ -44889,6 +45129,12 @@ Object.defineProperty(exports, "literal", {
|
|
|
44889
45129
|
return literal;
|
|
44890
45130
|
}
|
|
44891
45131
|
});
|
|
45132
|
+
Object.defineProperty(exports, "mayWriteToLocation", {
|
|
45133
|
+
enumerable: true,
|
|
45134
|
+
get: function() {
|
|
45135
|
+
return mayWriteToLocation;
|
|
45136
|
+
}
|
|
45137
|
+
});
|
|
44892
45138
|
Object.defineProperty(exports, "nodePin", {
|
|
44893
45139
|
enumerable: true,
|
|
44894
45140
|
get: function() {
|
|
@@ -44961,6 +45207,12 @@ Object.defineProperty(exports, "record", {
|
|
|
44961
45207
|
return record;
|
|
44962
45208
|
}
|
|
44963
45209
|
});
|
|
45210
|
+
Object.defineProperty(exports, "resolveLocationMode", {
|
|
45211
|
+
enumerable: true,
|
|
45212
|
+
get: function() {
|
|
45213
|
+
return resolveLocationMode;
|
|
45214
|
+
}
|
|
45215
|
+
});
|
|
44964
45216
|
Object.defineProperty(exports, "resolvePoolMemoryPolicy", {
|
|
44965
45217
|
enumerable: true,
|
|
44966
45218
|
get: function() {
|
|
@@ -44979,6 +45231,12 @@ Object.defineProperty(exports, "sleep", {
|
|
|
44979
45231
|
return sleep;
|
|
44980
45232
|
}
|
|
44981
45233
|
});
|
|
45234
|
+
Object.defineProperty(exports, "storageOccupancyCapability", {
|
|
45235
|
+
enumerable: true,
|
|
45236
|
+
get: function() {
|
|
45237
|
+
return storageOccupancyCapability;
|
|
45238
|
+
}
|
|
45239
|
+
});
|
|
44982
45240
|
Object.defineProperty(exports, "string", {
|
|
44983
45241
|
enumerable: true,
|
|
44984
45242
|
get: function() {
|