@camstack/addon-provider-dreo 0.2.78 → 0.2.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +621 -488
  2. package/dist/addon.mjs +621 -488
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
37
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
38
38
  //#endregion
39
- //#region ../types/dist/event-category-zAv7pMUz.mjs
39
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
40
40
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
41
41
  EventCategory["SystemBoot"] = "system.boot";
42
42
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -231,6 +231,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
231
231
  EventCategory["ProcessCrashed"] = "process.crashed";
232
232
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
233
233
  EventCategory["ProcessRestarted"] = "process.restarted";
234
+ /**
235
+ * The SET of storage locations changed — one was created, edited, enabled,
236
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
237
+ *
238
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
239
+ * it must also converge on its own periodic path, because a dropped event
240
+ * must not leave a node writing to yesterday's disk set forever. It exists
241
+ * because there was NO signal at all — an operator who added a second
242
+ * recordings disk in the admin UI got nothing, and the recorder kept its
243
+ * resolved locations until something else happened to re-resolve them
244
+ * (D387). Payload `StorageLocationsChangedPayload`.
245
+ */
246
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
234
247
  EventCategory["RecordingStarted"] = "recording.started";
235
248
  EventCategory["RecordingStopped"] = "recording.stopped";
236
249
  EventCategory["RecordingError"] = "recording.error";
@@ -7652,111 +7665,6 @@ var CameraSwitchGroupSchema = object({
7652
7665
  fetchedAt: number()
7653
7666
  });
7654
7667
  /**
7655
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7656
- * an addon declares its channels in.
7657
- *
7658
- * ## Two axes, deliberately separated
7659
- *
7660
- * - **DECLARATION** — which channels exist. Only the addon knows:
7661
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7662
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7663
- * and rots silently. So a channel is declared where it is consulted, and the
7664
- * `log-channels` capability enumerates the declarations.
7665
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7666
- * thing: the logging settings document on the `system` cap. Two authorities
7667
- * over the values is the exact defect
7668
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7669
- * remove; re-introducing it from the cure side would be grotesque.
7670
- *
7671
- * Nothing in this file reads a clock, an env var or a store. The registry is
7672
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7673
- * the hot path with a value somebody actually read, and by
7674
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7675
- * never reaches here, so it can neither disarm an armed channel nor arm a
7676
- * disarmed one (D49).
7677
- *
7678
- * ## The canonical call shape
7679
- *
7680
- * ```ts
7681
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7682
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7683
- * }
7684
- * ```
7685
- *
7686
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7687
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7688
- * object literal is never constructed because it lives inside the branch. It
7689
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7690
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7691
- * destination floor (measured at 1.93 ns/call when off).
7692
- *
7693
- * ## Why a channel emits at `info`
7694
- *
7695
- * `loki-logging.addon.ts` pins the destination default at `info` and
7696
- * `loki-destination.ts` drops everything below it, so a line emitted at
7697
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7698
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7699
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7700
- * emits at the channel's declared level, whose schema floor is `info`.
7701
- */
7702
- /**
7703
- * The level a channel writes at once armed.
7704
- *
7705
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7706
- * not leave the process for Loki, and the whole point of arming a channel is
7707
- * to read it later.
7708
- */
7709
- var LogChannelLevelSchema = _enum([
7710
- "info",
7711
- "warn",
7712
- "error"
7713
- ]);
7714
- /**
7715
- * What an addon declares about one channel. No value, no state — a
7716
- * declaration is inert.
7717
- */
7718
- var LogChannelDescriptorSchema = object({
7719
- /**
7720
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7721
- * the addon's short name so an operator reading a channel list can tell who
7722
- * owns it without a second lookup.
7723
- */
7724
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7725
- /** One sentence: what the operator will SEE after arming it. */
7726
- description: string().min(1),
7727
- /** The level its lines are emitted at. Never below `info`. */
7728
- defaultLevel: LogChannelLevelSchema,
7729
- /**
7730
- * Whether this channel can be narrowed to a camera.
7731
- *
7732
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7733
- * consulted with the numeric device id, AND every line the channel admits
7734
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7735
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7736
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7737
- * the body is the only way to filter.
7738
- *
7739
- * A channel whose lines carry the device only in `meta` (or not at all) is
7740
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7741
- * the operator narrows to one camera, sees nothing, and concludes the code
7742
- * path was never taken.
7743
- */
7744
- perDevice: boolean()
7745
- });
7746
- /**
7747
- * An armed window over one channel, as the document hands it to a mirror.
7748
- *
7749
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7750
- * expires by itself, which is the one failure a boolean cannot avoid.
7751
- */
7752
- var LogChannelWindowSchema = object({
7753
- channel: string().min(1),
7754
- /** Epoch ms the window closes at. */
7755
- armedUntilMs: number(),
7756
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7757
- deviceIds: array(number().int()).readonly().nullable()
7758
- });
7759
- /**
7760
7668
  * Ops-log — the durable, append-only operations audit shared by the
7761
7669
  * recordings and events management surfaces.
7762
7670
  *
@@ -8678,6 +8586,21 @@ var StorageCleanupJobSchema = object({
8678
8586
  });
8679
8587
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8680
8588
  /**
8589
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8590
+ * alias below is `z.infer<>` of it, never a second spelling.
8591
+ */
8592
+ var StorageLocationModeSchema = _enum([
8593
+ "active",
8594
+ "readonly",
8595
+ "drain",
8596
+ "disabled"
8597
+ ]);
8598
+ _enum([
8599
+ "normal",
8600
+ "never",
8601
+ "drain"
8602
+ ]);
8603
+ /**
8681
8604
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8682
8605
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8683
8606
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8702,8 +8625,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8702
8625
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8703
8626
  *
8704
8627
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8705
- * The default location for a type uses `id === <type>:default` by
8706
- * convention (the bare type ref like `'backups'` resolves to it).
8628
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8629
+ * There is no default location any more (D383): `enabled` is the whole write
8630
+ * model, and a bare type ref resolves to the sole location of the type, or —
8631
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8632
+ * slug is `default`.
8707
8633
  *
8708
8634
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8709
8635
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8724,23 +8650,37 @@ var StorageLocationSchema = object({
8724
8650
  * flag at upsert time, not here (the schema is provider-agnostic).
8725
8651
  */
