@camstack/addon-provider-homeassistant 1.2.94 → 1.2.96

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.
@@ -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";
@@ -7818,111 +7831,6 @@ var CameraSwitchGroupSchema = object({
7818
7831
  fetchedAt: number()
7819
7832
  });
7820
7833
  /**
7821
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7822
- * an addon declares its channels in.
7823
- *
7824
- * ## Two axes, deliberately separated
7825
- *
7826
- * - **DECLARATION** — which channels exist. Only the addon knows:
7827
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7828
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7829
- * and rots silently. So a channel is declared where it is consulted, and the
7830
- * `log-channels` capability enumerates the declarations.
7831
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7832
- * thing: the logging settings document on the `system` cap. Two authorities
7833
- * over the values is the exact defect
7834
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7835
- * remove; re-introducing it from the cure side would be grotesque.
7836
- *
7837
- * Nothing in this file reads a clock, an env var or a store. The registry is
7838
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7839
- * the hot path with a value somebody actually read, and by
7840
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7841
- * never reaches here, so it can neither disarm an armed channel nor arm a
7842
- * disarmed one (D49).
7843
- *
7844
- * ## The canonical call shape
7845
- *
7846
- * ```ts
7847
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7848
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7849
- * }
7850
- * ```
7851
- *
7852
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7853
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7854
- * object literal is never constructed because it lives inside the branch. It
7855
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7856
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7857
- * destination floor (measured at 1.93 ns/call when off).
7858
- *
7859
- * ## Why a channel emits at `info`
7860
- *
7861
- * `loki-logging.addon.ts` pins the destination default at `info` and
7862
- * `loki-destination.ts` drops everything below it, so a line emitted at
7863
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7864
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7865
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7866
- * emits at the channel's declared level, whose schema floor is `info`.
7867
- */
7868
- /**
7869
- * The level a channel writes at once armed.
7870
- *
7871
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7872
- * not leave the process for Loki, and the whole point of arming a channel is
7873
- * to read it later.
7874
- */
7875
- var LogChannelLevelSchema = _enum([
7876
- "info",
7877
- "warn",
7878
- "error"
7879
- ]);
7880
- /**
7881
- * What an addon declares about one channel. No value, no state — a
7882
- * declaration is inert.
7883
- */
7884
- var LogChannelDescriptorSchema = object({
7885
- /**
7886
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7887
- * the addon's short name so an operator reading a channel list can tell who
7888
- * owns it without a second lookup.
7889
- */
7890
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7891
- /** One sentence: what the operator will SEE after arming it. */
7892
- description: string().min(1),
7893
- /** The level its lines are emitted at. Never below `info`. */
7894
- defaultLevel: LogChannelLevelSchema,
7895
- /**
7896
- * Whether this channel can be narrowed to a camera.
7897
- *
7898
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7899
- * consulted with the numeric device id, AND every line the channel admits
7900
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7901
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7902
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7903
- * the body is the only way to filter.
7904
- *
7905
- * A channel whose lines carry the device only in `meta` (or not at all) is
7906
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7907
- * the operator narrows to one camera, sees nothing, and concludes the code
7908
- * path was never taken.
7909
- */
7910
- perDevice: boolean()
7911
- });
7912
- /**
7913
- * An armed window over one channel, as the document hands it to a mirror.
7914
- *
7915
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7916
- * expires by itself, which is the one failure a boolean cannot avoid.
7917
- */
7918
- var LogChannelWindowSchema = object({
7919
- channel: string().min(1),
7920
- /** Epoch ms the window closes at. */
7921
- armedUntilMs: number(),
7922
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7923
- deviceIds: array(number().int()).readonly().nullable()
7924
- });
7925
- /**
7926
7834
  * Ops-log — the durable, append-only operations audit shared by the
7927
7835
  * recordings and events management surfaces.
7928
7836
  *
@@ -8844,6 +8752,21 @@ var StorageCleanupJobSchema = object({
8844
8752
  });
8845
8753
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8846
8754
  /**
8755
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8756
+ * alias below is `z.infer<>` of it, never a second spelling.
8757
+ */
8758
+ var StorageLocationModeSchema = _enum([
8759
+ "active",
8760
+ "readonly",
8761
+ "drain",
8762
+ "disabled"
8763
+ ]);
8764
+ _enum([
8765
+ "normal",
8766
+ "never",
8767
+ "drain"
8768
+ ]);
8769
+ /**
8847
8770
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8848
8771
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8849
8772
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8868,8 +8791,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8868
8791
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8869
8792
  *
8870
8793
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8871
- * The default location for a type uses `id === <type>:default` by
8872
- * convention (the bare type ref like `'backups'` resolves to it).
8794
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8795
+ * There is no default location any more (D383): `enabled` is the whole write
8796
+ * model, and a bare type ref resolves to the sole location of the type, or —
8797
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8798
+ * slug is `default`.
8873
8799
  *
8874
8800
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8875
8801
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8890,23 +8816,37 @@ var StorageLocationSchema = object({
8890
8816
  * flag at upsert time, not here (the schema is provider-agnostic).
8891
8817
  */
8892
8818
  nodeId: string().optional(),
