@camstack/addon-import-alexa 0.2.77 → 0.2.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +621 -488
  2. package/dist/addon.mjs +621 -488
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -38,7 +38,7 @@ let node_os = require("node:os");
38
38
  let node_fs = require("node:fs");
39
39
  let node_path = require("node:path");
40
40
  node_path = __toESM(node_path);
41
- //#region ../types/dist/event-category-zAv7pMUz.mjs
41
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
42
42
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
43
43
  EventCategory["SystemBoot"] = "system.boot";
44
44
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -233,6 +233,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
233
233
  EventCategory["ProcessCrashed"] = "process.crashed";
234
234
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
235
235
  EventCategory["ProcessRestarted"] = "process.restarted";
236
+ /**
237
+ * The SET of storage locations changed — one was created, edited, enabled,
238
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
239
+ *
240
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
241
+ * it must also converge on its own periodic path, because a dropped event
242
+ * must not leave a node writing to yesterday's disk set forever. It exists
243
+ * because there was NO signal at all — an operator who added a second
244
+ * recordings disk in the admin UI got nothing, and the recorder kept its
245
+ * resolved locations until something else happened to re-resolve them
246
+ * (D387). Payload `StorageLocationsChangedPayload`.
247
+ */
248
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
236
249
  EventCategory["RecordingStarted"] = "recording.started";
237
250
  EventCategory["RecordingStopped"] = "recording.stopped";
238
251
  EventCategory["RecordingError"] = "recording.error";
@@ -7773,111 +7786,6 @@ var CameraSwitchGroupSchema = object({
7773
7786
  fetchedAt: number()
7774
7787
  });
7775
7788
  /**
7776
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7777
- * an addon declares its channels in.
7778
- *
7779
- * ## Two axes, deliberately separated
7780
- *
7781
- * - **DECLARATION** — which channels exist. Only the addon knows:
7782
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7783
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7784
- * and rots silently. So a channel is declared where it is consulted, and the
7785
- * `log-channels` capability enumerates the declarations.
7786
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7787
- * thing: the logging settings document on the `system` cap. Two authorities
7788
- * over the values is the exact defect
7789
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7790
- * remove; re-introducing it from the cure side would be grotesque.
7791
- *
7792
- * Nothing in this file reads a clock, an env var or a store. The registry is
7793
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7794
- * the hot path with a value somebody actually read, and by
7795
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7796
- * never reaches here, so it can neither disarm an armed channel nor arm a
7797
- * disarmed one (D49).
7798
- *
7799
- * ## The canonical call shape
7800
- *
7801
- * ```ts
7802
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7803
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7804
- * }
7805
- * ```
7806
- *
7807
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7808
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7809
- * object literal is never constructed because it lives inside the branch. It
7810
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7811
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7812
- * destination floor (measured at 1.93 ns/call when off).
7813
- *
7814
- * ## Why a channel emits at `info`
7815
- *
7816
- * `loki-logging.addon.ts` pins the destination default at `info` and
7817
- * `loki-destination.ts` drops everything below it, so a line emitted at
7818
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7819
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7820
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7821
- * emits at the channel's declared level, whose schema floor is `info`.
7822
- */
7823
- /**
7824
- * The level a channel writes at once armed.
7825
- *
7826
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7827
- * not leave the process for Loki, and the whole point of arming a channel is
7828
- * to read it later.
7829
- */
7830
- var LogChannelLevelSchema = _enum([
7831
- "info",
7832
- "warn",
7833
- "error"
7834
- ]);
7835
- /**
7836
- * What an addon declares about one channel. No value, no state — a
7837
- * declaration is inert.
7838
- */
7839
- var LogChannelDescriptorSchema = object({
7840
- /**
7841
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7842
- * the addon's short name so an operator reading a channel list can tell who
7843
- * owns it without a second lookup.
7844
- */
7845
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7846
- /** One sentence: what the operator will SEE after arming it. */
7847
- description: string().min(1),
7848
- /** The level its lines are emitted at. Never below `info`. */
7849
- defaultLevel: LogChannelLevelSchema,
7850
- /**
7851
- * Whether this channel can be narrowed to a camera.
7852
- *
7853
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7854
- * consulted with the numeric device id, AND every line the channel admits
7855
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7856
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7857
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7858
- * the body is the only way to filter.
7859
- *
7860
- * A channel whose lines carry the device only in `meta` (or not at all) is
7861
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7862
- * the operator narrows to one camera, sees nothing, and concludes the code
7863
- * path was never taken.
7864
- */
7865
- perDevice: boolean()
7866
- });
7867
- /**
7868
- * An armed window over one channel, as the document hands it to a mirror.
7869
- *
7870
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7871
- * expires by itself, which is the one failure a boolean cannot avoid.
7872
- */
7873
- var LogChannelWindowSchema = object({
7874
- channel: string().min(1),
7875
- /** Epoch ms the window closes at. */
7876
- armedUntilMs: number(),
7877
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7878
- deviceIds: array(number().int()).readonly().nullable()
7879
- });
7880
- /**
7881
7789
  * Ops-log — the durable, append-only operations audit shared by the
7882
7790
  * recordings and events management surfaces.
7883
7791
  *
@@ -8799,6 +8707,21 @@ var StorageCleanupJobSchema = object({
8799
8707
  });
8800
8708
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8801
8709
  /**
8710
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8711
+ * alias below is `z.infer<>` of it, never a second spelling.
8712
+ */
8713
+ var StorageLocationModeSchema = _enum([
8714
+ "active",
8715
+ "readonly",
8716
+ "drain",
8717
+ "disabled"
8718
+ ]);
8719
+ _enum([
8720
+ "normal",
8721
+ "never",
8722
+ "drain"
8723
+ ]);
8724
+ /**
8802
8725
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8803
8726
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8804
8727
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8823,8 +8746,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8823
8746
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8824
8747
  *
8825
8748
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8826
- * The default location for a type uses `id === <type>:default` by
8827
- * convention (the bare type ref like `'backups'` resolves to it).
8749
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8750
+ * There is no default location any more (D383): `enabled` is the whole write
8751
+ * model, and a bare type ref resolves to the sole location of the type, or —
8752
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8753
+ * slug is `default`.
8828
8754
  *
8829
8755
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8830
8756
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8845,23 +8771,37 @@ var StorageLocationSchema = object({
8845
8771
  * flag at upsert time, not here (the schema is provider-agnostic).
8846
8772
  */