8726
8652
  nodeId: string().optional(),
8727
- isDefault: boolean().default(false),
8728
8653
  isSystem: boolean().default(false),
8729
8654
  /**
8730
- * Operator opt-in: whether consumers that BALANCE across several locations
8731
- * of a type may write here. Recordings reads it today; event media and
8732
- * backups are the next consumers, which is why the flag lives on the
8733
- * location rather than in any one addon's store — nothing has to be
8734
- * extended to add the next consumer.
8655
+ * THE write switch, and the only one (D383). `enabled: true` means every
8656
+ * consumer that chooses a write target for this type may write here, and all
8657
+ * enabled locations of a type are used TOGETHER; `false` means read-only —
8658
+ * still read, still played back, still age-swept, still drained, never
8659
+ * written.
8735
8660
  *
8736
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8737
- * flag existed reads back with no flag and keeps working exactly as before;
8738
- * that is the whole compat story, and it is why no migration ships with it.
8739
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8740
- * disk must not silently start writing to it); the default of a type is
8741
- * always stamped `true`.
8661
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8662
+ * stored" on an update and "born inert unless it is the first location of its
8663
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8664
+ * enabled — {@link isLocationEnabled} is the one place that says so, and the
8665
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8666
+ * stops existing rather than being re-derived on every read.
8742
8667
  */
8743
8668
  enabled: boolean().optional(),
8669
+ /**
8670
+ * THE state of this location (D385), and the only authority on what may be
8671
+ * written, read or evicted here. Interpreted in exactly one place —
8672
+ * `storage-location-mode.ts` — which also folds the legacy
8673
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8674
+ * ambiguous.
8675
+ *
8676
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8677
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8678
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8679
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8680
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8681
+ * either, so the two cannot disagree.
8682
+ */
8683
+ mode: StorageLocationModeSchema.optional(),
8744
8684
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8745
8685
  * for node-local locations it can reach) — never persisted, absent when the
8746
8686
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8748,13 +8688,50 @@ var StorageLocationSchema = object({
8748
8688
  totalBytes: number(),
8749
8689
  availableBytes: number()
8750
8690
  }).nullable().optional(),
8691
+ /**
8692
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8693
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8694
+ * never persisted, never a filesystem walk.
8695
+ *
8696
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8697
+ * location yet — nobody stores here, the owning addon is down, or the first
8698
+ * refresh has not completed. A UI must omit the segment rather than draw it
8699
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8700
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8701
+ * be spelled out loud instead of appearing by accident.
8702
+ *
8703
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8704
+ * about the whole figure rather than about its freshest part.
8705
+ */
8706
+ owned: object({
8707
+ bytes: number().int().nonnegative(),
8708
+ measuredAtMs: number().int().nonnegative()
8709
+ }).optional(),
8751
8710
  createdAt: number(),
8752
8711
  updatedAt: number()
8753
8712
  });
8713
+ object({ isDefault: boolean().optional() });
8714
+ /**
8715
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8716
+ *
8717
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8718
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8719
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8720
+ * operator learns not to believe the screen.
8721
+ */
8722
+ var StorageDrainProgressSchema = object({
8723
+ locationId: string(),
8724
+ startedAtMs: number(),
8725
+ startBytes: number(),
8726
+ bytesRemaining: number(),
8727
+ drained: boolean(),
8728
+ estimatedEmptyAtMs: number().nullable()
8729
+ });
8754
8730
  /**
8755
8731
  * Reference accepted by consumer-facing `api.storage.*` calls.
8756
8732
  * Either:
8757
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8733
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8734
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8758
8735
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8759
8736
  *
8760
8737
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -8930,6 +8907,111 @@ var DecoderSessionConfigSchema = object({
8930
8907
  */
8931
8908
  debug: boolean().optional()
8932
8909
  });
