@camstack/addon-auth 1.2.85 → 1.2.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{dist-Ud9rgSkS.js → dist-BiBtU0Wh.js} +488 -355
- package/dist/{dist-D9EnjAse.mjs → dist-OqNG3erj.mjs} +488 -355
- package/dist/magic-link/auth-magic-link.addon.js +1 -1
- package/dist/magic-link/auth-magic-link.addon.mjs +1 -1
- package/dist/oidc/auth-oidc.addon.js +1 -1
- package/dist/oidc/auth-oidc.addon.mjs +1 -1
- package/dist/webauthn/_stub.js +1 -1
- package/dist/webauthn/{_virtual_mf-localSharedImportMap___mfe_internal__addon_auth_webauthn_widgets-CIf4k9xj.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_auth_webauthn_widgets-Bb2TiAjE.mjs} +3 -3
- package/dist/webauthn/{_virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DTGN2yVO.mjs → _virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Ce65hVtx.mjs} +1 -1
- package/dist/webauthn/auth-webauthn.addon.js +1 -1
- package/dist/webauthn/auth-webauthn.addon.mjs +1 -1
- package/dist/webauthn/{hostInit-DaIsdolf.mjs → hostInit-CmzQtGUQ.mjs} +3 -3
- package/dist/webauthn/remoteEntry.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../types/dist/event-category-
|
|
1
|
+
//#region ../types/dist/event-category-CnLqLOKs.mjs
|
|
2
2
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
3
3
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4
4
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -193,6 +193,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
193
193
|
EventCategory["ProcessCrashed"] = "process.crashed";
|
|
194
194
|
EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
|
|
195
195
|
EventCategory["ProcessRestarted"] = "process.restarted";
|
|
196
|
+
/**
|
|
197
|
+
* The SET of storage locations changed — one was created, edited, enabled,
|
|
198
|
+
* disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
|
|
199
|
+
*
|
|
200
|
+
* Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
|
|
201
|
+
* it must also converge on its own periodic path, because a dropped event
|
|
202
|
+
* must not leave a node writing to yesterday's disk set forever. It exists
|
|
203
|
+
* because there was NO signal at all — an operator who added a second
|
|
204
|
+
* recordings disk in the admin UI got nothing, and the recorder kept its
|
|
205
|
+
* resolved locations until something else happened to re-resolve them
|
|
206
|
+
* (D387). Payload `StorageLocationsChangedPayload`.
|
|
207
|
+
*/
|
|
208
|
+
EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
|
|
196
209
|
EventCategory["RecordingStarted"] = "recording.started";
|
|
197
210
|
EventCategory["RecordingStopped"] = "recording.stopped";
|
|
198
211
|
EventCategory["RecordingError"] = "recording.error";
|
|
@@ -7729,111 +7742,6 @@ var CameraSwitchGroupSchema = object({
|
|
|
7729
7742
|
fetchedAt: number()
|
|
7730
7743
|
});
|
|
7731
7744
|
/**
|
|
7732
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7733
|
-
* an addon declares its channels in.
|
|
7734
|
-
*
|
|
7735
|
-
* ## Two axes, deliberately separated
|
|
7736
|
-
*
|
|
7737
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7738
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7739
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7740
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7741
|
-
* `log-channels` capability enumerates the declarations.
|
|
7742
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7743
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7744
|
-
* over the values is the exact defect
|
|
7745
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7746
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
7747
|
-
*
|
|
7748
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7749
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7750
|
-
* the hot path with a value somebody actually read, and by
|
|
7751
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7752
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7753
|
-
* disarmed one (D49).
|
|
7754
|
-
*
|
|
7755
|
-
* ## The canonical call shape
|
|
7756
|
-
*
|
|
7757
|
-
* ```ts
|
|
7758
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7759
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7760
|
-
* }
|
|
7761
|
-
* ```
|
|
7762
|
-
*
|
|
7763
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7764
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7765
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
7766
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7767
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7768
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
7769
|
-
*
|
|
7770
|
-
* ## Why a channel emits at `info`
|
|
7771
|
-
*
|
|
7772
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7773
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7774
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7775
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7776
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7777
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7778
|
-
*/
|
|
7779
|
-
/**
|
|
7780
|
-
* The level a channel writes at once armed.
|
|
7781
|
-
*
|
|
7782
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7783
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7784
|
-
* to read it later.
|
|
7785
|
-
*/
|
|
7786
|
-
var LogChannelLevelSchema = _enum([
|
|
7787
|
-
"info",
|
|
7788
|
-
"warn",
|
|
7789
|
-
"error"
|
|
7790
|
-
]);
|
|
7791
|
-
/**
|
|
7792
|
-
* What an addon declares about one channel. No value, no state — a
|
|
7793
|
-
* declaration is inert.
|
|
7794
|
-
*/
|
|
7795
|
-
var LogChannelDescriptorSchema = object({
|
|
7796
|
-
/**
|
|
7797
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7798
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
7799
|
-
* owns it without a second lookup.
|
|
7800
|
-
*/
|
|
7801
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7802
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
7803
|
-
description: string().min(1),
|
|
7804
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
7805
|
-
defaultLevel: LogChannelLevelSchema,
|
|
7806
|
-
/**
|
|
7807
|
-
* Whether this channel can be narrowed to a camera.
|
|
7808
|
-
*
|
|
7809
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7810
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
7811
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7812
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7813
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7814
|
-
* the body is the only way to filter.
|
|
7815
|
-
*
|
|
7816
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7817
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7818
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7819
|
-
* path was never taken.
|
|
7820
|
-
*/
|
|
7821
|
-
perDevice: boolean()
|
|
7822
|
-
});
|
|
7823
|
-
/**
|
|
7824
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
7825
|
-
*
|
|
7826
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7827
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7828
|
-
*/
|
|
7829
|
-
var LogChannelWindowSchema = object({
|
|
7830
|
-
channel: string().min(1),
|
|
7831
|
-
/** Epoch ms the window closes at. */
|
|
7832
|
-
armedUntilMs: number(),
|
|
7833
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7834
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
7835
|
-
});
|
|
7836
|
-
/**
|
|
7837
7745
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7838
7746
|
* recordings and events management surfaces.
|
|
7839
7747
|
*
|
|
@@ -8755,6 +8663,21 @@ var StorageCleanupJobSchema = object({
|
|
|
8755
8663
|
});
|
|
8756
8664
|
var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
|
|
8757
8665
|
/**
|
|
8666
|
+
* The one typed state of a storage location. Authoritative Zod schema — the TS
|
|
8667
|
+
* alias below is `z.infer<>` of it, never a second spelling.
|
|
8668
|
+
*/
|
|
8669
|
+
var StorageLocationModeSchema = _enum([
|
|
8670
|
+
"active",
|
|
8671
|
+
"readonly",
|
|
8672
|
+
"drain",
|
|
8673
|
+
"disabled"
|
|
8674
|
+
]);
|
|
8675
|
+
_enum([
|
|
8676
|
+
"normal",
|
|
8677
|
+
"never",
|
|
8678
|
+
"drain"
|
|
8679
|
+
]);
|
|
8680
|
+
/**
|
|
8758
8681
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
8759
8682
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
8760
8683
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -8779,8 +8702,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
8779
8702
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
8780
8703
|
*
|
|
8781
8704
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
8782
|
-
* The
|
|
8783
|
-
*
|
|
8705
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
8706
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
8707
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
8708
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
8709
|
+
* slug is `default`.
|
|
8784
8710
|
*
|
|
8785
8711
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
8786
8712
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -8801,23 +8727,37 @@ var StorageLocationSchema = object({
|
|
|
8801
8727
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
8802
8728
|
*/
|
|
8803
8729
|
nodeId: string().optional(),
|
|
8804
|
-
isDefault: boolean().default(false),
|
|
8805
8730
|
isSystem: boolean().default(false),
|
|
8806
8731
|
/**
|
|
8807
|
-
*
|
|
8808
|
-
*
|
|
8809
|
-
*
|
|
8810
|
-
*
|
|
8811
|
-
*
|
|
8732
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
8733
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
8734
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
8735
|
+
* still read, still played back, still age-swept, still drained, never
|
|
8736
|
+
* written.
|
|
8812
8737
|
*
|
|
8813
|
-
* OPTIONAL
|
|
8814
|
-
*
|
|
8815
|
-
*
|
|
8816
|
-
*
|
|
8817
|
-
*
|
|
8818
|
-
*
|
|
8738
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
8739
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
8740
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
8741
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
8742
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
8743
|
+
* stops existing rather than being re-derived on every read.
|
|
8819
8744
|
*/
|
|
8820
8745
|
enabled: boolean().optional(),
|
|
8746
|
+
/**
|
|
8747
|
+
* THE state of this location (D385), and the only authority on what may be
|
|
8748
|
+
* written, read or evicted here. Interpreted in exactly one place —
|
|
8749
|
+
* `storage-location-mode.ts` — which also folds the legacy
|
|
8750
|
+
* `enabled` / `config.readOnly` pair into a mode so an old row is never
|
|
8751
|
+
* ambiguous.
|
|
8752
|
+
*
|
|
8753
|
+
* OPTIONAL only for the wire and for rows written before D385: absence is
|
|
8754
|
+
* resolved by `resolveLocationMode`, and the orchestrator stamps every
|
|
8755
|
+
* unstamped row ONCE at hydrate so absence stops existing rather than being
|
|
8756
|
+
* re-derived on every read. `enabled` survives one release as a DERIVED
|
|
8757
|
+
* mirror (`mode === 'active'`); `withLocationMode` is the only writer of
|
|
8758
|
+
* either, so the two cannot disagree.
|
|
8759
|
+
*/
|
|
8760
|
+
mode: StorageLocationModeSchema.optional(),
|
|
8821
8761
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
8822
8762
|
* for node-local locations it can reach) — never persisted, absent when the
|
|
8823
8763
|
* volume is remote/unreachable. The single capacity truth every UI reads. */
|
|
@@ -8825,13 +8765,50 @@ var StorageLocationSchema = object({
|
|
|
8825
8765
|
totalBytes: number(),
|
|
8826
8766
|
availableBytes: number()
|
|
8827
8767
|
}).nullable().optional(),
|
|
8768
|
+
/**
|
|
8769
|
+
* How much of that volume CamStack ITSELF holds on this location (D388) —
|
|
8770
|
+
* COMPUTED at read time from the `storage-occupancy` providers' own figures,
|
|
8771
|
+
* never persisted, never a filesystem walk.
|
|
8772
|
+
*
|
|
8773
|
+
* **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
|
|
8774
|
+
* location yet — nobody stores here, the owning addon is down, or the first
|
|
8775
|
+
* refresh has not completed. A UI must omit the segment rather than draw it
|
|
8776
|
+
* at zero, which would claim we occupy nothing (D315). It is an OBJECT and
|
|
8777
|
+
* not a bare number precisely so that a `?? 0` on the consuming side has to
|
|
8778
|
+
* be spelled out loud instead of appearing by accident.
|
|
8779
|
+
*
|
|
8780
|
+
* `measuredAtMs` is the OLDEST contributing measurement, so it is honest
|
|
8781
|
+
* about the whole figure rather than about its freshest part.
|
|
8782
|
+
*/
|
|
8783
|
+
owned: object({
|
|
8784
|
+
bytes: number().int().nonnegative(),
|
|
8785
|
+
measuredAtMs: number().int().nonnegative()
|
|
8786
|
+
}).optional(),
|
|
8828
8787
|
createdAt: number(),
|
|
8829
8788
|
updatedAt: number()
|
|
8830
8789
|
});
|
|
8790
|
+
object({ isDefault: boolean().optional() });
|
|
8791
|
+
/**
|
|
8792
|
+
* How far a `drain` has got (D386) — the read a UI renders, and nothing more.
|
|
8793
|
+
*
|
|
8794
|
+
* `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
|
|
8795
|
+
* OBSERVED and is `null` when it has observed none. Never a fabricated date: a
|
|
8796
|
+
* drain with no observed growth has no honest ETA, and inventing one is how an
|
|
8797
|
+
* operator learns not to believe the screen.
|
|
8798
|
+
*/
|
|
8799
|
+
var StorageDrainProgressSchema = object({
|
|
8800
|
+
locationId: string(),
|
|
8801
|
+
startedAtMs: number(),
|
|
8802
|
+
startBytes: number(),
|
|
8803
|
+
bytesRemaining: number(),
|
|
8804
|
+
drained: boolean(),
|
|
8805
|
+
estimatedEmptyAtMs: number().nullable()
|
|
8806
|
+
});
|
|
8831
8807
|
/**
|
|
8832
8808
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8833
8809
|
* Either:
|
|
8834
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
8810
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
8811
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
8835
8812
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
8836
8813
|
*
|
|
8837
8814
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -9007,6 +8984,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
9007
8984
|
*/
|
|
9008
8985
|
debug: boolean().optional()
|
|
9009
8986
|
});
|
|
8987
|
+
/**
|
|
8988
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8989
|
+
* an addon declares its channels in.
|
|
8990
|
+
*
|
|
8991
|
+
* ## Two axes, deliberately separated
|
|
8992
|
+
*
|
|
8993
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8994
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8995
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8996
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8997
|
+
* `log-channels` capability enumerates the declarations.
|
|
8998
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8999
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
9000
|
+
* over the values is the exact defect
|
|
9001
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
9002
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
9003
|
+
*
|
|
9004
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
9005
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
9006
|
+
* the hot path with a value somebody actually read, and by
|
|
9007
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
9008
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
9009
|
+
* disarmed one (D49).
|
|
9010
|
+
*
|
|
9011
|
+
* ## The canonical call shape
|
|
9012
|
+
*
|
|
9013
|
+
* ```ts
|
|
9014
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
9015
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
9016
|
+
* }
|
|
9017
|
+
* ```
|
|
9018
|
+
*
|
|
9019
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
9020
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
9021
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
9022
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
9023
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
9024
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
9025
|
+
*
|
|
9026
|
+
* ## Why a channel emits at `info`
|
|
9027
|
+
*
|
|
9028
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
9029
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
9030
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
9031
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
9032
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
9033
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
9034
|
+
*/
|
|
9035
|
+
/**
|
|
9036
|
+
* The level a channel writes at once armed.
|
|
9037
|
+
*
|
|
9038
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
9039
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
9040
|
+
* to read it later.
|
|
9041
|
+
*/
|
|
9042
|
+
var LogChannelLevelSchema = _enum([
|
|
9043
|
+
"info",
|
|
9044
|
+
"warn",
|
|
9045
|
+
"error"
|
|
9046
|
+
]);
|
|
9047
|
+
/**
|
|
9048
|
+
* What an addon declares about one channel. No value, no state — a
|
|
9049
|
+
* declaration is inert.
|
|
9050
|
+
*/
|
|
9051
|
+
var LogChannelDescriptorSchema = object({
|
|
9052
|
+
/**
|
|
9053
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
9054
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
9055
|
+
* owns it without a second lookup.
|
|
9056
|
+
*/
|
|
9057
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
9058
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
9059
|
+
description: string().min(1),
|
|
9060
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
9061
|
+
defaultLevel: LogChannelLevelSchema,
|
|
9062
|
+
/**
|
|
9063
|
+
* Whether this channel can be narrowed to a camera.
|
|
9064
|
+
*
|
|
9065
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
9066
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
9067
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
9068
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
9069
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
9070
|
+
* the body is the only way to filter.
|
|
9071
|
+
*
|
|
9072
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
9073
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
9074
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
9075
|
+
* path was never taken.
|
|
9076
|
+
*/
|
|
9077
|
+
perDevice: boolean()
|
|
9078
|
+
});
|
|
9079
|
+
/**
|
|
9080
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
9081
|
+
*
|
|
9082
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
9083
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
9084
|
+
*/
|
|
9085
|
+
var LogChannelWindowSchema = object({
|
|
9086
|
+
channel: string().min(1),
|
|
9087
|
+
/** Epoch ms the window closes at. */
|
|
9088
|
+
armedUntilMs: number(),
|
|
9089
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
9090
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
9091
|
+
});
|
|
9010
9092
|
var MODEL_FORMATS = [
|
|
9011
9093
|
"onnx",
|
|
9012
9094
|
"coreml",
|
|
@@ -21730,7 +21812,7 @@ method(object({
|
|
|
21730
21812
|
downloadId: string(),
|
|
21731
21813
|
offset: number(),
|
|
21732
21814
|
length: number()
|
|
21733
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
21815
|
+
}), _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({
|
|
21734
21816
|
createdAt: true,
|
|
21735
21817
|
updatedAt: true
|
|
21736
21818
|
}), StorageLocationSchema, {
|
|
@@ -21742,7 +21824,7 @@ method(object({
|
|
|
21742
21824
|
}), _void(), {
|
|
21743
21825
|
kind: "mutation",
|
|
21744
21826
|
auth: "admin"
|
|
21745
|
-
}), method(object({ id: string() }), object({
|
|
21827
|
+
}), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
|
|
21746
21828
|
ok: boolean(),
|
|
21747
21829
|
error: string().optional()
|
|
21748
21830
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
@@ -21812,6 +21894,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
|
|
|
21812
21894
|
kind: "mutation",
|
|
21813
21895
|
auth: "admin"
|
|
21814
21896
|
}), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
|
|
21897
|
+
/**
|
|
21898
|
+
* `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
|
|
21899
|
+
* location (D388).
|
|
21900
|
+
*
|
|
21901
|
+
* ## Why this is not `storage-evictable`
|
|
21902
|
+
*
|
|
21903
|
+
* `storage-evictable.getEvictableUsage` looks like the same question and is
|
|
21904
|
+
* not, in two ways that both matter and both bite hardest on the locations an
|
|
21905
|
+
* operator most wants a figure for:
|
|
21906
|
+
*
|
|
21907
|
+
* - it reports the whole eviction DOMAIN, not the location. `recordings:default`
|
|
21908
|
+
* and `recordingsLow:default` deliberately share one root and evict as one
|
|
21909
|
+
* oldest-first pool, so both answer with the SAME combined total. As an
|
|
21910
|
+
* occupancy figure that double-counts the disk.
|
|
21911
|
+
* - it reports ZERO for a location whose eviction policy is `never` (D385) —
|
|
21912
|
+
* a `readonly` or `disabled` disk. Those are exactly the disks an operator
|
|
21913
|
+
* is retiring and staring at.
|
|
21914
|
+
*
|
|
21915
|
+
* So this is its own contract with its own quantity, and the quantity is
|
|
21916
|
+
* OCCUPIED: every byte the addon holds on that location, whether or not it
|
|
21917
|
+
* would ever be willing to delete it. A provider that can only answer
|
|
21918
|
+
* "evictable" must not register here — a number that silently means different
|
|
21919
|
+
* things per class is worse than no number.
|
|
21920
|
+
*
|
|
21921
|
+
* ## Absence is an answer
|
|
21922
|
+
*
|
|
21923
|
+
* A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
|
|
21924
|
+
* stamps `StorageLocation.owned` only for locations it has a report for, and
|
|
21925
|
+
* the field is an OBJECT rather than a bare number so that a `?? 0` on the
|
|
21926
|
+
* consuming side has to be written out loud instead of appearing by accident.
|
|
21927
|
+
*
|
|
21928
|
+
* `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
|
|
21929
|
+
* a public client surface. Clients read the stamped `StorageLocation.owned`.
|
|
21930
|
+
*/
|
|
21931
|
+
/** One provider's occupancy answer for one location. */
|
|
21932
|
+
var StorageOccupancyReportSchema = object({
|
|
21933
|
+
locationId: string(),
|
|
21934
|
+
/** Bytes this provider holds on THAT location — not its eviction domain, and
|
|
21935
|
+
* not net of what it is willing to delete. */
|
|
21936
|
+
ownedBytes: number().int().nonnegative(),
|
|
21937
|
+
/** When the provider last actually measured this. The orchestrator carries it
|
|
21938
|
+
* through so a UI can say how old the figure is instead of implying "now". */
|
|
21939
|
+
measuredAtMs: number().int().nonnegative()
|
|
21940
|
+
});
|
|
21941
|
+
method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
|
|
21815
21942
|
var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
|
|
21816
21943
|
providerId: string().min(1),
|
|
21817
21944
|
displayName: string().min(1),
|
|
@@ -23482,39 +23609,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
|
|
|
23482
23609
|
deviceId: number(),
|
|
23483
23610
|
status: BatteryStatusSchema
|
|
23484
23611
|
});
|
|
23485
|
-
/**
|
|
23486
|
-
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23487
|
-
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23488
|
-
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23489
|
-
* one Home Assistant projection.
|
|
23490
|
-
*/
|
|
23491
|
-
var NetworkLinkStatusSchema = object({
|
|
23492
|
-
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23493
|
-
type: _enum([
|
|
23494
|
-
"wifi",
|
|
23495
|
-
"ethernet",
|
|
23496
|
-
"cellular",
|
|
23497
|
-
"unknown"
|
|
23498
|
-
]),
|
|
23499
|
-
/**
|
|
23500
|
-
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23501
|
-
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23502
|
-
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23503
|
-
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23504
|
-
* SKIP a null rather than coerce it.
|
|
23505
|
-
*/
|
|
23506
|
-
signalPercent: number().min(0).max(100).nullable(),
|
|
23507
|
-
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23508
|
-
rssiDbm: number().optional(),
|
|
23509
|
-
/** Network name of a wireless link, when the firmware reports it. */
|
|
23510
|
-
ssid: string().optional(),
|
|
23511
|
-
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23512
|
-
lastUpdated: number()
|
|
23513
|
-
});
|
|
23514
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
23515
|
-
deviceId: number(),
|
|
23516
|
-
status: NetworkLinkStatusSchema
|
|
23517
|
-
});
|
|
23518
23612
|
object({
|
|
23519
23613
|
on: boolean(),
|
|
23520
23614
|
/** Ms epoch of the last transition. 0 if never observed. */
|
|
@@ -25868,6 +25962,236 @@ DeviceType.Camera, method(object({
|
|
|
25868
25962
|
detection: NativeDetectionSchema
|
|
25869
25963
|
});
|
|
25870
25964
|
/**
|
|
25965
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
25966
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
25967
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
25968
|
+
*
|
|
25969
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
25970
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
25971
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
25972
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
25973
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
25974
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
25975
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
25976
|
+
* the reverse:
|
|
25977
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
25978
|
+
* / `getOptions`), and
|
|
25979
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
25980
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
25981
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
25982
|
+
* not here (see the addon design note):
|
|
25983
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
25984
|
+
* ptz.stop() → navigation.stop()
|
|
25985
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
25986
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
25987
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
25988
|
+
*
|
|
25989
|
+
* ## Continuous drive
|
|
25990
|
+
*
|
|
25991
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
25992
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
25993
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
25994
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
25995
|
+
* coalesce them. The UI owns the cadence.
|
|
25996
|
+
*
|
|
25997
|
+
* ## The action dictionary
|
|
25998
|
+
*
|
|
25999
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
26000
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
26001
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
26002
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
26003
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
26004
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
26005
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
26006
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
26007
|
+
*
|
|
26008
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
26009
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
26010
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
26011
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
26012
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
26013
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
26014
|
+
* THIS contract.
|
|
26015
|
+
*/
|
|
26016
|
+
/**
|
|
26017
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
26018
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
26019
|
+
* halts it.
|
|
26020
|
+
*
|
|
26021
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
26022
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
26023
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
26024
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
26025
|
+
*
|
|
26026
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
26027
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
26028
|
+
*/
|
|
26029
|
+
var NavigationMoveCommandSchema = object({
|
|
26030
|
+
pan: number().min(-1).max(1).optional(),
|
|
26031
|
+
tilt: number().min(-1).max(1).optional(),
|
|
26032
|
+
speed: number().min(0).max(1).optional()
|
|
26033
|
+
});
|
|
26034
|
+
/**
|
|
26035
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
26036
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
26037
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
26038
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
26039
|
+
*/
|
|
26040
|
+
var NavigationActionIdSchema = _enum([
|
|
26041
|
+
"goHome",
|
|
26042
|
+
"locate",
|
|
26043
|
+
"spotClean",
|
|
26044
|
+
"findPet",
|
|
26045
|
+
"personFollow",
|
|
26046
|
+
"stop",
|
|
26047
|
+
"startClean",
|
|
26048
|
+
"pauseClean",
|
|
26049
|
+
"dockWash",
|
|
26050
|
+
"autoEmpty",
|
|
26051
|
+
"flashOn",
|
|
26052
|
+
"flashOff"
|
|
26053
|
+
]);
|
|
26054
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
26055
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
26056
|
+
/**
|
|
26057
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
26058
|
+
* native panel and the PTZ mimic render as a button.
|
|
26059
|
+
*
|
|
26060
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
26061
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
26062
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
26063
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
26064
|
+
* - `label` — operator-facing English label.
|
|
26065
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
26066
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
26067
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
26068
|
+
* flips it from config, never by editing code.
|
|
26069
|
+
*/
|
|
26070
|
+
var NavigationActionEntrySchema = object({
|
|
26071
|
+
id: string(),
|
|
26072
|
+
kind: NavigationEntryKindSchema,
|
|
26073
|
+
label: string(),
|
|
26074
|
+
icon: string(),
|
|
26075
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
26076
|
+
soundId: number().int().optional(),
|
|
26077
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
26078
|
+
enabled: boolean()
|
|
26079
|
+
});
|
|
26080
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
26081
|
+
var NavigationPointSchema = object({
|
|
26082
|
+
x: number(),
|
|
26083
|
+
y: number()
|
|
26084
|
+
});
|
|
26085
|
+
/**
|
|
26086
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
26087
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
26088
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
26089
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
26090
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
26091
|
+
* that are not dictionary entries.
|
|
26092
|
+
*
|
|
26093
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
26094
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
26095
|
+
* map-coordinate plumbing is wired.
|
|
26096
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
26097
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
26098
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
26099
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
26100
|
+
* camera-service control; needs an active stream).
|
|
26101
|
+
*/
|
|
26102
|
+
var NavigationFeaturesSchema = object({
|
|
26103
|
+
move: boolean(),
|
|
26104
|
+
stop: boolean(),
|
|
26105
|
+
goToPoint: boolean(),
|
|
26106
|
+
runAction: boolean(),
|
|
26107
|
+
playSound: boolean(),
|
|
26108
|
+
light: boolean(),
|
|
26109
|
+
lightMode: boolean()
|
|
26110
|
+
});
|
|
26111
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
26112
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
26113
|
+
/**
|
|
26114
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
26115
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
26116
|
+
* - `following` — person/pet follow is currently armed.
|
|
26117
|
+
* - `flash` — the on-camera fill light is on.
|
|
26118
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
26119
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
26120
|
+
* `lightMode === 'manual'`.
|
|
26121
|
+
*/
|
|
26122
|
+
var NavigationStatusSchema = object({
|
|
26123
|
+
mode: _enum([
|
|
26124
|
+
"idle",
|
|
26125
|
+
"cleaning",
|
|
26126
|
+
"spot",
|
|
26127
|
+
"following",
|
|
26128
|
+
"goto",
|
|
26129
|
+
"returning",
|
|
26130
|
+
"paused",
|
|
26131
|
+
"unknown"
|
|
26132
|
+
]),
|
|
26133
|
+
following: boolean(),
|
|
26134
|
+
flash: boolean(),
|
|
26135
|
+
lightMode: NavigationLightModeSchema,
|
|
26136
|
+
lightLevel: number().min(40).max(100),
|
|
26137
|
+
/** Ms epoch when the slice was last updated. */
|
|
26138
|
+
lastChangedAt: number()
|
|
26139
|
+
});
|
|
26140
|
+
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
26141
|
+
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({
|
|
26142
|
+
deviceId: number(),
|
|
26143
|
+
actionId: NavigationActionIdSchema
|
|
26144
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26145
|
+
deviceId: number(),
|
|
26146
|
+
soundId: number().int()
|
|
26147
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26148
|
+
deviceId: number(),
|
|
26149
|
+
on: boolean()
|
|
26150
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26151
|
+
deviceId: number(),
|
|
26152
|
+
mode: NavigationLightModeSchema,
|
|
26153
|
+
level: number().min(40).max(100).optional()
|
|
26154
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
26155
|
+
deviceId: number(),
|
|
26156
|
+
level: number().min(40).max(100)
|
|
26157
|
+
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
26158
|
+
deviceId: number(),
|
|
26159
|
+
status: NavigationStatusSchema
|
|
26160
|
+
});
|
|
26161
|
+
/**
|
|
26162
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
26163
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
26164
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
26165
|
+
* one Home Assistant projection.
|
|
26166
|
+
*/
|
|
26167
|
+
var NetworkLinkStatusSchema = object({
|
|
26168
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
26169
|
+
type: _enum([
|
|
26170
|
+
"wifi",
|
|
26171
|
+
"ethernet",
|
|
26172
|
+
"cellular",
|
|
26173
|
+
"unknown"
|
|
26174
|
+
]),
|
|
26175
|
+
/**
|
|
26176
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
26177
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
26178
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
26179
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
26180
|
+
* SKIP a null rather than coerce it.
|
|
26181
|
+
*/
|
|
26182
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
26183
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
26184
|
+
rssiDbm: number().optional(),
|
|
26185
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
26186
|
+
ssid: string().optional(),
|
|
26187
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
26188
|
+
lastUpdated: number()
|
|
26189
|
+
});
|
|
26190
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
|
|
26191
|
+
deviceId: number(),
|
|
26192
|
+
status: NetworkLinkStatusSchema
|
|
26193
|
+
});
|
|
26194
|
+
/**
|
|
25871
26195
|
* network-quality — system-scoped singleton capability tracking RTT,
|
|
25872
26196
|
* jitter, and observed/peak bandwidth per device + per client.
|
|
25873
26197
|
*
|
|
@@ -27109,203 +27433,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
27109
27433
|
deviceId: number(),
|
|
27110
27434
|
status: PtzAutotrackStatusSchema
|
|
27111
27435
|
});
|
|
27112
|
-
/**
|
|
27113
|
-
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
27114
|
-
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
27115
|
-
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
27116
|
-
*
|
|
27117
|
-
* Why a NEW cap rather than overloading `ptz`:
|
|
27118
|
-
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
27119
|
-
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
27120
|
-
* The two are different physical models: PTZ is absolute-position + presets,
|
|
27121
|
-
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
27122
|
-
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
27123
|
-
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
27124
|
-
* the reverse:
|
|
27125
|
-
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
27126
|
-
* / `getOptions`), and
|
|
27127
|
-
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
27128
|
-
* robot camera shows up in the existing PTZ control path without every
|
|
27129
|
-
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
27130
|
-
* not here (see the addon design note):
|
|
27131
|
-
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
27132
|
-
* ptz.stop() → navigation.stop()
|
|
27133
|
-
* ptz.goHome() → navigation.runAction('goHome')
|
|
27134
|
-
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
27135
|
-
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
27136
|
-
*
|
|
27137
|
-
* ## Continuous drive
|
|
27138
|
-
*
|
|
27139
|
-
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
27140
|
-
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
27141
|
-
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
27142
|
-
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
27143
|
-
* coalesce them. The UI owns the cadence.
|
|
27144
|
-
*
|
|
27145
|
-
* ## The action dictionary
|
|
27146
|
-
*
|
|
27147
|
-
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
27148
|
-
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
27149
|
-
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
27150
|
-
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
27151
|
-
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
27152
|
-
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
27153
|
-
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
27154
|
-
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
27155
|
-
*
|
|
27156
|
-
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
27157
|
-
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
27158
|
-
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
27159
|
-
* every device handle. A future nodedreame publish adds a typed
|
|
27160
|
-
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
27161
|
-
* provider can then swap the raw calls for the typed methods with no change to
|
|
27162
|
-
* THIS contract.
|
|
27163
|
-
*/
|
|
27164
|
-
/**
|
|
27165
|
-
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
27166
|
-
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
27167
|
-
* halts it.
|
|
27168
|
-
*
|
|
27169
|
-
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
27170
|
-
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
27171
|
-
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
27172
|
-
* vector by it (drivers without proportional drive ignore it).
|
|
27173
|
-
*
|
|
27174
|
-
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
27175
|
-
* axis alone; an all-undefined nudge is a no-op.
|
|
27176
|
-
*/
|
|
27177
|
-
var NavigationMoveCommandSchema = object({
|
|
27178
|
-
pan: number().min(-1).max(1).optional(),
|
|
27179
|
-
tilt: number().min(-1).max(1).optional(),
|
|
27180
|
-
speed: number().min(0).max(1).optional()
|
|
27181
|
-
});
|
|
27182
|
-
/**
|
|
27183
|
-
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
27184
|
-
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
27185
|
-
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
27186
|
-
* `playSound` (see the `sound` dictionary entries).
|
|
27187
|
-
*/
|
|
27188
|
-
var NavigationActionIdSchema = _enum([
|
|
27189
|
-
"goHome",
|
|
27190
|
-
"locate",
|
|
27191
|
-
"spotClean",
|
|
27192
|
-
"findPet",
|
|
27193
|
-
"personFollow",
|
|
27194
|
-
"stop",
|
|
27195
|
-
"startClean",
|
|
27196
|
-
"pauseClean",
|
|
27197
|
-
"dockWash",
|
|
27198
|
-
"autoEmpty",
|
|
27199
|
-
"flashOn",
|
|
27200
|
-
"flashOff"
|
|
27201
|
-
]);
|
|
27202
|
-
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
27203
|
-
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
27204
|
-
/**
|
|
27205
|
-
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
27206
|
-
* native panel and the PTZ mimic render as a button.
|
|
27207
|
-
*
|
|
27208
|
-
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
27209
|
-
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
27210
|
-
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
27211
|
-
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
27212
|
-
* - `label` — operator-facing English label.
|
|
27213
|
-
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
27214
|
-
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
27215
|
-
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
27216
|
-
* flips it from config, never by editing code.
|
|
27217
|
-
*/
|
|
27218
|
-
var NavigationActionEntrySchema = object({
|
|
27219
|
-
id: string(),
|
|
27220
|
-
kind: NavigationEntryKindSchema,
|
|
27221
|
-
label: string(),
|
|
27222
|
-
icon: string(),
|
|
27223
|
-
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
27224
|
-
soundId: number().int().optional(),
|
|
27225
|
-
/** Per-device feature flag — render this entry only when true. */
|
|
27226
|
-
enabled: boolean()
|
|
27227
|
-
});
|
|
27228
|
-
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
27229
|
-
var NavigationPointSchema = object({
|
|
27230
|
-
x: number(),
|
|
27231
|
-
y: number()
|
|
27232
|
-
});
|
|
27233
|
-
/**
|
|
27234
|
-
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
27235
|
-
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
27236
|
-
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
27237
|
-
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
27238
|
-
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
27239
|
-
* that are not dictionary entries.
|
|
27240
|
-
*
|
|
27241
|
-
* - `move` / `stop` — the momentary drive joystick.
|
|
27242
|
-
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
27243
|
-
* map-coordinate plumbing is wired.
|
|
27244
|
-
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
27245
|
-
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
27246
|
-
* - `light` — the on/off fill-light toggle (works anytime).
|
|
27247
|
-
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
27248
|
-
* camera-service control; needs an active stream).
|
|
27249
|
-
*/
|
|
27250
|
-
var NavigationFeaturesSchema = object({
|
|
27251
|
-
move: boolean(),
|
|
27252
|
-
stop: boolean(),
|
|
27253
|
-
goToPoint: boolean(),
|
|
27254
|
-
runAction: boolean(),
|
|
27255
|
-
playSound: boolean(),
|
|
27256
|
-
light: boolean(),
|
|
27257
|
-
lightMode: boolean()
|
|
27258
|
-
});
|
|
27259
|
-
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
27260
|
-
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
27261
|
-
/**
|
|
27262
|
-
* Live navigation state so the UI can reflect what the robot is doing:
|
|
27263
|
-
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
27264
|
-
* - `following` — person/pet follow is currently armed.
|
|
27265
|
-
* - `flash` — the on-camera fill light is on.
|
|
27266
|
-
* - `lightMode` — auto vs manual fill-light mode.
|
|
27267
|
-
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
27268
|
-
* `lightMode === 'manual'`.
|
|
27269
|
-
*/
|
|
27270
|
-
var NavigationStatusSchema = object({
|
|
27271
|
-
mode: _enum([
|
|
27272
|
-
"idle",
|
|
27273
|
-
"cleaning",
|
|
27274
|
-
"spot",
|
|
27275
|
-
"following",
|
|
27276
|
-
"goto",
|
|
27277
|
-
"returning",
|
|
27278
|
-
"paused",
|
|
27279
|
-
"unknown"
|
|
27280
|
-
]),
|
|
27281
|
-
following: boolean(),
|
|
27282
|
-
flash: boolean(),
|
|
27283
|
-
lightMode: NavigationLightModeSchema,
|
|
27284
|
-
lightLevel: number().min(40).max(100),
|
|
27285
|
-
/** Ms epoch when the slice was last updated. */
|
|
27286
|
-
lastChangedAt: number()
|
|
27287
|
-
});
|
|
27288
|
-
NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
27289
|
-
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({
|
|
27290
|
-
deviceId: number(),
|
|
27291
|
-
actionId: NavigationActionIdSchema
|
|
27292
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27293
|
-
deviceId: number(),
|
|
27294
|
-
soundId: number().int()
|
|
27295
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27296
|
-
deviceId: number(),
|
|
27297
|
-
on: boolean()
|
|
27298
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27299
|
-
deviceId: number(),
|
|
27300
|
-
mode: NavigationLightModeSchema,
|
|
27301
|
-
level: number().min(40).max(100).optional()
|
|
27302
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
27303
|
-
deviceId: number(),
|
|
27304
|
-
level: number().min(40).max(100)
|
|
27305
|
-
}), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
|
|
27306
|
-
deviceId: number(),
|
|
27307
|
-
status: NavigationStatusSchema
|
|
27308
|
-
});
|
|
27309
27436
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
27310
27437
|
kind: "mutation",
|
|
27311
27438
|
auth: "admin"
|
|
@@ -34614,13 +34741,13 @@ Object.freeze({
|
|
|
34614
34741
|
addonId: null,
|
|
34615
34742
|
access: "view"
|
|
34616
34743
|
},
|
|
34617
|
-
"storage.
|
|
34744
|
+
"storage.list": {
|
|
34618
34745
|
capName: "storage",
|
|
34619
34746
|
capScope: "system",
|
|
34620
34747
|
addonId: null,
|
|
34621
34748
|
access: "view"
|
|
34622
34749
|
},
|
|
34623
|
-
"storage.
|
|
34750
|
+
"storage.listDrainProgress": {
|
|
34624
34751
|
capName: "storage",
|
|
34625
34752
|
capScope: "system",
|
|
34626
34753
|
addonId: null,
|
|
@@ -34770,6 +34897,12 @@ Object.freeze({
|
|
|
34770
34897
|
addonId: null,
|
|
34771
34898
|
access: "view"
|
|
34772
34899
|
},
|
|
34900
|
+
"storageOccupancy.getOccupancy": {
|
|
34901
|
+
capName: "storage-occupancy",
|
|
34902
|
+
capScope: "system",
|
|
34903
|
+
addonId: null,
|
|
34904
|
+
access: "view"
|
|
34905
|
+
},
|
|
34773
34906
|
"storageProvider.abortUpload": {
|
|
34774
34907
|
capName: "storage-provider",
|
|
34775
34908
|
capScope: "system",
|