8893
- isDefault: boolean().default(false),
8894
8819
  isSystem: boolean().default(false),
8895
8820
  /**
8896
- * Operator opt-in: whether consumers that BALANCE across several locations
8897
- * of a type may write here. Recordings reads it today; event media and
8898
- * backups are the next consumers, which is why the flag lives on the
8899
- * location rather than in any one addon's store — nothing has to be
8900
- * extended to add the next consumer.
8821
+ * THE write switch, and the only one (D383). `enabled: true` means every
8822
+ * consumer that chooses a write target for this type may write here, and all
8823
+ * enabled locations of a type are used TOGETHER; `false` means read-only —
8824
+ * still read, still played back, still age-swept, still drained, never
8825
+ * written.
8901
8826
  *
8902
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8903
- * flag existed reads back with no flag and keeps working exactly as before;
8904
- * that is the whole compat story, and it is why no migration ships with it.
8905
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8906
- * disk must not silently start writing to it); the default of a type is
8907
- * always stamped `true`.
8827
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8828
+ * stored" on an update and "born inert unless it is the first location of its
8829
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8830
+ * enabled — {@link isLocationEnabled} is the one place that says so, and the
8831
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8832
+ * stops existing rather than being re-derived on every read.
8908
8833
  */
8909
8834
  enabled: boolean().optional(),
8835
+ /**
8836
+ * THE state of this location (D385), and the only authority on what may be
8837
+ * written, read or evicted here. Interpreted in exactly one place —
8838
+ * `storage-location-mode.ts` — which also folds the legacy
8839
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8840
+ * ambiguous.
8841
+ *
8842
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8843
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8844
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8845
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8846
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8847
+ * either, so the two cannot disagree.
8848
+ */
8849
+ mode: StorageLocationModeSchema.optional(),
8910
8850
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8911
8851
  * for node-local locations it can reach) — never persisted, absent when the
8912
8852
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8914,13 +8854,50 @@ var StorageLocationSchema = object({
8914
8854
  totalBytes: number(),
8915
8855
  availableBytes: number()
8916
8856
  }).nullable().optional(),
8857
+ /**
8858
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8859
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8860
+ * never persisted, never a filesystem walk.
8861
+ *
8862
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8863
+ * location yet — nobody stores here, the owning addon is down, or the first
8864
+ * refresh has not completed. A UI must omit the segment rather than draw it
8865
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8866
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8867
+ * be spelled out loud instead of appearing by accident.
8868
+ *
8869
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8870
+ * about the whole figure rather than about its freshest part.
8871
+ */
8872
+ owned: object({
8873
+ bytes: number().int().nonnegative(),
8874
+ measuredAtMs: number().int().nonnegative()
8875
+ }).optional(),
8917
8876
  createdAt: number(),
8918
8877
  updatedAt: number()
8919
8878
  });
8879
+ object({ isDefault: boolean().optional() });
8880
+ /**
8881
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8882
+ *
8883
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8884
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8885
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8886
+ * operator learns not to believe the screen.
8887
+ */
8888
+ var StorageDrainProgressSchema = object({
8889
+ locationId: string(),
8890
+ startedAtMs: number(),
8891
+ startBytes: number(),
8892
+ bytesRemaining: number(),
8893
+ drained: boolean(),
8894
+ estimatedEmptyAtMs: number().nullable()
8895
+ });
8920
8896
  /**
8921
8897
  * Reference accepted by consumer-facing `api.storage.*` calls.
8922
8898
  * Either:
8923
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8899
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8900
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8924
8901
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8925
8902
  *
8926
8903
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -9096,6 +9073,111 @@ var DecoderSessionConfigSchema = object({
9096
9073
  */
9097
9074
  debug: boolean().optional()
9098
9075
  });
