@camstack/addon-mqtt-broker 1.2.78 → 1.2.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mqtt-broker.addon.js +488 -355
- package/dist/mqtt-broker.addon.mjs +488 -355
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
39
39
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
40
40
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
41
41
|
//#endregion
|
|
42
|
-
//#region ../types/dist/event-category-
|
|
42
|
+
//#region ../types/dist/event-category-CnLqLOKs.mjs
|
|
43
43
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
44
44
|
EventCategory["SystemBoot"] = "system.boot";
|
|
45
45
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -234,6 +234,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
234
234
|
EventCategory["ProcessCrashed"] = "process.crashed";
|
|
235
235
|
EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
|
|
236
236
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
237
|
+
/**
|
|
238
|
+
* The SET of storage locations changed — one was created, edited, enabled,
|
|
239
|
+
* disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
|
|
240
|
+
*
|
|
241
|
+
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
242
|
+
* it must also converge on its own periodic path, because a dropped event
|
|
243
|
+
* must not leave a node writing to yesterday's disk set forever. It exists
|
|
244
|
+
* because there was NO signal at all — an operator who added a second
|
|
245
|
+
* recordings disk in the admin UI got nothing, and the recorder kept its
|
|
246
|
+
* resolved locations until something else happened to re-resolve them
|
|
247
|
+
* (D387). Payload `StorageLocationsChangedPayload`.
|
|
248
|
+
*/
|
|
249
|
+
EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
|
|
237
250
|
EventCategory["RecordingStarted"] = "recording.started";
|
|
238
251
|
EventCategory["RecordingStopped"] = "recording.stopped";
|
|
239
252
|
EventCategory["RecordingError"] = "recording.error";
|
|
@@ -7639,111 +7652,6 @@ var CameraSwitchGroupSchema = object({
|
|
|
7639
7652
|
fetchedAt: number()
|
|
7640
7653
|
});
|
|
7641
7654
|
/**
|
|
7642
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7643
|
-
* an addon declares its channels in.
|
|
7644
|
-
*
|
|
7645
|
-
* ## Two axes, deliberately separated
|
|
7646
|
-
*
|
|
7647
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7648
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7649
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7650
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7651
|
-
* `log-channels` capability enumerates the declarations.
|
|
7652
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7653
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7654
|
-
* over the values is the exact defect
|
|
7655
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7656
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
7657
|
-
*
|
|
7658
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7659
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7660
|
-
* the hot path with a value somebody actually read, and by
|
|
7661
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7662
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7663
|
-
* disarmed one (D49).
|
|
7664
|
-
*
|
|
7665
|
-
* ## The canonical call shape
|
|
7666
|
-
*
|
|
7667
|
-
* ```ts
|
|
7668
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7669
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7670
|
-
* }
|
|
7671
|
-
* ```
|
|
7672
|
-
*
|
|
7673
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7674
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7675
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
7676
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7677
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7678
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
7679
|
-
*
|
|
7680
|
-
* ## Why a channel emits at `info`
|
|
7681
|
-
*
|
|
7682
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7683
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7684
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7685
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7686
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7687
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7688
|
-
*/
|
|
7689
|
-
/**
|
|
7690
|
-
* The level a channel writes at once armed.
|
|
7691
|
-
*
|
|
7692
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7693
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7694
|
-
* to read it later.
|
|
7695
|
-
*/
|
|
7696
|
-
var LogChannelLevelSchema = _enum([
|
|
7697
|
-
"info",
|
|
7698
|
-
"warn",
|
|
7699
|
-
"error"
|
|
7700
|
-
]);
|
|
7701
|
-
/**
|
|
7702
|
-
* What an addon declares about one channel. No value, no state — a
|
|
7703
|
-
* declaration is inert.
|
|
7704
|
-
*/
|
|
7705
|
-
var LogChannelDescriptorSchema = object({
|
|
7706
|
-
/**
|
|
7707
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7708
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
7709
|
-
* owns it without a second lookup.
|
|
7710
|
-
*/
|
|
7711
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7712
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
7713
|
-
description: string().min(1),
|
|
7714
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
7715
|
-
defaultLevel: LogChannelLevelSchema,
|
|
7716
|
-
/**
|
|
7717
|
-
* Whether this channel can be narrowed to a camera.
|
|
7718
|
-
*
|
|
7719
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7720
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
7721
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7722
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7723
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7724
|
-
* the body is the only way to filter.
|
|
7725
|
-
*
|
|
7726
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7727
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7728
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7729
|
-
* path was never taken.
|
|
7730
|
-
*/
|
|
7731
|
-
perDevice: boolean()
|
|
7732
|
-
});
|
|
7733
|
-
/**
|
|
7734
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
7735
|
-
*
|
|
7736
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7737
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7738
|
-
*/
|
|
7739
|
-
var LogChannelWindowSchema = object({
|
|
7740
|
-
channel: string().min(1),
|
|
7741
|
-
/** Epoch ms the window closes at. */
|
|
7742
|
-
armedUntilMs: number(),
|
|
7743
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7744
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
7745
|
-
});
|
|
7746
|
-
/**
|
|
7747
7655
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7748
7656
|
* recordings and events management surfaces.
|
|
7749
7657
|
*
|
|
@@ -8665,6 +8573,21 @@ var StorageCleanupJobSchema = object({
|
|
|
8665
8573
|
});
|
|
8666
8574
|
var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
|
|
8667
8575
|
/**
|
|
8576
|
+
* The one typed state of a storage location. Authoritative Zod schema — the TS
|
|
8577
|
+
* alias below is `z.infer<>` of it, never a second spelling.
|
|
8578
|
+
*/
|
|
8579
|
+
var StorageLocationModeSchema = _enum([
|
|
8580
|
+
"active",
|
|
8581
|
+
"readonly",
|
|
8582
|
+
"drain",
|
|
8583
|
+
"disabled"
|
|
8584
|
+
]);
|
|
8585
|
+
_enum([
|
|
8586
|
+
"normal",
|
|
8587
|
+
"never",
|
|
8588
|
+
"drain"
|
|
8589
|
+
]);
|
|
8590
|
+
/**
|
|
8668
8591
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8669
8592
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8670
8593
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8689,8 +8612,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
8689
8612
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
8690
8613
|
*
|
|
8691
8614
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
8692
|
-
* The
|
|
8693
|
-
*
|
|
8615
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
8616
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
8617
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
8618
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
8619
|
+
* slug is `default`.
|
|
8694
8620
|
*
|
|
8695
8621
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
8696
8622
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -8711,23 +8637,37 @@ var StorageLocationSchema = object({
|
|
|
8711
8637
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
8712
8638
|
*/
|
|
8713
8639
|
nodeId: string().optional(),
|
|
8714
|
-
isDefault: boolean().default(false),
|
|
8715
8640
|
isSystem: boolean().default(false),
|
|
8716
8641
|
/**
|
|
8717
|
-
*
|
|
8718
|
-
*
|
|
8719
|
-
*
|
|
8720
|
-
*
|
|
8721
|
-
*
|
|
8642
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
8643
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
8644
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
8645
|
+
* still read, still played back, still age-swept, still drained, never
|
|
8646
|
+
* written.
|
|
8722
8647
|
*
|
|
8723
|
-
* OPTIONAL
|
|
8724
|
-
*
|
|
8725
|
-
*
|
|
8726
|
-
*
|
|
8727
|
-
*
|
|
8728
|
-
*
|
|
8648
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
8649
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
8650
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
8651
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
8652
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
8653
|
+
* stops existing rather than being re-derived on every read.
|
|
8729
8654
|
*/
|
|
8730
8655
|
enabled: boolean().optional(),
|
|
8656
|
+
/**
|
|
8657
|
+
* THE state of this location (D385), and the only authority on what may be
|
|
8658
|
+
* written, read or evicted here. Interpreted in exactly one place —
|
|
8659
|
+
* `storage-location-mode.ts` — which also folds the legacy
|
|
8660
|
+
* `enabled` / `config.readOnly` pair into a mode so an old row is never
|
|
8661
|
+
* ambiguous.
|
|
8662
|
+
*
|
|
8663
|
+
* OPTIONAL only for the wire and for rows written before D385: absence is
|
|
8664
|
+
* resolved by `resolveLocationMode`, and the orchestrator stamps every
|
|
8665
|
+
* unstamped row ONCE at hydrate so absence stops existing rather than being
|
|
8666
|
+
* re-derived on every read. `enabled` survives one release as a DERIVED
|
|
8667
|
+
* mirror (`mode === 'active'`); `withLocationMode` is the only writer of
|
|
8668
|
+
* either, so the two cannot disagree.
|
|
8669
|
+
*/
|
|
8670
|
+
mode: StorageLocationModeSchema.optional(),
|
|
8731
8671
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
8732
8672
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
8733
8673
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -8735,13 +8675,50 @@ var StorageLocationSchema = object({
|
|
|
8735
8675
|
totalBytes: number(),
|
|
8736
8676
|
availableBytes: number()
|
|
8737
8677
|
}).nullable().optional(),
|
|
8678
|
+
/**
|
|
8679
|
+
* How much of that volume CamStack ITSELF holds on this location (D388) —
|
|
8680
|
+
* COMPUTED at read time from the `storage-occupancy` providers' own figures,
|
|
8681
|
+
* never persisted, never a filesystem walk.
|
|
8682
|
+
*
|
|
8683
|
+
* **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
|
|
8684
|
+
* location yet — nobody stores here, the owning addon is down, or the first
|
|
8685
|
+
* refresh has not completed. A UI must omit the segment rather than draw it
|
|
8686
|
+
* at zero, which would claim we occupy nothing (D315). It is an OBJECT and
|
|
8687
|
+
* not a bare number precisely so that a `?? 0` on the consuming side has to
|
|
8688
|
+
* be spelled out loud instead of appearing by accident.
|
|
8689
|
+
*
|
|
8690
|
+
* `measuredAtMs` is the OLDEST contributing measurement, so it is honest
|
|
8691
|
+
* about the whole figure rather than about its freshest part.
|
|
8692
|
+
*/
|
|
8693
|
+
owned: object({
|
|
8694
|
+
bytes: number().int().nonnegative(),
|
|
8695
|
+
measuredAtMs: number().int().nonnegative()
|
|
8696
|
+
}).optional(),
|
|
8738
8697
|
createdAt: number(),
|
|
8739
8698
|
updatedAt: number()
|
|
8740
8699
|
});
|
|
8700
|
+
object({ isDefault: boolean().optional() });
|
|
8701
|
+
/**
|
|
8702
|
+
* How far a `drain` has got (D386) — the read a UI renders, and nothing more.
|
|
8703
|
+
*
|
|
8704
|
+
* `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
|
|
8705
|
+
* OBSERVED and is `null` when it has observed none. Never a fabricated date: a
|
|
8706
|
+
* drain with no observed growth has no honest ETA, and inventing one is how an
|
|
8707
|
+
* operator learns not to believe the screen.
|
|
8708
|
+
*/
|
|
8709
|
+
var StorageDrainProgressSchema = object({
|
|
8710
|
+
locationId: string(),
|
|
8711
|
+
startedAtMs: number(),
|
|
8712
|
+
startBytes: number(),
|
|
8713
|
+
bytesRemaining: number(),
|
|
8714
|
+
drained: boolean(),
|
|
8715
|
+
estimatedEmptyAtMs: number().nullable()
|
|
8716
|
+
});
|
|
8741
8717
|
/**
|
|
8742
8718
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8743
8719
|
* Either:
|
|
8744
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
8720
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
8721
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
8745
8722
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
8746
8723
|
*
|
|
8747
8724
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -8917,6 +8894,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
8917
8894
|
*/
|
|
8918
8895
|
debug: boolean().optional()
|
|
8919
8896
|
});
|
|
8897
|
+
/**
|
|
8898
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8899
|
+
* an addon declares its channels in.
|
|
8900
|
+
*
|
|
8901
|
+
* ## Two axes, deliberately separated
|
|
8902
|
+
*
|
|
8903
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8904
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8905
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8906
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8907
|
+
* `log-channels` capability enumerates the declarations.
|
|
8908
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8909
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8910
|
+
* over the values is the exact defect
|
|
8911
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8912
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
8913
|
+
*
|
|
8914
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8915
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8916
|
+
* the hot path with a value somebody actually read, and by
|
|
8917
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8918
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8919
|
+
* disarmed one (D49).
|
|
8920
|
+
*
|
|
8921
|
+
* ## The canonical call shape
|
|
8922
|
+
*
|
|
8923
|
+
* ```ts
|
|
8924
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8925
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8926
|
+
* }
|
|
8927
|
+
* ```
|
|
8928
|
+
*
|
|
8929
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8930
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8931
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
8932
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8933
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8934
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
8935
|
+
*
|
|
8936
|
+
* ## Why a channel emits at `info`
|
|
8937
|
+
*
|
|
8938
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8939
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8940
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8941
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8942
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8943
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8944
|
+
*/
|
|
8945
|
+
/**
|
|
8946
|
+
* The level a channel writes at once armed.
|
|
8947
|
+
*
|
|
8948
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8949
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8950
|
+
* to read it later.
|
|
8951
|
+
*/
|
|
8952
|
+
var LogChannelLevelSchema = _enum([
|
|
8953
|
+
"info",
|
|
8954
|
+
"warn",
|
|
8955
|
+
"error"
|
|
8956
|
+
]);
|
|
8957
|
+
/**
|
|
8958
|
+
* What an addon declares about one channel. No value, no state — a
|
|
8959
|
+
* declaration is inert.
|
|
8960
|
+
*/
|
|
8961
|
+
var LogChannelDescriptorSchema = object({
|
|
8962
|
+
/**
|
|
8963
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8964
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
8965
|
+
* owns it without a second lookup.
|
|
8966
|
+
*/
|
|
8967
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8968
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
8969
|
+
description: string().min(1),
|
|
8970
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
8971
|
+
defaultLevel: LogChannelLevelSchema,
|
|
8972
|
+
/**
|
|
8973
|
+
* Whether this channel can be narrowed to a camera.
|
|
8974
|
+
*
|
|
8975
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8976
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
8977
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8978
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8979
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8980
|
+
* the body is the only way to filter.
|
|
8981
|
+
*
|
|
8982
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8983
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8984
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8985
|
+
* path was never taken.
|
|
8986
|
+
*/
|
|
8987
|
+
perDevice: boolean()
|
|
8988
|
+
});
|
|
8989
|
+
/**
|
|
8990
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
8991
|
+
*
|
|
8992
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8993
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8994
|
+
*/
|
|
8995
|
+
var LogChannelWindowSchema = object({
|
|
8996
|
+
channel: string().min(1),
|
|
8997
|
+
/** Epoch ms the window closes at. */
|
|
8998
|
+
armedUntilMs: number(),
|
|
8999
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
9000
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
9001
|
+
});
|
|
8920
9002
|
var MODEL_FORMATS = [
|
|
8921
9003
|
"onnx",
|
|
8922
9004
|
"coreml",
|
|
@@ -21649,7 +21731,7 @@ method(object({
|
|
|
21649
21731
|
downloadId: string(),
|
|
21650
21732
|
offset: number(),
|
|
21651
21733
|
length: number()
|
|
21652
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
21734
|
+
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
|
|
21653
21735
|
createdAt: true,
|
|
21654
21736
|
updatedAt: true
|
|
21655
21737
|
}), StorageLocationSchema, {
|
|
@@ -21661,7 +21743,7 @@ method(object({
|
|
|
21661
21743
|
}), _void(), {
|
|
21662
21744
|
kind: "mutation",
|
|
21663
21745
|
auth: "admin"
|
|
21664
|
-
}), method(object({ id: string() }), object({
|
|
21746
|
+
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
21665
21747
|
ok: boolean(),
|
|
21666
21748
|
error: string().optional()
|
|
21667
21749
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
@@ -21731,6 +21813,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
21731
21813
|
kind: "mutation",
|
|
21732
21814
|
auth: "admin"
|
|
21733
21815
|
}), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
|
|
21816
|
+
/**
|
|
21817
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
21818
|
+
* location (D388).
|
|
21819
|
+
*
|
|
21820
|
+
* ## Why this is not `storage-evictable`
|
|
21821
|
+
*
|
|
21822
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
21823
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
21824
|
+
* operator most wants a figure for:
|
|
21825
|
+
*
|
|
21826
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
21827
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
21828
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
21829
|
+
* occupancy figure that double-counts the disk.
|
|
21830
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
21831
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
21832
|
+
* is retiring and staring at.
|
|
21833
|
+
*
|
|
21834
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
21835
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
21836
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
21837
|
+
* "evictable" must not register here — a number that silently means different
|
|
21838
|
+
* things per class is worse than no number.
|
|
21839
|
+
*
|
|
21840
|
+
* ## Absence is an answer
|
|
21841
|
+
*
|
|
21842
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
21843
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
21844
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
21845
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
21846
|
+
*
|
|
21847
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
21848
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
21849
|
+
*/
|
|
21850
|
+
/** One provider's occupancy answer for one location. */
|
|
21851
|
+
var StorageOccupancyReportSchema = object({
|
|
21852
|
+
locationId: string(),
|
|
21853
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
21854
|
+
* not net of what it is willing to delete. */
|
|
21855
|
+
ownedBytes: number().int().nonnegative(),
|
|
21856
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
21857
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
21858
|
+
measuredAtMs: number().int().nonnegative()
|
|
21859
|
+
});
|
|
21860
|
+
method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
|
|
21734
21861
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21735
21862
|
providerId: string().min(1),
|
|
21736
21863
|
displayName: string().min(1),
|
|
@@ -23366,39 +23493,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
|
|
|
23366
23493
|
deviceId: number(),
|
|
23367
23494
|
status: BatteryStatusSchema
|
|
23368
23495
|
});
|
|
23369
|
-
/**
|
|
23370
|
-
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23371
|
-
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23372
|
-
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23373
|
-
* one Home Assistant projection.
|
|
23374
|
-
*/
|
|
23375
|
-
var NetworkLinkStatusSchema = object({
|
|
23376
|
-
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23377
|
-
type: _enum([
|
|
23378
|
-
"wifi",
|
|
23379
|
-
"ethernet",
|
|
23380
|
-
"cellular",
|
|
23381
|
-
"unknown"
|
|
23382
|
-
]),
|
|
23383
|
-
/**
|
|
23384
|
-
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23385
|
-
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23386
|
-
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23387
|
-
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23388
|
-
* SKIP a null rather than coerce it.
|
|
23389
|
-
*/
|
|
23390
|
-
signalPercent: number().min(0).max(100).nullable(),
|
|
23391
|
-
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23392
|
-
rssiDbm: number().optional(),
|
|
23393
|
-
/** Network name of a wireless link, when the firmware reports it. */
|
|
23394
|
-
ssid: string().optional(),
|
|
23395
|
-
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23396
|
-
lastUpdated: number()
|
|
23397
|
-
});
|
|
23398
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
23399
|
-
deviceId: number(),
|
|
23400
|
-
status: NetworkLinkStatusSchema
|
|
23401
|
-
});
|
|
23402
23496
|
object({
|
|
23403
23497
|
on: boolean(),
|
|
23404
23498
|
/** Ms epoch of the last transition. 0 if never observed. */
|
|
@@ -25752,6 +25846,236 @@ DeviceType.Camera, method(object({
|
|
|
25752
25846
|
detection: NativeDetectionSchema
|
|
25753
25847
|
});
|
|
25754
25848
|
/**
|
|
25849
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
25850
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
25851
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
25852
|
+
*
|
|
25853
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
25854
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
25855
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
25856
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
25857
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
25858
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
25859
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
25860
|
+
* the reverse:
|
|
25861
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
25862
|
+
* / `getOptions`), and
|
|
25863
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
25864
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
25865
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
25866
|
+
* not here (see the addon design note):
|
|
25867
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
25868
|
+
* ptz.stop() → navigation.stop()
|
|
25869
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
25870
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
25871
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
25872
|
+
*
|
|
25873
|
+
* ## Continuous drive
|
|
25874
|
+
*
|
|
25875
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
25876
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
25877
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
25878
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
25879
|
+
* coalesce them. The UI owns the cadence.
|
|
25880
|
+
*
|
|
25881
|
+
* ## The action dictionary
|
|
25882
|
+
*
|
|
25883
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
25884
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
25885
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
25886
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
25887
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
25888
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
25889
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
25890
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
25891
|
+
*
|
|
25892
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
25893
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
25894
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
25895
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
25896
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
25897
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
25898
|
+
* THIS contract.
|
|
25899
|
+
*/
|
|
25900
|
+
/**
|
|
25901
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
25902
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
25903
|
+
* halts it.
|
|
25904
|
+
*
|
|
25905
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
25906
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
25907
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
25908
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
25909
|
+
*
|
|
25910
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
25911
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
25912
|
+
*/
|
|
25913
|
+
var NavigationMoveCommandSchema = object({
|
|
25914
|
+
pan: number().min(-1).max(1).optional(),
|
|
25915
|
+
tilt: number().min(-1).max(1).optional(),
|
|
25916
|
+
speed: number().min(0).max(1).optional()
|
|
25917
|
+
});
|
|
25918
|
+
/**
|
|
25919
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
25920
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
25921
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
25922
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
25923
|
+
*/
|
|
25924
|
+
var NavigationActionIdSchema = _enum([
|
|
25925
|
+
"goHome",
|
|
25926
|
+
"locate",
|
|
25927
|
+
"spotClean",
|
|
25928
|
+
"findPet",
|
|
25929
|
+
"personFollow",
|
|
25930
|
+
"stop",
|
|
25931
|
+
"startClean",
|
|
25932
|
+
"pauseClean",
|
|
25933
|
+
"dockWash",
|
|
25934
|
+
"autoEmpty",
|
|
25935
|
+
"flashOn",
|
|
25936
|
+
"flashOff"
|
|
25937
|
+
]);
|
|
25938
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
25939
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
25940
|
+
/**
|
|
25941
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
25942
|
+
* native panel and the PTZ mimic render as a button.
|
|
25943
|
+
*
|
|
25944
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
25945
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
25946
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
25947
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
25948
|
+
* - `label` — operator-facing English label.
|
|
25949
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
25950
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
25951
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
25952
|
+
* flips it from config, never by editing code.
|
|
25953
|
+
*/
|
|
25954
|
+
var NavigationActionEntrySchema = object({
|
|
25955
|
+
id: string(),
|
|
25956
|
+
kind: NavigationEntryKindSchema,
|
|
25957
|
+
label: string(),
|
|
25958
|
+
icon: string(),
|
|
25959
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
25960
|
+
soundId: number().int().optional(),
|
|
25961
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
25962
|
+
enabled: boolean()
|
|
25963
|
+
});
|
|
25964
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
25965
|
+
var NavigationPointSchema = object({
|
|
25966
|
+
x: number(),
|
|
25967
|
+
y: number()
|
|
25968
|
+
});
|
|
25969
|
+
/**
|
|
25970
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
25971
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
25972
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
25973
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
25974
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
25975
|
+
* that are not dictionary entries.
|
|
25976
|
+
*
|
|
25977
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
25978
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
25979
|
+
* map-coordinate plumbing is wired.
|
|
25980
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
25981
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
25982
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
25983
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
25984
|
+
* camera-service control; needs an active stream).
|
|
25985
|
+
*/
|
|
25986
|
+
var NavigationFeaturesSchema = object({
|
|
25987
|
+
move: boolean(),
|
|
25988
|
+
stop: boolean(),
|
|
25989
|
+
goToPoint: boolean(),
|
|
25990
|
+
runAction: boolean(),
|
|
25991
|
+
playSound: boolean(),
|
|
25992
|
+
light: boolean(),
|
|
25993
|
+
lightMode: boolean()
|
|
25994
|
+
});
|
|
25995
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
25996
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
25997
|
+
/**
|
|
25998
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
25999
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
26000
|
+
* - `following` — person/pet follow is currently armed.
|
|
26001
|
+
* - `flash` — the on-camera fill light is on.
|
|
26002
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
26003
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
26004
|
+
* `lightMode === 'manual'`.
|
|
26005
|
+
*/
|
|
26006
|
+
var NavigationStatusSchema = object({
|
|
26007
|
+
mode: _enum([
|
|
26008
|
+
"idle",
|
|
26009
|
+
"cleaning",
|
|
26010
|
+
"spot",
|
|
26011
|
+
"following",
|
|
26012
|
+
"goto",
|
|
26013
|
+
"returning",
|
|
26014
|
+
"paused",
|
|
26015
|
+
"unknown"
|
|
26016
|
+
]),
|
|
26017
|
+
following: boolean(),
|
|
26018
|
+
flash: boolean(),
|
|
26019
|
+
lightMode: NavigationLightModeSchema,
|
|
26020
|
+
lightLevel: number().min(40).max(100),
|
|
26021
|
+
/** Ms epoch when the slice was last updated. */
|
|
26022
|
+
lastChangedAt: number()
|
|
26023
|
+
});
|
|
26024
|
+
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
26025
|
+
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({
|
|
26026
|
+
deviceId: number(),
|
|
26027
|
+
actionId: NavigationActionIdSchema
|
|
26028
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26029
|
+
deviceId: number(),
|
|
26030
|
+
soundId: number().int()
|
|
26031
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26032
|
+
deviceId: number(),
|
|
26033
|
+
on: boolean()
|
|
26034
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26035
|
+
deviceId: number(),
|
|
26036
|
+
mode: NavigationLightModeSchema,
|
|
26037
|
+
level: number().min(40).max(100).optional()
|
|
26038
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26039
|
+
deviceId: number(),
|
|
26040
|
+
level: number().min(40).max(100)
|
|
26041
|
+
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
26042
|
+
deviceId: number(),
|
|
26043
|
+
status: NavigationStatusSchema
|
|
26044
|
+
});
|
|
26045
|
+
/**
|
|
26046
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
26047
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
26048
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
26049
|
+
* one Home Assistant projection.
|
|
26050
|
+
*/
|
|
26051
|
+
var NetworkLinkStatusSchema = object({
|
|
26052
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
26053
|
+
type: _enum([
|
|
26054
|
+
"wifi",
|
|
26055
|
+
"ethernet",
|
|
26056
|
+
"cellular",
|
|
26057
|
+
"unknown"
|
|
26058
|
+
]),
|
|
26059
|
+
/**
|
|
26060
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
26061
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
26062
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
26063
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
26064
|
+
* SKIP a null rather than coerce it.
|
|
26065
|
+
*/
|
|
26066
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
26067
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
26068
|
+
rssiDbm: number().optional(),
|
|
26069
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
26070
|
+
ssid: string().optional(),
|
|
26071
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
26072
|
+
lastUpdated: number()
|
|
26073
|
+
});
|
|
26074
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
26075
|
+
deviceId: number(),
|
|
26076
|
+
status: NetworkLinkStatusSchema
|
|
26077
|
+
});
|
|
26078
|
+
/**
|
|
25755
26079
|
* network-quality — system-scoped singleton capability tracking RTT,
|
|
25756
26080
|
* jitter, and observed/peak bandwidth per device + per client.
|
|
25757
26081
|
*
|
|
@@ -26993,203 +27317,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
26993
27317
|
deviceId: number(),
|
|
26994
27318
|
status: PtzAutotrackStatusSchema
|
|
26995
27319
|
});
|
|
26996
|
-
/**
|
|
26997
|
-
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
26998
|
-
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
26999
|
-
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
27000
|
-
*
|
|
27001
|
-
* Why a NEW cap rather than overloading `ptz`:
|
|
27002
|
-
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
27003
|
-
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
27004
|
-
* The two are different physical models: PTZ is absolute-position + presets,
|
|
27005
|
-
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
27006
|
-
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
27007
|
-
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
27008
|
-
* the reverse:
|
|
27009
|
-
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
27010
|
-
* / `getOptions`), and
|
|
27011
|
-
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
27012
|
-
* robot camera shows up in the existing PTZ control path without every
|
|
27013
|
-
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
27014
|
-
* not here (see the addon design note):
|
|
27015
|
-
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
27016
|
-
* ptz.stop() → navigation.stop()
|
|
27017
|
-
* ptz.goHome() → navigation.runAction('goHome')
|
|
27018
|
-
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
27019
|
-
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
27020
|
-
*
|
|
27021
|
-
* ## Continuous drive
|
|
27022
|
-
*
|
|
27023
|
-
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
27024
|
-
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
27025
|
-
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
27026
|
-
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
27027
|
-
* coalesce them. The UI owns the cadence.
|
|
27028
|
-
*
|
|
27029
|
-
* ## The action dictionary
|
|
27030
|
-
*
|
|
27031
|
-
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
27032
|
-
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
27033
|
-
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
27034
|
-
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
27035
|
-
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
27036
|
-
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
27037
|
-
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
27038
|
-
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
27039
|
-
*
|
|
27040
|
-
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
27041
|
-
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
27042
|
-
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
27043
|
-
* every device handle. A future nodedreame publish adds a typed
|
|
27044
|
-
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
27045
|
-
* provider can then swap the raw calls for the typed methods with no change to
|
|
27046
|
-
* THIS contract.
|
|
27047
|
-
*/
|
|
27048
|
-
/**
|
|
27049
|
-
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
27050
|
-
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
27051
|
-
* halts it.
|
|
27052
|
-
*
|
|
27053
|
-
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
27054
|
-
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
27055
|
-
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
27056
|
-
* vector by it (drivers without proportional drive ignore it).
|
|
27057
|
-
*
|
|
27058
|
-
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
27059
|
-
* axis alone; an all-undefined nudge is a no-op.
|
|
27060
|
-
*/
|
|
27061
|
-
var NavigationMoveCommandSchema = object({
|
|
27062
|
-
pan: number().min(-1).max(1).optional(),
|
|
27063
|
-
tilt: number().min(-1).max(1).optional(),
|
|
27064
|
-
speed: number().min(0).max(1).optional()
|
|
27065
|
-
});
|
|
27066
|
-
/**
|
|
27067
|
-
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
27068
|
-
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
27069
|
-
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
27070
|
-
* `playSound` (see the `sound` dictionary entries).
|
|
27071
|
-
*/
|
|
27072
|
-
var NavigationActionIdSchema = _enum([
|
|
27073
|
-
"goHome",
|
|
27074
|
-
"locate",
|
|
27075
|
-
"spotClean",
|
|
27076
|
-
"findPet",
|
|
27077
|
-
"personFollow",
|
|
27078
|
-
"stop",
|
|
27079
|
-
"startClean",
|
|
27080
|
-
"pauseClean",
|
|
27081
|
-
"dockWash",
|
|
27082
|
-
"autoEmpty",
|
|
27083
|
-
"flashOn",
|
|
27084
|
-
"flashOff"
|
|
27085
|
-
]);
|
|
27086
|
-
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
27087
|
-
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
27088
|
-
/**
|
|
27089
|
-
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
27090
|
-
* native panel and the PTZ mimic render as a button.
|
|
27091
|
-
*
|
|
27092
|
-
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
27093
|
-
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
27094
|
-
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
27095
|
-
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
27096
|
-
* - `label` — operator-facing English label.
|
|
27097
|
-
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
27098
|
-
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
27099
|
-
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
27100
|
-
* flips it from config, never by editing code.
|
|
27101
|
-
*/
|
|
27102
|
-
var NavigationActionEntrySchema = object({
|
|
27103
|
-
id: string(),
|
|
27104
|
-
kind: NavigationEntryKindSchema,
|
|
27105
|
-
label: string(),
|
|
27106
|
-
icon: string(),
|
|
27107
|
-
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
27108
|
-
soundId: number().int().optional(),
|
|
27109
|
-
/** Per-device feature flag — render this entry only when true. */
|
|
27110
|
-
enabled: boolean()
|
|
27111
|
-
});
|
|
27112
|
-
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
27113
|
-
var NavigationPointSchema = object({
|
|
27114
|
-
x: number(),
|
|
27115
|
-
y: number()
|
|
27116
|
-
});
|
|
27117
|
-
/**
|
|
27118
|
-
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
27119
|
-
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
27120
|
-
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
27121
|
-
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
27122
|
-
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
27123
|
-
* that are not dictionary entries.
|
|
27124
|
-
*
|
|
27125
|
-
* - `move` / `stop` — the momentary drive joystick.
|
|
27126
|
-
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
27127
|
-
* map-coordinate plumbing is wired.
|
|
27128
|
-
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
27129
|
-
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
27130
|
-
* - `light` — the on/off fill-light toggle (works anytime).
|
|
27131
|
-
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
27132
|
-
* camera-service control; needs an active stream).
|
|
27133
|
-
*/
|
|
27134
|
-
var NavigationFeaturesSchema = object({
|
|
27135
|
-
move: boolean(),
|
|
27136
|
-
stop: boolean(),
|
|
27137
|
-
goToPoint: boolean(),
|
|
27138
|
-
runAction: boolean(),
|
|
27139
|
-
playSound: boolean(),
|
|
27140
|
-
light: boolean(),
|
|
27141
|
-
lightMode: boolean()
|
|
27142
|
-
});
|
|
27143
|
-
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
27144
|
-
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
27145
|
-
/**
|
|
27146
|
-
* Live navigation state so the UI can reflect what the robot is doing:
|
|
27147
|
-
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
27148
|
-
* - `following` — person/pet follow is currently armed.
|
|
27149
|
-
* - `flash` — the on-camera fill light is on.
|
|
27150
|
-
* - `lightMode` — auto vs manual fill-light mode.
|
|
27151
|
-
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
27152
|
-
* `lightMode === 'manual'`.
|
|
27153
|
-
*/
|
|
27154
|
-
var NavigationStatusSchema = object({
|
|
27155
|
-
mode: _enum([
|
|
27156
|
-
"idle",
|
|
27157
|
-
"cleaning",
|
|
27158
|
-
"spot",
|
|
27159
|
-
"following",
|
|
27160
|
-
"goto",
|
|
27161
|
-
"returning",
|
|
27162
|
-
"paused",
|
|
27163
|
-
"unknown"
|
|
27164
|
-
]),
|
|
27165
|
-
following: boolean(),
|
|
27166
|
-
flash: boolean(),
|
|
27167
|
-
lightMode: NavigationLightModeSchema,
|
|
27168
|
-
lightLevel: number().min(40).max(100),
|
|
27169
|
-
/** Ms epoch when the slice was last updated. */
|
|
27170
|
-
lastChangedAt: number()
|
|
27171
|
-
});
|
|
27172
|
-
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
27173
|
-
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({
|
|
27174
|
-
deviceId: number(),
|
|
27175
|
-
actionId: NavigationActionIdSchema
|
|
27176
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27177
|
-
deviceId: number(),
|
|
27178
|
-
soundId: number().int()
|
|
27179
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27180
|
-
deviceId: number(),
|
|
27181
|
-
on: boolean()
|
|
27182
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27183
|
-
deviceId: number(),
|
|
27184
|
-
mode: NavigationLightModeSchema,
|
|
27185
|
-
level: number().min(40).max(100).optional()
|
|
27186
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27187
|
-
deviceId: number(),
|
|
27188
|
-
level: number().min(40).max(100)
|
|
27189
|
-
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
27190
|
-
deviceId: number(),
|
|
27191
|
-
status: NavigationStatusSchema
|
|
27192
|
-
});
|
|
27193
27320
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
27194
27321
|
kind: "mutation",
|
|
27195
27322
|
auth: "admin"
|
|
@@ -34498,13 +34625,13 @@ Object.freeze({
|
|
|
34498
34625
|
addonId: null,
|
|
34499
34626
|
access: "view"
|
|
34500
34627
|
},
|
|
34501
|
-
"storage.
|
|
34628
|
+
"storage.list": {
|
|
34502
34629
|
capName: "storage",
|
|
34503
34630
|
capScope: "system",
|
|
34504
34631
|
addonId: null,
|
|
34505
34632
|
access: "view"
|
|
34506
34633
|
},
|
|
34507
|
-
"storage.
|
|
34634
|
+
"storage.listDrainProgress": {
|
|
34508
34635
|
capName: "storage",
|
|
34509
34636
|
capScope: "system",
|
|
34510
34637
|
addonId: null,
|
|
@@ -34654,6 +34781,12 @@ Object.freeze({
|
|
|
34654
34781
|
addonId: null,
|
|
34655
34782
|
access: "view"
|
|
34656
34783
|
},
|
|
34784
|
+
"storageOccupancy.getOccupancy": {
|
|
34785
|
+
capName: "storage-occupancy",
|
|
34786
|
+
capScope: "system",
|
|
34787
|
+
addonId: null,
|
|
34788
|
+
access: "view"
|
|
34789
|
+
},
|
|
34657
34790
|
"storageProvider.abortUpload": {
|
|
34658
34791
|
capName: "storage-provider",
|
|
34659
34792
|
capScope: "system",
|