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