8847
8773
  nodeId: string().optional(),
8848
- isDefault: boolean().default(false),
8849
8774
  isSystem: boolean().default(false),
8850
8775
  /**
8851
- * Operator opt-in: whether consumers that BALANCE across several locations
8852
- * of a type may write here. Recordings reads it today; event media and
8853
- * backups are the next consumers, which is why the flag lives on the
8854
- * location rather than in any one addon's store — nothing has to be
8855
- * extended to add the next consumer.
8776
+ * THE write switch, and the only one (D383). `enabled: true` means every
8777
+ * consumer that chooses a write target for this type may write here, and all
8778
+ * enabled locations of a type are used TOGETHER; `false` means read-only —
8779
+ * still read, still played back, still age-swept, still drained, never
8780
+ * written.
8856
8781
  *
8857
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8858
- * flag existed reads back with no flag and keeps working exactly as before;
8859
- * that is the whole compat story, and it is why no migration ships with it.
8860
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8861
- * disk must not silently start writing to it); the default of a type is
8862
- * always stamped `true`.
8782
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8783
+ * stored" on an update and "born inert unless it is the first location of its
8784
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8785
+ * enabled — {@link isLocationEnabled} is the one place that says so, and the
8786
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8787
+ * stops existing rather than being re-derived on every read.
8863
8788
  */
8864
8789
  enabled: boolean().optional(),
8790
+ /**
8791
+ * THE state of this location (D385), and the only authority on what may be
8792
+ * written, read or evicted here. Interpreted in exactly one place —
8793
+ * `storage-location-mode.ts` — which also folds the legacy
8794
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8795
+ * ambiguous.
8796
+ *
8797
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8798
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8799
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8800
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8801
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8802
+ * either, so the two cannot disagree.
8803
+ */
8804
+ mode: StorageLocationModeSchema.optional(),
8865
8805
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8866
8806
  * for node-local locations it can reach) — never persisted, absent when the
8867
8807
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8869,13 +8809,50 @@ var StorageLocationSchema = object({
8869
8809
  totalBytes: number(),
8870
8810
  availableBytes: number()
8871
8811
  }).nullable().optional(),
8812
+ /**
8813
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8814
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8815
+ * never persisted, never a filesystem walk.
8816
+ *
8817
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8818
+ * location yet — nobody stores here, the owning addon is down, or the first
8819
+ * refresh has not completed. A UI must omit the segment rather than draw it
8820
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8821
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8822
+ * be spelled out loud instead of appearing by accident.
8823
+ *
8824
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8825
+ * about the whole figure rather than about its freshest part.
8826
+ */
8827
+ owned: object({
8828
+ bytes: number().int().nonnegative(),
8829
+ measuredAtMs: number().int().nonnegative()
8830
+ }).optional(),
8872
8831
  createdAt: number(),
8873
8832
  updatedAt: number()
8874
8833
  });
8834
+ object({ isDefault: boolean().optional() });
8835
+ /**
8836
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8837
+ *
8838
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8839
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8840
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8841
+ * operator learns not to believe the screen.
8842
+ */
8843
+ var StorageDrainProgressSchema = object({
8844
+ locationId: string(),
8845
+ startedAtMs: number(),
8846
+ startBytes: number(),
8847
+ bytesRemaining: number(),
8848
+ drained: boolean(),
8849
+ estimatedEmptyAtMs: number().nullable()
8850
+ });
8875
8851
  /**
8876
8852
  * Reference accepted by consumer-facing `api.storage.*` calls.
8877
8853
  * Either:
8878
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8854
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8855
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8879
8856
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8880
8857
  *
8881
8858
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -9051,6 +9028,111 @@ var DecoderSessionConfigSchema = object({
9051
9028
  */
9052
9029
  debug: boolean().optional()
9053
9030
  });
