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