@camstack/addon-provider-rademacher 0.2.77 → 0.2.79

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
@@ -983,7 +983,7 @@ var Rademacher = class {
983
983
  }
984
984
  };
985
985
  //#endregion
986
- //#region ../types/dist/event-category-zAv7pMUz.mjs
986
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
987
987
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
988
988
  EventCategory["SystemBoot"] = "system.boot";
989
989
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1178,6 +1178,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1178
1178
  EventCategory["ProcessCrashed"] = "process.crashed";
1179
1179
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
1180
1180
  EventCategory["ProcessRestarted"] = "process.restarted";
1181
+ /**
1182
+ * The SET of storage locations changed — one was created, edited, enabled,
1183
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
1184
+ *
1185
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
1186
+ * it must also converge on its own periodic path, because a dropped event
1187
+ * must not leave a node writing to yesterday's disk set forever. It exists
1188
+ * because there was NO signal at all — an operator who added a second
1189
+ * recordings disk in the admin UI got nothing, and the recorder kept its
1190
+ * resolved locations until something else happened to re-resolve them
1191
+ * (D387). Payload `StorageLocationsChangedPayload`.
1192
+ */
1193
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
1181
1194
  EventCategory["RecordingStarted"] = "recording.started";
1182
1195
  EventCategory["RecordingStopped"] = "recording.stopped";
1183
1196
  EventCategory["RecordingError"] = "recording.error";
@@ -8599,111 +8612,6 @@ var CameraSwitchGroupSchema = object({
8599
8612
  fetchedAt: number()
8600
8613
  });
8601
8614
  /**
8602
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
8603
- * an addon declares its channels in.
8604
- *
8605
- * ## Two axes, deliberately separated
8606
- *
8607
- * - **DECLARATION** — which channels exist. Only the addon knows:
8608
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8609
- * baichuan/handshake. A hand-wired central list rots at the first addition,
8610
- * and rots silently. So a channel is declared where it is consulted, and the
8611
- * `log-channels` capability enumerates the declarations.
8612
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
8613
- * thing: the logging settings document on the `system` cap. Two authorities
8614
- * over the values is the exact defect
8615
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8616
- * remove; re-introducing it from the cure side would be grotesque.
8617
- *
8618
- * Nothing in this file reads a clock, an env var or a store. The registry is
8619
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8620
- * the hot path with a value somebody actually read, and by
8621
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8622
- * never reaches here, so it can neither disarm an armed channel nor arm a
8623
- * disarmed one (D49).
8624
- *
8625
- * ## The canonical call shape
8626
- *
8627
- * ```ts
8628
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8629
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8630
- * }
8631
- * ```
8632
- *
8633
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8634
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
8635
- * object literal is never constructed because it lives inside the branch. It
8636
- * is the same shape already proven in production at `stream-broker.ts:1650`,
8637
- * and the same discipline `LoggingGate.allowsDestination` uses for the
8638
- * destination floor (measured at 1.93 ns/call when off).
8639
- *
8640
- * ## Why a channel emits at `info`
8641
- *
8642
- * `loki-logging.addon.ts` pins the destination default at `info` and
8643
- * `loki-destination.ts` drops everything below it, so a line emitted at
8644
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8645
- * minutes. A diagnostic that cannot be read an hour later is worse than no
8646
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8647
- * emits at the channel's declared level, whose schema floor is `info`.
8648
- */
8649
- /**
8650
- * The level a channel writes at once armed.
8651
- *
8652
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
8653
- * not leave the process for Loki, and the whole point of arming a channel is
8654
- * to read it later.
8655
- */
8656
- var LogChannelLevelSchema = _enum([
8657
- "info",
8658
- "warn",
8659
- "error"
8660
- ]);
8661
- /**
8662
- * What an addon declares about one channel. No value, no state — a
8663
- * declaration is inert.
8664
- */
8665
- var LogChannelDescriptorSchema = object({
8666
- /**
8667
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
8668
- * the addon's short name so an operator reading a channel list can tell who
8669
- * owns it without a second lookup.
8670
- */
8671
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
8672
- /** One sentence: what the operator will SEE after arming it. */
8673
- description: string().min(1),
8674
- /** The level its lines are emitted at. Never below `info`. */
8675
- defaultLevel: LogChannelLevelSchema,
8676
- /**
8677
- * Whether this channel can be narrowed to a camera.
8678
- *
8679
- * `true` is a PROMISE with two halves, and both must hold: the gate is
8680
- * consulted with the numeric device id, AND every line the channel admits
8681
- * carries `tags: { deviceId }` with that same numeric id. The second half is
8682
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
8683
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
8684
- * the body is the only way to filter.
8685
- *
8686
- * A channel whose lines carry the device only in `meta` (or not at all) is
8687
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
8688
- * the operator narrows to one camera, sees nothing, and concludes the code
8689
- * path was never taken.
8690
- */
8691
- perDevice: boolean()
8692
- });
8693
- /**
8694
- * An armed window over one channel, as the document hands it to a mirror.
8695
- *
8696
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
8697
- * expires by itself, which is the one failure a boolean cannot avoid.
8698
- */
8699
- var LogChannelWindowSchema = object({
8700
- channel: string().min(1),
8701
- /** Epoch ms the window closes at. */
8702
- armedUntilMs: number(),
8703
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
8704
- deviceIds: array(number().int()).readonly().nullable()
8705
- });
8706
- /**
8707
8615
  * Ops-log — the durable, append-only operations audit shared by the
8708
8616
  * recordings and events management surfaces.
8709
8617
  *
@@ -9625,6 +9533,21 @@ var StorageCleanupJobSchema = object({
9625
9533
  });
9626
9534
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
9627
9535
  /**
9536
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
9537
+ * alias below is `z.infer<>` of it, never a second spelling.
9538
+ */
9539
+ var StorageLocationModeSchema = _enum([
9540
+ "active",
9541
+ "readonly",
9542
+ "drain",
9543
+ "disabled"
9544
+ ]);
9545
+ _enum([
9546
+ "normal",
9547
+ "never",
9548
+ "drain"
9549
+ ]);
9550
+ /**
9628
9551
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
9629
9552
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
9630
9553
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -9649,8 +9572,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
9649
9572
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
9650
9573
  *
9651
9574
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
9652
- * The default location for a type uses `id === <type>:default` by
9653
- * convention (the bare type ref like `'backups'` resolves to it).
9575
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
9576
+ * There is no default location any more (D383): `enabled` is the whole write
9577
+ * model, and a bare type ref resolves to the sole location of the type, or —
9578
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
9579
+ * slug is `default`.
9654
9580
  *
9655
9581
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
9656
9582
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -9671,23 +9597,37 @@ var StorageLocationSchema = object({
9671
9597
  * flag at upsert time, not here (the schema is provider-agnostic).
9672
9598
  */
