@camstack/addon-provider-velux 0.2.78 → 0.2.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +621 -488
  2. package/dist/addon.mjs +621 -488
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-zAv7pMUz.mjs
2
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -194,6 +194,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
194
194
  EventCategory["ProcessCrashed"] = "process.crashed";
195
195
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
196
196
  EventCategory["ProcessRestarted"] = "process.restarted";
197
+ /**
198
+ * The SET of storage locations changed — one was created, edited, enabled,
199
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
200
+ *
201
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
202
+ * it must also converge on its own periodic path, because a dropped event
203
+ * must not leave a node writing to yesterday's disk set forever. It exists
204
+ * because there was NO signal at all — an operator who added a second
205
+ * recordings disk in the admin UI got nothing, and the recorder kept its
206
+ * resolved locations until something else happened to re-resolve them
207
+ * (D387). Payload `StorageLocationsChangedPayload`.
208
+ */
209
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
197
210
  EventCategory["RecordingStarted"] = "recording.started";
198
211
  EventCategory["RecordingStopped"] = "recording.stopped";
199
212
  EventCategory["RecordingError"] = "recording.error";
@@ -7615,111 +7628,6 @@ var CameraSwitchGroupSchema = object({
7615
7628
  fetchedAt: number()
7616
7629
  });
7617
7630
  /**
7618
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7619
- * an addon declares its channels in.
7620
- *
7621
- * ## Two axes, deliberately separated
7622
- *
7623
- * - **DECLARATION** — which channels exist. Only the addon knows:
7624
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7625
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7626
- * and rots silently. So a channel is declared where it is consulted, and the
7627
- * `log-channels` capability enumerates the declarations.
7628
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7629
- * thing: the logging settings document on the `system` cap. Two authorities
7630
- * over the values is the exact defect
7631
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7632
- * remove; re-introducing it from the cure side would be grotesque.
7633
- *
7634
- * Nothing in this file reads a clock, an env var or a store. The registry is
7635
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7636
- * the hot path with a value somebody actually read, and by
7637
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7638
- * never reaches here, so it can neither disarm an armed channel nor arm a
7639
- * disarmed one (D49).
7640
- *
7641
- * ## The canonical call shape
7642
- *
7643
- * ```ts
7644
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7645
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7646
- * }
7647
- * ```
7648
- *
7649
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7650
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7651
- * object literal is never constructed because it lives inside the branch. It
7652
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7653
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7654
- * destination floor (measured at 1.93 ns/call when off).
7655
- *
7656
- * ## Why a channel emits at `info`
7657
- *
7658
- * `loki-logging.addon.ts` pins the destination default at `info` and
7659
- * `loki-destination.ts` drops everything below it, so a line emitted at
7660
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7661
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7662
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7663
- * emits at the channel's declared level, whose schema floor is `info`.
7664
- */
7665
- /**
7666
- * The level a channel writes at once armed.
7667
- *
7668
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7669
- * not leave the process for Loki, and the whole point of arming a channel is
7670
- * to read it later.
7671
- */
7672
- var LogChannelLevelSchema = _enum([
7673
- "info",
7674
- "warn",
7675
- "error"
7676
- ]);
7677
- /**
7678
- * What an addon declares about one channel. No value, no state — a
7679
- * declaration is inert.
7680
- */
7681
- var LogChannelDescriptorSchema = object({
7682
- /**
7683
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7684
- * the addon's short name so an operator reading a channel list can tell who
7685
- * owns it without a second lookup.
7686
- */
7687
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7688
- /** One sentence: what the operator will SEE after arming it. */
7689
- description: string().min(1),
7690
- /** The level its lines are emitted at. Never below `info`. */
7691
- defaultLevel: LogChannelLevelSchema,
7692
- /**
7693
- * Whether this channel can be narrowed to a camera.
7694
- *
7695
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7696
- * consulted with the numeric device id, AND every line the channel admits
7697
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7698
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7699
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7700
- * the body is the only way to filter.
7701
- *
7702
- * A channel whose lines carry the device only in `meta` (or not at all) is
7703
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7704
- * the operator narrows to one camera, sees nothing, and concludes the code
7705
- * path was never taken.
7706
- */
7707
- perDevice: boolean()
7708
- });
7709
- /**
7710
- * An armed window over one channel, as the document hands it to a mirror.
7711
- *
7712
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7713
- * expires by itself, which is the one failure a boolean cannot avoid.
7714
- */
7715
- var LogChannelWindowSchema = object({
7716
- channel: string().min(1),
7717
- /** Epoch ms the window closes at. */
7718
- armedUntilMs: number(),
7719
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7720
- deviceIds: array(number().int()).readonly().nullable()
7721
- });
7722
- /**
7723
7631
  * Ops-log — the durable, append-only operations audit shared by the
7724
7632
  * recordings and events management surfaces.
7725
7633
  *
@@ -8641,6 +8549,21 @@ var StorageCleanupJobSchema = object({
8641
8549
  });
8642
8550
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8643
8551
  /**
8552
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8553
+ * alias below is `z.infer<>` of it, never a second spelling.
8554
+ */
8555
+ var StorageLocationModeSchema = _enum([
8556
+ "active",
8557
+ "readonly",
8558
+ "drain",
8559
+ "disabled"
8560
+ ]);
8561
+ _enum([
8562
+ "normal",
8563
+ "never",
8564
+ "drain"
8565
+ ]);
8566
+ /**
8644
8567
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8645
8568
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8646
8569
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8665,8 +8588,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8665
8588
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8666
8589
  *
8667
8590
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8668
- * The default location for a type uses `id === <type>:default` by
8669
- * convention (the bare type ref like `'backups'` resolves to it).
8591
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8592
+ * There is no default location any more (D383): `enabled` is the whole write
8593
+ * model, and a bare type ref resolves to the sole location of the type, or —
8594
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8595
+ * slug is `default`.
8670
8596
  *
8671
8597
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8672
8598
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8687,23 +8613,37 @@ var StorageLocationSchema = object({
8687
8613
  * flag at upsert time, not here (the schema is provider-agnostic).
8688
8614
  */