8910
+ /**
8911
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8912
+ * an addon declares its channels in.
8913
+ *
8914
+ * ## Two axes, deliberately separated
8915
+ *
8916
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8917
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8918
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8919
+ * and rots silently. So a channel is declared where it is consulted, and the
8920
+ * `log-channels` capability enumerates the declarations.
8921
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8922
+ * thing: the logging settings document on the `system` cap. Two authorities
8923
+ * over the values is the exact defect
8924
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8925
+ * remove; re-introducing it from the cure side would be grotesque.
8926
+ *
8927
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8928
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8929
+ * the hot path with a value somebody actually read, and by
8930
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8931
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8932
+ * disarmed one (D49).
8933
+ *
8934
+ * ## The canonical call shape
8935
+ *
8936
+ * ```ts
8937
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8938
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8939
+ * }
8940
+ * ```
8941
+ *
8942
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8943
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8944
+ * object literal is never constructed because it lives inside the branch. It
8945
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8946
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
8947
+ * destination floor (measured at 1.93 ns/call when off).
8948
+ *
8949
+ * ## Why a channel emits at `info`
8950
+ *
8951
+ * `loki-logging.addon.ts` pins the destination default at `info` and
8952
+ * `loki-destination.ts` drops everything below it, so a line emitted at
8953
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8954
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
8955
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8956
+ * emits at the channel's declared level, whose schema floor is `info`.
8957
+ */
8958
+ /**
8959
+ * The level a channel writes at once armed.
8960
+ *
8961
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
8962
+ * not leave the process for Loki, and the whole point of arming a channel is
8963
+ * to read it later.
8964
+ */
8965
+ var LogChannelLevelSchema = _enum([
8966
+ "info",
8967
+ "warn",
8968
+ "error"
8969
+ ]);
8970
+ /**
8971
+ * What an addon declares about one channel. No value, no state — a
8972
+ * declaration is inert.
8973
+ */
8974
+ var LogChannelDescriptorSchema = object({
8975
+ /**
8976
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
8977
+ * the addon's short name so an operator reading a channel list can tell who
8978
+ * owns it without a second lookup.
8979
+ */
8980
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
8981
+ /** One sentence: what the operator will SEE after arming it. */
8982
+ description: string().min(1),
8983
+ /** The level its lines are emitted at. Never below `info`. */
8984
+ defaultLevel: LogChannelLevelSchema,
8985
+ /**
8986
+ * Whether this channel can be narrowed to a camera.
8987
+ *
8988
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
8989
+ * consulted with the numeric device id, AND every line the channel admits
8990
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
8991
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
8992
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
8993
+ * the body is the only way to filter.
8994
+ *
8995
+ * A channel whose lines carry the device only in `meta` (or not at all) is
8996
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
8997
+ * the operator narrows to one camera, sees nothing, and concludes the code
8998
+ * path was never taken.
8999
+ */
9000
+ perDevice: boolean()
9001
+ });
9002
+ /**
9003
+ * An armed window over one channel, as the document hands it to a mirror.
9004
+ *
9005
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
9006
+ * expires by itself, which is the one failure a boolean cannot avoid.
9007
+ */
9008
+ var LogChannelWindowSchema = object({
9009
+ channel: string().min(1),
9010
+ /** Epoch ms the window closes at. */
9011
+ armedUntilMs: number(),
9012
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9013
+ deviceIds: array(number().int()).readonly().nullable()
9014
+ });
8933
9015
  var MODEL_FORMATS = [
8934
9016
  "onnx",
8935
9017
  "coreml",
@@ -21979,7 +22061,7 @@ method(object({
21979
22061
  downloadId: string(),
21980
22062
  offset: number(),
21981
22063
  length: number()
21982
- }), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(object({ type: StorageLocationTypeSchema }), StorageLocationSchema.nullable()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
22064
+ }), _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({
21983
22065
  createdAt: true,
21984
22066
  updatedAt: true
21985
22067
  }), StorageLocationSchema, {
@@ -21991,7 +22073,7 @@ method(object({
21991
22073
  }), _void(), {
21992
22074
  kind: "mutation",
21993
22075
  auth: "admin"
21994
- }), method(object({ id: string() }), object({
22076
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21995
22077
  ok: boolean(),
21996
22078
  error: string().optional()
21997
22079
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22061,6 +22143,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22061
22143
  kind: "mutation",
22062
22144
  auth: "admin"
22063
22145
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22146
+ /**
22147
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22148
+ * location (D388).
22149
+ *
22150
+ * ## Why this is not `storage-evictable`
22151
+ *
22152
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22153
+ * not, in two ways that both matter and both bite hardest on the locations an
22154
+ * operator most wants a figure for:
22155
+ *
22156
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22157
+ * and `recordingsLow:default` deliberately share one root and evict as one
22158
+ * oldest-first pool, so both answer with the SAME combined total. As an
22159
+ * occupancy figure that double-counts the disk.
22160
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22161
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22162
+ * is retiring and staring at.
22163
+ *
22164
+ * So this is its own contract with its own quantity, and the quantity is
22165
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22166
+ * would ever be willing to delete it. A provider that can only answer
22167
+ * "evictable" must not register here — a number that silently means different
22168
+ * things per class is worse than no number.
22169
+ *
22170
+ * ## Absence is an answer
22171
+ *
22172
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22173
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22174
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22175
+ * consuming side has to be written out loud instead of appearing by accident.
22176
+ *
22177
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22178
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22179
+ */
22180
+ /** One provider's occupancy answer for one location. */
22181
+ var StorageOccupancyReportSchema = object({
22182
+ locationId: string(),
22183
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22184
+ * not net of what it is willing to delete. */
22185
+ ownedBytes: number().int().nonnegative(),
22186
+ /** When the provider last actually measured this. The orchestrator carries it
22187
+ * through so a UI can say how old the figure is instead of implying "now". */
22188
+ measuredAtMs: number().int().nonnegative()
22189
+ });
22190
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22064
22191
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22065
22192
  providerId: string().min(1),
22066
22193
  displayName: string().min(1),
@@ -23896,88 +24023,6 @@ onStatusChanged: { data: object({
23896
24023
  volatileStateFields: ["lastUpdated"]
23897
24024
  };
23898
24025
  /**
23899
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23900
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23901
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23902
- * one Home Assistant projection.
23903
- */
23904
- var NetworkLinkStatusSchema = object({
23905
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23906
- type: _enum([
23907
- "wifi",
23908
- "ethernet",
23909
- "cellular",
23910
- "unknown"
23911
- ]),
23912
- /**
23913
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23914
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23915
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23916
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23917
- * SKIP a null rather than coerce it.
23918
- */
23919
- signalPercent: number().min(0).max(100).nullable(),
23920
- /** Raw received signal strength in dBm, when the firmware reports one. */
23921
- rssiDbm: number().optional(),
23922
- /** Network name of a wireless link, when the firmware reports it. */
23923
- ssid: string().optional(),
23924
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23925
- lastUpdated: number()
23926
- });
23927
- var networkLinkCapability = {
23928
- name: "network-link",
23929
- scope: "device",
23930
- deviceNative: true,
23931
- mode: "singleton",
23932
- deviceTypes: [
23933
- DeviceType.Camera,
23934
- DeviceType.Sensor,
23935
- DeviceType.Button,
23936
- DeviceType.Switch,
23937
- DeviceType.Light,
23938
- DeviceType.Lock,
23939
- DeviceType.Siren
23940
- ],
23941
- methods: {},
23942
- events: {
23943
- /**
23944
- * Emitted whenever the cached status changes (a link switch, a signal
23945
- * reading that moved). Mirrored on the parent chain by the
23946
- * DeviceEventPropagator like `battery.onStatusChanged`.
23947
- */
23948
- onStatusChanged: { data: object({
23949
- deviceId: number(),
23950
- status: NetworkLinkStatusSchema
23951
- }) } },
23952
- status: {
23953
- schema: NetworkLinkStatusSchema,
23954
- kind: "push",
23955
- empty: {
23956
- type: "unknown",
23957
- signalPercent: null,
23958
- lastUpdated: 0
23959
- }
23960
- },
23961
- /**
23962
- * Runtime-state slice — every provider stores the same shape under
23963
- * `device.runtimeState['network-link']`, read once by the badge and the
23964
- * Home Assistant projector regardless of the driver.
23965
- */
23966
- runtimeState: NetworkLinkStatusSchema,
23967
- /**
23968
- * Runtime-state durability: **restored** — a link reading is slow to
23969
- * change and a sleeping battery camera may not report for hours; the
23970
- * restored slice is what the badge shows until the next read.
23971
- *
23972
- * See `RuntimeStateDurability`. Enforced by
23973
- * `scripts/check-runtime-state-durability.ts`.
23974
- */
23975
- durability: "restored",
23976
- /** Clock fields: written, but excluded from the compare that decides
23977
- * whether persisting is worth a SQLite commit. */
23978
- volatileStateFields: ["lastUpdated"]
23979
- };
23980
- /**
23981
24026
  * Generic boolean sensor — last-resort fallback when no domain-
23982
24027
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23983
24028
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -27515,6 +27560,369 @@ var nativeObjectDetectionCapability = {
27515
27560
  volatileStateFields: ["lastFetchedAt"]
27516
27561
  };
27517
27562
  /**
27563
+ * `navigation` — a device-scoped capability that natively expresses the FULL
27564
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
27565
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
27566
+ *
27567
+ * Why a NEW cap rather than overloading `ptz`:
27568
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27569
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27570
+ * The two are different physical models: PTZ is absolute-position + presets,
27571
+ * navigation is momentary drive nudges + discrete robot ACTIONS
27572
+ * (dock / spot-clean / follow-pet / go-to-point / …).
27573
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27574
+ * the reverse:
27575
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
27576
+ * / `getOptions`), and
27577
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27578
+ * robot camera shows up in the existing PTZ control path without every
27579
+ * PTZ provider learning about robots. The mapping lives in the adapter,
27580
+ * not here (see the addon design note):
27581
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27582
+ * ptz.stop() → navigation.stop()
27583
+ * ptz.goHome() → navigation.runAction('goHome')
27584
+ * ptz.getPresets() → navigation.listActions() (id→preset)
27585
+ * ptz.goToPreset(id) → navigation.runAction(id)
27586
+ *
27587
+ * ## Continuous drive
27588
+ *
27589
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27590
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27591
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27592
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27593
+ * coalesce them. The UI owns the cadence.
27594
+ *
27595
+ * ## The action dictionary
27596
+ *
27597
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27598
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27599
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27600
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27601
+ * vendor-specific list. `kind: 'action'` entries are triggered with
27602
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27603
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
27604
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27605
+ *
27606
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27607
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27608
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
27609
+ * every device handle. A future nodedreame publish adds a typed
27610
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27611
+ * provider can then swap the raw calls for the typed methods with no change to
27612
+ * THIS contract.
27613
+ */
27614
+ /**
27615
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27616
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27617
+ * halts it.
27618
+ *
27619
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
27620
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27621
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27622
+ * vector by it (drivers without proportional drive ignore it).
27623
+ *
27624
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27625
+ * axis alone; an all-undefined nudge is a no-op.
27626
+ */
27627
+ var NavigationMoveCommandSchema = object({
27628
+ pan: number().min(-1).max(1).optional(),
27629
+ tilt: number().min(-1).max(1).optional(),
27630
+ speed: number().min(0).max(1).optional()
27631
+ });
27632
+ /**
27633
+ * The enumerated discrete actions a navigation-capable robot can perform via
27634
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27635
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
27636
+ * `playSound` (see the `sound` dictionary entries).
27637
+ */
27638
+ var NavigationActionIdSchema = _enum([
27639
+ "goHome",
27640
+ "locate",
27641
+ "spotClean",
27642
+ "findPet",
27643
+ "personFollow",
27644
+ "stop",
27645
+ "startClean",
27646
+ "pauseClean",
27647
+ "dockWash",
27648
+ "autoEmpty",
27649
+ "flashOn",
27650
+ "flashOff"
27651
+ ]);
27652
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27653
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
27654
+ /**
27655
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27656
+ * native panel and the PTZ mimic render as a button.
27657
+ *
27658
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27659
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27660
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
27661
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27662
+ * - `label` — operator-facing English label.
27663
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27664
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27665
+ * PTZ render ONLY enabled entries. Data-driven: the provider
27666
+ * flips it from config, never by editing code.
27667
+ */
27668
+ var NavigationActionEntrySchema = object({
27669
+ id: string(),
27670
+ kind: NavigationEntryKindSchema,
27671
+ label: string(),
27672
+ icon: string(),
27673
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27674
+ soundId: number().int().optional(),
27675
+ /** Per-device feature flag — render this entry only when true. */
27676
+ enabled: boolean()
27677
+ });
27678
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
27679
+ var NavigationPointSchema = object({
27680
+ x: number(),
27681
+ y: number()
27682
+ });
27683
+ /**
27684
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27685
+ * The cap reports which are enabled so the UI / PTZ render only the controls
27686
+ * that are turned on for THIS device. Data-driven: the provider derives these
27687
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27688
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27689
+ * that are not dictionary entries.
27690
+ *
27691
+ * - `move` / `stop` — the momentary drive joystick.
27692
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27693
+ * map-coordinate plumbing is wired.
27694
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27695
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27696
+ * - `light` — the on/off fill-light toggle (works anytime).
27697
+ * - `lightMode` — the auto/manual selector + manual level slider (a
27698
+ * camera-service control; needs an active stream).
27699
+ */
27700
+ var NavigationFeaturesSchema = object({
27701
+ move: boolean(),
27702
+ stop: boolean(),
27703
+ goToPoint: boolean(),
27704
+ runAction: boolean(),
27705
+ playSound: boolean(),
27706
+ light: boolean(),
27707
+ lightMode: boolean()
27708
+ });
27709
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27710
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
27711
+ /**
27712
+ * Live navigation state so the UI can reflect what the robot is doing:
27713
+ * - `mode` — coarse activity (idle / cleaning / following / …).
27714
+ * - `following` — person/pet follow is currently armed.
27715
+ * - `flash` — the on-camera fill light is on.
27716
+ * - `lightMode` — auto vs manual fill-light mode.
27717
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
27718
+ * `lightMode === 'manual'`.
27719
+ */
27720
+ var NavigationStatusSchema = object({
27721
+ mode: _enum([
27722
+ "idle",
27723
+ "cleaning",
27724
+ "spot",
27725
+ "following",
27726
+ "goto",
27727
+ "returning",
27728
+ "paused",
27729
+ "unknown"
27730
+ ]),
27731
+ following: boolean(),
27732
+ flash: boolean(),
27733
+ lightMode: NavigationLightModeSchema,
27734
+ lightLevel: number().min(40).max(100),
27735
+ /** Ms epoch when the slice was last updated. */
27736
+ lastChangedAt: number()
27737
+ });
27738
+ /**
27739
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
27740
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
27741
+ * convention.
27742
+ */
27743
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
27744
+ var navigationCapability = {
27745
+ name: "navigation",
27746
+ scope: "device",
27747
+ deviceNative: true,
27748
+ mode: "singleton",
27749
+ deviceTypes: [DeviceType.Camera],
27750
+ deviceConfig: { ui: {
27751
+ kind: "widget",
27752
+ widgetId: "host/navigation-panel",
27753
+ tab: "navigation",
27754
+ topTab: true,
27755
+ label: "Navigation",
27756
+ order: 0
27757
+ } },
27758
+ methods: {
27759
+ /**
27760
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
27761
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
27762
+ * path) works for any authenticated user, not admin-only. The UI sends
27763
+ * these at ~1 Hz while a control is held; the provider forwards each one to
27764
+ * a single drive write WITHOUT debouncing.
27765
+ */
27766
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27767
+ /** Halt all motion immediately (zero drive vector). */
27768
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
27769
+ /** Send the robot to a point on its live map. */
27770
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27771
+ /**
27772
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
27773
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
27774
+ */
27775
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
27776
+ /**
27777
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
27778
+ * unsupported action ids are rejected by the provider.
27779
+ */
27780
+ runAction: method(object({
27781
+ deviceId: number(),
27782
+ actionId: NavigationActionIdSchema
27783
+ }), _void(), { kind: "mutation" }),
27784
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
27785
+ playSound: method(object({
27786
+ deviceId: number(),
27787
+ soundId: number().int()
27788
+ }), _void(), { kind: "mutation" }),
27789
+ /**
27790
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
27791
+ * works anytime, no active stream required).
27792
+ */
27793
+ setLightOn: method(object({
27794
+ deviceId: number(),
27795
+ on: boolean()
27796
+ }), _void(), { kind: "mutation" }),
27797
+ /**
27798
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
27799
+ * initial `level`. The auto/manual + level control is a CAMERA-service
27800
+ * action that generally needs an active camera stream/monitor session — the
27801
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
27802
+ */
27803
+ setLightMode: method(object({
27804
+ deviceId: number(),
27805
+ mode: NavigationLightModeSchema,
27806
+ level: number().min(40).max(100).optional()
27807
+ }), _void(), { kind: "mutation" }),
27808
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
27809
+ setLightLevel: method(object({
27810
+ deviceId: number(),
27811
+ level: number().min(40).max(100)
27812
+ }), _void(), { kind: "mutation" }),
27813
+ /**
27814
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
27815
+ * controls the UI shows (the per-entry flags for the dictionary come back on
27816
+ * `listActions`).
27817
+ */
27818
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
27819
+ },
27820
+ events: { onStatusChanged: { data: object({
27821
+ deviceId: number(),
27822
+ status: NavigationStatusSchema
27823
+ }) } },
27824
+ status: {
27825
+ schema: NavigationStatusSchema,
27826
+ kind: "push"
27827
+ },
27828
+ /**
27829
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
27830
+ * for live mode / follow / flash changes.
27831
+ */
27832
+ runtimeState: NavigationRuntimeStateSchema,
27833
+ /**
27834
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
27835
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
27836
+ * that. The live handle re-publishes on connect.
27837
+ *
27838
+ * See `RuntimeStateDurability`. Enforced by
27839
+ * `scripts/check-runtime-state-durability.ts`.
27840
+ */
27841
+ durability: "session"
27842
+ };
27843
+ /**
27844
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
27845
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
27846
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
27847
+ * one Home Assistant projection.
27848
+ */
27849
+ var NetworkLinkStatusSchema = object({
27850
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
27851
+ type: _enum([
27852
+ "wifi",
27853
+ "ethernet",
27854
+ "cellular",
27855
+ "unknown"
27856
+ ]),
27857
+ /**
27858
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
27859
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
27860
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
27861
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
27862
+ * SKIP a null rather than coerce it.
27863
+ */
27864
+ signalPercent: number().min(0).max(100).nullable(),
27865
+ /** Raw received signal strength in dBm, when the firmware reports one. */
27866
+ rssiDbm: number().optional(),
27867
+ /** Network name of a wireless link, when the firmware reports it. */
27868
+ ssid: string().optional(),
27869
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
27870
+ lastUpdated: number()
27871
+ });
27872
+ var networkLinkCapability = {
27873
+ name: "network-link",
27874
+ scope: "device",
27875
+ deviceNative: true,
27876
+ mode: "singleton",
27877
+ deviceTypes: [
27878
+ DeviceType.Camera,
27879
+ DeviceType.Sensor,
27880
+ DeviceType.Button,
27881
+ DeviceType.Switch,
27882
+ DeviceType.Light,
27883
+ DeviceType.Lock,
27884
+ DeviceType.Siren
27885
+ ],
27886
+ methods: {},
27887
+ events: {
27888
+ /**
27889
+ * Emitted whenever the cached status changes (a link switch, a signal
27890
+ * reading that moved). Mirrored on the parent chain by the
27891
+ * DeviceEventPropagator like `battery.onStatusChanged`.
27892
+ */
27893
+ onStatusChanged: { data: object({
27894
+ deviceId: number(),
27895
+ status: NetworkLinkStatusSchema
27896
+ }) } },
27897
+ status: {
27898
+ schema: NetworkLinkStatusSchema,
27899
+ kind: "push",
27900
+ empty: {
27901
+ type: "unknown",
27902
+ signalPercent: null,
27903
+ lastUpdated: 0
27904
+ }
27905
+ },
27906
+ /**
27907
+ * Runtime-state slice — every provider stores the same shape under
27908
+ * `device.runtimeState['network-link']`, read once by the badge and the
27909
+ * Home Assistant projector regardless of the driver.
27910
+ */
27911
+ runtimeState: NetworkLinkStatusSchema,
27912
+ /**
27913
+ * Runtime-state durability: **restored** — a link reading is slow to
27914
+ * change and a sleeping battery camera may not report for hours; the
27915
+ * restored slice is what the badge shows until the next read.
27916
+ *
27917
+ * See `RuntimeStateDurability`. Enforced by
27918
+ * `scripts/check-runtime-state-durability.ts`.
27919
+ */
27920
+ durability: "restored",
27921
+ /** Clock fields: written, but excluded from the compare that decides
27922
+ * whether persisting is worth a SQLite commit. */
27923
+ volatileStateFields: ["lastUpdated"]
27924
+ };
27925
+ /**
27518
27926
  * network-quality — system-scoped singleton capability tracking RTT,
27519
27927
  * jitter, and observed/peak bandwidth per device + per client.
27520
27928
  *
@@ -29095,287 +29503,6 @@ var ptzAutotrackCapability = {
29095
29503
  */
29096
29504
  durability: "session"
29097
29505
  };
29098
- /**
29099
- * `navigation` — a device-scoped capability that natively expresses the FULL
29100
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
29101
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
29102
- *
29103
- * Why a NEW cap rather than overloading `ptz`:
29104
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29105
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29106
- * The two are different physical models: PTZ is absolute-position + presets,
29107
- * navigation is momentary drive nudges + discrete robot ACTIONS
29108
- * (dock / spot-clean / follow-pet / go-to-point / …).
29109
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29110
- * the reverse:
29111
- * 1. a native CamStack navigation panel (data-driven from `listActions`
29112
- * / `getOptions`), and
29113
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29114
- * robot camera shows up in the existing PTZ control path without every
29115
- * PTZ provider learning about robots. The mapping lives in the adapter,
29116
- * not here (see the addon design note):
29117
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29118
- * ptz.stop() → navigation.stop()
29119
- * ptz.goHome() → navigation.runAction('goHome')
29120
- * ptz.getPresets() → navigation.listActions() (id→preset)
29121
- * ptz.goToPreset(id) → navigation.runAction(id)
29122
- *
29123
- * ## Continuous drive
29124
- *
29125
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29126
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29127
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29128
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29129
- * coalesce them. The UI owns the cadence.
29130
- *
29131
- * ## The action dictionary
29132
- *
29133
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29134
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29135
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29136
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29137
- * vendor-specific list. `kind: 'action'` entries are triggered with
29138
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29139
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
29140
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29141
- *
29142
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29143
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29144
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
29145
- * every device handle. A future nodedreame publish adds a typed
29146
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29147
- * provider can then swap the raw calls for the typed methods with no change to
29148
- * THIS contract.
29149
- */
29150
- /**
29151
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29152
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29153
- * halts it.
29154
- *
29155
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
29156
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29157
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29158
- * vector by it (drivers without proportional drive ignore it).
29159
- *
29160
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29161
- * axis alone; an all-undefined nudge is a no-op.
29162
- */
29163
- var NavigationMoveCommandSchema = object({
29164
- pan: number().min(-1).max(1).optional(),
29165
- tilt: number().min(-1).max(1).optional(),
29166
- speed: number().min(0).max(1).optional()
29167
- });
29168
- /**
29169
- * The enumerated discrete actions a navigation-capable robot can perform via
29170
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29171
- * subset it supports through `listActions`. Sounds are NOT here — they go through
29172
- * `playSound` (see the `sound` dictionary entries).
29173
- */
29174
- var NavigationActionIdSchema = _enum([
29175
- "goHome",
29176
- "locate",
29177
- "spotClean",
29178
- "findPet",
29179
- "personFollow",
29180
- "stop",
29181
- "startClean",
29182
- "pauseClean",
29183
- "dockWash",
29184
- "autoEmpty",
29185
- "flashOn",
29186
- "flashOff"
29187
- ]);
29188
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29189
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
29190
- /**
29191
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29192
- * native panel and the PTZ mimic render as a button.
29193
- *
29194
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29195
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29196
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
29197
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29198
- * - `label` — operator-facing English label.
29199
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29200
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29201
- * PTZ render ONLY enabled entries. Data-driven: the provider
29202
- * flips it from config, never by editing code.
29203
- */
29204
- var NavigationActionEntrySchema = object({
29205
- id: string(),
29206
- kind: NavigationEntryKindSchema,
29207
- label: string(),
29208
- icon: string(),
29209
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29210
- soundId: number().int().optional(),
29211
- /** Per-device feature flag — render this entry only when true. */
29212
- enabled: boolean()
29213
- });
29214
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
29215
- var NavigationPointSchema = object({
29216
- x: number(),
29217
- y: number()
29218
- });
29219
- /**
29220
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29221
- * The cap reports which are enabled so the UI / PTZ render only the controls
29222
- * that are turned on for THIS device. Data-driven: the provider derives these
29223
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29224
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29225
- * that are not dictionary entries.
29226
- *
29227
- * - `move` / `stop` — the momentary drive joystick.
29228
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29229
- * map-coordinate plumbing is wired.
29230
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29231
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29232
- * - `light` — the on/off fill-light toggle (works anytime).
29233
- * - `lightMode` — the auto/manual selector + manual level slider (a
29234
- * camera-service control; needs an active stream).
29235
- */
29236
- var NavigationFeaturesSchema = object({
29237
- move: boolean(),
29238
- stop: boolean(),
29239
- goToPoint: boolean(),
29240
- runAction: boolean(),
29241
- playSound: boolean(),
29242
- light: boolean(),
29243
- lightMode: boolean()
29244
- });
29245
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29246
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
29247
- /**
29248
- * Live navigation state so the UI can reflect what the robot is doing:
29249
- * - `mode` — coarse activity (idle / cleaning / following / …).
29250
- * - `following` — person/pet follow is currently armed.
29251
- * - `flash` — the on-camera fill light is on.
29252
- * - `lightMode` — auto vs manual fill-light mode.
29253
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
29254
- * `lightMode === 'manual'`.
29255
- */
29256
- var NavigationStatusSchema = object({
29257
- mode: _enum([
29258
- "idle",
29259
- "cleaning",
29260
- "spot",
29261
- "following",
29262
- "goto",
29263
- "returning",
29264
- "paused",
29265
- "unknown"
29266
- ]),
29267
- following: boolean(),
29268
- flash: boolean(),
29269
- lightMode: NavigationLightModeSchema,
29270
- lightLevel: number().min(40).max(100),
29271
- /** Ms epoch when the slice was last updated. */
29272
- lastChangedAt: number()
29273
- });
29274
- /**
29275
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29276
- * observable). Adds `lastFetchedAt` on top of the status shape per the
29277
- * convention.
29278
- */
29279
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29280
- var navigationCapability = {
29281
- name: "navigation",
29282
- scope: "device",
29283
- deviceNative: true,
29284
- mode: "singleton",
29285
- deviceTypes: [DeviceType.Camera],
29286
- deviceConfig: { ui: {
29287
- kind: "widget",
29288
- widgetId: "host/navigation-panel",
29289
- tab: "navigation",
29290
- topTab: true,
29291
- label: "Navigation",
29292
- order: 0
29293
- } },
29294
- methods: {
29295
- /**
29296
- * Momentary drive nudge (the robot moves). `protected` — mirrors
29297
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29298
- * path) works for any authenticated user, not admin-only. The UI sends
29299
- * these at ~1 Hz while a control is held; the provider forwards each one to
29300
- * a single drive write WITHOUT debouncing.
29301
- */
29302
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29303
- /** Halt all motion immediately (zero drive vector). */
29304
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29305
- /** Send the robot to a point on its live map. */
29306
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29307
- /**
29308
- * Enumerate the discrete controls THIS device supports (data-driven UI +
29309
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29310
- */
29311
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29312
- /**
29313
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29314
- * unsupported action ids are rejected by the provider.
29315
- */
29316
- runAction: method(object({
29317
- deviceId: number(),
29318
- actionId: NavigationActionIdSchema
29319
- }), _void(), { kind: "mutation" }),
29320
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29321
- playSound: method(object({
29322
- deviceId: number(),
29323
- soundId: number().int()
29324
- }), _void(), { kind: "mutation" }),
29325
- /**
29326
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29327
- * works anytime, no active stream required).
29328
- */
29329
- setLightOn: method(object({
29330
- deviceId: number(),
29331
- on: boolean()
29332
- }), _void(), { kind: "mutation" }),
29333
- /**
29334
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29335
- * initial `level`. The auto/manual + level control is a CAMERA-service
29336
- * action that generally needs an active camera stream/monitor session — the
29337
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
29338
- */
29339
- setLightMode: method(object({
29340
- deviceId: number(),
29341
- mode: NavigationLightModeSchema,
29342
- level: number().min(40).max(100).optional()
29343
- }), _void(), { kind: "mutation" }),
29344
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29345
- setLightLevel: method(object({
29346
- deviceId: number(),
29347
- level: number().min(40).max(100)
29348
- }), _void(), { kind: "mutation" }),
29349
- /**
29350
- * Per-device FEATURE-FLAG report for the general primitives — drives which
29351
- * controls the UI shows (the per-entry flags for the dictionary come back on
29352
- * `listActions`).
29353
- */
29354
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29355
- },
29356
- events: { onStatusChanged: { data: object({
29357
- deviceId: number(),
29358
- status: NavigationStatusSchema
29359
- }) } },
29360
- status: {
29361
- schema: NavigationStatusSchema,
29362
- kind: "push"
29363
- },
29364
- /**
29365
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29366
- * for live mode / follow / flash changes.
29367
- */
29368
- runtimeState: NavigationRuntimeStateSchema,
29369
- /**
29370
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
29371
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
29372
- * that. The live handle re-publishes on connect.
29373
- *
29374
- * See `RuntimeStateDurability`. Enforced by
29375
- * `scripts/check-runtime-state-durability.ts`.
29376
- */
29377
- durability: "session"
29378
- };
29379
29506
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29380
29507
  kind: "mutation",
29381
29508
  auth: "admin"
@@ -38832,13 +38959,13 @@ Object.freeze({
38832
38959
  addonId: null,
38833
38960
  access: "view"
38834
38961
  },
38835
- "storage.getDefaultLocation": {
38962
+ "storage.list": {
38836
38963
  capName: "storage",
38837
38964
  capScope: "system",
38838
38965
  addonId: null,
38839
38966
  access: "view"
38840
38967
  },
38841
- "storage.list": {
38968
+ "storage.listDrainProgress": {
38842
38969
  capName: "storage",
38843
38970
  capScope: "system",
38844
38971
  addonId: null,
@@ -38988,6 +39115,12 @@ Object.freeze({
38988
39115
  addonId: null,
38989
39116
  access: "view"
38990
39117
  },
39118
+ "storageOccupancy.getOccupancy": {
39119
+ capName: "storage-occupancy",
39120
+ capScope: "system",
39121
+ addonId: null,
39122
+ access: "view"
39123
+ },
38991
39124
  "storageProvider.abortUpload": {
38992
39125
  capName: "storage-provider",
38993
39126
  capScope: "system",