9673
9599
  nodeId: string().optional(),
9674
- isDefault: boolean().default(false),
9675
9600
  isSystem: boolean().default(false),
9676
9601
  /**
9677
- * Operator opt-in: whether consumers that BALANCE across several locations
9678
- * of a type may write here. Recordings reads it today; event media and
9679
- * backups are the next consumers, which is why the flag lives on the
9680
- * location rather than in any one addon's store — nothing has to be
9681
- * extended to add the next consumer.
9602
+ * THE write switch, and the only one (D383). `enabled: true` means every
9603
+ * consumer that chooses a write target for this type may write here, and all
9604
+ * enabled locations of a type are used TOGETHER; `false` means read-only —
9605
+ * still read, still played back, still age-swept, still drained, never
9606
+ * written.
9682
9607
  *
9683
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
9684
- * flag existed reads back with no flag and keeps working exactly as before;
9685
- * that is the whole compat story, and it is why no migration ships with it.
9686
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
9687
- * disk must not silently start writing to it); the default of a type is
9688
- * always stamped `true`.
9608
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
9609
+ * stored" on an update and "born inert unless it is the first location of its
9610
+ * type" on a create. On a PERSISTED row absence is legacy and it means
9611
+ * enabled — {@link isLocationEnabled} is the one place that says so, and the
9612
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
9613
+ * stops existing rather than being re-derived on every read.
9689
9614
  */
9690
9615
  enabled: boolean().optional(),
9616
+ /**
9617
+ * THE state of this location (D385), and the only authority on what may be
9618
+ * written, read or evicted here. Interpreted in exactly one place —
9619
+ * `storage-location-mode.ts` — which also folds the legacy
9620
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
9621
+ * ambiguous.
9622
+ *
9623
+ * OPTIONAL only for the wire and for rows written before D385: absence is
9624
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
9625
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
9626
+ * re-derived on every read. `enabled` survives one release as a DERIVED
9627
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
9628
+ * either, so the two cannot disagree.
9629
+ */
9630
+ mode: StorageLocationModeSchema.optional(),
9691
9631
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
9692
9632
  * for node-local locations it can reach) — never persisted, absent when the
9693
9633
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -9695,13 +9635,50 @@ var StorageLocationSchema = object({
9695
9635
  totalBytes: number(),
9696
9636
  availableBytes: number()
9697
9637
  }).nullable().optional(),
9638
+ /**
9639
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
9640
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
9641
+ * never persisted, never a filesystem walk.
9642
+ *
9643
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
9644
+ * location yet — nobody stores here, the owning addon is down, or the first
9645
+ * refresh has not completed. A UI must omit the segment rather than draw it
9646
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
9647
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
9648
+ * be spelled out loud instead of appearing by accident.
9649
+ *
9650
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
9651
+ * about the whole figure rather than about its freshest part.
9652
+ */
9653
+ owned: object({
9654
+ bytes: number().int().nonnegative(),
9655
+ measuredAtMs: number().int().nonnegative()
9656
+ }).optional(),
9698
9657
  createdAt: number(),
9699
9658
  updatedAt: number()
9700
9659
  });
9660
+ object({ isDefault: boolean().optional() });
9661
+ /**
9662
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
9663
+ *
9664
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
9665
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
9666
+ * drain with no observed growth has no honest ETA, and inventing one is how an
9667
+ * operator learns not to believe the screen.
9668
+ */
9669
+ var StorageDrainProgressSchema = object({
9670
+ locationId: string(),
9671
+ startedAtMs: number(),
9672
+ startBytes: number(),
9673
+ bytesRemaining: number(),
9674
+ drained: boolean(),
9675
+ estimatedEmptyAtMs: number().nullable()
9676
+ });
9701
9677
  /**
9702
9678
  * Reference accepted by consumer-facing `api.storage.*` calls.
9703
9679
  * Either:
9704
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
9680
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
9681
+ * (transitionally, the `<type>:default`-slugged row when several exist)
9705
9682
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
9706
9683
  *
9707
9684
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -9877,6 +9854,111 @@ var DecoderSessionConfigSchema = object({
9877
9854
  */