8689
8615
  nodeId: string().optional(),
8690
- isDefault: boolean().default(false),
8691
8616
  isSystem: boolean().default(false),
8692
8617
  /**
8693
- * Operator opt-in: whether consumers that BALANCE across several locations
8694
- * of a type may write here. Recordings reads it today; event media and
8695
- * backups are the next consumers, which is why the flag lives on the
8696
- * location rather than in any one addon's store — nothing has to be
8697
- * extended to add the next consumer.
8618
+ * THE write switch, and the only one (D383). `enabled: true` means every
8619
+ * consumer that chooses a write target for this type may write here, and all
8620
+ * enabled locations of a type are used TOGETHER; `false` means read-only —
8621
+ * still read, still played back, still age-swept, still drained, never
8622
+ * written.
8698
8623
  *
8699
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8700
- * flag existed reads back with no flag and keeps working exactly as before;
8701
- * that is the whole compat story, and it is why no migration ships with it.
8702
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8703
- * disk must not silently start writing to it); the default of a type is
8704
- * always stamped `true`.
8624
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8625
+ * stored" on an update and "born inert unless it is the first location of its
8626
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8627
+ * enabled — {@link isLocationEnabled} is the one place that says so, and the
8628
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8629
+ * stops existing rather than being re-derived on every read.
8705
8630
  */
8706
8631
  enabled: boolean().optional(),
8632
+ /**
8633
+ * THE state of this location (D385), and the only authority on what may be
8634
+ * written, read or evicted here. Interpreted in exactly one place —
8635
+ * `storage-location-mode.ts` — which also folds the legacy
8636
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8637
+ * ambiguous.
8638
+ *
8639
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8640
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8641
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8642
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8643
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8644
+ * either, so the two cannot disagree.
8645
+ */
8646
+ mode: StorageLocationModeSchema.optional(),
8707
8647
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8708
8648
  * for node-local locations it can reach) — never persisted, absent when the
8709
8649
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8711,13 +8651,50 @@ var StorageLocationSchema = object({
8711
8651
  totalBytes: number(),
8712
8652
  availableBytes: number()
8713
8653
  }).nullable().optional(),
8654
+ /**
8655
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8656
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8657
+ * never persisted, never a filesystem walk.
8658
+ *
8659
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8660
+ * location yet — nobody stores here, the owning addon is down, or the first
8661
+ * refresh has not completed. A UI must omit the segment rather than draw it
8662
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8663
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8664
+ * be spelled out loud instead of appearing by accident.
8665
+ *
8666
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8667
+ * about the whole figure rather than about its freshest part.
8668
+ */
8669
+ owned: object({
8670
+ bytes: number().int().nonnegative(),
8671
+ measuredAtMs: number().int().nonnegative()
8672
+ }).optional(),
8714
8673
  createdAt: number(),
8715
8674
  updatedAt: number()
8716
8675
  });
8676
+ object({ isDefault: boolean().optional() });
8677
+ /**
8678
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8679
+ *
8680
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8681
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8682
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8683
+ * operator learns not to believe the screen.
8684
+ */
8685
+ var StorageDrainProgressSchema = object({
8686
+ locationId: string(),
8687
+ startedAtMs: number(),
8688
+ startBytes: number(),
8689
+ bytesRemaining: number(),
8690
+ drained: boolean(),
8691
+ estimatedEmptyAtMs: number().nullable()
8692
+ });
8717
8693
  /**
8718
8694
  * Reference accepted by consumer-facing `api.storage.*` calls.
8719
8695
  * Either:
8720
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8696
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8697
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8721
8698
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8722
8699
  *
8723
8700
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -8893,6 +8870,111 @@ var DecoderSessionConfigSchema = object({
8893
8870
  */
8894
8871
  debug: boolean().optional()
8895
8872
  });
