@camstack/addon-pipeline-orchestrator 1.2.165 → 1.2.167
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/_stub.js +2 -2
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-DQ07H3Xc.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-Cd0R035D.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Ckk-7c_N.mjs +26 -0
- package/dist/{_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-ClansAhh.mjs → _virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Druu1Kh6.mjs} +1 -1
- package/dist/{hostInit-i8CRHOvH.mjs → hostInit-BVIqHvsT.mjs} +3 -3
- package/dist/index.js +488 -355
- package/dist/index.mjs +488 -355
- package/dist/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CN5lrprX.mjs +0 -26
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
//#region ../types/dist/event-category-
|
|
5
|
+
//#region ../types/dist/event-category-CnLqLOKs.mjs
|
|
6
6
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
7
7
|
EventCategory["SystemBoot"] = "system.boot";
|
|
8
8
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -197,6 +197,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
197
197
|
EventCategory["ProcessCrashed"] = "process.crashed";
|
|
198
198
|
EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
|
|
199
199
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
200
|
+
/**
|
|
201
|
+
* The SET of storage locations changed — one was created, edited, enabled,
|
|
202
|
+
* disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
|
|
203
|
+
*
|
|
204
|
+
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
205
|
+
* it must also converge on its own periodic path, because a dropped event
|
|
206
|
+
* must not leave a node writing to yesterday's disk set forever. It exists
|
|
207
|
+
* because there was NO signal at all — an operator who added a second
|
|
208
|
+
* recordings disk in the admin UI got nothing, and the recorder kept its
|
|
209
|
+
* resolved locations until something else happened to re-resolve them
|
|
210
|
+
* (D387). Payload `StorageLocationsChangedPayload`.
|
|
211
|
+
*/
|
|
212
|
+
EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
|
|
200
213
|
EventCategory["RecordingStarted"] = "recording.started";
|
|
201
214
|
EventCategory["RecordingStopped"] = "recording.stopped";
|
|
202
215
|
EventCategory["RecordingError"] = "recording.error";
|
|
@@ -8463,111 +8476,6 @@ function composeSwitchedOff(input) {
|
|
|
8463
8476
|
};
|
|
8464
8477
|
}
|
|
8465
8478
|
/**
|
|
8466
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8467
|
-
* an addon declares its channels in.
|
|
8468
|
-
*
|
|
8469
|
-
* ## Two axes, deliberately separated
|
|
8470
|
-
*
|
|
8471
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8472
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8473
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8474
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8475
|
-
* `log-channels` capability enumerates the declarations.
|
|
8476
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8477
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8478
|
-
* over the values is the exact defect
|
|
8479
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8480
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
8481
|
-
*
|
|
8482
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8483
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8484
|
-
* the hot path with a value somebody actually read, and by
|
|
8485
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8486
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8487
|
-
* disarmed one (D49).
|
|
8488
|
-
*
|
|
8489
|
-
* ## The canonical call shape
|
|
8490
|
-
*
|
|
8491
|
-
* ```ts
|
|
8492
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8493
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8494
|
-
* }
|
|
8495
|
-
* ```
|
|
8496
|
-
*
|
|
8497
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8498
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8499
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
8500
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8501
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8502
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
8503
|
-
*
|
|
8504
|
-
* ## Why a channel emits at `info`
|
|
8505
|
-
*
|
|
8506
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8507
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8508
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8509
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8510
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8511
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8512
|
-
*/
|
|
8513
|
-
/**
|
|
8514
|
-
* The level a channel writes at once armed.
|
|
8515
|
-
*
|
|
8516
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8517
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8518
|
-
* to read it later.
|
|
8519
|
-
*/
|
|
8520
|
-
var LogChannelLevelSchema = _enum([
|
|
8521
|
-
"info",
|
|
8522
|
-
"warn",
|
|
8523
|
-
"error"
|
|
8524
|
-
]);
|
|
8525
|
-
/**
|
|
8526
|
-
* What an addon declares about one channel. No value, no state — a
|
|
8527
|
-
* declaration is inert.
|
|
8528
|
-
*/
|
|
8529
|
-
var LogChannelDescriptorSchema = object({
|
|
8530
|
-
/**
|
|
8531
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8532
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
8533
|
-
* owns it without a second lookup.
|
|
8534
|
-
*/
|
|
8535
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8536
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
8537
|
-
description: string().min(1),
|
|
8538
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
8539
|
-
defaultLevel: LogChannelLevelSchema,
|
|
8540
|
-
/**
|
|
8541
|
-
* Whether this channel can be narrowed to a camera.
|
|
8542
|
-
*
|
|
8543
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8544
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
8545
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8546
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8547
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8548
|
-
* the body is the only way to filter.
|
|
8549
|
-
*
|
|
8550
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8551
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8552
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8553
|
-
* path was never taken.
|
|
8554
|
-
*/
|
|
8555
|
-
perDevice: boolean()
|
|
8556
|
-
});
|
|
8557
|
-
/**
|
|
8558
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
8559
|
-
*
|
|
8560
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8561
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8562
|
-
*/
|
|
8563
|
-
var LogChannelWindowSchema = object({
|
|
8564
|
-
channel: string().min(1),
|
|
8565
|
-
/** Epoch ms the window closes at. */
|
|
8566
|
-
armedUntilMs: number(),
|
|
8567
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8568
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
8569
|
-
});
|
|
8570
|
-
/**
|
|
8571
8479
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
8572
8480
|
* recordings and events management surfaces.
|
|
8573
8481
|
*
|
|
@@ -9489,6 +9397,21 @@ var StorageCleanupJobSchema = object({
|
|
|
9489
9397
|
});
|
|
9490
9398
|
var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
|
|
9491
9399
|
/**
|
|
9400
|
+
* The one typed state of a storage location. Authoritative Zod schema — the TS
|
|
9401
|
+
* alias below is `z.infer<>` of it, never a second spelling.
|
|
9402
|
+
*/
|
|
9403
|
+
var StorageLocationModeSchema = _enum([
|
|
9404
|
+
"active",
|
|
9405
|
+
"readonly",
|
|
9406
|
+
"drain",
|
|
9407
|
+
"disabled"
|
|
9408
|
+
]);
|
|
9409
|
+
_enum([
|
|
9410
|
+
"normal",
|
|
9411
|
+
"never",
|
|
9412
|
+
"drain"
|
|
9413
|
+
]);
|
|
9414
|
+
/**
|
|
9492
9415
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
9493
9416
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
9494
9417
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -9513,8 +9436,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
9513
9436
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
9514
9437
|
*
|
|
9515
9438
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
9516
|
-
* The
|
|
9517
|
-
*
|
|
9439
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
9440
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
9441
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
9442
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
9443
|
+
* slug is `default`.
|
|
9518
9444
|
*
|
|
9519
9445
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
9520
9446
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -9535,23 +9461,37 @@ var StorageLocationSchema = object({
|
|
|
9535
9461
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
9536
9462
|
*/
|
|
9537
9463
|
nodeId: string().optional(),
|
|
9538
|
-
isDefault: boolean().default(false),
|
|
9539
9464
|
isSystem: boolean().default(false),
|
|
9540
9465
|
/**
|
|
9541
|
-
*
|
|
9542
|
-
*
|
|
9543
|
-
*
|
|
9544
|
-
*
|
|
9545
|
-
*
|
|
9466
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
9467
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
9468
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
9469
|
+
* still read, still played back, still age-swept, still drained, never
|
|
9470
|
+
* written.
|
|
9546
9471
|
*
|
|
9547
|
-
* OPTIONAL
|
|
9548
|
-
*
|
|
9549
|
-
*
|
|
9550
|
-
*
|
|
9551
|
-
*
|
|
9552
|
-
*
|
|
9472
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
9473
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
9474
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
9475
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
9476
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
9477
|
+
* stops existing rather than being re-derived on every read.
|
|
9553
9478
|
*/
|
|
9554
9479
|
enabled: boolean().optional(),
|
|
9480
|
+
/**
|
|
9481
|
+
* THE state of this location (D385), and the only authority on what may be
|
|
9482
|
+
* written, read or evicted here. Interpreted in exactly one place —
|
|
9483
|
+
* `storage-location-mode.ts` — which also folds the legacy
|
|
9484
|
+
* `enabled` / `config.readOnly` pair into a mode so an old row is never
|
|
9485
|
+
* ambiguous.
|
|
9486
|
+
*
|
|
9487
|
+
* OPTIONAL only for the wire and for rows written before D385: absence is
|
|
9488
|
+
* resolved by `resolveLocationMode`, and the orchestrator stamps every
|
|
9489
|
+
* unstamped row ONCE at hydrate so absence stops existing rather than being
|
|
9490
|
+
* re-derived on every read. `enabled` survives one release as a DERIVED
|
|
9491
|
+
* mirror (`mode === 'active'`); `withLocationMode` is the only writer of
|
|
9492
|
+
* either, so the two cannot disagree.
|
|
9493
|
+
*/
|
|
9494
|
+
mode: StorageLocationModeSchema.optional(),
|
|
9555
9495
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
9556
9496
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
9557
9497
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -9559,13 +9499,50 @@ var StorageLocationSchema = object({
|
|
|
9559
9499
|
totalBytes: number(),
|
|
9560
9500
|
availableBytes: number()
|
|
9561
9501
|
}).nullable().optional(),
|
|
9502
|
+
/**
|
|
9503
|
+
* How much of that volume CamStack ITSELF holds on this location (D388) —
|
|
9504
|
+
* COMPUTED at read time from the `storage-occupancy` providers' own figures,
|
|
9505
|
+
* never persisted, never a filesystem walk.
|
|
9506
|
+
*
|
|
9507
|
+
* **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
|
|
9508
|
+
* location yet — nobody stores here, the owning addon is down, or the first
|
|
9509
|
+
* refresh has not completed. A UI must omit the segment rather than draw it
|
|
9510
|
+
* at zero, which would claim we occupy nothing (D315). It is an OBJECT and
|
|
9511
|
+
* not a bare number precisely so that a `?? 0` on the consuming side has to
|
|
9512
|
+
* be spelled out loud instead of appearing by accident.
|
|
9513
|
+
*
|
|
9514
|
+
* `measuredAtMs` is the OLDEST contributing measurement, so it is honest
|
|
9515
|
+
* about the whole figure rather than about its freshest part.
|
|
9516
|
+
*/
|
|
9517
|
+
owned: object({
|
|
9518
|
+
bytes: number().int().nonnegative(),
|
|
9519
|
+
measuredAtMs: number().int().nonnegative()
|
|
9520
|
+
}).optional(),
|
|
9562
9521
|
createdAt: number(),
|
|
9563
9522
|
updatedAt: number()
|
|
9564
9523
|
});
|
|
9524
|
+
object({ isDefault: boolean().optional() });
|
|
9525
|
+
/**
|
|
9526
|
+
* How far a `drain` has got (D386) — the read a UI renders, and nothing more.
|
|
9527
|
+
*
|
|
9528
|
+
* `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
|
|
9529
|
+
* OBSERVED and is `null` when it has observed none. Never a fabricated date: a
|
|
9530
|
+
* drain with no observed growth has no honest ETA, and inventing one is how an
|
|
9531
|
+
* operator learns not to believe the screen.
|
|
9532
|
+
*/
|
|
9533
|
+
var StorageDrainProgressSchema = object({
|
|
9534
|
+
locationId: string(),
|
|
9535
|
+
startedAtMs: number(),
|
|
9536
|
+
startBytes: number(),
|
|
9537
|
+
bytesRemaining: number(),
|
|
9538
|
+
drained: boolean(),
|
|
9539
|
+
estimatedEmptyAtMs: number().nullable()
|
|
9540
|
+
});
|
|
9565
9541
|
/**
|
|
9566
9542
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
9567
9543
|
* Either:
|
|
9568
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
9544
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
9545
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
9569
9546
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
9570
9547
|
*
|
|
9571
9548
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -9741,6 +9718,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
9741
9718
|
*/
|
|
9742
9719
|
debug: boolean().optional()
|
|
9743
9720
|
});
|
|
9721
|
+
/**
|
|
9722
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
9723
|
+
* an addon declares its channels in.
|
|
9724
|
+
*
|
|
9725
|
+
* ## Two axes, deliberately separated
|
|
9726
|
+
*
|
|
9727
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
9728
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
9729
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
9730
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
9731
|
+
* `log-channels` capability enumerates the declarations.
|
|
9732
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
9733
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
9734
|
+
* over the values is the exact defect
|
|
9735
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
9736
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
9737
|
+
*
|
|
9738
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
9739
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
9740
|
+
* the hot path with a value somebody actually read, and by
|
|
9741
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
9742
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
9743
|
+
* disarmed one (D49).
|
|
9744
|
+
*
|
|
9745
|
+
* ## The canonical call shape
|
|
9746
|
+
*
|
|
9747
|
+
* ```ts
|
|
9748
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
9749
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
9750
|
+
* }
|
|
9751
|
+
* ```
|
|
9752
|
+
*
|
|
9753
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
9754
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
9755
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
9756
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
9757
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
9758
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
9759
|
+
*
|
|
9760
|
+
* ## Why a channel emits at `info`
|
|
9761
|
+
*
|
|
9762
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
9763
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
9764
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
9765
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
9766
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
9767
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
9768
|
+
*/
|
|
9769
|
+
/**
|
|
9770
|
+
* The level a channel writes at once armed.
|
|
9771
|
+
*
|
|
9772
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
9773
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
9774
|
+
* to read it later.
|
|
9775
|
+
*/
|
|
9776
|
+
var LogChannelLevelSchema = _enum([
|
|
9777
|
+
"info",
|
|
9778
|
+
"warn",
|
|
9779
|
+
"error"
|
|
9780
|
+
]);
|
|
9781
|
+
/**
|
|
9782
|
+
* What an addon declares about one channel. No value, no state — a
|
|
9783
|
+
* declaration is inert.
|
|
9784
|
+
*/
|
|
9785
|
+
var LogChannelDescriptorSchema = object({
|
|
9786
|
+
/**
|
|
9787
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
9788
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
9789
|
+
* owns it without a second lookup.
|
|
9790
|
+
*/
|
|
9791
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
9792
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
9793
|
+
description: string().min(1),
|
|
9794
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
9795
|
+
defaultLevel: LogChannelLevelSchema,
|
|
9796
|
+
/**
|
|
9797
|
+
* Whether this channel can be narrowed to a camera.
|
|
9798
|
+
*
|
|
9799
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
9800
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
9801
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
9802
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
9803
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
9804
|
+
* the body is the only way to filter.
|
|
9805
|
+
*
|
|
9806
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
9807
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
9808
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
9809
|
+
* path was never taken.
|
|
9810
|
+
*/
|
|
9811
|
+
perDevice: boolean()
|
|
9812
|
+
});
|
|
9813
|
+
/**
|
|
9814
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
9815
|
+
*
|
|
9816
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
9817
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
9818
|
+
*/
|
|
9819
|
+
var LogChannelWindowSchema = object({
|
|
9820
|
+
channel: string().min(1),
|
|
9821
|
+
/** Epoch ms the window closes at. */
|
|
9822
|
+
armedUntilMs: number(),
|
|
9823
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
9824
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
9825
|
+
});
|
|
9744
9826
|
var MODEL_FORMATS = [
|
|
9745
9827
|
"onnx",
|
|
9746
9828
|
"coreml",
|
|
@@ -23196,7 +23278,7 @@ method(object({
|
|
|
23196
23278
|
downloadId: string(),
|
|
23197
23279
|
offset: number(),
|
|
23198
23280
|
length: number()
|
|
23199
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
23281
|
+
}), _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({
|
|
23200
23282
|
createdAt: true,
|
|
23201
23283
|
updatedAt: true
|
|
23202
23284
|
}), StorageLocationSchema, {
|
|
@@ -23208,7 +23290,7 @@ method(object({
|
|
|
23208
23290
|
}), _void(), {
|
|
23209
23291
|
kind: "mutation",
|
|
23210
23292
|
auth: "admin"
|
|
23211
|
-
}), method(object({ id: string() }), object({
|
|
23293
|
+
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
23212
23294
|
ok: boolean(),
|
|
23213
23295
|
error: string().optional()
|
|
23214
23296
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
@@ -23278,6 +23360,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
23278
23360
|
kind: "mutation",
|
|
23279
23361
|
auth: "admin"
|
|
23280
23362
|
}), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
|
|
23363
|
+
/**
|
|
23364
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
23365
|
+
* location (D388).
|
|
23366
|
+
*
|
|
23367
|
+
* ## Why this is not `storage-evictable`
|
|
23368
|
+
*
|
|
23369
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
23370
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
23371
|
+
* operator most wants a figure for:
|
|
23372
|
+
*
|
|
23373
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
23374
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
23375
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
23376
|
+
* occupancy figure that double-counts the disk.
|
|
23377
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
23378
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
23379
|
+
* is retiring and staring at.
|
|
23380
|
+
*
|
|
23381
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
23382
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
23383
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
23384
|
+
* "evictable" must not register here — a number that silently means different
|
|
23385
|
+
* things per class is worse than no number.
|
|
23386
|
+
*
|
|
23387
|
+
* ## Absence is an answer
|
|
23388
|
+
*
|
|
23389
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
23390
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
23391
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
23392
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
23393
|
+
*
|
|
23394
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
23395
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
23396
|
+
*/
|
|
23397
|
+
/** One provider's occupancy answer for one location. */
|
|
23398
|
+
var StorageOccupancyReportSchema = object({
|
|
23399
|
+
locationId: string(),
|
|
23400
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
23401
|
+
* not net of what it is willing to delete. */
|
|
23402
|
+
ownedBytes: number().int().nonnegative(),
|
|
23403
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
23404
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
23405
|
+
measuredAtMs: number().int().nonnegative()
|
|
23406
|
+
});
|
|
23407
|
+
method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
|
|
23281
23408
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
23282
23409
|
providerId: string().min(1),
|
|
23283
23410
|
displayName: string().min(1),
|
|
@@ -24913,39 +25040,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
|
|
|
24913
25040
|
deviceId: number(),
|
|
24914
25041
|
status: BatteryStatusSchema
|
|
24915
25042
|
});
|
|
24916
|
-
/**
|
|
24917
|
-
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
24918
|
-
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
24919
|
-
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
24920
|
-
* one Home Assistant projection.
|
|
24921
|
-
*/
|
|
24922
|
-
var NetworkLinkStatusSchema = object({
|
|
24923
|
-
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
24924
|
-
type: _enum([
|
|
24925
|
-
"wifi",
|
|
24926
|
-
"ethernet",
|
|
24927
|
-
"cellular",
|
|
24928
|
-
"unknown"
|
|
24929
|
-
]),
|
|
24930
|
-
/**
|
|
24931
|
-
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
24932
|
-
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
24933
|
-
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
24934
|
-
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
24935
|
-
* SKIP a null rather than coerce it.
|
|
24936
|
-
*/
|
|
24937
|
-
signalPercent: number().min(0).max(100).nullable(),
|
|
24938
|
-
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
24939
|
-
rssiDbm: number().optional(),
|
|
24940
|
-
/** Network name of a wireless link, when the firmware reports it. */
|
|
24941
|
-
ssid: string().optional(),
|
|
24942
|
-
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
24943
|
-
lastUpdated: number()
|
|
24944
|
-
});
|
|
24945
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
24946
|
-
deviceId: number(),
|
|
24947
|
-
status: NetworkLinkStatusSchema
|
|
24948
|
-
});
|
|
24949
25043
|
object({
|
|
24950
25044
|
on: boolean(),
|
|
24951
25045
|
/** Ms epoch of the last transition. 0 if never observed. */
|
|
@@ -27299,6 +27393,236 @@ DeviceType.Camera, method(object({
|
|
|
27299
27393
|
detection: NativeDetectionSchema
|
|
27300
27394
|
});
|
|
27301
27395
|
/**
|
|
27396
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
27397
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
27398
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
27399
|
+
*
|
|
27400
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
27401
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
27402
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
27403
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
27404
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
27405
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
27406
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
27407
|
+
* the reverse:
|
|
27408
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
27409
|
+
* / `getOptions`), and
|
|
27410
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
27411
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
27412
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
27413
|
+
* not here (see the addon design note):
|
|
27414
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
27415
|
+
* ptz.stop() → navigation.stop()
|
|
27416
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
27417
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
27418
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
27419
|
+
*
|
|
27420
|
+
* ## Continuous drive
|
|
27421
|
+
*
|
|
27422
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
27423
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
27424
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
27425
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
27426
|
+
* coalesce them. The UI owns the cadence.
|
|
27427
|
+
*
|
|
27428
|
+
* ## The action dictionary
|
|
27429
|
+
*
|
|
27430
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
27431
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
27432
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
27433
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
27434
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
27435
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
27436
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
27437
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
27438
|
+
*
|
|
27439
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
27440
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
27441
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
27442
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
27443
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
27444
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
27445
|
+
* THIS contract.
|
|
27446
|
+
*/
|
|
27447
|
+
/**
|
|
27448
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
27449
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
27450
|
+
* halts it.
|
|
27451
|
+
*
|
|
27452
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
27453
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
27454
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
27455
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
27456
|
+
*
|
|
27457
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
27458
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
27459
|
+
*/
|
|
27460
|
+
var NavigationMoveCommandSchema = object({
|
|
27461
|
+
pan: number().min(-1).max(1).optional(),
|
|
27462
|
+
tilt: number().min(-1).max(1).optional(),
|
|
27463
|
+
speed: number().min(0).max(1).optional()
|
|
27464
|
+
});
|
|
27465
|
+
/**
|
|
27466
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
27467
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
27468
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
27469
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
27470
|
+
*/
|
|
27471
|
+
var NavigationActionIdSchema = _enum([
|
|
27472
|
+
"goHome",
|
|
27473
|
+
"locate",
|
|
27474
|
+
"spotClean",
|
|
27475
|
+
"findPet",
|
|
27476
|
+
"personFollow",
|
|
27477
|
+
"stop",
|
|
27478
|
+
"startClean",
|
|
27479
|
+
"pauseClean",
|
|
27480
|
+
"dockWash",
|
|
27481
|
+
"autoEmpty",
|
|
27482
|
+
"flashOn",
|
|
27483
|
+
"flashOff"
|
|
27484
|
+
]);
|
|
27485
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
27486
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
27487
|
+
/**
|
|
27488
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
27489
|
+
* native panel and the PTZ mimic render as a button.
|
|
27490
|
+
*
|
|
27491
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
27492
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
27493
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
27494
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
27495
|
+
* - `label` — operator-facing English label.
|
|
27496
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
27497
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
27498
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
27499
|
+
* flips it from config, never by editing code.
|
|
27500
|
+
*/
|
|
27501
|
+
var NavigationActionEntrySchema = object({
|
|
27502
|
+
id: string(),
|
|
27503
|
+
kind: NavigationEntryKindSchema,
|
|
27504
|
+
label: string(),
|
|
27505
|
+
icon: string(),
|
|
27506
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
27507
|
+
soundId: number().int().optional(),
|
|
27508
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
27509
|
+
enabled: boolean()
|
|
27510
|
+
});
|
|
27511
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
27512
|
+
var NavigationPointSchema = object({
|
|
27513
|
+
x: number(),
|
|
27514
|
+
y: number()
|
|
27515
|
+
});
|
|
27516
|
+
/**
|
|
27517
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
27518
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
27519
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
27520
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
27521
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
27522
|
+
* that are not dictionary entries.
|
|
27523
|
+
*
|
|
27524
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
27525
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
27526
|
+
* map-coordinate plumbing is wired.
|
|
27527
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
27528
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
27529
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
27530
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
27531
|
+
* camera-service control; needs an active stream).
|
|
27532
|
+
*/
|
|
27533
|
+
var NavigationFeaturesSchema = object({
|
|
27534
|
+
move: boolean(),
|
|
27535
|
+
stop: boolean(),
|
|
27536
|
+
goToPoint: boolean(),
|
|
27537
|
+
runAction: boolean(),
|
|
27538
|
+
playSound: boolean(),
|
|
27539
|
+
light: boolean(),
|
|
27540
|
+
lightMode: boolean()
|
|
27541
|
+
});
|
|
27542
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
27543
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
27544
|
+
/**
|
|
27545
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
27546
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
27547
|
+
* - `following` — person/pet follow is currently armed.
|
|
27548
|
+
* - `flash` — the on-camera fill light is on.
|
|
27549
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
27550
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
27551
|
+
* `lightMode === 'manual'`.
|
|
27552
|
+
*/
|
|
27553
|
+
var NavigationStatusSchema = object({
|
|
27554
|
+
mode: _enum([
|
|
27555
|
+
"idle",
|
|
27556
|
+
"cleaning",
|
|
27557
|
+
"spot",
|
|
27558
|
+
"following",
|
|
27559
|
+
"goto",
|
|
27560
|
+
"returning",
|
|
27561
|
+
"paused",
|
|
27562
|
+
"unknown"
|
|
27563
|
+
]),
|
|
27564
|
+
following: boolean(),
|
|
27565
|
+
flash: boolean(),
|
|
27566
|
+
lightMode: NavigationLightModeSchema,
|
|
27567
|
+
lightLevel: number().min(40).max(100),
|
|
27568
|
+
/** Ms epoch when the slice was last updated. */
|
|
27569
|
+
lastChangedAt: number()
|
|
27570
|
+
});
|
|
27571
|
+
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
27572
|
+
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({
|
|
27573
|
+
deviceId: number(),
|
|
27574
|
+
actionId: NavigationActionIdSchema
|
|
27575
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27576
|
+
deviceId: number(),
|
|
27577
|
+
soundId: number().int()
|
|
27578
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27579
|
+
deviceId: number(),
|
|
27580
|
+
on: boolean()
|
|
27581
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27582
|
+
deviceId: number(),
|
|
27583
|
+
mode: NavigationLightModeSchema,
|
|
27584
|
+
level: number().min(40).max(100).optional()
|
|
27585
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
27586
|
+
deviceId: number(),
|
|
27587
|
+
level: number().min(40).max(100)
|
|
27588
|
+
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
27589
|
+
deviceId: number(),
|
|
27590
|
+
status: NavigationStatusSchema
|
|
27591
|
+
});
|
|
27592
|
+
/**
|
|
27593
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
27594
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
27595
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
27596
|
+
* one Home Assistant projection.
|
|
27597
|
+
*/
|
|
27598
|
+
var NetworkLinkStatusSchema = object({
|
|
27599
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
27600
|
+
type: _enum([
|
|
27601
|
+
"wifi",
|
|
27602
|
+
"ethernet",
|
|
27603
|
+
"cellular",
|
|
27604
|
+
"unknown"
|
|
27605
|
+
]),
|
|
27606
|
+
/**
|
|
27607
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
27608
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
27609
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
27610
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
27611
|
+
* SKIP a null rather than coerce it.
|
|
27612
|
+
*/
|
|
27613
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
27614
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
27615
|
+
rssiDbm: number().optional(),
|
|
27616
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
27617
|
+
ssid: string().optional(),
|
|
27618
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
27619
|
+
lastUpdated: number()
|
|
27620
|
+
});
|
|
27621
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
27622
|
+
deviceId: number(),
|
|
27623
|
+
status: NetworkLinkStatusSchema
|
|
27624
|
+
});
|
|
27625
|
+
/**
|
|
27302
27626
|
* network-quality — system-scoped singleton capability tracking RTT,
|
|
27303
27627
|
* jitter, and observed/peak bandwidth per device + per client.
|
|
27304
27628
|
*
|
|
@@ -28540,203 +28864,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
28540
28864
|
deviceId: number(),
|
|
28541
28865
|
status: PtzAutotrackStatusSchema
|
|
28542
28866
|
});
|
|
28543
|
-
/**
|
|
28544
|
-
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
28545
|
-
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
28546
|
-
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
28547
|
-
*
|
|
28548
|
-
* Why a NEW cap rather than overloading `ptz`:
|
|
28549
|
-
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
28550
|
-
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
28551
|
-
* The two are different physical models: PTZ is absolute-position + presets,
|
|
28552
|
-
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
28553
|
-
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
28554
|
-
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
28555
|
-
* the reverse:
|
|
28556
|
-
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
28557
|
-
* / `getOptions`), and
|
|
28558
|
-
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
28559
|
-
* robot camera shows up in the existing PTZ control path without every
|
|
28560
|
-
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
28561
|
-
* not here (see the addon design note):
|
|
28562
|
-
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
28563
|
-
* ptz.stop() → navigation.stop()
|
|
28564
|
-
* ptz.goHome() → navigation.runAction('goHome')
|
|
28565
|
-
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
28566
|
-
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
28567
|
-
*
|
|
28568
|
-
* ## Continuous drive
|
|
28569
|
-
*
|
|
28570
|
-
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
28571
|
-
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
28572
|
-
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
28573
|
-
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
28574
|
-
* coalesce them. The UI owns the cadence.
|
|
28575
|
-
*
|
|
28576
|
-
* ## The action dictionary
|
|
28577
|
-
*
|
|
28578
|
-
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
28579
|
-
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
28580
|
-
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
28581
|
-
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
28582
|
-
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
28583
|
-
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
28584
|
-
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
28585
|
-
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
28586
|
-
*
|
|
28587
|
-
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
28588
|
-
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
28589
|
-
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
28590
|
-
* every device handle. A future nodedreame publish adds a typed
|
|
28591
|
-
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
28592
|
-
* provider can then swap the raw calls for the typed methods with no change to
|
|
28593
|
-
* THIS contract.
|
|
28594
|
-
*/
|
|
28595
|
-
/**
|
|
28596
|
-
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
28597
|
-
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
28598
|
-
* halts it.
|
|
28599
|
-
*
|
|
28600
|
-
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
28601
|
-
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
28602
|
-
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
28603
|
-
* vector by it (drivers without proportional drive ignore it).
|
|
28604
|
-
*
|
|
28605
|
-
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
28606
|
-
* axis alone; an all-undefined nudge is a no-op.
|
|
28607
|
-
*/
|
|
28608
|
-
var NavigationMoveCommandSchema = object({
|
|
28609
|
-
pan: number().min(-1).max(1).optional(),
|
|
28610
|
-
tilt: number().min(-1).max(1).optional(),
|
|
28611
|
-
speed: number().min(0).max(1).optional()
|
|
28612
|
-
});
|
|
28613
|
-
/**
|
|
28614
|
-
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
28615
|
-
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
28616
|
-
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
28617
|
-
* `playSound` (see the `sound` dictionary entries).
|
|
28618
|
-
*/
|
|
28619
|
-
var NavigationActionIdSchema = _enum([
|
|
28620
|
-
"goHome",
|
|
28621
|
-
"locate",
|
|
28622
|
-
"spotClean",
|
|
28623
|
-
"findPet",
|
|
28624
|
-
"personFollow",
|
|
28625
|
-
"stop",
|
|
28626
|
-
"startClean",
|
|
28627
|
-
"pauseClean",
|
|
28628
|
-
"dockWash",
|
|
28629
|
-
"autoEmpty",
|
|
28630
|
-
"flashOn",
|
|
28631
|
-
"flashOff"
|
|
28632
|
-
]);
|
|
28633
|
-
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
28634
|
-
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
28635
|
-
/**
|
|
28636
|
-
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
28637
|
-
* native panel and the PTZ mimic render as a button.
|
|
28638
|
-
*
|
|
28639
|
-
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
28640
|
-
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
28641
|
-
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
28642
|
-
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
28643
|
-
* - `label` — operator-facing English label.
|
|
28644
|
-
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
28645
|
-
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
28646
|
-
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
28647
|
-
* flips it from config, never by editing code.
|
|
28648
|
-
*/
|
|
28649
|
-
var NavigationActionEntrySchema = object({
|
|
28650
|
-
id: string(),
|
|
28651
|
-
kind: NavigationEntryKindSchema,
|
|
28652
|
-
label: string(),
|
|
28653
|
-
icon: string(),
|
|
28654
|
-
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
28655
|
-
soundId: number().int().optional(),
|
|
28656
|
-
/** Per-device feature flag — render this entry only when true. */
|
|
28657
|
-
enabled: boolean()
|
|
28658
|
-
});
|
|
28659
|
-
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
28660
|
-
var NavigationPointSchema = object({
|
|
28661
|
-
x: number(),
|
|
28662
|
-
y: number()
|
|
28663
|
-
});
|
|
28664
|
-
/**
|
|
28665
|
-
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
28666
|
-
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
28667
|
-
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
28668
|
-
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
28669
|
-
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
28670
|
-
* that are not dictionary entries.
|
|
28671
|
-
*
|
|
28672
|
-
* - `move` / `stop` — the momentary drive joystick.
|
|
28673
|
-
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
28674
|
-
* map-coordinate plumbing is wired.
|
|
28675
|
-
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
28676
|
-
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
28677
|
-
* - `light` — the on/off fill-light toggle (works anytime).
|
|
28678
|
-
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
28679
|
-
* camera-service control; needs an active stream).
|
|
28680
|
-
*/
|
|
28681
|
-
var NavigationFeaturesSchema = object({
|
|
28682
|
-
move: boolean(),
|
|
28683
|
-
stop: boolean(),
|
|
28684
|
-
goToPoint: boolean(),
|
|
28685
|
-
runAction: boolean(),
|
|
28686
|
-
playSound: boolean(),
|
|
28687
|
-
light: boolean(),
|
|
28688
|
-
lightMode: boolean()
|
|
28689
|
-
});
|
|
28690
|
-
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
28691
|
-
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
28692
|
-
/**
|
|
28693
|
-
* Live navigation state so the UI can reflect what the robot is doing:
|
|
28694
|
-
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
28695
|
-
* - `following` — person/pet follow is currently armed.
|
|
28696
|
-
* - `flash` — the on-camera fill light is on.
|
|
28697
|
-
* - `lightMode` — auto vs manual fill-light mode.
|
|
28698
|
-
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
28699
|
-
* `lightMode === 'manual'`.
|
|
28700
|
-
*/
|
|
28701
|
-
var NavigationStatusSchema = object({
|
|
28702
|
-
mode: _enum([
|
|
28703
|
-
"idle",
|
|
28704
|
-
"cleaning",
|
|
28705
|
-
"spot",
|
|
28706
|
-
"following",
|
|
28707
|
-
"goto",
|
|
28708
|
-
"returning",
|
|
28709
|
-
"paused",
|
|
28710
|
-
"unknown"
|
|
28711
|
-
]),
|
|
28712
|
-
following: boolean(),
|
|
28713
|
-
flash: boolean(),
|
|
28714
|
-
lightMode: NavigationLightModeSchema,
|
|
28715
|
-
lightLevel: number().min(40).max(100),
|
|
28716
|
-
/** Ms epoch when the slice was last updated. */
|
|
28717
|
-
lastChangedAt: number()
|
|
28718
|
-
});
|
|
28719
|
-
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
28720
|
-
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({
|
|
28721
|
-
deviceId: number(),
|
|
28722
|
-
actionId: NavigationActionIdSchema
|
|
28723
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
28724
|
-
deviceId: number(),
|
|
28725
|
-
soundId: number().int()
|
|
28726
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
28727
|
-
deviceId: number(),
|
|
28728
|
-
on: boolean()
|
|
28729
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
28730
|
-
deviceId: number(),
|
|
28731
|
-
mode: NavigationLightModeSchema,
|
|
28732
|
-
level: number().min(40).max(100).optional()
|
|
28733
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
28734
|
-
deviceId: number(),
|
|
28735
|
-
level: number().min(40).max(100)
|
|
28736
|
-
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
28737
|
-
deviceId: number(),
|
|
28738
|
-
status: NavigationStatusSchema
|
|
28739
|
-
});
|
|
28740
28867
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
28741
28868
|
kind: "mutation",
|
|
28742
28869
|
auth: "admin"
|
|
@@ -36129,13 +36256,13 @@ Object.freeze({
|
|
|
36129
36256
|
addonId: null,
|
|
36130
36257
|
access: "view"
|
|
36131
36258
|
},
|
|
36132
|
-
"storage.
|
|
36259
|
+
"storage.list": {
|
|
36133
36260
|
capName: "storage",
|
|
36134
36261
|
capScope: "system",
|
|
36135
36262
|
addonId: null,
|
|
36136
36263
|
access: "view"
|
|
36137
36264
|
},
|
|
36138
|
-
"storage.
|
|
36265
|
+
"storage.listDrainProgress": {
|
|
36139
36266
|
capName: "storage",
|
|
36140
36267
|
capScope: "system",
|
|
36141
36268
|
addonId: null,
|
|
@@ -36285,6 +36412,12 @@ Object.freeze({
|
|
|
36285
36412
|
addonId: null,
|
|
36286
36413
|
access: "view"
|
|
36287
36414
|
},
|
|
36415
|
+
"storageOccupancy.getOccupancy": {
|
|
36416
|
+
capName: "storage-occupancy",
|
|
36417
|
+
capScope: "system",
|
|
36418
|
+
addonId: null,
|
|
36419
|
+
access: "view"
|
|
36420
|
+
},
|
|
36288
36421
|
"storageProvider.abortUpload": {
|
|
36289
36422
|
capName: "storage-provider",
|
|
36290
36423
|
capScope: "system",
|