9031
+ /**
9032
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
9033
+ * an addon declares its channels in.
9034
+ *
9035
+ * ## Two axes, deliberately separated
9036
+ *
9037
+ * - **DECLARATION** — which channels exist. Only the addon knows:
9038
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
9039
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
9040
+ * and rots silently. So a channel is declared where it is consulted, and the
9041
+ * `log-channels` capability enumerates the declarations.
9042
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
9043
+ * thing: the logging settings document on the `system` cap. Two authorities
9044
+ * over the values is the exact defect
9045
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
9046
+ * remove; re-introducing it from the cure side would be grotesque.
9047
+ *
9048
+ * Nothing in this file reads a clock, an env var or a store. The registry is
9049
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
9050
+ * the hot path with a value somebody actually read, and by
9051
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
9052
+ * never reaches here, so it can neither disarm an armed channel nor arm a
9053
+ * disarmed one (D49).
9054
+ *
9055
+ * ## The canonical call shape
9056
+ *
9057
+ * ```ts
9058
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
9059
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
9060
+ * }
9061
+ * ```
9062
+ *
9063
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
9064
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
9065
+ * object literal is never constructed because it lives inside the branch. It
9066
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
9067
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
9068
+ * destination floor (measured at 1.93 ns/call when off).
9069
+ *
9070
+ * ## Why a channel emits at `info`
9071
+ *
9072
+ * `loki-logging.addon.ts` pins the destination default at `info` and
9073
+ * `loki-destination.ts` drops everything below it, so a line emitted at
9074
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
9075
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
9076
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
9077
+ * emits at the channel's declared level, whose schema floor is `info`.
9078
+ */
9079
+ /**
9080
+ * The level a channel writes at once armed.
9081
+ *
9082
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
9083
+ * not leave the process for Loki, and the whole point of arming a channel is
9084
+ * to read it later.
9085
+ */
9086
+ var LogChannelLevelSchema = _enum([
9087
+ "info",
9088
+ "warn",
9089
+ "error"
9090
+ ]);
9091
+ /**
9092
+ * What an addon declares about one channel. No value, no state — a
9093
+ * declaration is inert.
9094
+ */
9095
+ var LogChannelDescriptorSchema = object({
9096
+ /**
9097
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
9098
+ * the addon's short name so an operator reading a channel list can tell who
9099
+ * owns it without a second lookup.
9100
+ */
9101
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
9102
+ /** One sentence: what the operator will SEE after arming it. */
9103
+ description: string().min(1),
9104
+ /** The level its lines are emitted at. Never below `info`. */
9105
+ defaultLevel: LogChannelLevelSchema,
9106
+ /**
9107
+ * Whether this channel can be narrowed to a camera.
9108
+ *
9109
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
9110
+ * consulted with the numeric device id, AND every line the channel admits
9111
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
9112
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
9113
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
9114
+ * the body is the only way to filter.
9115
+ *
9116
+ * A channel whose lines carry the device only in `meta` (or not at all) is
9117
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
9118
+ * the operator narrows to one camera, sees nothing, and concludes the code
9119
+ * path was never taken.
9120
+ */
9121
+ perDevice: boolean()
9122
+ });
9123
+ /**
9124
+ * An armed window over one channel, as the document hands it to a mirror.
9125
+ *
9126
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
9127
+ * expires by itself, which is the one failure a boolean cannot avoid.
9128
+ */
9129
+ var LogChannelWindowSchema = object({
9130
+ channel: string().min(1),
9131
+ /** Epoch ms the window closes at. */
9132
+ armedUntilMs: number(),
9133
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9134
+ deviceIds: array(number().int()).readonly().nullable()
9135
+ });
9054
9136
  var MODEL_FORMATS = [
9055
9137
  "onnx",
9056
9138
  "coreml",
@@ -22168,7 +22250,7 @@ method(object({
22168
22250
  downloadId: string(),
22169
22251
  offset: number(),
22170
22252
  length: number()
22171
- }), _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({
22253
+ }), _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({
22172
22254
  createdAt: true,
22173
22255
  updatedAt: true
22174
22256
  }), StorageLocationSchema, {
@@ -22180,7 +22262,7 @@ method(object({
22180
22262
  }), _void(), {
22181
22263
  kind: "mutation",
22182
22264
  auth: "admin"
22183
- }), method(object({ id: string() }), object({
22265
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
22184
22266
  ok: boolean(),
22185
22267
  error: string().optional()
22186
22268
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22250,6 +22332,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22250
22332
  kind: "mutation",
22251
22333
  auth: "admin"
22252
22334
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
22335
+ /**
22336
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
22337
+ * location (D388).
22338
+ *
22339
+ * ## Why this is not `storage-evictable`
22340
+ *
22341
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
22342
+ * not, in two ways that both matter and both bite hardest on the locations an
22343
+ * operator most wants a figure for:
22344
+ *
22345
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
22346
+ * and `recordingsLow:default` deliberately share one root and evict as one
22347
+ * oldest-first pool, so both answer with the SAME combined total. As an
22348
+ * occupancy figure that double-counts the disk.
22349
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
22350
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
22351
+ * is retiring and staring at.
22352
+ *
22353
+ * So this is its own contract with its own quantity, and the quantity is
22354
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
22355
+ * would ever be willing to delete it. A provider that can only answer
22356
+ * "evictable" must not register here — a number that silently means different
22357
+ * things per class is worse than no number.
22358
+ *
22359
+ * ## Absence is an answer
22360
+ *
22361
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
22362
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
22363
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
22364
+ * consuming side has to be written out loud instead of appearing by accident.
22365
+ *
22366
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
22367
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
22368
+ */
22369
+ /** One provider's occupancy answer for one location. */
22370
+ var StorageOccupancyReportSchema = object({
22371
+ locationId: string(),
22372
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
22373
+ * not net of what it is willing to delete. */
22374
+ ownedBytes: number().int().nonnegative(),
22375
+ /** When the provider last actually measured this. The orchestrator carries it
22376
+ * through so a UI can say how old the figure is instead of implying "now". */
22377
+ measuredAtMs: number().int().nonnegative()
22378
+ });
22379
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22253
22380
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22254
22381
  providerId: string().min(1),
22255
22382
  displayName: string().min(1),
@@ -24085,88 +24212,6 @@ onStatusChanged: { data: object({
24085
24212
  volatileStateFields: ["lastUpdated"]
24086
24213
  };
24087
24214
  /**
24088
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
24089
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24090
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
24091
- * one Home Assistant projection.
24092
- */
24093
- var NetworkLinkStatusSchema = object({
24094
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24095
- type: _enum([
24096
- "wifi",
24097
- "ethernet",
24098
- "cellular",
24099
- "unknown"
24100
- ]),
24101
- /**
24102
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
24103
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24104
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24105
- * one whose reading has not landed must not be drawn at 0 %. Consumers
24106
- * SKIP a null rather than coerce it.
24107
- */
24108
- signalPercent: number().min(0).max(100).nullable(),
24109
- /** Raw received signal strength in dBm, when the firmware reports one. */
24110
- rssiDbm: number().optional(),
24111
- /** Network name of a wireless link, when the firmware reports it. */
24112
- ssid: string().optional(),
24113
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24114
- lastUpdated: number()
24115
- });
24116
- var networkLinkCapability = {
24117
- name: "network-link",
24118
- scope: "device",
24119
- deviceNative: true,
24120
- mode: "singleton",
24121
- deviceTypes: [
24122
- DeviceType.Camera,
24123
- DeviceType.Sensor,
24124
- DeviceType.Button,
24125
- DeviceType.Switch,
24126
- DeviceType.Light,
24127
- DeviceType.Lock,
24128
- DeviceType.Siren
24129
- ],
24130
- methods: {},
24131
- events: {
24132
- /**
24133
- * Emitted whenever the cached status changes (a link switch, a signal
24134
- * reading that moved). Mirrored on the parent chain by the
24135
- * DeviceEventPropagator like `battery.onStatusChanged`.
24136
- */
24137
- onStatusChanged: { data: object({
24138
- deviceId: number(),
24139
- status: NetworkLinkStatusSchema
24140
- }) } },
24141
- status: {
24142
- schema: NetworkLinkStatusSchema,
24143
- kind: "push",
24144
- empty: {
24145
- type: "unknown",
24146
- signalPercent: null,
24147
- lastUpdated: 0
24148
- }
24149
- },
24150
- /**
24151
- * Runtime-state slice — every provider stores the same shape under
24152
- * `device.runtimeState['network-link']`, read once by the badge and the
24153
- * Home Assistant projector regardless of the driver.
24154
- */
24155
- runtimeState: NetworkLinkStatusSchema,
24156
- /**
24157
- * Runtime-state durability: **restored** — a link reading is slow to
24158
- * change and a sleeping battery camera may not report for hours; the
24159
- * restored slice is what the badge shows until the next read.
24160
- *
24161
- * See `RuntimeStateDurability`. Enforced by
24162
- * `scripts/check-runtime-state-durability.ts`.
24163
- */
24164
- durability: "restored",
24165
- /** Clock fields: written, but excluded from the compare that decides
24166
- * whether persisting is worth a SQLite commit. */
24167
- volatileStateFields: ["lastUpdated"]
24168
- };
24169
- /**
24170
24215
  * Generic boolean sensor — last-resort fallback when no domain-
24171
24216
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24172
24217
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -27713,6 +27758,369 @@ var nativeObjectDetectionCapability = {
27713
27758
  volatileStateFields: ["lastFetchedAt"]
27714
27759
  };
27715
27760
  /**
27761
+ * `navigation` — a device-scoped capability that natively expresses the FULL
27762
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
27763
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
27764
+ *
27765
+ * Why a NEW cap rather than overloading `ptz`:
27766
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27767
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27768
+ * The two are different physical models: PTZ is absolute-position + presets,
27769
+ * navigation is momentary drive nudges + discrete robot ACTIONS
27770
+ * (dock / spot-clean / follow-pet / go-to-point / …).
27771
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27772
+ * the reverse:
27773
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
27774
+ * / `getOptions`), and
27775
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27776
+ * robot camera shows up in the existing PTZ control path without every
27777
+ * PTZ provider learning about robots. The mapping lives in the adapter,
27778
+ * not here (see the addon design note):
27779
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27780
+ * ptz.stop() → navigation.stop()
27781
+ * ptz.goHome() → navigation.runAction('goHome')
27782
+ * ptz.getPresets() → navigation.listActions() (id→preset)
27783
+ * ptz.goToPreset(id) → navigation.runAction(id)
27784
+ *
27785
+ * ## Continuous drive
27786
+ *
27787
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27788
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27789
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27790
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27791
+ * coalesce them. The UI owns the cadence.
27792
+ *
27793
+ * ## The action dictionary
27794
+ *
27795
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27796
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27797
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27798
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27799
+ * vendor-specific list. `kind: 'action'` entries are triggered with
27800
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27801
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
27802
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27803
+ *
27804
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27805
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27806
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
27807
+ * every device handle. A future nodedreame publish adds a typed
27808
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27809
+ * provider can then swap the raw calls for the typed methods with no change to
27810
+ * THIS contract.
27811
+ */
27812
+ /**
27813
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27814
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27815
+ * halts it.
27816
+ *
27817
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
27818
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27819
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27820
+ * vector by it (drivers without proportional drive ignore it).
27821
+ *
27822
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27823
+ * axis alone; an all-undefined nudge is a no-op.
27824
+ */
27825
+ var NavigationMoveCommandSchema = object({
27826
+ pan: number().min(-1).max(1).optional(),
27827
+ tilt: number().min(-1).max(1).optional(),
27828
+ speed: number().min(0).max(1).optional()
27829
+ });
27830
+ /**
27831
+ * The enumerated discrete actions a navigation-capable robot can perform via
27832
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27833
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
27834
+ * `playSound` (see the `sound` dictionary entries).
27835
+ */
27836
+ var NavigationActionIdSchema = _enum([
27837
+ "goHome",
27838
+ "locate",
27839
+ "spotClean",
27840
+ "findPet",
27841
+ "personFollow",
27842
+ "stop",
27843
+ "startClean",
27844
+ "pauseClean",
27845
+ "dockWash",
27846
+ "autoEmpty",
27847
+ "flashOn",
27848
+ "flashOff"
27849
+ ]);
27850
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27851
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
27852
+ /**
27853
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27854
+ * native panel and the PTZ mimic render as a button.
27855
+ *
27856
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27857
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27858
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
27859
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27860
+ * - `label` — operator-facing English label.
27861
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27862
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27863
+ * PTZ render ONLY enabled entries. Data-driven: the provider
27864
+ * flips it from config, never by editing code.
27865
+ */
27866
+ var NavigationActionEntrySchema = object({
27867
+ id: string(),
27868
+ kind: NavigationEntryKindSchema,
27869
+ label: string(),
27870
+ icon: string(),
27871
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27872
+ soundId: number().int().optional(),
27873
+ /** Per-device feature flag — render this entry only when true. */
27874
+ enabled: boolean()
27875
+ });
27876
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
27877
+ var NavigationPointSchema = object({
27878
+ x: number(),
27879
+ y: number()
27880
+ });
27881
+ /**
27882
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27883
+ * The cap reports which are enabled so the UI / PTZ render only the controls
27884
+ * that are turned on for THIS device. Data-driven: the provider derives these
27885
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27886
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27887
+ * that are not dictionary entries.
27888
+ *
27889
+ * - `move` / `stop` — the momentary drive joystick.
27890
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27891
+ * map-coordinate plumbing is wired.
27892
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27893
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27894
+ * - `light` — the on/off fill-light toggle (works anytime).
27895
+ * - `lightMode` — the auto/manual selector + manual level slider (a
27896
+ * camera-service control; needs an active stream).
27897
+ */
27898
+ var NavigationFeaturesSchema = object({
27899
+ move: boolean(),
27900
+ stop: boolean(),
27901
+ goToPoint: boolean(),
27902
+ runAction: boolean(),
27903
+ playSound: boolean(),
27904
+ light: boolean(),
27905
+ lightMode: boolean()
27906
+ });
27907
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27908
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
27909
+ /**
27910
+ * Live navigation state so the UI can reflect what the robot is doing:
27911
+ * - `mode` — coarse activity (idle / cleaning / following / …).
27912
+ * - `following` — person/pet follow is currently armed.
27913
+ * - `flash` — the on-camera fill light is on.
27914
+ * - `lightMode` — auto vs manual fill-light mode.
27915
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
27916
+ * `lightMode === 'manual'`.
27917
+ */
27918
+ var NavigationStatusSchema = object({
27919
+ mode: _enum([
27920
+ "idle",
27921
+ "cleaning",
27922
+ "spot",
27923
+ "following",
27924
+ "goto",
27925
+ "returning",
27926
+ "paused",
27927
+ "unknown"
27928
+ ]),
27929
+ following: boolean(),
27930
+ flash: boolean(),
27931
+ lightMode: NavigationLightModeSchema,
27932
+ lightLevel: number().min(40).max(100),
27933
+ /** Ms epoch when the slice was last updated. */
27934
+ lastChangedAt: number()
27935
+ });
27936
+ /**
27937
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
27938
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
27939
+ * convention.
27940
+ */
27941
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
27942
+ var navigationCapability = {
27943
+ name: "navigation",
27944
+ scope: "device",
27945
+ deviceNative: true,
27946
+ mode: "singleton",
27947
+ deviceTypes: [DeviceType.Camera],
27948
+ deviceConfig: { ui: {
27949
+ kind: "widget",
27950
+ widgetId: "host/navigation-panel",
27951
+ tab: "navigation",
27952
+ topTab: true,
27953
+ label: "Navigation",
27954
+ order: 0
27955
+ } },
27956
+ methods: {
27957
+ /**
27958
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
27959
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
27960
+ * path) works for any authenticated user, not admin-only. The UI sends
27961
+ * these at ~1 Hz while a control is held; the provider forwards each one to
27962
+ * a single drive write WITHOUT debouncing.
27963
+ */
27964
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27965
+ /** Halt all motion immediately (zero drive vector). */
27966
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
27967
+ /** Send the robot to a point on its live map. */
27968
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
27969
+ /**
27970
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
27971
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
27972
+ */
27973
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
27974
+ /**
27975
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
27976
+ * unsupported action ids are rejected by the provider.
27977
+ */
27978
+ runAction: method(object({
27979
+ deviceId: number(),
27980
+ actionId: NavigationActionIdSchema
27981
+ }), _void(), { kind: "mutation" }),
27982
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
27983
+ playSound: method(object({
27984
+ deviceId: number(),
27985
+ soundId: number().int()
27986
+ }), _void(), { kind: "mutation" }),
27987
+ /**
27988
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
27989
+ * works anytime, no active stream required).
27990
+ */
27991
+ setLightOn: method(object({
27992
+ deviceId: number(),
27993
+ on: boolean()
27994
+ }), _void(), { kind: "mutation" }),
27995
+ /**
27996
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
27997
+ * initial `level`. The auto/manual + level control is a CAMERA-service
27998
+ * action that generally needs an active camera stream/monitor session — the
27999
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
28000
+ */
28001
+ setLightMode: method(object({
28002
+ deviceId: number(),
28003
+ mode: NavigationLightModeSchema,
28004
+ level: number().min(40).max(100).optional()
28005
+ }), _void(), { kind: "mutation" }),
28006
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
28007
+ setLightLevel: method(object({
28008
+ deviceId: number(),
28009
+ level: number().min(40).max(100)
28010
+ }), _void(), { kind: "mutation" }),
28011
+ /**
28012
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
28013
+ * controls the UI shows (the per-entry flags for the dictionary come back on
28014
+ * `listActions`).
28015
+ */
28016
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
28017
+ },
28018
+ events: { onStatusChanged: { data: object({
28019
+ deviceId: number(),
28020
+ status: NavigationStatusSchema
28021
+ }) } },
28022
+ status: {
28023
+ schema: NavigationStatusSchema,
28024
+ kind: "push"
28025
+ },
28026
+ /**
28027
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
28028
+ * for live mode / follow / flash changes.
28029
+ */
28030
+ runtimeState: NavigationRuntimeStateSchema,
28031
+ /**
28032
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
28033
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
28034
+ * that. The live handle re-publishes on connect.
28035
+ *
28036
+ * See `RuntimeStateDurability`. Enforced by
28037
+ * `scripts/check-runtime-state-durability.ts`.
28038
+ */
28039
+ durability: "session"
28040
+ };
28041
+ /**
28042
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
28043
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
28044
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
28045
+ * one Home Assistant projection.
28046
+ */
28047
+ var NetworkLinkStatusSchema = object({
28048
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
28049
+ type: _enum([
28050
+ "wifi",
28051
+ "ethernet",
28052
+ "cellular",
28053
+ "unknown"
28054
+ ]),
28055
+ /**
28056
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
28057
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
28058
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
28059
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
28060
+ * SKIP a null rather than coerce it.
28061
+ */
28062
+ signalPercent: number().min(0).max(100).nullable(),
28063
+ /** Raw received signal strength in dBm, when the firmware reports one. */
28064
+ rssiDbm: number().optional(),
28065
+ /** Network name of a wireless link, when the firmware reports it. */
28066
+ ssid: string().optional(),
28067
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
28068
+ lastUpdated: number()
28069
+ });
28070
+ var networkLinkCapability = {
28071
+ name: "network-link",
28072
+ scope: "device",
28073
+ deviceNative: true,
28074
+ mode: "singleton",
28075
+ deviceTypes: [
28076
+ DeviceType.Camera,
28077
+ DeviceType.Sensor,
28078
+ DeviceType.Button,
28079
+ DeviceType.Switch,
28080
+ DeviceType.Light,
28081
+ DeviceType.Lock,
28082
+ DeviceType.Siren
28083
+ ],
28084
+ methods: {},
28085
+ events: {
28086
+ /**
28087
+ * Emitted whenever the cached status changes (a link switch, a signal
28088
+ * reading that moved). Mirrored on the parent chain by the
28089
+ * DeviceEventPropagator like `battery.onStatusChanged`.
28090
+ */
28091
+ onStatusChanged: { data: object({
28092
+ deviceId: number(),
28093
+ status: NetworkLinkStatusSchema
28094
+ }) } },
28095
+ status: {
28096
+ schema: NetworkLinkStatusSchema,
28097
+ kind: "push",
28098
+ empty: {
28099
+ type: "unknown",
28100
+ signalPercent: null,
28101
+ lastUpdated: 0
28102
+ }
28103
+ },
28104
+ /**
28105
+ * Runtime-state slice — every provider stores the same shape under
28106
+ * `device.runtimeState['network-link']`, read once by the badge and the
28107
+ * Home Assistant projector regardless of the driver.
28108
+ */
28109
+ runtimeState: NetworkLinkStatusSchema,
28110
+ /**
28111
+ * Runtime-state durability: **restored** — a link reading is slow to
28112
+ * change and a sleeping battery camera may not report for hours; the
28113
+ * restored slice is what the badge shows until the next read.
28114
+ *
28115
+ * See `RuntimeStateDurability`. Enforced by
28116
+ * `scripts/check-runtime-state-durability.ts`.
28117
+ */
28118
+ durability: "restored",
28119
+ /** Clock fields: written, but excluded from the compare that decides
28120
+ * whether persisting is worth a SQLite commit. */
28121
+ volatileStateFields: ["lastUpdated"]
28122
+ };
28123
+ /**
27716
28124
  * network-quality — system-scoped singleton capability tracking RTT,
27717
28125
  * jitter, and observed/peak bandwidth per device + per client.
27718
28126
  *
@@ -29293,287 +29701,6 @@ var ptzAutotrackCapability = {
29293
29701
  */
29294
29702
  durability: "session"
29295
29703
  };
29296
- /**
29297
- * `navigation` — a device-scoped capability that natively expresses the FULL
29298
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
29299
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
29300
- *
29301
- * Why a NEW cap rather than overloading `ptz`:
29302
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29303
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29304
- * The two are different physical models: PTZ is absolute-position + presets,
29305
- * navigation is momentary drive nudges + discrete robot ACTIONS
29306
- * (dock / spot-clean / follow-pet / go-to-point / …).
29307
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29308
- * the reverse:
29309
- * 1. a native CamStack navigation panel (data-driven from `listActions`
29310
- * / `getOptions`), and
29311
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29312
- * robot camera shows up in the existing PTZ control path without every
29313
- * PTZ provider learning about robots. The mapping lives in the adapter,
29314
- * not here (see the addon design note):
29315
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29316
- * ptz.stop() → navigation.stop()
29317
- * ptz.goHome() → navigation.runAction('goHome')
29318
- * ptz.getPresets() → navigation.listActions() (id→preset)
29319
- * ptz.goToPreset(id) → navigation.runAction(id)
29320
- *
29321
- * ## Continuous drive
29322
- *
29323
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29324
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29325
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29326
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29327
- * coalesce them. The UI owns the cadence.
29328
- *
29329
- * ## The action dictionary
29330
- *
29331
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29332
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29333
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29334
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29335
- * vendor-specific list. `kind: 'action'` entries are triggered with
29336
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29337
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
29338
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29339
- *
29340
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29341
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29342
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
29343
- * every device handle. A future nodedreame publish adds a typed
29344
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29345
- * provider can then swap the raw calls for the typed methods with no change to
29346
- * THIS contract.
29347
- */
29348
- /**
29349
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29350
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29351
- * halts it.
29352
- *
29353
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
29354
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29355
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29356
- * vector by it (drivers without proportional drive ignore it).
29357
- *
29358
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29359
- * axis alone; an all-undefined nudge is a no-op.
29360
- */
29361
- var NavigationMoveCommandSchema = object({
29362
- pan: number().min(-1).max(1).optional(),
29363
- tilt: number().min(-1).max(1).optional(),
29364
- speed: number().min(0).max(1).optional()
29365
- });
29366
- /**
29367
- * The enumerated discrete actions a navigation-capable robot can perform via
29368
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29369
- * subset it supports through `listActions`. Sounds are NOT here — they go through
29370
- * `playSound` (see the `sound` dictionary entries).
29371
- */
29372
- var NavigationActionIdSchema = _enum([
29373
- "goHome",
29374
- "locate",
29375
- "spotClean",
29376
- "findPet",
29377
- "personFollow",
29378
- "stop",
29379
- "startClean",
29380
- "pauseClean",
29381
- "dockWash",
29382
- "autoEmpty",
29383
- "flashOn",
29384
- "flashOff"
29385
- ]);
29386
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29387
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
29388
- /**
29389
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29390
- * native panel and the PTZ mimic render as a button.
29391
- *
29392
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29393
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29394
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
29395
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29396
- * - `label` — operator-facing English label.
29397
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29398
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29399
- * PTZ render ONLY enabled entries. Data-driven: the provider
29400
- * flips it from config, never by editing code.
29401
- */
29402
- var NavigationActionEntrySchema = object({
29403
- id: string(),
29404
- kind: NavigationEntryKindSchema,
29405
- label: string(),
29406
- icon: string(),
29407
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29408
- soundId: number().int().optional(),
29409
- /** Per-device feature flag — render this entry only when true. */
29410
- enabled: boolean()
29411
- });
29412
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
29413
- var NavigationPointSchema = object({
29414
- x: number(),
29415
- y: number()
29416
- });
29417
- /**
29418
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29419
- * The cap reports which are enabled so the UI / PTZ render only the controls
29420
- * that are turned on for THIS device. Data-driven: the provider derives these
29421
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29422
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29423
- * that are not dictionary entries.
29424
- *
29425
- * - `move` / `stop` — the momentary drive joystick.
29426
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29427
- * map-coordinate plumbing is wired.
29428
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29429
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29430
- * - `light` — the on/off fill-light toggle (works anytime).
29431
- * - `lightMode` — the auto/manual selector + manual level slider (a
29432
- * camera-service control; needs an active stream).
29433
- */
29434
- var NavigationFeaturesSchema = object({
29435
- move: boolean(),
29436
- stop: boolean(),
29437
- goToPoint: boolean(),
29438
- runAction: boolean(),
29439
- playSound: boolean(),
29440
- light: boolean(),
29441
- lightMode: boolean()
29442
- });
29443
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29444
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
29445
- /**
29446
- * Live navigation state so the UI can reflect what the robot is doing:
29447
- * - `mode` — coarse activity (idle / cleaning / following / …).
29448
- * - `following` — person/pet follow is currently armed.
29449
- * - `flash` — the on-camera fill light is on.
29450
- * - `lightMode` — auto vs manual fill-light mode.
29451
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
29452
- * `lightMode === 'manual'`.
29453
- */
29454
- var NavigationStatusSchema = object({
29455
- mode: _enum([
29456
- "idle",
29457
- "cleaning",
29458
- "spot",
29459
- "following",
29460
- "goto",
29461
- "returning",
29462
- "paused",
29463
- "unknown"
29464
- ]),
29465
- following: boolean(),
29466
- flash: boolean(),
29467
- lightMode: NavigationLightModeSchema,
29468
- lightLevel: number().min(40).max(100),
29469
- /** Ms epoch when the slice was last updated. */
29470
- lastChangedAt: number()
29471
- });
29472
- /**
29473
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29474
- * observable). Adds `lastFetchedAt` on top of the status shape per the
29475
- * convention.
29476
- */
29477
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29478
- var navigationCapability = {
29479
- name: "navigation",
29480
- scope: "device",
29481
- deviceNative: true,
29482
- mode: "singleton",
29483
- deviceTypes: [DeviceType.Camera],
29484
- deviceConfig: { ui: {
29485
- kind: "widget",
29486
- widgetId: "host/navigation-panel",
29487
- tab: "navigation",
29488
- topTab: true,
29489
- label: "Navigation",
29490
- order: 0
29491
- } },
29492
- methods: {
29493
- /**
29494
- * Momentary drive nudge (the robot moves). `protected` — mirrors
29495
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29496
- * path) works for any authenticated user, not admin-only. The UI sends
29497
- * these at ~1 Hz while a control is held; the provider forwards each one to
29498
- * a single drive write WITHOUT debouncing.
29499
- */
29500
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29501
- /** Halt all motion immediately (zero drive vector). */
29502
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29503
- /** Send the robot to a point on its live map. */
29504
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29505
- /**
29506
- * Enumerate the discrete controls THIS device supports (data-driven UI +
29507
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29508
- */
29509
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29510
- /**
29511
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29512
- * unsupported action ids are rejected by the provider.
29513
- */
29514
- runAction: method(object({
29515
- deviceId: number(),
29516
- actionId: NavigationActionIdSchema
29517
- }), _void(), { kind: "mutation" }),
29518
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29519
- playSound: method(object({
29520
- deviceId: number(),
29521
- soundId: number().int()
29522
- }), _void(), { kind: "mutation" }),
29523
- /**
29524
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29525
- * works anytime, no active stream required).
29526
- */
29527
- setLightOn: method(object({
29528
- deviceId: number(),
29529
- on: boolean()
29530
- }), _void(), { kind: "mutation" }),
29531
- /**
29532
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29533
- * initial `level`. The auto/manual + level control is a CAMERA-service
29534
- * action that generally needs an active camera stream/monitor session — the
29535
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
29536
- */
29537
- setLightMode: method(object({
29538
- deviceId: number(),
29539
- mode: NavigationLightModeSchema,
29540
- level: number().min(40).max(100).optional()
29541
- }), _void(), { kind: "mutation" }),
29542
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29543
- setLightLevel: method(object({
29544
- deviceId: number(),
29545
- level: number().min(40).max(100)
29546
- }), _void(), { kind: "mutation" }),
29547
- /**
29548
- * Per-device FEATURE-FLAG report for the general primitives — drives which
29549
- * controls the UI shows (the per-entry flags for the dictionary come back on
29550
- * `listActions`).
29551
- */
29552
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29553
- },
29554
- events: { onStatusChanged: { data: object({
29555
- deviceId: number(),
29556
- status: NavigationStatusSchema
29557
- }) } },
29558
- status: {
29559
- schema: NavigationStatusSchema,
29560
- kind: "push"
29561
- },
29562
- /**
29563
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29564
- * for live mode / follow / flash changes.
29565
- */
29566
- runtimeState: NavigationRuntimeStateSchema,
29567
- /**
29568
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
29569
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
29570
- * that. The live handle re-publishes on connect.
29571
- *
29572
- * See `RuntimeStateDurability`. Enforced by
29573
- * `scripts/check-runtime-state-durability.ts`.
29574
- */
29575
- durability: "session"
29576
- };
29577
29704
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29578
29705
  kind: "mutation",
29579
29706
  auth: "admin"
@@ -39030,13 +39157,13 @@ Object.freeze({
39030
39157
  addonId: null,
39031
39158
  access: "view"
39032
39159
  },
39033
- "storage.getDefaultLocation": {
39160
+ "storage.list": {
39034
39161
  capName: "storage",
39035
39162
  capScope: "system",
39036
39163
  addonId: null,
39037
39164
  access: "view"
39038
39165
  },
39039
- "storage.list": {
39166
+ "storage.listDrainProgress": {
39040
39167
  capName: "storage",
39041
39168
  capScope: "system",
39042
39169
  addonId: null,
@@ -39186,6 +39313,12 @@ Object.freeze({
39186
39313
  addonId: null,
39187
39314
  access: "view"
39188
39315
  },
39316
+ "storageOccupancy.getOccupancy": {
39317
+ capName: "storage-occupancy",
39318
+ capScope: "system",
39319
+ addonId: null,
39320
+ access: "view"
39321
+ },
39189
39322
  "storageProvider.abortUpload": {
39190
39323
  capName: "storage-provider",
39191
39324
  capScope: "system",