8873
+ /**
8874
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8875
+ * an addon declares its channels in.
8876
+ *
8877
+ * ## Two axes, deliberately separated
8878
+ *
8879
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8880
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8881
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8882
+ * and rots silently. So a channel is declared where it is consulted, and the
8883
+ * `log-channels` capability enumerates the declarations.
8884
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8885
+ * thing: the logging settings document on the `system` cap. Two authorities
8886
+ * over the values is the exact defect
8887
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8888
+ * remove; re-introducing it from the cure side would be grotesque.
8889
+ *
8890
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8891
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8892
+ * the hot path with a value somebody actually read, and by
8893
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8894
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8895
+ * disarmed one (D49).
8896
+ *
8897
+ * ## The canonical call shape
8898
+ *
8899
+ * ```ts
8900
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8901
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8902
+ * }
8903
+ * ```
8904
+ *
8905
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8906
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8907
+ * object literal is never constructed because it lives inside the branch. It
8908
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8909
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
8910
+ * destination floor (measured at 1.93 ns/call when off).
8911
+ *
8912
+ * ## Why a channel emits at `info`
8913
+ *
8914
+ * `loki-logging.addon.ts` pins the destination default at `info` and
8915
+ * `loki-destination.ts` drops everything below it, so a line emitted at
8916
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8917
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
8918
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8919
+ * emits at the channel's declared level, whose schema floor is `info`.
8920
+ */
8921
+ /**
8922
+ * The level a channel writes at once armed.
8923
+ *
8924
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
8925
+ * not leave the process for Loki, and the whole point of arming a channel is
8926
+ * to read it later.
8927
+ */
8928
+ var LogChannelLevelSchema = _enum([
8929
+ "info",
8930
+ "warn",
8931
+ "error"
8932
+ ]);
8933
+ /**
8934
+ * What an addon declares about one channel. No value, no state — a
8935
+ * declaration is inert.
8936
+ */
8937
+ var LogChannelDescriptorSchema = object({
8938
+ /**
8939
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
8940
+ * the addon's short name so an operator reading a channel list can tell who
8941
+ * owns it without a second lookup.
8942
+ */
8943
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
8944
+ /** One sentence: what the operator will SEE after arming it. */
8945
+ description: string().min(1),
8946
+ /** The level its lines are emitted at. Never below `info`. */
8947
+ defaultLevel: LogChannelLevelSchema,
8948
+ /**
8949
+ * Whether this channel can be narrowed to a camera.
8950
+ *
8951
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
8952
+ * consulted with the numeric device id, AND every line the channel admits
8953
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
8954
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
8955
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
8956
+ * the body is the only way to filter.
8957
+ *
8958
+ * A channel whose lines carry the device only in `meta` (or not at all) is
8959
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
8960
+ * the operator narrows to one camera, sees nothing, and concludes the code
8961
+ * path was never taken.
8962
+ */
8963
+ perDevice: boolean()
8964
+ });
8965
+ /**
8966
+ * An armed window over one channel, as the document hands it to a mirror.
8967
+ *
8968
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
8969
+ * expires by itself, which is the one failure a boolean cannot avoid.
8970
+ */
8971
+ var LogChannelWindowSchema = object({
8972
+ channel: string().min(1),
8973
+ /** Epoch ms the window closes at. */
8974
+ armedUntilMs: number(),
8975
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
8976
+ deviceIds: array(number().int()).readonly().nullable()
8977
+ });
8896
8978
  var MODEL_FORMATS = [
8897
8979
  "onnx",
8898
8980
  "coreml",
@@ -21925,7 +22007,7 @@ method(object({
21925
22007
  downloadId: string(),
21926
22008
  offset: number(),
21927
22009
  length: number()
21928
- }), _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({
22010
+ }), _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({
21929
22011
  createdAt: true,
21930
22012
  updatedAt: true
21931
22013
  }), StorageLocationSchema, {
@@ -21937,7 +22019,7 @@ method(object({
21937
22019
  }), _void(), {
21938
22020
  kind: "mutation",
21939
22021
  auth: "admin"
21940
- }), method(object({ id: string() }), object({
22022
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21941
22023
  ok: boolean(),
21942
22024
  error: string().optional()
21943
22025
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22007,6 +22089,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22007
22089
  kind: "mutation",
22008
22090
  auth: "admin"
22009
22091
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22092
+ /**
22093
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22094
+ * location (D388).
22095
+ *
22096
+ * ## Why this is not `storage-evictable`
22097
+ *
22098
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22099
+ * not, in two ways that both matter and both bite hardest on the locations an
22100
+ * operator most wants a figure for:
22101
+ *
22102
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22103
+ * and `recordingsLow:default` deliberately share one root and evict as one
22104
+ * oldest-first pool, so both answer with the SAME combined total. As an
22105
+ * occupancy figure that double-counts the disk.
22106
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22107
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22108
+ * is retiring and staring at.
22109
+ *
22110
+ * So this is its own contract with its own quantity, and the quantity is
22111
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22112
+ * would ever be willing to delete it. A provider that can only answer
22113
+ * "evictable" must not register here — a number that silently means different
22114
+ * things per class is worse than no number.
22115
+ *
22116
+ * ## Absence is an answer
22117
+ *
22118
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22119
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22120
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22121
+ * consuming side has to be written out loud instead of appearing by accident.
22122
+ *
22123
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22124
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22125
+ */
22126
+ /** One provider's occupancy answer for one location. */
22127
+ var StorageOccupancyReportSchema = object({
22128
+ locationId: string(),
22129
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22130
+ * not net of what it is willing to delete. */
22131
+ ownedBytes: number().int().nonnegative(),
22132
+ /** When the provider last actually measured this. The orchestrator carries it
22133
+ * through so a UI can say how old the figure is instead of implying "now". */
22134
+ measuredAtMs: number().int().nonnegative()
22135
+ });
22136
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22010
22137
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22011
22138
  providerId: string().min(1),
22012
22139
  displayName: string().min(1),
@@ -23842,88 +23969,6 @@ onStatusChanged: { data: object({
23842
23969
  volatileStateFields: ["lastUpdated"]
23843
23970
  };
23844
23971
  /**
23845
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23846
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23847
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23848
- * one Home Assistant projection.
23849
- */
23850
- var NetworkLinkStatusSchema = object({
23851
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23852
- type: _enum([
23853
- "wifi",
23854
- "ethernet",
23855
- "cellular",
23856
- "unknown"
23857
- ]),
23858
- /**
23859
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23860
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23861
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23862
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23863
- * SKIP a null rather than coerce it.
23864
- */
23865
- signalPercent: number().min(0).max(100).nullable(),
23866
- /** Raw received signal strength in dBm, when the firmware reports one. */
23867
- rssiDbm: number().optional(),
23868
- /** Network name of a wireless link, when the firmware reports it. */
23869
- ssid: string().optional(),
23870
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23871
- lastUpdated: number()
23872
- });
23873
- var networkLinkCapability = {
23874
- name: "network-link",
23875
- scope: "device",
23876
- deviceNative: true,
23877
- mode: "singleton",
23878
- deviceTypes: [
23879
- DeviceType.Camera,
23880
- DeviceType.Sensor,
23881
- DeviceType.Button,
23882
- DeviceType.Switch,
23883
- DeviceType.Light,
23884
- DeviceType.Lock,
23885
- DeviceType.Siren
23886
- ],
23887
- methods: {},
23888
- events: {
23889
- /**
23890
- * Emitted whenever the cached status changes (a link switch, a signal
23891
- * reading that moved). Mirrored on the parent chain by the
23892
- * DeviceEventPropagator like `battery.onStatusChanged`.
23893
- */
23894
- onStatusChanged: { data: object({
23895
- deviceId: number(),
23896
- status: NetworkLinkStatusSchema
23897
- }) } },
23898
- status: {
23899
- schema: NetworkLinkStatusSchema,
23900
- kind: "push",
23901
- empty: {
23902
- type: "unknown",
23903
- signalPercent: null,
23904
- lastUpdated: 0
23905
- }
23906
- },
23907
- /**
23908
- * Runtime-state slice — every provider stores the same shape under
23909
- * `device.runtimeState['network-link']`, read once by the badge and the
23910
- * Home Assistant projector regardless of the driver.
23911
- */
23912
- runtimeState: NetworkLinkStatusSchema,
23913
- /**
23914
- * Runtime-state durability: **restored** — a link reading is slow to
23915
- * change and a sleeping battery camera may not report for hours; the
23916
- * restored slice is what the badge shows until the next read.
23917
- *
23918
- * See `RuntimeStateDurability`. Enforced by
23919
- * `scripts/check-runtime-state-durability.ts`.
23920
- */
23921
- durability: "restored",
23922
- /** Clock fields: written, but excluded from the compare that decides
23923
- * whether persisting is worth a SQLite commit. */
23924
- volatileStateFields: ["lastUpdated"]
23925
- };
23926
- /**
23927
23972
  * Generic boolean sensor — last-resort fallback when no domain-
23928
23973
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23929
23974
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -27453,6 +27498,369 @@ var nativeObjectDetectionCapability = {
27453
27498
  volatileStateFields: ["lastFetchedAt"]
27454
27499
  };
27455
27500
  /**
27501
+ * `navigation` — a device-scoped capability that natively expresses the FULL
27502
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
27503
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
27504
+ *
27505
+ * Why a NEW cap rather than overloading `ptz`:
27506
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27507
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27508
+ * The two are different physical models: PTZ is absolute-position + presets,
27509
+ * navigation is momentary drive nudges + discrete robot ACTIONS
27510
+ * (dock / spot-clean / follow-pet / go-to-point / …).
27511
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27512
+ * the reverse:
27513
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
27514
+ * / `getOptions`), and
27515
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27516
+ * robot camera shows up in the existing PTZ control path without every
27517
+ * PTZ provider learning about robots. The mapping lives in the adapter,
27518
+ * not here (see the addon design note):
27519
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27520
+ * ptz.stop() → navigation.stop()
27521
+ * ptz.goHome() → navigation.runAction('goHome')
27522
+ * ptz.getPresets() → navigation.listActions() (id→preset)
27523
+ * ptz.goToPreset(id) → navigation.runAction(id)
27524
+ *
27525
+ * ## Continuous drive
27526
+ *
27527
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27528
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27529
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27530
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27531
+ * coalesce them. The UI owns the cadence.
27532
+ *
27533
+ * ## The action dictionary
27534
+ *
27535
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27536
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27537
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27538
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27539
+ * vendor-specific list. `kind: 'action'` entries are triggered with
27540
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27541
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
27542
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27543
+ *
27544
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27545
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27546
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
27547
+ * every device handle. A future nodedreame publish adds a typed
27548
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27549
+ * provider can then swap the raw calls for the typed methods with no change to
27550
+ * THIS contract.
27551
+ */
27552
+ /**
27553
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27554
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27555
+ * halts it.
27556
+ *
27557
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
27558
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27559
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27560
+ * vector by it (drivers without proportional drive ignore it).
27561
+ *
27562
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27563
+ * axis alone; an all-undefined nudge is a no-op.
27564
+ */
27565
+ var NavigationMoveCommandSchema = object({
27566
+ pan: number().min(-1).max(1).optional(),
27567
+ tilt: number().min(-1).max(1).optional(),
27568
+ speed: number().min(0).max(1).optional()
27569
+ });
27570
+ /**
27571
+ * The enumerated discrete actions a navigation-capable robot can perform via
27572
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27573
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
27574
+ * `playSound` (see the `sound` dictionary entries).
27575
+ */
27576
+ var NavigationActionIdSchema = _enum([
27577
+ "goHome",
27578
+ "locate",
27579
+ "spotClean",
27580
+ "findPet",
27581
+ "personFollow",
27582
+ "stop",
27583
+ "startClean",
27584
+ "pauseClean",
27585
+ "dockWash",
27586
+ "autoEmpty",
27587
+ "flashOn",
27588
+ "flashOff"
27589
+ ]);
27590
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27591
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
27592
+ /**
27593
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27594
+ * native panel and the PTZ mimic render as a button.
27595
+ *
27596
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27597
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27598
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
27599
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27600
+ * - `label` — operator-facing English label.
27601
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27602
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27603
+ * PTZ render ONLY enabled entries. Data-driven: the provider
27604
+ * flips it from config, never by editing code.
27605
+ */
27606
+ var NavigationActionEntrySchema = object({
27607
+ id: string(),
27608
+ kind: NavigationEntryKindSchema,
27609
+ label: string(),
27610
+ icon: string(),
27611
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27612
+ soundId: number().int().optional(),
27613
+ /** Per-device feature flag — render this entry only when true. */
27614
+ enabled: boolean()
27615
+ });
27616
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
27617
+ var NavigationPointSchema = object({
27618
+ x: number(),
27619
+ y: number()
27620
+ });
27621
+ /**
27622
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27623
+ * The cap reports which are enabled so the UI / PTZ render only the controls
27624
+ * that are turned on for THIS device. Data-driven: the provider derives these
27625
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27626
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27627
+ * that are not dictionary entries.
27628
+ *
27629
+ * - `move` / `stop` — the momentary drive joystick.
27630
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27631
+ * map-coordinate plumbing is wired.
27632
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27633
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27634
+ * - `light` — the on/off fill-light toggle (works anytime).
27635
+ * - `lightMode` — the auto/manual selector + manual level slider (a
27636
+ * camera-service control; needs an active stream).
27637
+ */
27638
+ var NavigationFeaturesSchema = object({
27639
+ move: boolean(),
27640
+ stop: boolean(),
27641
+ goToPoint: boolean(),
27642
+ runAction: boolean(),
27643
+ playSound: boolean(),
27644
+ light: boolean(),
27645
+ lightMode: boolean()
27646
+ });
27647
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27648
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
27649
+ /**
27650
+ * Live navigation state so the UI can reflect what the robot is doing:
27651
+ * - `mode` — coarse activity (idle / cleaning / following / …).
27652
+ * - `following` — person/pet follow is currently armed.
27653
+ * - `flash` — the on-camera fill light is on.
27654
+ * - `lightMode` — auto vs manual fill-light mode.
27655
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
27656
+ * `lightMode === 'manual'`.
27657
+ */
27658
+ var NavigationStatusSchema = object({
27659
+ mode: _enum([
27660
+ "idle",
27661
+ "cleaning",
27662
+ "spot",
27663
+ "following",
27664
+ "goto",
27665
+ "returning",
27666
+ "paused",
27667
+ "unknown"
27668
+ ]),
27669
+ following: boolean(),
27670
+ flash: boolean(),
27671
+ lightMode: NavigationLightModeSchema,
27672
+ lightLevel: number().min(40).max(100),
27673
+ /** Ms epoch when the slice was last updated. */
27674
+ lastChangedAt: number()
27675
+ });
27676
+ /**
27677
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
27678
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
27679
+ * convention.
27680
+ */
27681
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
27682
+ var navigationCapability = {
27683
+ name: "navigation",
27684
+ scope: "device",
27685
+ deviceNative: true,
27686
+ mode: "singleton",
27687
+ deviceTypes: [DeviceType.Camera],
27688
+ deviceConfig: { ui: {
27689
+ kind: "widget",
27690
+ widgetId: "host/navigation-panel",
27691
+ tab: "navigation",
27692
+ topTab: true,
27693
+ label: "Navigation",
27694
+ order: 0
27695
+ } },
27696
+ methods: {
27697
+ /**
27698
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
27699
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
27700
+ * path) works for any authenticated user, not admin-only. The UI sends
27701
+ * these at ~1 Hz while a control is held; the provider forwards each one to
27702
+ * a single drive write WITHOUT debouncing.
27703
+ */
27704
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27705
+ /** Halt all motion immediately (zero drive vector). */
27706
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
27707
+ /** Send the robot to a point on its live map. */
27708
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27709
+ /**
27710
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
27711
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
27712
+ */
27713
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
27714
+ /**
27715
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
27716
+ * unsupported action ids are rejected by the provider.
27717
+ */
27718
+ runAction: method(object({
27719
+ deviceId: number(),
27720
+ actionId: NavigationActionIdSchema
27721
+ }), _void(), { kind: "mutation" }),
27722
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
27723
+ playSound: method(object({
27724
+ deviceId: number(),
27725
+ soundId: number().int()
27726
+ }), _void(), { kind: "mutation" }),
27727
+ /**
27728
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
27729
+ * works anytime, no active stream required).
27730
+ */
27731
+ setLightOn: method(object({
27732
+ deviceId: number(),
27733
+ on: boolean()
27734
+ }), _void(), { kind: "mutation" }),
27735
+ /**
27736
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
27737
+ * initial `level`. The auto/manual + level control is a CAMERA-service
27738
+ * action that generally needs an active camera stream/monitor session — the
27739
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
27740
+ */
27741
+ setLightMode: method(object({
27742
+ deviceId: number(),
27743
+ mode: NavigationLightModeSchema,
27744
+ level: number().min(40).max(100).optional()
27745
+ }), _void(), { kind: "mutation" }),
27746
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
27747
+ setLightLevel: method(object({
27748
+ deviceId: number(),
27749
+ level: number().min(40).max(100)
27750
+ }), _void(), { kind: "mutation" }),
27751
+ /**
27752
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
27753
+ * controls the UI shows (the per-entry flags for the dictionary come back on
27754
+ * `listActions`).
27755
+ */
27756
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
27757
+ },
27758
+ events: { onStatusChanged: { data: object({
27759
+ deviceId: number(),
27760
+ status: NavigationStatusSchema
27761
+ }) } },
27762
+ status: {
27763
+ schema: NavigationStatusSchema,
27764
+ kind: "push"
27765
+ },
27766
+ /**
27767
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
27768
+ * for live mode / follow / flash changes.
27769
+ */
27770
+ runtimeState: NavigationRuntimeStateSchema,
27771
+ /**
27772
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
27773
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
27774
+ * that. The live handle re-publishes on connect.
27775
+ *
27776
+ * See `RuntimeStateDurability`. Enforced by
27777
+ * `scripts/check-runtime-state-durability.ts`.
27778
+ */
27779
+ durability: "session"
27780
+ };
27781
+ /**
27782
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
27783
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
27784
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
27785
+ * one Home Assistant projection.
27786
+ */
27787
+ var NetworkLinkStatusSchema = object({
27788
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
27789
+ type: _enum([
27790
+ "wifi",
27791
+ "ethernet",
27792
+ "cellular",
27793
+ "unknown"
27794
+ ]),
27795
+ /**
27796
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
27797
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
27798
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
27799
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
27800
+ * SKIP a null rather than coerce it.
27801
+ */
27802
+ signalPercent: number().min(0).max(100).nullable(),
27803
+ /** Raw received signal strength in dBm, when the firmware reports one. */
27804
+ rssiDbm: number().optional(),
27805
+ /** Network name of a wireless link, when the firmware reports it. */
27806
+ ssid: string().optional(),
27807
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
27808
+ lastUpdated: number()
27809
+ });
27810
+ var networkLinkCapability = {
27811
+ name: "network-link",
27812
+ scope: "device",
27813
+ deviceNative: true,
27814
+ mode: "singleton",
27815
+ deviceTypes: [
27816
+ DeviceType.Camera,
27817
+ DeviceType.Sensor,
27818
+ DeviceType.Button,
27819
+ DeviceType.Switch,
27820
+ DeviceType.Light,
27821
+ DeviceType.Lock,
27822
+ DeviceType.Siren
27823
+ ],
27824
+ methods: {},
27825
+ events: {
27826
+ /**
27827
+ * Emitted whenever the cached status changes (a link switch, a signal
27828
+ * reading that moved). Mirrored on the parent chain by the
27829
+ * DeviceEventPropagator like `battery.onStatusChanged`.
27830
+ */
27831
+ onStatusChanged: { data: object({
27832
+ deviceId: number(),
27833
+ status: NetworkLinkStatusSchema
27834
+ }) } },
27835
+ status: {
27836
+ schema: NetworkLinkStatusSchema,
27837
+ kind: "push",
27838
+ empty: {
27839
+ type: "unknown",
27840
+ signalPercent: null,
27841
+ lastUpdated: 0
27842
+ }
27843
+ },
27844
+ /**
27845
+ * Runtime-state slice — every provider stores the same shape under
27846
+ * `device.runtimeState['network-link']`, read once by the badge and the
27847
+ * Home Assistant projector regardless of the driver.
27848
+ */
27849
+ runtimeState: NetworkLinkStatusSchema,
27850
+ /**
27851
+ * Runtime-state durability: **restored** — a link reading is slow to
27852
+ * change and a sleeping battery camera may not report for hours; the
27853
+ * restored slice is what the badge shows until the next read.
27854
+ *
27855
+ * See `RuntimeStateDurability`. Enforced by
27856
+ * `scripts/check-runtime-state-durability.ts`.
27857
+ */
27858
+ durability: "restored",
27859
+ /** Clock fields: written, but excluded from the compare that decides
27860
+ * whether persisting is worth a SQLite commit. */
27861
+ volatileStateFields: ["lastUpdated"]
27862
+ };
27863
+ /**
27456
27864
  * network-quality — system-scoped singleton capability tracking RTT,
27457
27865
  * jitter, and observed/peak bandwidth per device + per client.
27458
27866
  *
@@ -29033,287 +29441,6 @@ var ptzAutotrackCapability = {
29033
29441
  */
29034
29442
  durability: "session"
29035
29443
  };
29036
- /**
29037
- * `navigation` — a device-scoped capability that natively expresses the FULL
29038
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
29039
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
29040
- *
29041
- * Why a NEW cap rather than overloading `ptz`:
29042
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29043
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29044
- * The two are different physical models: PTZ is absolute-position + presets,
29045
- * navigation is momentary drive nudges + discrete robot ACTIONS
29046
- * (dock / spot-clean / follow-pet / go-to-point / …).
29047
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29048
- * the reverse:
29049
- * 1. a native CamStack navigation panel (data-driven from `listActions`
29050
- * / `getOptions`), and
29051
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29052
- * robot camera shows up in the existing PTZ control path without every
29053
- * PTZ provider learning about robots. The mapping lives in the adapter,
29054
- * not here (see the addon design note):
29055
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29056
- * ptz.stop() → navigation.stop()
29057
- * ptz.goHome() → navigation.runAction('goHome')
29058
- * ptz.getPresets() → navigation.listActions() (id→preset)
29059
- * ptz.goToPreset(id) → navigation.runAction(id)
29060
- *
29061
- * ## Continuous drive
29062
- *
29063
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29064
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29065
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29066
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29067
- * coalesce them. The UI owns the cadence.
29068
- *
29069
- * ## The action dictionary
29070
- *
29071
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29072
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29073
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29074
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29075
- * vendor-specific list. `kind: 'action'` entries are triggered with
29076
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29077
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
29078
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29079
- *
29080
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29081
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29082
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
29083
- * every device handle. A future nodedreame publish adds a typed
29084
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29085
- * provider can then swap the raw calls for the typed methods with no change to
29086
- * THIS contract.
29087
- */
29088
- /**
29089
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29090
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29091
- * halts it.
29092
- *
29093
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
29094
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29095
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29096
- * vector by it (drivers without proportional drive ignore it).
29097
- *
29098
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29099
- * axis alone; an all-undefined nudge is a no-op.
29100
- */
29101
- var NavigationMoveCommandSchema = object({
29102
- pan: number().min(-1).max(1).optional(),
29103
- tilt: number().min(-1).max(1).optional(),
29104
- speed: number().min(0).max(1).optional()
29105
- });
29106
- /**
29107
- * The enumerated discrete actions a navigation-capable robot can perform via
29108
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29109
- * subset it supports through `listActions`. Sounds are NOT here — they go through
29110
- * `playSound` (see the `sound` dictionary entries).
29111
- */
29112
- var NavigationActionIdSchema = _enum([
29113
- "goHome",
29114
- "locate",
29115
- "spotClean",
29116
- "findPet",
29117
- "personFollow",
29118
- "stop",
29119
- "startClean",
29120
- "pauseClean",
29121
- "dockWash",
29122
- "autoEmpty",
29123
- "flashOn",
29124
- "flashOff"
29125
- ]);
29126
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29127
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
29128
- /**
29129
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29130
- * native panel and the PTZ mimic render as a button.
29131
- *
29132
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29133
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29134
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
29135
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29136
- * - `label` — operator-facing English label.
29137
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29138
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29139
- * PTZ render ONLY enabled entries. Data-driven: the provider
29140
- * flips it from config, never by editing code.
29141
- */
29142
- var NavigationActionEntrySchema = object({
29143
- id: string(),
29144
- kind: NavigationEntryKindSchema,
29145
- label: string(),
29146
- icon: string(),
29147
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29148
- soundId: number().int().optional(),
29149
- /** Per-device feature flag — render this entry only when true. */
29150
- enabled: boolean()
29151
- });
29152
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
29153
- var NavigationPointSchema = object({
29154
- x: number(),
29155
- y: number()
29156
- });
29157
- /**
29158
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29159
- * The cap reports which are enabled so the UI / PTZ render only the controls
29160
- * that are turned on for THIS device. Data-driven: the provider derives these
29161
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29162
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29163
- * that are not dictionary entries.
29164
- *
29165
- * - `move` / `stop` — the momentary drive joystick.
29166
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29167
- * map-coordinate plumbing is wired.
29168
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29169
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29170
- * - `light` — the on/off fill-light toggle (works anytime).
29171
- * - `lightMode` — the auto/manual selector + manual level slider (a
29172
- * camera-service control; needs an active stream).
29173
- */
29174
- var NavigationFeaturesSchema = object({
29175
- move: boolean(),
29176
- stop: boolean(),
29177
- goToPoint: boolean(),
29178
- runAction: boolean(),
29179
- playSound: boolean(),
29180
- light: boolean(),
29181
- lightMode: boolean()
29182
- });
29183
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29184
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
29185
- /**
29186
- * Live navigation state so the UI can reflect what the robot is doing:
29187
- * - `mode` — coarse activity (idle / cleaning / following / …).
29188
- * - `following` — person/pet follow is currently armed.
29189
- * - `flash` — the on-camera fill light is on.
29190
- * - `lightMode` — auto vs manual fill-light mode.
29191
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
29192
- * `lightMode === 'manual'`.
29193
- */
29194
- var NavigationStatusSchema = object({
29195
- mode: _enum([
29196
- "idle",
29197
- "cleaning",
29198
- "spot",
29199
- "following",
29200
- "goto",
29201
- "returning",
29202
- "paused",
29203
- "unknown"
29204
- ]),
29205
- following: boolean(),
29206
- flash: boolean(),
29207
- lightMode: NavigationLightModeSchema,
29208
- lightLevel: number().min(40).max(100),
29209
- /** Ms epoch when the slice was last updated. */
29210
- lastChangedAt: number()
29211
- });
29212
- /**
29213
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29214
- * observable). Adds `lastFetchedAt` on top of the status shape per the
29215
- * convention.
29216
- */
29217
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29218
- var navigationCapability = {
29219
- name: "navigation",
29220
- scope: "device",
29221
- deviceNative: true,
29222
- mode: "singleton",
29223
- deviceTypes: [DeviceType.Camera],
29224
- deviceConfig: { ui: {
29225
- kind: "widget",
29226
- widgetId: "host/navigation-panel",
29227
- tab: "navigation",
29228
- topTab: true,
29229
- label: "Navigation",
29230
- order: 0
29231
- } },
29232
- methods: {
29233
- /**
29234
- * Momentary drive nudge (the robot moves). `protected` — mirrors
29235
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29236
- * path) works for any authenticated user, not admin-only. The UI sends
29237
- * these at ~1 Hz while a control is held; the provider forwards each one to
29238
- * a single drive write WITHOUT debouncing.
29239
- */
29240
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29241
- /** Halt all motion immediately (zero drive vector). */
29242
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29243
- /** Send the robot to a point on its live map. */
29244
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29245
- /**
29246
- * Enumerate the discrete controls THIS device supports (data-driven UI +
29247
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29248
- */
29249
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29250
- /**
29251
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29252
- * unsupported action ids are rejected by the provider.
29253
- */
29254
- runAction: method(object({
29255
- deviceId: number(),
29256
- actionId: NavigationActionIdSchema
29257
- }), _void(), { kind: "mutation" }),
29258
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29259
- playSound: method(object({
29260
- deviceId: number(),
29261
- soundId: number().int()
29262
- }), _void(), { kind: "mutation" }),
29263
- /**
29264
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29265
- * works anytime, no active stream required).
29266
- */
29267
- setLightOn: method(object({
29268
- deviceId: number(),
29269
- on: boolean()
29270
- }), _void(), { kind: "mutation" }),
29271
- /**
29272
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29273
- * initial `level`. The auto/manual + level control is a CAMERA-service
29274
- * action that generally needs an active camera stream/monitor session — the
29275
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
29276
- */
29277
- setLightMode: method(object({
29278
- deviceId: number(),
29279
- mode: NavigationLightModeSchema,
29280
- level: number().min(40).max(100).optional()
29281
- }), _void(), { kind: "mutation" }),
29282
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29283
- setLightLevel: method(object({
29284
- deviceId: number(),
29285
- level: number().min(40).max(100)
29286
- }), _void(), { kind: "mutation" }),
29287
- /**
29288
- * Per-device FEATURE-FLAG report for the general primitives — drives which
29289
- * controls the UI shows (the per-entry flags for the dictionary come back on
29290
- * `listActions`).
29291
- */
29292
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29293
- },
29294
- events: { onStatusChanged: { data: object({
29295
- deviceId: number(),
29296
- status: NavigationStatusSchema
29297
- }) } },
29298
- status: {
29299
- schema: NavigationStatusSchema,
29300
- kind: "push"
29301
- },
29302
- /**
29303
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29304
- * for live mode / follow / flash changes.
29305
- */
29306
- runtimeState: NavigationRuntimeStateSchema,
29307
- /**
29308
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
29309
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
29310
- * that. The live handle re-publishes on connect.
29311
- *
29312
- * See `RuntimeStateDurability`. Enforced by
29313
- * `scripts/check-runtime-state-durability.ts`.
29314
- */
29315
- durability: "session"
29316
- };
29317
29444
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29318
29445
  kind: "mutation",
29319
29446
  auth: "admin"
@@ -38770,13 +38897,13 @@ Object.freeze({
38770
38897
  addonId: null,
38771
38898
  access: "view"
38772
38899
  },
38773
- "storage.getDefaultLocation": {
38900
+ "storage.list": {
38774
38901
  capName: "storage",
38775
38902
  capScope: "system",
38776
38903
  addonId: null,
38777
38904
  access: "view"
38778
38905
  },
38779
- "storage.list": {
38906
+ "storage.listDrainProgress": {
38780
38907
  capName: "storage",
38781
38908
  capScope: "system",
38782
38909
  addonId: null,
@@ -38926,6 +39053,12 @@ Object.freeze({
38926
39053
  addonId: null,
38927
39054
  access: "view"
38928
39055
  },
39056
+ "storageOccupancy.getOccupancy": {
39057
+ capName: "storage-occupancy",
39058
+ capScope: "system",
39059
+ addonId: null,
39060
+ access: "view"
39061
+ },
38929
39062
  "storageProvider.abortUpload": {
38930
39063
  capName: "storage-provider",
38931
39064
  capScope: "system",