9076
+ /**
9077
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
9078
+ * an addon declares its channels in.
9079
+ *
9080
+ * ## Two axes, deliberately separated
9081
+ *
9082
+ * - **DECLARATION** — which channels exist. Only the addon knows:
9083
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
9084
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
9085
+ * and rots silently. So a channel is declared where it is consulted, and the
9086
+ * `log-channels` capability enumerates the declarations.
9087
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
9088
+ * thing: the logging settings document on the `system` cap. Two authorities
9089
+ * over the values is the exact defect
9090
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
9091
+ * remove; re-introducing it from the cure side would be grotesque.
9092
+ *
9093
+ * Nothing in this file reads a clock, an env var or a store. The registry is
9094
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
9095
+ * the hot path with a value somebody actually read, and by
9096
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
9097
+ * never reaches here, so it can neither disarm an armed channel nor arm a
9098
+ * disarmed one (D49).
9099
+ *
9100
+ * ## The canonical call shape
9101
+ *
9102
+ * ```ts
9103
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
9104
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
9105
+ * }
9106
+ * ```
9107
+ *
9108
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
9109
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
9110
+ * object literal is never constructed because it lives inside the branch. It
9111
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
9112
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
9113
+ * destination floor (measured at 1.93 ns/call when off).
9114
+ *
9115
+ * ## Why a channel emits at `info`
9116
+ *
9117
+ * `loki-logging.addon.ts` pins the destination default at `info` and
9118
+ * `loki-destination.ts` drops everything below it, so a line emitted at
9119
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
9120
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
9121
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
9122
+ * emits at the channel's declared level, whose schema floor is `info`.
9123
+ */
9124
+ /**
9125
+ * The level a channel writes at once armed.
9126
+ *
9127
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
9128
+ * not leave the process for Loki, and the whole point of arming a channel is
9129
+ * to read it later.
9130
+ */
9131
+ var LogChannelLevelSchema = _enum([
9132
+ "info",
9133
+ "warn",
9134
+ "error"
9135
+ ]);
9136
+ /**
9137
+ * What an addon declares about one channel. No value, no state — a
9138
+ * declaration is inert.
9139
+ */
9140
+ var LogChannelDescriptorSchema = object({
9141
+ /**
9142
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
9143
+ * the addon's short name so an operator reading a channel list can tell who
9144
+ * owns it without a second lookup.
9145
+ */
9146
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
9147
+ /** One sentence: what the operator will SEE after arming it. */
9148
+ description: string().min(1),
9149
+ /** The level its lines are emitted at. Never below `info`. */
9150
+ defaultLevel: LogChannelLevelSchema,
9151
+ /**
9152
+ * Whether this channel can be narrowed to a camera.
9153
+ *
9154
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
9155
+ * consulted with the numeric device id, AND every line the channel admits
9156
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
9157
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
9158
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
9159
+ * the body is the only way to filter.
9160
+ *
9161
+ * A channel whose lines carry the device only in `meta` (or not at all) is
9162
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
9163
+ * the operator narrows to one camera, sees nothing, and concludes the code
9164
+ * path was never taken.
9165
+ */
9166
+ perDevice: boolean()
9167
+ });
9168
+ /**
9169
+ * An armed window over one channel, as the document hands it to a mirror.
9170
+ *
9171
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
9172
+ * expires by itself, which is the one failure a boolean cannot avoid.
9173
+ */
9174
+ var LogChannelWindowSchema = object({
9175
+ channel: string().min(1),
9176
+ /** Epoch ms the window closes at. */
9177
+ armedUntilMs: number(),
9178
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9179
+ deviceIds: array(number().int()).readonly().nullable()
9180
+ });
9099
9181
  var MODEL_FORMATS = [
9100
9182
  "onnx",
9101
9183
  "coreml",
@@ -22313,7 +22395,7 @@ method(object({
22313
22395
  downloadId: string(),
22314
22396
  offset: number(),
22315
22397
  length: number()
22316
- }), _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({
22398
+ }), _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({
22317
22399
  createdAt: true,
22318
22400
  updatedAt: true
22319
22401
  }), StorageLocationSchema, {
@@ -22325,7 +22407,7 @@ method(object({
22325
22407
  }), _void(), {
22326
22408
  kind: "mutation",
22327
22409
  auth: "admin"
22328
- }), method(object({ id: string() }), object({
22410
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
22329
22411
  ok: boolean(),
22330
22412
  error: string().optional()
22331
22413
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22395,6 +22477,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22395
22477
  kind: "mutation",
22396
22478
  auth: "admin"
22397
22479
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22480
+ /**
22481
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22482
+ * location (D388).
22483
+ *
22484
+ * ## Why this is not `storage-evictable`
22485
+ *
22486
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22487
+ * not, in two ways that both matter and both bite hardest on the locations an
22488
+ * operator most wants a figure for:
22489
+ *
22490
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22491
+ * and `recordingsLow:default` deliberately share one root and evict as one
22492
+ * oldest-first pool, so both answer with the SAME combined total. As an
22493
+ * occupancy figure that double-counts the disk.
22494
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22495
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22496
+ * is retiring and staring at.
22497
+ *
22498
+ * So this is its own contract with its own quantity, and the quantity is
22499
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22500
+ * would ever be willing to delete it. A provider that can only answer
22501
+ * "evictable" must not register here — a number that silently means different
22502
+ * things per class is worse than no number.
22503
+ *
22504
+ * ## Absence is an answer
22505
+ *
22506
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22507
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22508
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22509
+ * consuming side has to be written out loud instead of appearing by accident.
22510
+ *
22511
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22512
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22513
+ */
22514
+ /** One provider's occupancy answer for one location. */
22515
+ var StorageOccupancyReportSchema = object({
22516
+ locationId: string(),
22517
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22518
+ * not net of what it is willing to delete. */
22519
+ ownedBytes: number().int().nonnegative(),
22520
+ /** When the provider last actually measured this. The orchestrator carries it
22521
+ * through so a UI can say how old the figure is instead of implying "now". */
22522
+ measuredAtMs: number().int().nonnegative()
22523
+ });
22524
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22398
22525
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22399
22526
  providerId: string().min(1),
22400
22527
  displayName: string().min(1),
@@ -24302,88 +24429,6 @@ onStatusChanged: { data: object({
24302
24429
  volatileStateFields: ["lastUpdated"]
24303
24430
  };
24304
24431
  /**
24305
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
24306
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24307
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
24308
- * one Home Assistant projection.
24309
- */
24310
- var NetworkLinkStatusSchema = object({
24311
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24312
- type: _enum([
24313
- "wifi",
24314
- "ethernet",
24315
- "cellular",
24316
- "unknown"
24317
- ]),
24318
- /**
24319
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
24320
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24321
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24322
- * one whose reading has not landed must not be drawn at 0 %. Consumers
24323
- * SKIP a null rather than coerce it.
24324
- */
24325
- signalPercent: number().min(0).max(100).nullable(),
24326
- /** Raw received signal strength in dBm, when the firmware reports one. */
24327
- rssiDbm: number().optional(),
24328
- /** Network name of a wireless link, when the firmware reports it. */
24329
- ssid: string().optional(),
24330
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24331
- lastUpdated: number()
24332
- });
24333
- var networkLinkCapability = {
24334
- name: "network-link",
24335
- scope: "device",
24336
- deviceNative: true,
24337
- mode: "singleton",
24338
- deviceTypes: [
24339
- DeviceType.Camera,
24340
- DeviceType.Sensor,
24341
- DeviceType.Button,
24342
- DeviceType.Switch,
24343
- DeviceType.Light,
24344
- DeviceType.Lock,
24345
- DeviceType.Siren
24346
- ],
24347
- methods: {},
24348
- events: {
24349
- /**
24350
- * Emitted whenever the cached status changes (a link switch, a signal
24351
- * reading that moved). Mirrored on the parent chain by the
24352
- * DeviceEventPropagator like `battery.onStatusChanged`.
24353
- */
24354
- onStatusChanged: { data: object({
24355
- deviceId: number(),
24356
- status: NetworkLinkStatusSchema
24357
- }) } },
24358
- status: {
24359
- schema: NetworkLinkStatusSchema,
24360
- kind: "push",
24361
- empty: {
24362
- type: "unknown",
24363
- signalPercent: null,
24364
- lastUpdated: 0
24365
- }
24366
- },
24367
- /**
24368
- * Runtime-state slice — every provider stores the same shape under
24369
- * `device.runtimeState['network-link']`, read once by the badge and the
24370
- * Home Assistant projector regardless of the driver.
24371
- */
24372
- runtimeState: NetworkLinkStatusSchema,
24373
- /**
24374
- * Runtime-state durability: **restored** — a link reading is slow to
24375
- * change and a sleeping battery camera may not report for hours; the
24376
- * restored slice is what the badge shows until the next read.
24377
- *
24378
- * See `RuntimeStateDurability`. Enforced by
24379
- * `scripts/check-runtime-state-durability.ts`.
24380
- */
24381
- durability: "restored",
24382
- /** Clock fields: written, but excluded from the compare that decides
24383
- * whether persisting is worth a SQLite commit. */
24384
- volatileStateFields: ["lastUpdated"]
24385
- };
24386
- /**
24387
24432
  * Generic boolean sensor — last-resort fallback when no domain-
24388
24433
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24389
24434
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -27930,6 +27975,369 @@ var nativeObjectDetectionCapability = {
27930
27975
  volatileStateFields: ["lastFetchedAt"]
27931
27976
  };
27932
27977
  /**
27978
+ * `navigation` — a device-scoped capability that natively expresses the FULL
27979
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
27980
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
27981
+ *
27982
+ * Why a NEW cap rather than overloading `ptz`:
27983
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27984
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27985
+ * The two are different physical models: PTZ is absolute-position + presets,
27986
+ * navigation is momentary drive nudges + discrete robot ACTIONS
27987
+ * (dock / spot-clean / follow-pet / go-to-point / …).
27988
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27989
+ * the reverse:
27990
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
27991
+ * / `getOptions`), and
27992
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27993
+ * robot camera shows up in the existing PTZ control path without every
27994
+ * PTZ provider learning about robots. The mapping lives in the adapter,
27995
+ * not here (see the addon design note):
27996
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27997
+ * ptz.stop() → navigation.stop()
27998
+ * ptz.goHome() → navigation.runAction('goHome')
27999
+ * ptz.getPresets() → navigation.listActions() (id→preset)
28000
+ * ptz.goToPreset(id) → navigation.runAction(id)
28001
+ *
28002
+ * ## Continuous drive
28003
+ *
28004
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
28005
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
28006
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
28007
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
28008
+ * coalesce them. The UI owns the cadence.
28009
+ *
28010
+ * ## The action dictionary
28011
+ *
28012
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
28013
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
28014
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
28015
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
28016
+ * vendor-specific list. `kind: 'action'` entries are triggered with
28017
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
28018
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
28019
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
28020
+ *
28021
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
28022
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
28023
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
28024
+ * every device handle. A future nodedreame publish adds a typed
28025
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
28026
+ * provider can then swap the raw calls for the typed methods with no change to
28027
+ * THIS contract.
28028
+ */
28029
+ /**
28030
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
28031
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
28032
+ * halts it.
28033
+ *
28034
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
28035
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
28036
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
28037
+ * vector by it (drivers without proportional drive ignore it).
28038
+ *
28039
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
28040
+ * axis alone; an all-undefined nudge is a no-op.
28041
+ */
28042
+ var NavigationMoveCommandSchema = object({
28043
+ pan: number().min(-1).max(1).optional(),
28044
+ tilt: number().min(-1).max(1).optional(),
28045
+ speed: number().min(0).max(1).optional()
28046
+ });
28047
+ /**
28048
+ * The enumerated discrete actions a navigation-capable robot can perform via
28049
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
28050
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
28051
+ * `playSound` (see the `sound` dictionary entries).
28052
+ */
28053
+ var NavigationActionIdSchema = _enum([
28054
+ "goHome",
28055
+ "locate",
28056
+ "spotClean",
28057
+ "findPet",
28058
+ "personFollow",
28059
+ "stop",
28060
+ "startClean",
28061
+ "pauseClean",
28062
+ "dockWash",
28063
+ "autoEmpty",
28064
+ "flashOn",
28065
+ "flashOff"
28066
+ ]);
28067
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
28068
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
28069
+ /**
28070
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
28071
+ * native panel and the PTZ mimic render as a button.
28072
+ *
28073
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
28074
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
28075
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
28076
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
28077
+ * - `label` — operator-facing English label.
28078
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
28079
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
28080
+ * PTZ render ONLY enabled entries. Data-driven: the provider
28081
+ * flips it from config, never by editing code.
28082
+ */
28083
+ var NavigationActionEntrySchema = object({
28084
+ id: string(),
28085
+ kind: NavigationEntryKindSchema,
28086
+ label: string(),
28087
+ icon: string(),
28088
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
28089
+ soundId: number().int().optional(),
28090
+ /** Per-device feature flag — render this entry only when true. */
28091
+ enabled: boolean()
28092
+ });
28093
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
28094
+ var NavigationPointSchema = object({
28095
+ x: number(),
28096
+ y: number()
28097
+ });
28098
+ /**
28099
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
28100
+ * The cap reports which are enabled so the UI / PTZ render only the controls
28101
+ * that are turned on for THIS device. Data-driven: the provider derives these
28102
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
28103
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
28104
+ * that are not dictionary entries.
28105
+ *
28106
+ * - `move` / `stop` — the momentary drive joystick.
28107
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
28108
+ * map-coordinate plumbing is wired.
28109
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
28110
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
28111
+ * - `light` — the on/off fill-light toggle (works anytime).
28112
+ * - `lightMode` — the auto/manual selector + manual level slider (a
28113
+ * camera-service control; needs an active stream).
28114
+ */
28115
+ var NavigationFeaturesSchema = object({
28116
+ move: boolean(),
28117
+ stop: boolean(),
28118
+ goToPoint: boolean(),
28119
+ runAction: boolean(),
28120
+ playSound: boolean(),
28121
+ light: boolean(),
28122
+ lightMode: boolean()
28123
+ });
28124
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
28125
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
28126
+ /**
28127
+ * Live navigation state so the UI can reflect what the robot is doing:
28128
+ * - `mode` — coarse activity (idle / cleaning / following / …).
28129
+ * - `following` — person/pet follow is currently armed.
28130
+ * - `flash` — the on-camera fill light is on.
28131
+ * - `lightMode` — auto vs manual fill-light mode.
28132
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
28133
+ * `lightMode === 'manual'`.
28134
+ */
28135
+ var NavigationStatusSchema = object({
28136
+ mode: _enum([
28137
+ "idle",
28138
+ "cleaning",
28139
+ "spot",
28140
+ "following",
28141
+ "goto",
28142
+ "returning",
28143
+ "paused",
28144
+ "unknown"
28145
+ ]),
28146
+ following: boolean(),
28147
+ flash: boolean(),
28148
+ lightMode: NavigationLightModeSchema,
28149
+ lightLevel: number().min(40).max(100),
28150
+ /** Ms epoch when the slice was last updated. */
28151
+ lastChangedAt: number()
28152
+ });
28153
+ /**
28154
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
28155
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
28156
+ * convention.
28157
+ */
28158
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
28159
+ var navigationCapability = {
28160
+ name: "navigation",
28161
+ scope: "device",
28162
+ deviceNative: true,
28163
+ mode: "singleton",
28164
+ deviceTypes: [DeviceType.Camera],
28165
+ deviceConfig: { ui: {
28166
+ kind: "widget",
28167
+ widgetId: "host/navigation-panel",
28168
+ tab: "navigation",
28169
+ topTab: true,
28170
+ label: "Navigation",
28171
+ order: 0
28172
+ } },
28173
+ methods: {
28174
+ /**
28175
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
28176
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
28177
+ * path) works for any authenticated user, not admin-only. The UI sends
28178
+ * these at ~1 Hz while a control is held; the provider forwards each one to
28179
+ * a single drive write WITHOUT debouncing.
28180
+ */
28181
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
28182
+ /** Halt all motion immediately (zero drive vector). */
28183
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
28184
+ /** Send the robot to a point on its live map. */
28185
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
28186
+ /**
28187
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
28188
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
28189
+ */
28190
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
28191
+ /**
28192
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
28193
+ * unsupported action ids are rejected by the provider.
28194
+ */
28195
+ runAction: method(object({
28196
+ deviceId: number(),
28197
+ actionId: NavigationActionIdSchema
28198
+ }), _void(), { kind: "mutation" }),
28199
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
28200
+ playSound: method(object({
28201
+ deviceId: number(),
28202
+ soundId: number().int()
28203
+ }), _void(), { kind: "mutation" }),
28204
+ /**
28205
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
28206
+ * works anytime, no active stream required).
28207
+ */
28208
+ setLightOn: method(object({
28209
+ deviceId: number(),
28210
+ on: boolean()
28211
+ }), _void(), { kind: "mutation" }),
28212
+ /**
28213
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
28214
+ * initial `level`. The auto/manual + level control is a CAMERA-service
28215
+ * action that generally needs an active camera stream/monitor session — the
28216
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
28217
+ */
28218
+ setLightMode: method(object({
28219
+ deviceId: number(),
28220
+ mode: NavigationLightModeSchema,
28221
+ level: number().min(40).max(100).optional()
28222
+ }), _void(), { kind: "mutation" }),
28223
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
28224
+ setLightLevel: method(object({
28225
+ deviceId: number(),
28226
+ level: number().min(40).max(100)
28227
+ }), _void(), { kind: "mutation" }),
28228
+ /**
28229
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
28230
+ * controls the UI shows (the per-entry flags for the dictionary come back on
28231
+ * `listActions`).
28232
+ */
28233
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
28234
+ },
28235
+ events: { onStatusChanged: { data: object({
28236
+ deviceId: number(),
28237
+ status: NavigationStatusSchema
28238
+ }) } },
28239
+ status: {
28240
+ schema: NavigationStatusSchema,
28241
+ kind: "push"
28242
+ },
28243
+ /**
28244
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
28245
+ * for live mode / follow / flash changes.
28246
+ */
28247
+ runtimeState: NavigationRuntimeStateSchema,
28248
+ /**
28249
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
28250
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
28251
+ * that. The live handle re-publishes on connect.
28252
+ *
28253
+ * See `RuntimeStateDurability`. Enforced by
28254
+ * `scripts/check-runtime-state-durability.ts`.
28255
+ */
28256
+ durability: "session"
28257
+ };
28258
+ /**
28259
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
28260
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
28261
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
28262
+ * one Home Assistant projection.
28263
+ */
28264
+ var NetworkLinkStatusSchema = object({
28265
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
28266
+ type: _enum([
28267
+ "wifi",
28268
+ "ethernet",
28269
+ "cellular",
28270
+ "unknown"
28271
+ ]),
28272
+ /**
28273
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
28274
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
28275
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
28276
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
28277
+ * SKIP a null rather than coerce it.
28278
+ */
28279
+ signalPercent: number().min(0).max(100).nullable(),
28280
+ /** Raw received signal strength in dBm, when the firmware reports one. */
28281
+ rssiDbm: number().optional(),
28282
+ /** Network name of a wireless link, when the firmware reports it. */
28283
+ ssid: string().optional(),
28284
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
28285
+ lastUpdated: number()
28286
+ });
28287
+ var networkLinkCapability = {
28288
+ name: "network-link",
28289
+ scope: "device",
28290
+ deviceNative: true,
28291
+ mode: "singleton",
28292
+ deviceTypes: [
28293
+ DeviceType.Camera,
28294
+ DeviceType.Sensor,
28295
+ DeviceType.Button,
28296
+ DeviceType.Switch,
28297
+ DeviceType.Light,
28298
+ DeviceType.Lock,
28299
+ DeviceType.Siren
28300
+ ],
28301
+ methods: {},
28302
+ events: {
28303
+ /**
28304
+ * Emitted whenever the cached status changes (a link switch, a signal
28305
+ * reading that moved). Mirrored on the parent chain by the
28306
+ * DeviceEventPropagator like `battery.onStatusChanged`.
28307
+ */
28308
+ onStatusChanged: { data: object({
28309
+ deviceId: number(),
28310
+ status: NetworkLinkStatusSchema
28311
+ }) } },
28312
+ status: {
28313
+ schema: NetworkLinkStatusSchema,
28314
+ kind: "push",
28315
+ empty: {
28316
+ type: "unknown",
28317
+ signalPercent: null,
28318
+ lastUpdated: 0
28319
+ }
28320
+ },
28321
+ /**
28322
+ * Runtime-state slice — every provider stores the same shape under
28323
+ * `device.runtimeState['network-link']`, read once by the badge and the
28324
+ * Home Assistant projector regardless of the driver.
28325
+ */
28326
+ runtimeState: NetworkLinkStatusSchema,
28327
+ /**
28328
+ * Runtime-state durability: **restored** — a link reading is slow to
28329
+ * change and a sleeping battery camera may not report for hours; the
28330
+ * restored slice is what the badge shows until the next read.
28331
+ *
28332
+ * See `RuntimeStateDurability`. Enforced by
28333
+ * `scripts/check-runtime-state-durability.ts`.
28334
+ */
28335
+ durability: "restored",
28336
+ /** Clock fields: written, but excluded from the compare that decides
28337
+ * whether persisting is worth a SQLite commit. */
28338
+ volatileStateFields: ["lastUpdated"]
28339
+ };
28340
+ /**
27933
28341
  * network-quality — system-scoped singleton capability tracking RTT,
27934
28342
  * jitter, and observed/peak bandwidth per device + per client.
27935
28343
  *
@@ -29510,287 +29918,6 @@ var ptzAutotrackCapability = {
29510
29918
  */
29511
29919
  durability: "session"
29512
29920
  };
29513
- /**
29514
- * `navigation` — a device-scoped capability that natively expresses the FULL
29515
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
29516
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
29517
- *
29518
- * Why a NEW cap rather than overloading `ptz`:
29519
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29520
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29521
- * The two are different physical models: PTZ is absolute-position + presets,
29522
- * navigation is momentary drive nudges + discrete robot ACTIONS
29523
- * (dock / spot-clean / follow-pet / go-to-point / …).
29524
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29525
- * the reverse:
29526
- * 1. a native CamStack navigation panel (data-driven from `listActions`
29527
- * / `getOptions`), and
29528
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29529
- * robot camera shows up in the existing PTZ control path without every
29530
- * PTZ provider learning about robots. The mapping lives in the adapter,
29531
- * not here (see the addon design note):
29532
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29533
- * ptz.stop() → navigation.stop()
29534
- * ptz.goHome() → navigation.runAction('goHome')
29535
- * ptz.getPresets() → navigation.listActions() (id→preset)
29536
- * ptz.goToPreset(id) → navigation.runAction(id)
29537
- *
29538
- * ## Continuous drive
29539
- *
29540
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29541
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29542
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29543
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29544
- * coalesce them. The UI owns the cadence.
29545
- *
29546
- * ## The action dictionary
29547
- *
29548
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29549
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29550
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29551
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29552
- * vendor-specific list. `kind: 'action'` entries are triggered with
29553
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29554
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
29555
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29556
- *
29557
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29558
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29559
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
29560
- * every device handle. A future nodedreame publish adds a typed
29561
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29562
- * provider can then swap the raw calls for the typed methods with no change to
29563
- * THIS contract.
29564
- */
29565
- /**
29566
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29567
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29568
- * halts it.
29569
- *
29570
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
29571
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29572
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29573
- * vector by it (drivers without proportional drive ignore it).
29574
- *
29575
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29576
- * axis alone; an all-undefined nudge is a no-op.
29577
- */
29578
- var NavigationMoveCommandSchema = object({
29579
- pan: number().min(-1).max(1).optional(),
29580
- tilt: number().min(-1).max(1).optional(),
29581
- speed: number().min(0).max(1).optional()
29582
- });
29583
- /**
29584
- * The enumerated discrete actions a navigation-capable robot can perform via
29585
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29586
- * subset it supports through `listActions`. Sounds are NOT here — they go through
29587
- * `playSound` (see the `sound` dictionary entries).
29588
- */
29589
- var NavigationActionIdSchema = _enum([
29590
- "goHome",
29591
- "locate",
29592
- "spotClean",
29593
- "findPet",
29594
- "personFollow",
29595
- "stop",
29596
- "startClean",
29597
- "pauseClean",
29598
- "dockWash",
29599
- "autoEmpty",
29600
- "flashOn",
29601
- "flashOff"
29602
- ]);
29603
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29604
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
29605
- /**
29606
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29607
- * native panel and the PTZ mimic render as a button.
29608
- *
29609
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29610
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29611
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
29612
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29613
- * - `label` — operator-facing English label.
29614
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29615
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29616
- * PTZ render ONLY enabled entries. Data-driven: the provider
29617
- * flips it from config, never by editing code.
29618
- */
29619
- var NavigationActionEntrySchema = object({
29620
- id: string(),
29621
- kind: NavigationEntryKindSchema,
29622
- label: string(),
29623
- icon: string(),
29624
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29625
- soundId: number().int().optional(),
29626
- /** Per-device feature flag — render this entry only when true. */
29627
- enabled: boolean()
29628
- });
29629
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
29630
- var NavigationPointSchema = object({
29631
- x: number(),
29632
- y: number()
29633
- });
29634
- /**
29635
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29636
- * The cap reports which are enabled so the UI / PTZ render only the controls
29637
- * that are turned on for THIS device. Data-driven: the provider derives these
29638
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29639
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29640
- * that are not dictionary entries.
29641
- *
29642
- * - `move` / `stop` — the momentary drive joystick.
29643
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29644
- * map-coordinate plumbing is wired.
29645
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29646
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29647
- * - `light` — the on/off fill-light toggle (works anytime).
29648
- * - `lightMode` — the auto/manual selector + manual level slider (a
29649
- * camera-service control; needs an active stream).
29650
- */
29651
- var NavigationFeaturesSchema = object({
29652
- move: boolean(),
29653
- stop: boolean(),
29654
- goToPoint: boolean(),
29655
- runAction: boolean(),
29656
- playSound: boolean(),
29657
- light: boolean(),
29658
- lightMode: boolean()
29659
- });
29660
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29661
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
29662
- /**
29663
- * Live navigation state so the UI can reflect what the robot is doing:
29664
- * - `mode` — coarse activity (idle / cleaning / following / …).
29665
- * - `following` — person/pet follow is currently armed.
29666
- * - `flash` — the on-camera fill light is on.
29667
- * - `lightMode` — auto vs manual fill-light mode.
29668
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
29669
- * `lightMode === 'manual'`.
29670
- */
29671
- var NavigationStatusSchema = object({
29672
- mode: _enum([
29673
- "idle",
29674
- "cleaning",
29675
- "spot",
29676
- "following",
29677
- "goto",
29678
- "returning",
29679
- "paused",
29680
- "unknown"
29681
- ]),
29682
- following: boolean(),
29683
- flash: boolean(),
29684
- lightMode: NavigationLightModeSchema,
29685
- lightLevel: number().min(40).max(100),
29686
- /** Ms epoch when the slice was last updated. */
29687
- lastChangedAt: number()
29688
- });
29689
- /**
29690
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29691
- * observable). Adds `lastFetchedAt` on top of the status shape per the
29692
- * convention.
29693
- */
29694
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29695
- var navigationCapability = {
29696
- name: "navigation",
29697
- scope: "device",
29698
- deviceNative: true,
29699
- mode: "singleton",
29700
- deviceTypes: [DeviceType.Camera],
29701
- deviceConfig: { ui: {
29702
- kind: "widget",
29703
- widgetId: "host/navigation-panel",
29704
- tab: "navigation",
29705
- topTab: true,
29706
- label: "Navigation",
29707
- order: 0
29708
- } },
29709
- methods: {
29710
- /**
29711
- * Momentary drive nudge (the robot moves). `protected` — mirrors
29712
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29713
- * path) works for any authenticated user, not admin-only. The UI sends
29714
- * these at ~1 Hz while a control is held; the provider forwards each one to
29715
- * a single drive write WITHOUT debouncing.
29716
- */
29717
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29718
- /** Halt all motion immediately (zero drive vector). */
29719
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29720
- /** Send the robot to a point on its live map. */
29721
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29722
- /**
29723
- * Enumerate the discrete controls THIS device supports (data-driven UI +
29724
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29725
- */
29726
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29727
- /**
29728
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29729
- * unsupported action ids are rejected by the provider.
29730
- */
29731
- runAction: method(object({
29732
- deviceId: number(),
29733
- actionId: NavigationActionIdSchema
29734
- }), _void(), { kind: "mutation" }),
29735
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29736
- playSound: method(object({
29737
- deviceId: number(),
29738
- soundId: number().int()
29739
- }), _void(), { kind: "mutation" }),
29740
- /**
29741
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29742
- * works anytime, no active stream required).
29743
- */
29744
- setLightOn: method(object({
29745
- deviceId: number(),
29746
- on: boolean()
29747
- }), _void(), { kind: "mutation" }),
29748
- /**
29749
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29750
- * initial `level`. The auto/manual + level control is a CAMERA-service
29751
- * action that generally needs an active camera stream/monitor session — the
29752
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
29753
- */
29754
- setLightMode: method(object({
29755
- deviceId: number(),
29756
- mode: NavigationLightModeSchema,
29757
- level: number().min(40).max(100).optional()
29758
- }), _void(), { kind: "mutation" }),
29759
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29760
- setLightLevel: method(object({
29761
- deviceId: number(),
29762
- level: number().min(40).max(100)
29763
- }), _void(), { kind: "mutation" }),
29764
- /**
29765
- * Per-device FEATURE-FLAG report for the general primitives — drives which
29766
- * controls the UI shows (the per-entry flags for the dictionary come back on
29767
- * `listActions`).
29768
- */
29769
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29770
- },
29771
- events: { onStatusChanged: { data: object({
29772
- deviceId: number(),
29773
- status: NavigationStatusSchema
29774
- }) } },
29775
- status: {
29776
- schema: NavigationStatusSchema,
29777
- kind: "push"
29778
- },
29779
- /**
29780
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29781
- * for live mode / follow / flash changes.
29782
- */
29783
- runtimeState: NavigationRuntimeStateSchema,
29784
- /**
29785
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
29786
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
29787
- * that. The live handle re-publishes on connect.
29788
- *
29789
- * See `RuntimeStateDurability`. Enforced by
29790
- * `scripts/check-runtime-state-durability.ts`.
29791
- */
29792
- durability: "session"
29793
- };
29794
29921
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29795
29922
  kind: "mutation",
29796
29923
  auth: "admin"
@@ -39247,13 +39374,13 @@ Object.freeze({
39247
39374
  addonId: null,
39248
39375
  access: "view"
39249
39376
  },
39250
- "storage.getDefaultLocation": {
39377
+ "storage.list": {
39251
39378
  capName: "storage",
39252
39379
  capScope: "system",
39253
39380
  addonId: null,
39254
39381
  access: "view"
39255
39382
  },
39256
- "storage.list": {
39383
+ "storage.listDrainProgress": {
39257
39384
  capName: "storage",
39258
39385
  capScope: "system",
39259
39386
  addonId: null,
@@ -39403,6 +39530,12 @@ Object.freeze({
39403
39530
  addonId: null,
39404
39531
  access: "view"
39405
39532
  },
39533
+ "storageOccupancy.getOccupancy": {
39534
+ capName: "storage-occupancy",
39535
+ capScope: "system",
39536
+ addonId: null,
39537
+ access: "view"
39538
+ },
39406
39539
  "storageProvider.abortUpload": {
39407
39540
  capName: "storage-provider",
39408
39541
  capScope: "system",