9878
9855
  debug: boolean().optional()
9879
9856
  });
9857
+ /**
9858
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
9859
+ * an addon declares its channels in.
9860
+ *
9861
+ * ## Two axes, deliberately separated
9862
+ *
9863
+ * - **DECLARATION** — which channels exist. Only the addon knows:
9864
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
9865
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
9866
+ * and rots silently. So a channel is declared where it is consulted, and the
9867
+ * `log-channels` capability enumerates the declarations.
9868
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
9869
+ * thing: the logging settings document on the `system` cap. Two authorities
9870
+ * over the values is the exact defect
9871
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
9872
+ * remove; re-introducing it from the cure side would be grotesque.
9873
+ *
9874
+ * Nothing in this file reads a clock, an env var or a store. The registry is
9875
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
9876
+ * the hot path with a value somebody actually read, and by
9877
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
9878
+ * never reaches here, so it can neither disarm an armed channel nor arm a
9879
+ * disarmed one (D49).
9880
+ *
9881
+ * ## The canonical call shape
9882
+ *
9883
+ * ```ts
9884
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
9885
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
9886
+ * }
9887
+ * ```
9888
+ *
9889
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
9890
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
9891
+ * object literal is never constructed because it lives inside the branch. It
9892
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
9893
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
9894
+ * destination floor (measured at 1.93 ns/call when off).
9895
+ *
9896
+ * ## Why a channel emits at `info`
9897
+ *
9898
+ * `loki-logging.addon.ts` pins the destination default at `info` and
9899
+ * `loki-destination.ts` drops everything below it, so a line emitted at
9900
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
9901
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
9902
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
9903
+ * emits at the channel's declared level, whose schema floor is `info`.
9904
+ */
9905
+ /**
9906
+ * The level a channel writes at once armed.
9907
+ *
9908
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
9909
+ * not leave the process for Loki, and the whole point of arming a channel is
9910
+ * to read it later.
9911
+ */
9912
+ var LogChannelLevelSchema = _enum([
9913
+ "info",
9914
+ "warn",
9915
+ "error"
9916
+ ]);
9917
+ /**
9918
+ * What an addon declares about one channel. No value, no state — a
9919
+ * declaration is inert.
9920
+ */
9921
+ var LogChannelDescriptorSchema = object({
9922
+ /**
9923
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
9924
+ * the addon's short name so an operator reading a channel list can tell who
9925
+ * owns it without a second lookup.
9926
+ */
9927
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
9928
+ /** One sentence: what the operator will SEE after arming it. */
9929
+ description: string().min(1),
9930
+ /** The level its lines are emitted at. Never below `info`. */
9931
+ defaultLevel: LogChannelLevelSchema,
9932
+ /**
9933
+ * Whether this channel can be narrowed to a camera.
9934
+ *
9935
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
9936
+ * consulted with the numeric device id, AND every line the channel admits
9937
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
9938
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
9939
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
9940
+ * the body is the only way to filter.
9941
+ *
9942
+ * A channel whose lines carry the device only in `meta` (or not at all) is
9943
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
9944
+ * the operator narrows to one camera, sees nothing, and concludes the code
9945
+ * path was never taken.
9946
+ */
9947
+ perDevice: boolean()
9948
+ });
9949
+ /**
9950
+ * An armed window over one channel, as the document hands it to a mirror.
9951
+ *
9952
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
9953
+ * expires by itself, which is the one failure a boolean cannot avoid.
9954
+ */
9955
+ var LogChannelWindowSchema = object({
9956
+ channel: string().min(1),
9957
+ /** Epoch ms the window closes at. */
9958
+ armedUntilMs: number(),
9959
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9960
+ deviceIds: array(number().int()).readonly().nullable()
9961
+ });
9880
9962
  var MODEL_FORMATS = [
9881
9963
  "onnx",
9882
9964
  "coreml",
@@ -22909,7 +22991,7 @@ method(object({
22909
22991
  downloadId: string(),
22910
22992
  offset: number(),
22911
22993
  length: number()
22912
- }), _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({
22994
+ }), _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({
22913
22995
  createdAt: true,
22914
22996
  updatedAt: true
22915
22997
  }), StorageLocationSchema, {
@@ -22921,7 +23003,7 @@ method(object({
22921
23003
  }), _void(), {
22922
23004
  kind: "mutation",
22923
23005
  auth: "admin"
22924
- }), method(object({ id: string() }), object({
23006
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
22925
23007
  ok: boolean(),
22926
23008
  error: string().optional()
22927
23009
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22991,6 +23073,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22991
23073
  kind: "mutation",
22992
23074
  auth: "admin"
22993
23075
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
23076
+ /**
23077
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
23078
+ * location (D388).
23079
+ *
23080
+ * ## Why this is not `storage-evictable`
23081
+ *
23082
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
23083
+ * not, in two ways that both matter and both bite hardest on the locations an
23084
+ * operator most wants a figure for:
23085
+ *
23086
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
23087
+ * and `recordingsLow:default` deliberately share one root and evict as one
23088
+ * oldest-first pool, so both answer with the SAME combined total. As an
23089
+ * occupancy figure that double-counts the disk.
23090
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
23091
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
23092
+ * is retiring and staring at.
23093
+ *
23094
+ * So this is its own contract with its own quantity, and the quantity is
23095
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
23096
+ * would ever be willing to delete it. A provider that can only answer
23097
+ * "evictable" must not register here — a number that silently means different
23098
+ * things per class is worse than no number.
23099
+ *
23100
+ * ## Absence is an answer
23101
+ *
23102
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
23103
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
23104
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
23105
+ * consuming side has to be written out loud instead of appearing by accident.
23106
+ *
23107
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
23108
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
23109
+ */
23110
+ /** One provider's occupancy answer for one location. */
23111
+ var StorageOccupancyReportSchema = object({
23112
+ locationId: string(),
23113
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
23114
+ * not net of what it is willing to delete. */
23115
+ ownedBytes: number().int().nonnegative(),
23116
+ /** When the provider last actually measured this. The orchestrator carries it
23117
+ * through so a UI can say how old the figure is instead of implying "now". */
23118
+ measuredAtMs: number().int().nonnegative()
23119
+ });
23120
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22994
23121
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22995
23122
  providerId: string().min(1),
22996
23123
  displayName: string().min(1),
@@ -24826,88 +24953,6 @@ onStatusChanged: { data: object({
24826
24953
  volatileStateFields: ["lastUpdated"]
24827
24954
  };
24828
24955
  /**
24829
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
24830
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24831
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
24832
- * one Home Assistant projection.
24833
- */
24834
- var NetworkLinkStatusSchema = object({
24835
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24836
- type: _enum([
24837
- "wifi",
24838
- "ethernet",
24839
- "cellular",
24840
- "unknown"
24841
- ]),
24842
- /**
24843
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
24844
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24845
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24846
- * one whose reading has not landed must not be drawn at 0 %. Consumers
24847
- * SKIP a null rather than coerce it.
24848
- */
24849
- signalPercent: number().min(0).max(100).nullable(),
24850
- /** Raw received signal strength in dBm, when the firmware reports one. */
24851
- rssiDbm: number().optional(),
24852
- /** Network name of a wireless link, when the firmware reports it. */
24853
- ssid: string().optional(),
24854
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24855
- lastUpdated: number()
24856
- });
24857
- var networkLinkCapability = {
24858
- name: "network-link",
24859
- scope: "device",
24860
- deviceNative: true,
24861
- mode: "singleton",
24862
- deviceTypes: [
24863
- DeviceType.Camera,
24864
- DeviceType.Sensor,
24865
- DeviceType.Button,
24866
- DeviceType.Switch,
24867
- DeviceType.Light,
24868
- DeviceType.Lock,
24869
- DeviceType.Siren
24870
- ],
24871
- methods: {},
24872
- events: {
24873
- /**
24874
- * Emitted whenever the cached status changes (a link switch, a signal
24875
- * reading that moved). Mirrored on the parent chain by the
24876
- * DeviceEventPropagator like `battery.onStatusChanged`.
24877
- */
24878
- onStatusChanged: { data: object({
24879
- deviceId: number(),
24880
- status: NetworkLinkStatusSchema
24881
- }) } },
24882
- status: {
24883
- schema: NetworkLinkStatusSchema,
24884
- kind: "push",
24885
- empty: {
24886
- type: "unknown",
24887
- signalPercent: null,
24888
- lastUpdated: 0
24889
- }
24890
- },
24891
- /**
24892
- * Runtime-state slice — every provider stores the same shape under
24893
- * `device.runtimeState['network-link']`, read once by the badge and the
24894
- * Home Assistant projector regardless of the driver.
24895
- */
24896
- runtimeState: NetworkLinkStatusSchema,
24897
- /**
24898
- * Runtime-state durability: **restored** — a link reading is slow to
24899
- * change and a sleeping battery camera may not report for hours; the
24900
- * restored slice is what the badge shows until the next read.
24901
- *
24902
- * See `RuntimeStateDurability`. Enforced by
24903
- * `scripts/check-runtime-state-durability.ts`.
24904
- */
24905
- durability: "restored",
24906
- /** Clock fields: written, but excluded from the compare that decides
24907
- * whether persisting is worth a SQLite commit. */
24908
- volatileStateFields: ["lastUpdated"]
24909
- };
24910
- /**
24911
24956
  * Generic boolean sensor — last-resort fallback when no domain-
24912
24957
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24913
24958
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -28437,6 +28482,369 @@ var nativeObjectDetectionCapability = {
28437
28482
  volatileStateFields: ["lastFetchedAt"]
28438
28483
  };
28439
28484
  /**
28485
+ * `navigation` — a device-scoped capability that natively expresses the FULL
28486
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
28487
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
28488
+ *
28489
+ * Why a NEW cap rather than overloading `ptz`:
28490
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
28491
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
28492
+ * The two are different physical models: PTZ is absolute-position + presets,
28493
+ * navigation is momentary drive nudges + discrete robot ACTIONS
28494
+ * (dock / spot-clean / follow-pet / go-to-point / …).
28495
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
28496
+ * the reverse:
28497
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
28498
+ * / `getOptions`), and
28499
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
28500
+ * robot camera shows up in the existing PTZ control path without every
28501
+ * PTZ provider learning about robots. The mapping lives in the adapter,
28502
+ * not here (see the addon design note):
28503
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
28504
+ * ptz.stop() → navigation.stop()
28505
+ * ptz.goHome() → navigation.runAction('goHome')
28506
+ * ptz.getPresets() → navigation.listActions() (id→preset)
28507
+ * ptz.goToPreset(id) → navigation.runAction(id)
28508
+ *
28509
+ * ## Continuous drive
28510
+ *
28511
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
28512
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
28513
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
28514
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
28515
+ * coalesce them. The UI owns the cadence.
28516
+ *
28517
+ * ## The action dictionary
28518
+ *
28519
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
28520
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
28521
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
28522
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
28523
+ * vendor-specific list. `kind: 'action'` entries are triggered with
28524
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
28525
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
28526
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
28527
+ *
28528
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
28529
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
28530
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
28531
+ * every device handle. A future nodedreame publish adds a typed
28532
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
28533
+ * provider can then swap the raw calls for the typed methods with no change to
28534
+ * THIS contract.
28535
+ */
28536
+ /**
28537
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
28538
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
28539
+ * halts it.
28540
+ *
28541
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
28542
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
28543
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
28544
+ * vector by it (drivers without proportional drive ignore it).
28545
+ *
28546
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
28547
+ * axis alone; an all-undefined nudge is a no-op.
28548
+ */
28549
+ var NavigationMoveCommandSchema = object({
28550
+ pan: number().min(-1).max(1).optional(),
28551
+ tilt: number().min(-1).max(1).optional(),
28552
+ speed: number().min(0).max(1).optional()
28553
+ });
28554
+ /**
28555
+ * The enumerated discrete actions a navigation-capable robot can perform via
28556
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
28557
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
28558
+ * `playSound` (see the `sound` dictionary entries).
28559
+ */
28560
+ var NavigationActionIdSchema = _enum([
28561
+ "goHome",
28562
+ "locate",
28563
+ "spotClean",
28564
+ "findPet",
28565
+ "personFollow",
28566
+ "stop",
28567
+ "startClean",
28568
+ "pauseClean",
28569
+ "dockWash",
28570
+ "autoEmpty",
28571
+ "flashOn",
28572
+ "flashOff"
28573
+ ]);
28574
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
28575
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
28576
+ /**
28577
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
28578
+ * native panel and the PTZ mimic render as a button.
28579
+ *
28580
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
28581
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
28582
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
28583
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
28584
+ * - `label` — operator-facing English label.
28585
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
28586
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
28587
+ * PTZ render ONLY enabled entries. Data-driven: the provider
28588
+ * flips it from config, never by editing code.
28589
+ */
28590
+ var NavigationActionEntrySchema = object({
28591
+ id: string(),
28592
+ kind: NavigationEntryKindSchema,
28593
+ label: string(),
28594
+ icon: string(),
28595
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
28596
+ soundId: number().int().optional(),
28597
+ /** Per-device feature flag — render this entry only when true. */
28598
+ enabled: boolean()
28599
+ });
28600
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
28601
+ var NavigationPointSchema = object({
28602
+ x: number(),
28603
+ y: number()
28604
+ });
28605
+ /**
28606
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
28607
+ * The cap reports which are enabled so the UI / PTZ render only the controls
28608
+ * that are turned on for THIS device. Data-driven: the provider derives these
28609
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
28610
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
28611
+ * that are not dictionary entries.
28612
+ *
28613
+ * - `move` / `stop` — the momentary drive joystick.
28614
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
28615
+ * map-coordinate plumbing is wired.
28616
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
28617
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
28618
+ * - `light` — the on/off fill-light toggle (works anytime).
28619
+ * - `lightMode` — the auto/manual selector + manual level slider (a
28620
+ * camera-service control; needs an active stream).
28621
+ */
28622
+ var NavigationFeaturesSchema = object({
28623
+ move: boolean(),
28624
+ stop: boolean(),
28625
+ goToPoint: boolean(),
28626
+ runAction: boolean(),
28627
+ playSound: boolean(),
28628
+ light: boolean(),
28629
+ lightMode: boolean()
28630
+ });
28631
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
28632
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
28633
+ /**
28634
+ * Live navigation state so the UI can reflect what the robot is doing:
28635
+ * - `mode` — coarse activity (idle / cleaning / following / …).
28636
+ * - `following` — person/pet follow is currently armed.
28637
+ * - `flash` — the on-camera fill light is on.
28638
+ * - `lightMode` — auto vs manual fill-light mode.
28639
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
28640
+ * `lightMode === 'manual'`.
28641
+ */
28642
+ var NavigationStatusSchema = object({
28643
+ mode: _enum([
28644
+ "idle",
28645
+ "cleaning",
28646
+ "spot",
28647
+ "following",
28648
+ "goto",
28649
+ "returning",
28650
+ "paused",
28651
+ "unknown"
28652
+ ]),
28653
+ following: boolean(),
28654
+ flash: boolean(),
28655
+ lightMode: NavigationLightModeSchema,
28656
+ lightLevel: number().min(40).max(100),
28657
+ /** Ms epoch when the slice was last updated. */
28658
+ lastChangedAt: number()
28659
+ });
28660
+ /**
28661
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
28662
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
28663
+ * convention.
28664
+ */
28665
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
28666
+ var navigationCapability = {
28667
+ name: "navigation",
28668
+ scope: "device",
28669
+ deviceNative: true,
28670
+ mode: "singleton",
28671
+ deviceTypes: [DeviceType.Camera],
28672
+ deviceConfig: { ui: {
28673
+ kind: "widget",
28674
+ widgetId: "host/navigation-panel",
28675
+ tab: "navigation",
28676
+ topTab: true,
28677
+ label: "Navigation",
28678
+ order: 0
28679
+ } },
28680
+ methods: {
28681
+ /**
28682
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
28683
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
28684
+ * path) works for any authenticated user, not admin-only. The UI sends
28685
+ * these at ~1 Hz while a control is held; the provider forwards each one to
28686
+ * a single drive write WITHOUT debouncing.
28687
+ */
28688
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
28689
+ /** Halt all motion immediately (zero drive vector). */
28690
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
28691
+ /** Send the robot to a point on its live map. */
28692
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
28693
+ /**
28694
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
28695
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
28696
+ */
28697
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
28698
+ /**
28699
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
28700
+ * unsupported action ids are rejected by the provider.
28701
+ */
28702
+ runAction: method(object({
28703
+ deviceId: number(),
28704
+ actionId: NavigationActionIdSchema
28705
+ }), _void(), { kind: "mutation" }),
28706
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
28707
+ playSound: method(object({
28708
+ deviceId: number(),
28709
+ soundId: number().int()
28710
+ }), _void(), { kind: "mutation" }),
28711
+ /**
28712
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
28713
+ * works anytime, no active stream required).
28714
+ */
28715
+ setLightOn: method(object({
28716
+ deviceId: number(),
28717
+ on: boolean()
28718
+ }), _void(), { kind: "mutation" }),
28719
+ /**
28720
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
28721
+ * initial `level`. The auto/manual + level control is a CAMERA-service
28722
+ * action that generally needs an active camera stream/monitor session — the
28723
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
28724
+ */
28725
+ setLightMode: method(object({
28726
+ deviceId: number(),
28727
+ mode: NavigationLightModeSchema,
28728
+ level: number().min(40).max(100).optional()
28729
+ }), _void(), { kind: "mutation" }),
28730
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
28731
+ setLightLevel: method(object({
28732
+ deviceId: number(),
28733
+ level: number().min(40).max(100)
28734
+ }), _void(), { kind: "mutation" }),
28735
+ /**
28736
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
28737
+ * controls the UI shows (the per-entry flags for the dictionary come back on
28738
+ * `listActions`).
28739
+ */
28740
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
28741
+ },
28742
+ events: { onStatusChanged: { data: object({
28743
+ deviceId: number(),
28744
+ status: NavigationStatusSchema
28745
+ }) } },
28746
+ status: {
28747
+ schema: NavigationStatusSchema,
28748
+ kind: "push"
28749
+ },
28750
+ /**
28751
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
28752
+ * for live mode / follow / flash changes.
28753
+ */
28754
+ runtimeState: NavigationRuntimeStateSchema,
28755
+ /**
28756
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
28757
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
28758
+ * that. The live handle re-publishes on connect.
28759
+ *
28760
+ * See `RuntimeStateDurability`. Enforced by
28761
+ * `scripts/check-runtime-state-durability.ts`.
28762
+ */
28763
+ durability: "session"
28764
+ };
28765
+ /**
28766
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
28767
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
28768
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
28769
+ * one Home Assistant projection.
28770
+ */
28771
+ var NetworkLinkStatusSchema = object({
28772
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
28773
+ type: _enum([
28774
+ "wifi",
28775
+ "ethernet",
28776
+ "cellular",
28777
+ "unknown"
28778
+ ]),
28779
+ /**
28780
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
28781
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
28782
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
28783
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
28784
+ * SKIP a null rather than coerce it.
28785
+ */
28786
+ signalPercent: number().min(0).max(100).nullable(),
28787
+ /** Raw received signal strength in dBm, when the firmware reports one. */
28788
+ rssiDbm: number().optional(),
28789
+ /** Network name of a wireless link, when the firmware reports it. */
28790
+ ssid: string().optional(),
28791
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
28792
+ lastUpdated: number()
28793
+ });
28794
+ var networkLinkCapability = {
28795
+ name: "network-link",
28796
+ scope: "device",
28797
+ deviceNative: true,
28798
+ mode: "singleton",
28799
+ deviceTypes: [
28800
+ DeviceType.Camera,
28801
+ DeviceType.Sensor,
28802
+ DeviceType.Button,
28803
+ DeviceType.Switch,
28804
+ DeviceType.Light,
28805
+ DeviceType.Lock,
28806
+ DeviceType.Siren
28807
+ ],
28808
+ methods: {},
28809
+ events: {
28810
+ /**
28811
+ * Emitted whenever the cached status changes (a link switch, a signal
28812
+ * reading that moved). Mirrored on the parent chain by the
28813
+ * DeviceEventPropagator like `battery.onStatusChanged`.
28814
+ */
28815
+ onStatusChanged: { data: object({
28816
+ deviceId: number(),
28817
+ status: NetworkLinkStatusSchema
28818
+ }) } },
28819
+ status: {
28820
+ schema: NetworkLinkStatusSchema,
28821
+ kind: "push",
28822
+ empty: {
28823
+ type: "unknown",
28824
+ signalPercent: null,
28825
+ lastUpdated: 0
28826
+ }
28827
+ },
28828
+ /**
28829
+ * Runtime-state slice — every provider stores the same shape under
28830
+ * `device.runtimeState['network-link']`, read once by the badge and the
28831
+ * Home Assistant projector regardless of the driver.
28832
+ */
28833
+ runtimeState: NetworkLinkStatusSchema,
28834
+ /**
28835
+ * Runtime-state durability: **restored** — a link reading is slow to
28836
+ * change and a sleeping battery camera may not report for hours; the
28837
+ * restored slice is what the badge shows until the next read.
28838
+ *
28839
+ * See `RuntimeStateDurability`. Enforced by
28840
+ * `scripts/check-runtime-state-durability.ts`.
28841
+ */
28842
+ durability: "restored",
28843
+ /** Clock fields: written, but excluded from the compare that decides
28844
+ * whether persisting is worth a SQLite commit. */
28845
+ volatileStateFields: ["lastUpdated"]
28846
+ };
28847
+ /**
28440
28848
  * network-quality — system-scoped singleton capability tracking RTT,
28441
28849
  * jitter, and observed/peak bandwidth per device + per client.
28442
28850
  *
@@ -30017,287 +30425,6 @@ var ptzAutotrackCapability = {
30017
30425
  */
30018
30426
  durability: "session"
30019
30427
  };
30020
- /**
30021
- * `navigation` — a device-scoped capability that natively expresses the FULL
30022
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
30023
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
30024
- *
30025
- * Why a NEW cap rather than overloading `ptz`:
30026
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
30027
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
30028
- * The two are different physical models: PTZ is absolute-position + presets,
30029
- * navigation is momentary drive nudges + discrete robot ACTIONS
30030
- * (dock / spot-clean / follow-pet / go-to-point / …).
30031
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
30032
- * the reverse:
30033
- * 1. a native CamStack navigation panel (data-driven from `listActions`
30034
- * / `getOptions`), and
30035
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
30036
- * robot camera shows up in the existing PTZ control path without every
30037
- * PTZ provider learning about robots. The mapping lives in the adapter,
30038
- * not here (see the addon design note):
30039
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
30040
- * ptz.stop() → navigation.stop()
30041
- * ptz.goHome() → navigation.runAction('goHome')
30042
- * ptz.getPresets() → navigation.listActions() (id→preset)
30043
- * ptz.goToPreset(id) → navigation.runAction(id)
30044
- *
30045
- * ## Continuous drive
30046
- *
30047
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
30048
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
30049
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
30050
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
30051
- * coalesce them. The UI owns the cadence.
30052
- *
30053
- * ## The action dictionary
30054
- *
30055
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
30056
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
30057
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
30058
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
30059
- * vendor-specific list. `kind: 'action'` entries are triggered with
30060
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
30061
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
30062
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
30063
- *
30064
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
30065
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
30066
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
30067
- * every device handle. A future nodedreame publish adds a typed
30068
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
30069
- * provider can then swap the raw calls for the typed methods with no change to
30070
- * THIS contract.
30071
- */
30072
- /**
30073
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
30074
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
30075
- * halts it.
30076
- *
30077
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
30078
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
30079
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
30080
- * vector by it (drivers without proportional drive ignore it).
30081
- *
30082
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
30083
- * axis alone; an all-undefined nudge is a no-op.
30084
- */
30085
- var NavigationMoveCommandSchema = object({
30086
- pan: number().min(-1).max(1).optional(),
30087
- tilt: number().min(-1).max(1).optional(),
30088
- speed: number().min(0).max(1).optional()
30089
- });
30090
- /**
30091
- * The enumerated discrete actions a navigation-capable robot can perform via
30092
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
30093
- * subset it supports through `listActions`. Sounds are NOT here — they go through
30094
- * `playSound` (see the `sound` dictionary entries).
30095
- */
30096
- var NavigationActionIdSchema = _enum([
30097
- "goHome",
30098
- "locate",
30099
- "spotClean",
30100
- "findPet",
30101
- "personFollow",
30102
- "stop",
30103
- "startClean",
30104
- "pauseClean",
30105
- "dockWash",
30106
- "autoEmpty",
30107
- "flashOn",
30108
- "flashOff"
30109
- ]);
30110
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
30111
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
30112
- /**
30113
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
30114
- * native panel and the PTZ mimic render as a button.
30115
- *
30116
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
30117
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
30118
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
30119
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
30120
- * - `label` — operator-facing English label.
30121
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
30122
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
30123
- * PTZ render ONLY enabled entries. Data-driven: the provider
30124
- * flips it from config, never by editing code.
30125
- */
30126
- var NavigationActionEntrySchema = object({
30127
- id: string(),
30128
- kind: NavigationEntryKindSchema,
30129
- label: string(),
30130
- icon: string(),
30131
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
30132
- soundId: number().int().optional(),
30133
- /** Per-device feature flag — render this entry only when true. */
30134
- enabled: boolean()
30135
- });
30136
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
30137
- var NavigationPointSchema = object({
30138
- x: number(),
30139
- y: number()
30140
- });
30141
- /**
30142
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
30143
- * The cap reports which are enabled so the UI / PTZ render only the controls
30144
- * that are turned on for THIS device. Data-driven: the provider derives these
30145
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
30146
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
30147
- * that are not dictionary entries.
30148
- *
30149
- * - `move` / `stop` — the momentary drive joystick.
30150
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
30151
- * map-coordinate plumbing is wired.
30152
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
30153
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
30154
- * - `light` — the on/off fill-light toggle (works anytime).
30155
- * - `lightMode` — the auto/manual selector + manual level slider (a
30156
- * camera-service control; needs an active stream).
30157
- */
30158
- var NavigationFeaturesSchema = object({
30159
- move: boolean(),
30160
- stop: boolean(),
30161
- goToPoint: boolean(),
30162
- runAction: boolean(),
30163
- playSound: boolean(),
30164
- light: boolean(),
30165
- lightMode: boolean()
30166
- });
30167
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
30168
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
30169
- /**
30170
- * Live navigation state so the UI can reflect what the robot is doing:
30171
- * - `mode` — coarse activity (idle / cleaning / following / …).
30172
- * - `following` — person/pet follow is currently armed.
30173
- * - `flash` — the on-camera fill light is on.
30174
- * - `lightMode` — auto vs manual fill-light mode.
30175
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
30176
- * `lightMode === 'manual'`.
30177
- */
30178
- var NavigationStatusSchema = object({
30179
- mode: _enum([
30180
- "idle",
30181
- "cleaning",
30182
- "spot",
30183
- "following",
30184
- "goto",
30185
- "returning",
30186
- "paused",
30187
- "unknown"
30188
- ]),
30189
- following: boolean(),
30190
- flash: boolean(),
30191
- lightMode: NavigationLightModeSchema,
30192
- lightLevel: number().min(40).max(100),
30193
- /** Ms epoch when the slice was last updated. */
30194
- lastChangedAt: number()
30195
- });
30196
- /**
30197
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
30198
- * observable). Adds `lastFetchedAt` on top of the status shape per the
30199
- * convention.
30200
- */
30201
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
30202
- var navigationCapability = {
30203
- name: "navigation",
30204
- scope: "device",
30205
- deviceNative: true,
30206
- mode: "singleton",
30207
- deviceTypes: [DeviceType.Camera],
30208
- deviceConfig: { ui: {
30209
- kind: "widget",
30210
- widgetId: "host/navigation-panel",
30211
- tab: "navigation",
30212
- topTab: true,
30213
- label: "Navigation",
30214
- order: 0
30215
- } },
30216
- methods: {
30217
- /**
30218
- * Momentary drive nudge (the robot moves). `protected` — mirrors
30219
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
30220
- * path) works for any authenticated user, not admin-only. The UI sends
30221
- * these at ~1 Hz while a control is held; the provider forwards each one to
30222
- * a single drive write WITHOUT debouncing.
30223
- */
30224
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
30225
- /** Halt all motion immediately (zero drive vector). */
30226
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
30227
- /** Send the robot to a point on its live map. */
30228
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
30229
- /**
30230
- * Enumerate the discrete controls THIS device supports (data-driven UI +
30231
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
30232
- */
30233
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
30234
- /**
30235
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
30236
- * unsupported action ids are rejected by the provider.
30237
- */
30238
- runAction: method(object({
30239
- deviceId: number(),
30240
- actionId: NavigationActionIdSchema
30241
- }), _void(), { kind: "mutation" }),
30242
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
30243
- playSound: method(object({
30244
- deviceId: number(),
30245
- soundId: number().int()
30246
- }), _void(), { kind: "mutation" }),
30247
- /**
30248
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
30249
- * works anytime, no active stream required).
30250
- */
30251
- setLightOn: method(object({
30252
- deviceId: number(),
30253
- on: boolean()
30254
- }), _void(), { kind: "mutation" }),
30255
- /**
30256
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
30257
- * initial `level`. The auto/manual + level control is a CAMERA-service
30258
- * action that generally needs an active camera stream/monitor session — the
30259
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
30260
- */
30261
- setLightMode: method(object({
30262
- deviceId: number(),
30263
- mode: NavigationLightModeSchema,
30264
- level: number().min(40).max(100).optional()
30265
- }), _void(), { kind: "mutation" }),
30266
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
30267
- setLightLevel: method(object({
30268
- deviceId: number(),
30269
- level: number().min(40).max(100)
30270
- }), _void(), { kind: "mutation" }),
30271
- /**
30272
- * Per-device FEATURE-FLAG report for the general primitives — drives which
30273
- * controls the UI shows (the per-entry flags for the dictionary come back on
30274
- * `listActions`).
30275
- */
30276
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
30277
- },
30278
- events: { onStatusChanged: { data: object({
30279
- deviceId: number(),
30280
- status: NavigationStatusSchema
30281
- }) } },
30282
- status: {
30283
- schema: NavigationStatusSchema,
30284
- kind: "push"
30285
- },
30286
- /**
30287
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
30288
- * for live mode / follow / flash changes.
30289
- */
30290
- runtimeState: NavigationRuntimeStateSchema,
30291
- /**
30292
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
30293
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
30294
- * that. The live handle re-publishes on connect.
30295
- *
30296
- * See `RuntimeStateDurability`. Enforced by
30297
- * `scripts/check-runtime-state-durability.ts`.
30298
- */
30299
- durability: "session"
30300
- };
30301
30428
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
30302
30429
  kind: "mutation",
30303
30430
  auth: "admin"
@@ -39754,13 +39881,13 @@ Object.freeze({
39754
39881
  addonId: null,
39755
39882
  access: "view"
39756
39883
  },
39757
- "storage.getDefaultLocation": {
39884
+ "storage.list": {
39758
39885
  capName: "storage",
39759
39886
  capScope: "system",
39760
39887
  addonId: null,
39761
39888
  access: "view"
39762
39889
  },
39763
- "storage.list": {
39890
+ "storage.listDrainProgress": {
39764
39891
  capName: "storage",
39765
39892
  capScope: "system",
39766
39893
  addonId: null,
@@ -39910,6 +40037,12 @@ Object.freeze({
39910
40037
  addonId: null,
39911
40038
  access: "view"
39912
40039
  },
40040
+ "storageOccupancy.getOccupancy": {
40041
+ capName: "storage-occupancy",
40042
+ capScope: "system",
40043
+ addonId: null,
40044
+ access: "view"
40045
+ },
39913
40046
  "storageProvider.abortUpload": {
39914
40047
  capName: "storage-provider",
39915
40048
  capScope: "system",