@camstack/addon-osd-manager 0.1.75 → 0.1.77

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 (18) hide show
  1. package/dist/{MotionZonesSettings-C7jRsout.mjs → MotionZonesSettings-CcUQv9US.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-BdztqQd2.mjs → PrivacyMaskSettings-C1kY8VDL.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-Cg47gSZn.mjs → SceneMonitorEditor-DSLR3HyX.mjs} +3 -3
  4. package/dist/_stub.js +10 -10
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-Dzr3iybL.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-CBDnIQTl.mjs} +4 -4
  6. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-zKEKO1Le.mjs +26 -0
  7. package/dist/{hostInit-C0fK-ddn.mjs → hostInit-DSL_s_Qu.mjs} +3 -3
  8. package/dist/index.js +646 -487
  9. package/dist/index.mjs +646 -487
  10. package/dist/{player-overlays-o65lZSbk.mjs → player-overlays-DPEo1CnK.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-DbTv1Tw_.mjs → responsive-veJ_u_lF.mjs} +1 -1
  13. package/dist/{square-3lb1NRdx.mjs → square-BKRxPrj2.mjs} +1 -1
  14. package/dist/{trash-2-C80GFjip.mjs → trash-2-B_FOJHPE.mjs} +1 -1
  15. package/dist/{use-device-snapshot-C6nbTUeb.mjs → use-device-snapshot-CCUZGgXd.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-BsrrBUK-.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-CtVrWNnx.mjs} +1 -1
  17. package/package.json +1 -1
  18. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-bYmvh4b8.mjs +0 -26
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- //#region ../types/dist/event-category-zAv7pMUz.mjs
5
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -197,6 +197,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
197
197
  EventCategory["ProcessCrashed"] = "process.crashed";
198
198
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
199
199
  EventCategory["ProcessRestarted"] = "process.restarted";
200
+ /**
201
+ * The SET of storage locations changed — one was created, edited, enabled,
202
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
203
+ *
204
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
205
+ * it must also converge on its own periodic path, because a dropped event
206
+ * must not leave a node writing to yesterday's disk set forever. It exists
207
+ * because there was NO signal at all — an operator who added a second
208
+ * recordings disk in the admin UI got nothing, and the recorder kept its
209
+ * resolved locations until something else happened to re-resolve them
210
+ * (D387). Payload `StorageLocationsChangedPayload`.
211
+ */
212
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
200
213
  EventCategory["RecordingStarted"] = "recording.started";
201
214
  EventCategory["RecordingStopped"] = "recording.stopped";
202
215
  EventCategory["RecordingError"] = "recording.error";
@@ -7714,111 +7727,6 @@ var CameraSwitchGroupSchema = object({
7714
7727
  fetchedAt: number()
7715
7728
  });
7716
7729
  /**
7717
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7718
- * an addon declares its channels in.
7719
- *
7720
- * ## Two axes, deliberately separated
7721
- *
7722
- * - **DECLARATION** — which channels exist. Only the addon knows:
7723
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7724
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7725
- * and rots silently. So a channel is declared where it is consulted, and the
7726
- * `log-channels` capability enumerates the declarations.
7727
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7728
- * thing: the logging settings document on the `system` cap. Two authorities
7729
- * over the values is the exact defect
7730
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7731
- * remove; re-introducing it from the cure side would be grotesque.
7732
- *
7733
- * Nothing in this file reads a clock, an env var or a store. The registry is
7734
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7735
- * the hot path with a value somebody actually read, and by
7736
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7737
- * never reaches here, so it can neither disarm an armed channel nor arm a
7738
- * disarmed one (D49).
7739
- *
7740
- * ## The canonical call shape
7741
- *
7742
- * ```ts
7743
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7744
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7745
- * }
7746
- * ```
7747
- *
7748
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7749
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7750
- * object literal is never constructed because it lives inside the branch. It
7751
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7752
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7753
- * destination floor (measured at 1.93 ns/call when off).
7754
- *
7755
- * ## Why a channel emits at `info`
7756
- *
7757
- * `loki-logging.addon.ts` pins the destination default at `info` and
7758
- * `loki-destination.ts` drops everything below it, so a line emitted at
7759
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7760
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7761
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7762
- * emits at the channel's declared level, whose schema floor is `info`.
7763
- */
7764
- /**
7765
- * The level a channel writes at once armed.
7766
- *
7767
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7768
- * not leave the process for Loki, and the whole point of arming a channel is
7769
- * to read it later.
7770
- */
7771
- var LogChannelLevelSchema = _enum([
7772
- "info",
7773
- "warn",
7774
- "error"
7775
- ]);
7776
- /**
7777
- * What an addon declares about one channel. No value, no state — a
7778
- * declaration is inert.
7779
- */
7780
- var LogChannelDescriptorSchema = object({
7781
- /**
7782
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7783
- * the addon's short name so an operator reading a channel list can tell who
7784
- * owns it without a second lookup.
7785
- */
7786
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7787
- /** One sentence: what the operator will SEE after arming it. */
7788
- description: string().min(1),
7789
- /** The level its lines are emitted at. Never below `info`. */
7790
- defaultLevel: LogChannelLevelSchema,
7791
- /**
7792
- * Whether this channel can be narrowed to a camera.
7793
- *
7794
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7795
- * consulted with the numeric device id, AND every line the channel admits
7796
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7797
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7798
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7799
- * the body is the only way to filter.
7800
- *
7801
- * A channel whose lines carry the device only in `meta` (or not at all) is
7802
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7803
- * the operator narrows to one camera, sees nothing, and concludes the code
7804
- * path was never taken.
7805
- */
7806
- perDevice: boolean()
7807
- });
7808
- /**
7809
- * An armed window over one channel, as the document hands it to a mirror.
7810
- *
7811
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7812
- * expires by itself, which is the one failure a boolean cannot avoid.
7813
- */
7814
- var LogChannelWindowSchema = object({
7815
- channel: string().min(1),
7816
- /** Epoch ms the window closes at. */
7817
- armedUntilMs: number(),
7818
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7819
- deviceIds: array(number().int()).readonly().nullable()
7820
- });
7821
- /**
7822
7730
  * Ops-log — the durable, append-only operations audit shared by the
7823
7731
  * recordings and events management surfaces.
7824
7732
  *
@@ -8740,6 +8648,21 @@ var StorageCleanupJobSchema = object({
8740
8648
  });
8741
8649
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8742
8650
  /**
8651
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8652
+ * alias below is `z.infer<>` of it, never a second spelling.
8653
+ */
8654
+ var StorageLocationModeSchema = _enum([
8655
+ "active",
8656
+ "readonly",
8657
+ "drain",
8658
+ "disabled"
8659
+ ]);
8660
+ _enum([
8661
+ "normal",
8662
+ "never",
8663
+ "drain"
8664
+ ]);
8665
+ /**
8743
8666
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8744
8667
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8745
8668
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8764,8 +8687,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8764
8687
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8765
8688
  *
8766
8689
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8767
- * The default location for a type uses `id === <type>:default` by
8768
- * convention (the bare type ref like `'backups'` resolves to it).
8690
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8691
+ * There is no default location any more (D383): `enabled` is the whole write
8692
+ * model, and a bare type ref resolves to the sole location of the type, or —
8693
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8694
+ * slug is `default`.
8769
8695
  *
8770
8696
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8771
8697
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8786,23 +8712,37 @@ var StorageLocationSchema = object({
8786
8712
  * flag at upsert time, not here (the schema is provider-agnostic).
8787
8713
  */
8788
8714
  nodeId: string().optional(),
8789
- isDefault: boolean().default(false),
8790
8715
  isSystem: boolean().default(false),
8791
8716
  /**
8792
- * Operator opt-in: whether consumers that BALANCE across several locations
8793
- * of a type may write here. Recordings reads it today; event media and
8794
- * backups are the next consumers, which is why the flag lives on the
8795
- * location rather than in any one addon's store nothing has to be
8796
- * extended to add the next consumer.
8717
+ * THE write switch, and the only one (D383). `enabled: true` means every
8718
+ * consumer that chooses a write target for this type may write here, and all
8719
+ * enabled locations of a type are used TOGETHER; `false` means read-only
8720
+ * still read, still played back, still age-swept, still drained, never
8721
+ * written.
8797
8722
  *
8798
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8799
- * flag existed reads back with no flag and keeps working exactly as before;
8800
- * that is the whole compat story, and it is why no migration ships with it.
8801
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8802
- * disk must not silently start writing to it); the default of a type is
8803
- * always stamped `true`.
8723
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8724
+ * stored" on an update and "born inert unless it is the first location of its
8725
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8726
+ * enabled {@link isLocationEnabled} is the one place that says so, and the
8727
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8728
+ * stops existing rather than being re-derived on every read.
8804
8729
  */
8805
8730
  enabled: boolean().optional(),
8731
+ /**
8732
+ * THE state of this location (D385), and the only authority on what may be
8733
+ * written, read or evicted here. Interpreted in exactly one place —
8734
+ * `storage-location-mode.ts` — which also folds the legacy
8735
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8736
+ * ambiguous.
8737
+ *
8738
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8739
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8740
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8741
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8742
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8743
+ * either, so the two cannot disagree.
8744
+ */
8745
+ mode: StorageLocationModeSchema.optional(),
8806
8746
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8807
8747
  * for node-local locations it can reach) — never persisted, absent when the
8808
8748
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8810,13 +8750,50 @@ var StorageLocationSchema = object({
8810
8750
  totalBytes: number(),
8811
8751
  availableBytes: number()
8812
8752
  }).nullable().optional(),
8753
+ /**
8754
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8755
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8756
+ * never persisted, never a filesystem walk.
8757
+ *
8758
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8759
+ * location yet — nobody stores here, the owning addon is down, or the first
8760
+ * refresh has not completed. A UI must omit the segment rather than draw it
8761
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8762
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8763
+ * be spelled out loud instead of appearing by accident.
8764
+ *
8765
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8766
+ * about the whole figure rather than about its freshest part.
8767
+ */
8768
+ owned: object({
8769
+ bytes: number().int().nonnegative(),
8770
+ measuredAtMs: number().int().nonnegative()
8771
+ }).optional(),
8813
8772
  createdAt: number(),
8814
8773
  updatedAt: number()
8815
8774
  });
8775
+ object({ isDefault: boolean().optional() });
8776
+ /**
8777
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8778
+ *
8779
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8780
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8781
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8782
+ * operator learns not to believe the screen.
8783
+ */
8784
+ var StorageDrainProgressSchema = object({
8785
+ locationId: string(),
8786
+ startedAtMs: number(),
8787
+ startBytes: number(),
8788
+ bytesRemaining: number(),
8789
+ drained: boolean(),
8790
+ estimatedEmptyAtMs: number().nullable()
8791
+ });
8816
8792
  /**
8817
8793
  * Reference accepted by consumer-facing `api.storage.*` calls.
8818
8794
  * Either:
8819
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8795
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8796
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8820
8797
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8821
8798
  *
8822
8799
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -8992,6 +8969,111 @@ var DecoderSessionConfigSchema = object({
8992
8969
  */
8993
8970
  debug: boolean().optional()
8994
8971
  });
8972
+ /**
8973
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8974
+ * an addon declares its channels in.
8975
+ *
8976
+ * ## Two axes, deliberately separated
8977
+ *
8978
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8979
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8980
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8981
+ * and rots silently. So a channel is declared where it is consulted, and the
8982
+ * `log-channels` capability enumerates the declarations.
8983
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8984
+ * thing: the logging settings document on the `system` cap. Two authorities
8985
+ * over the values is the exact defect
8986
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8987
+ * remove; re-introducing it from the cure side would be grotesque.
8988
+ *
8989
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8990
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8991
+ * the hot path with a value somebody actually read, and by
8992
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8993
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8994
+ * disarmed one (D49).
8995
+ *
8996
+ * ## The canonical call shape
8997
+ *
8998
+ * ```ts
8999
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
9000
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
9001
+ * }
9002
+ * ```
9003
+ *
9004
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
9005
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
9006
+ * object literal is never constructed because it lives inside the branch. It
9007
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
9008
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
9009
+ * destination floor (measured at 1.93 ns/call when off).
9010
+ *
9011
+ * ## Why a channel emits at `info`
9012
+ *
9013
+ * `loki-logging.addon.ts` pins the destination default at `info` and
9014
+ * `loki-destination.ts` drops everything below it, so a line emitted at
9015
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
9016
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
9017
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
9018
+ * emits at the channel's declared level, whose schema floor is `info`.
9019
+ */
9020
+ /**
9021
+ * The level a channel writes at once armed.
9022
+ *
9023
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
9024
+ * not leave the process for Loki, and the whole point of arming a channel is
9025
+ * to read it later.
9026
+ */
9027
+ var LogChannelLevelSchema = _enum([
9028
+ "info",
9029
+ "warn",
9030
+ "error"
9031
+ ]);
9032
+ /**
9033
+ * What an addon declares about one channel. No value, no state — a
9034
+ * declaration is inert.
9035
+ */
9036
+ var LogChannelDescriptorSchema = object({
9037
+ /**
9038
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
9039
+ * the addon's short name so an operator reading a channel list can tell who
9040
+ * owns it without a second lookup.
9041
+ */
9042
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
9043
+ /** One sentence: what the operator will SEE after arming it. */
9044
+ description: string().min(1),
9045
+ /** The level its lines are emitted at. Never below `info`. */
9046
+ defaultLevel: LogChannelLevelSchema,
9047
+ /**
9048
+ * Whether this channel can be narrowed to a camera.
9049
+ *
9050
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
9051
+ * consulted with the numeric device id, AND every line the channel admits
9052
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
9053
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
9054
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
9055
+ * the body is the only way to filter.
9056
+ *
9057
+ * A channel whose lines carry the device only in `meta` (or not at all) is
9058
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
9059
+ * the operator narrows to one camera, sees nothing, and concludes the code
9060
+ * path was never taken.
9061
+ */
9062
+ perDevice: boolean()
9063
+ });
9064
+ /**
9065
+ * An armed window over one channel, as the document hands it to a mirror.
9066
+ *
9067
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
9068
+ * expires by itself, which is the one failure a boolean cannot avoid.
9069
+ */
9070
+ var LogChannelWindowSchema = object({
9071
+ channel: string().min(1),
9072
+ /** Epoch ms the window closes at. */
9073
+ armedUntilMs: number(),
9074
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9075
+ deviceIds: array(number().int()).readonly().nullable()
9076
+ });
8995
9077
  var MODEL_FORMATS = [
8996
9078
  "onnx",
8997
9079
  "coreml",
@@ -25848,7 +25930,6 @@ var storageCapability = {
25848
25930
  }), _instanceof(Uint8Array)),
25849
25931
  endDownload: method(object({ downloadId: string() }), _void(), { kind: "mutation" }),
25850
25932
  listLocations: method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()),
25851
- getDefaultLocation: method(object({ type: StorageLocationTypeSchema }), StorageLocationSchema.nullable()),
25852
25933
  listLocationDeclarations: method(_void(), array(StorageLocationDeclarationSchema).readonly()),
25853
25934
  upsertLocation: method(StorageLocationSchema.omit({
25854
25935
  createdAt: true,
@@ -25878,6 +25959,12 @@ var storageCapability = {
25878
25959
  kind: "mutation",
25879
25960
  auth: "admin"
25880
25961
  }),
25962
+ /**
25963
+ * How far each draining location has got (D386). A pure READ of what the
25964
+ * last pressure sweep computed — it starts no work, and a location that is
25965
+ * not draining simply does not appear.
25966
+ */
25967
+ listDrainProgress: method(_void(), array(StorageDrainProgressSchema).readonly()),
25881
25968
  testLocation: method(object({ id: string() }), object({
25882
25969
  ok: boolean(),
25883
25970
  error: string().optional()
@@ -26025,6 +26112,71 @@ var storageMigrationCapability = {
26025
26112
  history: method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" })
26026
26113
  }
26027
26114
  };
26115
+ /**
26116
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
26117
+ * location (D388).
26118
+ *
26119
+ * ## Why this is not `storage-evictable`
26120
+ *
26121
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
26122
+ * not, in two ways that both matter and both bite hardest on the locations an
26123
+ * operator most wants a figure for:
26124
+ *
26125
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
26126
+ * and `recordingsLow:default` deliberately share one root and evict as one
26127
+ * oldest-first pool, so both answer with the SAME combined total. As an
26128
+ * occupancy figure that double-counts the disk.
26129
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
26130
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
26131
+ * is retiring and staring at.
26132
+ *
26133
+ * So this is its own contract with its own quantity, and the quantity is
26134
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
26135
+ * would ever be willing to delete it. A provider that can only answer
26136
+ * "evictable" must not register here — a number that silently means different
26137
+ * things per class is worse than no number.
26138
+ *
26139
+ * ## Absence is an answer
26140
+ *
26141
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
26142
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
26143
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
26144
+ * consuming side has to be written out loud instead of appearing by accident.
26145
+ *
26146
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
26147
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
26148
+ */
26149
+ /** One provider's occupancy answer for one location. */
26150
+ var StorageOccupancyReportSchema = object({
26151
+ locationId: string(),
26152
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
26153
+ * not net of what it is willing to delete. */
26154
+ ownedBytes: number().int().nonnegative(),
26155
+ /** When the provider last actually measured this. The orchestrator carries it
26156
+ * through so a UI can say how old the figure is instead of implying "now". */
26157
+ measuredAtMs: number().int().nonnegative()
26158
+ });
26159
+ var storageOccupancyCapability = {
26160
+ name: "storage-occupancy",
26161
+ scope: "system",
26162
+ mode: "collection",
26163
+ internal: true,
26164
+ methods: {
26165
+ /**
26166
+ * Occupancy for the given locations, in ONE round trip.
26167
+ *
26168
+ * A provider answers only for the locations it actually holds bytes on and
26169
+ * OMITS the rest — an omitted location is "I hold nothing measurable here",
26170
+ * which the orchestrator merges as a contribution of nothing rather than as
26171
+ * a claim that the location is empty. Only a location no provider reports
26172
+ * at all stays unknown.
26173
+ *
26174
+ * This must be CHEAP and must never walk a filesystem: it is on the admin
26175
+ * UI's `listLocations` path. The owner keeps its own figure fresh (D224) and
26176
+ * answers from what it already has.
26177
+ */
26178
+ getOccupancy: method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" }) }
26179
+ };
26028
26180
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
26029
26181
  providerId: string().min(1),
26030
26182
  displayName: string().min(1),
@@ -28380,88 +28532,6 @@ onStatusChanged: { data: object({
28380
28532
  volatileStateFields: ["lastUpdated"]
28381
28533
  };
28382
28534
  /**
28383
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
28384
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
28385
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
28386
- * one Home Assistant projection.
28387
- */
28388
- var NetworkLinkStatusSchema = object({
28389
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
28390
- type: _enum([
28391
- "wifi",
28392
- "ethernet",
28393
- "cellular",
28394
- "unknown"
28395
- ]),
28396
- /**
28397
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
28398
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
28399
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
28400
- * one whose reading has not landed must not be drawn at 0 %. Consumers
28401
- * SKIP a null rather than coerce it.
28402
- */
28403
- signalPercent: number().min(0).max(100).nullable(),
28404
- /** Raw received signal strength in dBm, when the firmware reports one. */
28405
- rssiDbm: number().optional(),
28406
- /** Network name of a wireless link, when the firmware reports it. */
28407
- ssid: string().optional(),
28408
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
28409
- lastUpdated: number()
28410
- });
28411
- var networkLinkCapability = {
28412
- name: "network-link",
28413
- scope: "device",
28414
- deviceNative: true,
28415
- mode: "singleton",
28416
- deviceTypes: [
28417
- DeviceType.Camera,
28418
- DeviceType.Sensor,
28419
- DeviceType.Button,
28420
- DeviceType.Switch,
28421
- DeviceType.Light,
28422
- DeviceType.Lock,
28423
- DeviceType.Siren
28424
- ],
28425
- methods: {},
28426
- events: {
28427
- /**
28428
- * Emitted whenever the cached status changes (a link switch, a signal
28429
- * reading that moved). Mirrored on the parent chain by the
28430
- * DeviceEventPropagator like `battery.onStatusChanged`.
28431
- */
28432
- onStatusChanged: { data: object({
28433
- deviceId: number(),
28434
- status: NetworkLinkStatusSchema
28435
- }) } },
28436
- status: {
28437
- schema: NetworkLinkStatusSchema,
28438
- kind: "push",
28439
- empty: {
28440
- type: "unknown",
28441
- signalPercent: null,
28442
- lastUpdated: 0
28443
- }
28444
- },
28445
- /**
28446
- * Runtime-state slice — every provider stores the same shape under
28447
- * `device.runtimeState['network-link']`, read once by the badge and the
28448
- * Home Assistant projector regardless of the driver.
28449
- */
28450
- runtimeState: NetworkLinkStatusSchema,
28451
- /**
28452
- * Runtime-state durability: **restored** — a link reading is slow to
28453
- * change and a sleeping battery camera may not report for hours; the
28454
- * restored slice is what the badge shows until the next read.
28455
- *
28456
- * See `RuntimeStateDurability`. Enforced by
28457
- * `scripts/check-runtime-state-durability.ts`.
28458
- */
28459
- durability: "restored",
28460
- /** Clock fields: written, but excluded from the compare that decides
28461
- * whether persisting is worth a SQLite commit. */
28462
- volatileStateFields: ["lastUpdated"]
28463
- };
28464
- /**
28465
28535
  * Generic boolean sensor — last-resort fallback when no domain-
28466
28536
  * specific binary cap fits (Home Assistant `binary_sensor` without a
28467
28537
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32272,6 +32342,369 @@ var nativeObjectDetectionCapability = {
32272
32342
  volatileStateFields: ["lastFetchedAt"]
32273
32343
  };
32274
32344
  /**
32345
+ * `navigation` — a device-scoped capability that natively expresses the FULL
32346
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
32347
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
32348
+ *
32349
+ * Why a NEW cap rather than overloading `ptz`:
32350
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
32351
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
32352
+ * The two are different physical models: PTZ is absolute-position + presets,
32353
+ * navigation is momentary drive nudges + discrete robot ACTIONS
32354
+ * (dock / spot-clean / follow-pet / go-to-point / …).
32355
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
32356
+ * the reverse:
32357
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
32358
+ * / `getOptions`), and
32359
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
32360
+ * robot camera shows up in the existing PTZ control path without every
32361
+ * PTZ provider learning about robots. The mapping lives in the adapter,
32362
+ * not here (see the addon design note):
32363
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
32364
+ * ptz.stop() → navigation.stop()
32365
+ * ptz.goHome() → navigation.runAction('goHome')
32366
+ * ptz.getPresets() → navigation.listActions() (id→preset)
32367
+ * ptz.goToPreset(id) → navigation.runAction(id)
32368
+ *
32369
+ * ## Continuous drive
32370
+ *
32371
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
32372
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
32373
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
32374
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
32375
+ * coalesce them. The UI owns the cadence.
32376
+ *
32377
+ * ## The action dictionary
32378
+ *
32379
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
32380
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
32381
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
32382
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
32383
+ * vendor-specific list. `kind: 'action'` entries are triggered with
32384
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
32385
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
32386
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
32387
+ *
32388
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
32389
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
32390
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
32391
+ * every device handle. A future nodedreame publish adds a typed
32392
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
32393
+ * provider can then swap the raw calls for the typed methods with no change to
32394
+ * THIS contract.
32395
+ */
32396
+ /**
32397
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
32398
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
32399
+ * halts it.
32400
+ *
32401
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
32402
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
32403
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
32404
+ * vector by it (drivers without proportional drive ignore it).
32405
+ *
32406
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
32407
+ * axis alone; an all-undefined nudge is a no-op.
32408
+ */
32409
+ var NavigationMoveCommandSchema = object({
32410
+ pan: number().min(-1).max(1).optional(),
32411
+ tilt: number().min(-1).max(1).optional(),
32412
+ speed: number().min(0).max(1).optional()
32413
+ });
32414
+ /**
32415
+ * The enumerated discrete actions a navigation-capable robot can perform via
32416
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
32417
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
32418
+ * `playSound` (see the `sound` dictionary entries).
32419
+ */
32420
+ var NavigationActionIdSchema = _enum([
32421
+ "goHome",
32422
+ "locate",
32423
+ "spotClean",
32424
+ "findPet",
32425
+ "personFollow",
32426
+ "stop",
32427
+ "startClean",
32428
+ "pauseClean",
32429
+ "dockWash",
32430
+ "autoEmpty",
32431
+ "flashOn",
32432
+ "flashOff"
32433
+ ]);
32434
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
32435
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
32436
+ /**
32437
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
32438
+ * native panel and the PTZ mimic render as a button.
32439
+ *
32440
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
32441
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
32442
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
32443
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
32444
+ * - `label` — operator-facing English label.
32445
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
32446
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
32447
+ * PTZ render ONLY enabled entries. Data-driven: the provider
32448
+ * flips it from config, never by editing code.
32449
+ */
32450
+ var NavigationActionEntrySchema = object({
32451
+ id: string(),
32452
+ kind: NavigationEntryKindSchema,
32453
+ label: string(),
32454
+ icon: string(),
32455
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
32456
+ soundId: number().int().optional(),
32457
+ /** Per-device feature flag — render this entry only when true. */
32458
+ enabled: boolean()
32459
+ });
32460
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
32461
+ var NavigationPointSchema = object({
32462
+ x: number(),
32463
+ y: number()
32464
+ });
32465
+ /**
32466
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
32467
+ * The cap reports which are enabled so the UI / PTZ render only the controls
32468
+ * that are turned on for THIS device. Data-driven: the provider derives these
32469
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
32470
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
32471
+ * that are not dictionary entries.
32472
+ *
32473
+ * - `move` / `stop` — the momentary drive joystick.
32474
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
32475
+ * map-coordinate plumbing is wired.
32476
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
32477
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
32478
+ * - `light` — the on/off fill-light toggle (works anytime).
32479
+ * - `lightMode` — the auto/manual selector + manual level slider (a
32480
+ * camera-service control; needs an active stream).
32481
+ */
32482
+ var NavigationFeaturesSchema = object({
32483
+ move: boolean(),
32484
+ stop: boolean(),
32485
+ goToPoint: boolean(),
32486
+ runAction: boolean(),
32487
+ playSound: boolean(),
32488
+ light: boolean(),
32489
+ lightMode: boolean()
32490
+ });
32491
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
32492
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
32493
+ /**
32494
+ * Live navigation state so the UI can reflect what the robot is doing:
32495
+ * - `mode` — coarse activity (idle / cleaning / following / …).
32496
+ * - `following` — person/pet follow is currently armed.
32497
+ * - `flash` — the on-camera fill light is on.
32498
+ * - `lightMode` — auto vs manual fill-light mode.
32499
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
32500
+ * `lightMode === 'manual'`.
32501
+ */
32502
+ var NavigationStatusSchema = object({
32503
+ mode: _enum([
32504
+ "idle",
32505
+ "cleaning",
32506
+ "spot",
32507
+ "following",
32508
+ "goto",
32509
+ "returning",
32510
+ "paused",
32511
+ "unknown"
32512
+ ]),
32513
+ following: boolean(),
32514
+ flash: boolean(),
32515
+ lightMode: NavigationLightModeSchema,
32516
+ lightLevel: number().min(40).max(100),
32517
+ /** Ms epoch when the slice was last updated. */
32518
+ lastChangedAt: number()
32519
+ });
32520
+ /**
32521
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
32522
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
32523
+ * convention.
32524
+ */
32525
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
32526
+ var navigationCapability = {
32527
+ name: "navigation",
32528
+ scope: "device",
32529
+ deviceNative: true,
32530
+ mode: "singleton",
32531
+ deviceTypes: [DeviceType.Camera],
32532
+ deviceConfig: { ui: {
32533
+ kind: "widget",
32534
+ widgetId: "host/navigation-panel",
32535
+ tab: "navigation",
32536
+ topTab: true,
32537
+ label: "Navigation",
32538
+ order: 0
32539
+ } },
32540
+ methods: {
32541
+ /**
32542
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
32543
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
32544
+ * path) works for any authenticated user, not admin-only. The UI sends
32545
+ * these at ~1 Hz while a control is held; the provider forwards each one to
32546
+ * a single drive write WITHOUT debouncing.
32547
+ */
32548
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
32549
+ /** Halt all motion immediately (zero drive vector). */
32550
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
32551
+ /** Send the robot to a point on its live map. */
32552
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
32553
+ /**
32554
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
32555
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
32556
+ */
32557
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
32558
+ /**
32559
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
32560
+ * unsupported action ids are rejected by the provider.
32561
+ */
32562
+ runAction: method(object({
32563
+ deviceId: number(),
32564
+ actionId: NavigationActionIdSchema
32565
+ }), _void(), { kind: "mutation" }),
32566
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
32567
+ playSound: method(object({
32568
+ deviceId: number(),
32569
+ soundId: number().int()
32570
+ }), _void(), { kind: "mutation" }),
32571
+ /**
32572
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
32573
+ * works anytime, no active stream required).
32574
+ */
32575
+ setLightOn: method(object({
32576
+ deviceId: number(),
32577
+ on: boolean()
32578
+ }), _void(), { kind: "mutation" }),
32579
+ /**
32580
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
32581
+ * initial `level`. The auto/manual + level control is a CAMERA-service
32582
+ * action that generally needs an active camera stream/monitor session — the
32583
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
32584
+ */
32585
+ setLightMode: method(object({
32586
+ deviceId: number(),
32587
+ mode: NavigationLightModeSchema,
32588
+ level: number().min(40).max(100).optional()
32589
+ }), _void(), { kind: "mutation" }),
32590
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
32591
+ setLightLevel: method(object({
32592
+ deviceId: number(),
32593
+ level: number().min(40).max(100)
32594
+ }), _void(), { kind: "mutation" }),
32595
+ /**
32596
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
32597
+ * controls the UI shows (the per-entry flags for the dictionary come back on
32598
+ * `listActions`).
32599
+ */
32600
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
32601
+ },
32602
+ events: { onStatusChanged: { data: object({
32603
+ deviceId: number(),
32604
+ status: NavigationStatusSchema
32605
+ }) } },
32606
+ status: {
32607
+ schema: NavigationStatusSchema,
32608
+ kind: "push"
32609
+ },
32610
+ /**
32611
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
32612
+ * for live mode / follow / flash changes.
32613
+ */
32614
+ runtimeState: NavigationRuntimeStateSchema,
32615
+ /**
32616
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
32617
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
32618
+ * that. The live handle re-publishes on connect.
32619
+ *
32620
+ * See `RuntimeStateDurability`. Enforced by
32621
+ * `scripts/check-runtime-state-durability.ts`.
32622
+ */
32623
+ durability: "session"
32624
+ };
32625
+ /**
32626
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
32627
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
32628
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
32629
+ * one Home Assistant projection.
32630
+ */
32631
+ var NetworkLinkStatusSchema = object({
32632
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
32633
+ type: _enum([
32634
+ "wifi",
32635
+ "ethernet",
32636
+ "cellular",
32637
+ "unknown"
32638
+ ]),
32639
+ /**
32640
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
32641
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
32642
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
32643
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
32644
+ * SKIP a null rather than coerce it.
32645
+ */
32646
+ signalPercent: number().min(0).max(100).nullable(),
32647
+ /** Raw received signal strength in dBm, when the firmware reports one. */
32648
+ rssiDbm: number().optional(),
32649
+ /** Network name of a wireless link, when the firmware reports it. */
32650
+ ssid: string().optional(),
32651
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
32652
+ lastUpdated: number()
32653
+ });
32654
+ var networkLinkCapability = {
32655
+ name: "network-link",
32656
+ scope: "device",
32657
+ deviceNative: true,
32658
+ mode: "singleton",
32659
+ deviceTypes: [
32660
+ DeviceType.Camera,
32661
+ DeviceType.Sensor,
32662
+ DeviceType.Button,
32663
+ DeviceType.Switch,
32664
+ DeviceType.Light,
32665
+ DeviceType.Lock,
32666
+ DeviceType.Siren
32667
+ ],
32668
+ methods: {},
32669
+ events: {
32670
+ /**
32671
+ * Emitted whenever the cached status changes (a link switch, a signal
32672
+ * reading that moved). Mirrored on the parent chain by the
32673
+ * DeviceEventPropagator like `battery.onStatusChanged`.
32674
+ */
32675
+ onStatusChanged: { data: object({
32676
+ deviceId: number(),
32677
+ status: NetworkLinkStatusSchema
32678
+ }) } },
32679
+ status: {
32680
+ schema: NetworkLinkStatusSchema,
32681
+ kind: "push",
32682
+ empty: {
32683
+ type: "unknown",
32684
+ signalPercent: null,
32685
+ lastUpdated: 0
32686
+ }
32687
+ },
32688
+ /**
32689
+ * Runtime-state slice — every provider stores the same shape under
32690
+ * `device.runtimeState['network-link']`, read once by the badge and the
32691
+ * Home Assistant projector regardless of the driver.
32692
+ */
32693
+ runtimeState: NetworkLinkStatusSchema,
32694
+ /**
32695
+ * Runtime-state durability: **restored** — a link reading is slow to
32696
+ * change and a sleeping battery camera may not report for hours; the
32697
+ * restored slice is what the badge shows until the next read.
32698
+ *
32699
+ * See `RuntimeStateDurability`. Enforced by
32700
+ * `scripts/check-runtime-state-durability.ts`.
32701
+ */
32702
+ durability: "restored",
32703
+ /** Clock fields: written, but excluded from the compare that decides
32704
+ * whether persisting is worth a SQLite commit. */
32705
+ volatileStateFields: ["lastUpdated"]
32706
+ };
32707
+ /**
32275
32708
  * network-quality — system-scoped singleton capability tracking RTT,
32276
32709
  * jitter, and observed/peak bandwidth per device + per client.
32277
32710
  *
@@ -34085,287 +34518,6 @@ var ptzAutotrackCapability = {
34085
34518
  durability: "session"
34086
34519
  };
34087
34520
  /**
34088
- * `navigation` — a device-scoped capability that natively expresses the FULL
34089
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
34090
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
34091
- *
34092
- * Why a NEW cap rather than overloading `ptz`:
34093
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
34094
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
34095
- * The two are different physical models: PTZ is absolute-position + presets,
34096
- * navigation is momentary drive nudges + discrete robot ACTIONS
34097
- * (dock / spot-clean / follow-pet / go-to-point / …).
34098
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
34099
- * the reverse:
34100
- * 1. a native CamStack navigation panel (data-driven from `listActions`
34101
- * / `getOptions`), and
34102
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
34103
- * robot camera shows up in the existing PTZ control path without every
34104
- * PTZ provider learning about robots. The mapping lives in the adapter,
34105
- * not here (see the addon design note):
34106
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
34107
- * ptz.stop() → navigation.stop()
34108
- * ptz.goHome() → navigation.runAction('goHome')
34109
- * ptz.getPresets() → navigation.listActions() (id→preset)
34110
- * ptz.goToPreset(id) → navigation.runAction(id)
34111
- *
34112
- * ## Continuous drive
34113
- *
34114
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
34115
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
34116
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
34117
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
34118
- * coalesce them. The UI owns the cadence.
34119
- *
34120
- * ## The action dictionary
34121
- *
34122
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
34123
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
34124
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
34125
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
34126
- * vendor-specific list. `kind: 'action'` entries are triggered with
34127
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
34128
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
34129
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
34130
- *
34131
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
34132
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
34133
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
34134
- * every device handle. A future nodedreame publish adds a typed
34135
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
34136
- * provider can then swap the raw calls for the typed methods with no change to
34137
- * THIS contract.
34138
- */
34139
- /**
34140
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
34141
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
34142
- * halts it.
34143
- *
34144
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
34145
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
34146
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
34147
- * vector by it (drivers without proportional drive ignore it).
34148
- *
34149
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
34150
- * axis alone; an all-undefined nudge is a no-op.
34151
- */
34152
- var NavigationMoveCommandSchema = object({
34153
- pan: number().min(-1).max(1).optional(),
34154
- tilt: number().min(-1).max(1).optional(),
34155
- speed: number().min(0).max(1).optional()
34156
- });
34157
- /**
34158
- * The enumerated discrete actions a navigation-capable robot can perform via
34159
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
34160
- * subset it supports through `listActions`. Sounds are NOT here — they go through
34161
- * `playSound` (see the `sound` dictionary entries).
34162
- */
34163
- var NavigationActionIdSchema = _enum([
34164
- "goHome",
34165
- "locate",
34166
- "spotClean",
34167
- "findPet",
34168
- "personFollow",
34169
- "stop",
34170
- "startClean",
34171
- "pauseClean",
34172
- "dockWash",
34173
- "autoEmpty",
34174
- "flashOn",
34175
- "flashOff"
34176
- ]);
34177
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
34178
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
34179
- /**
34180
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
34181
- * native panel and the PTZ mimic render as a button.
34182
- *
34183
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
34184
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
34185
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
34186
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
34187
- * - `label` — operator-facing English label.
34188
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
34189
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
34190
- * PTZ render ONLY enabled entries. Data-driven: the provider
34191
- * flips it from config, never by editing code.
34192
- */
34193
- var NavigationActionEntrySchema = object({
34194
- id: string(),
34195
- kind: NavigationEntryKindSchema,
34196
- label: string(),
34197
- icon: string(),
34198
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
34199
- soundId: number().int().optional(),
34200
- /** Per-device feature flag — render this entry only when true. */
34201
- enabled: boolean()
34202
- });
34203
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
34204
- var NavigationPointSchema = object({
34205
- x: number(),
34206
- y: number()
34207
- });
34208
- /**
34209
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
34210
- * The cap reports which are enabled so the UI / PTZ render only the controls
34211
- * that are turned on for THIS device. Data-driven: the provider derives these
34212
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
34213
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
34214
- * that are not dictionary entries.
34215
- *
34216
- * - `move` / `stop` — the momentary drive joystick.
34217
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
34218
- * map-coordinate plumbing is wired.
34219
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
34220
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
34221
- * - `light` — the on/off fill-light toggle (works anytime).
34222
- * - `lightMode` — the auto/manual selector + manual level slider (a
34223
- * camera-service control; needs an active stream).
34224
- */
34225
- var NavigationFeaturesSchema = object({
34226
- move: boolean(),
34227
- stop: boolean(),
34228
- goToPoint: boolean(),
34229
- runAction: boolean(),
34230
- playSound: boolean(),
34231
- light: boolean(),
34232
- lightMode: boolean()
34233
- });
34234
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
34235
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
34236
- /**
34237
- * Live navigation state so the UI can reflect what the robot is doing:
34238
- * - `mode` — coarse activity (idle / cleaning / following / …).
34239
- * - `following` — person/pet follow is currently armed.
34240
- * - `flash` — the on-camera fill light is on.
34241
- * - `lightMode` — auto vs manual fill-light mode.
34242
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
34243
- * `lightMode === 'manual'`.
34244
- */
34245
- var NavigationStatusSchema = object({
34246
- mode: _enum([
34247
- "idle",
34248
- "cleaning",
34249
- "spot",
34250
- "following",
34251
- "goto",
34252
- "returning",
34253
- "paused",
34254
- "unknown"
34255
- ]),
34256
- following: boolean(),
34257
- flash: boolean(),
34258
- lightMode: NavigationLightModeSchema,
34259
- lightLevel: number().min(40).max(100),
34260
- /** Ms epoch when the slice was last updated. */
34261
- lastChangedAt: number()
34262
- });
34263
- /**
34264
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
34265
- * observable). Adds `lastFetchedAt` on top of the status shape per the
34266
- * convention.
34267
- */
34268
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
34269
- var navigationCapability = {
34270
- name: "navigation",
34271
- scope: "device",
34272
- deviceNative: true,
34273
- mode: "singleton",
34274
- deviceTypes: [DeviceType.Camera],
34275
- deviceConfig: { ui: {
34276
- kind: "widget",
34277
- widgetId: "host/navigation-panel",
34278
- tab: "navigation",
34279
- topTab: true,
34280
- label: "Navigation",
34281
- order: 0
34282
- } },
34283
- methods: {
34284
- /**
34285
- * Momentary drive nudge (the robot moves). `protected` — mirrors
34286
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
34287
- * path) works for any authenticated user, not admin-only. The UI sends
34288
- * these at ~1 Hz while a control is held; the provider forwards each one to
34289
- * a single drive write WITHOUT debouncing.
34290
- */
34291
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
34292
- /** Halt all motion immediately (zero drive vector). */
34293
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
34294
- /** Send the robot to a point on its live map. */
34295
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
34296
- /**
34297
- * Enumerate the discrete controls THIS device supports (data-driven UI +
34298
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
34299
- */
34300
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
34301
- /**
34302
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
34303
- * unsupported action ids are rejected by the provider.
34304
- */
34305
- runAction: method(object({
34306
- deviceId: number(),
34307
- actionId: NavigationActionIdSchema
34308
- }), _void(), { kind: "mutation" }),
34309
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
34310
- playSound: method(object({
34311
- deviceId: number(),
34312
- soundId: number().int()
34313
- }), _void(), { kind: "mutation" }),
34314
- /**
34315
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
34316
- * works anytime, no active stream required).
34317
- */
34318
- setLightOn: method(object({
34319
- deviceId: number(),
34320
- on: boolean()
34321
- }), _void(), { kind: "mutation" }),
34322
- /**
34323
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
34324
- * initial `level`. The auto/manual + level control is a CAMERA-service
34325
- * action that generally needs an active camera stream/monitor session — the
34326
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
34327
- */
34328
- setLightMode: method(object({
34329
- deviceId: number(),
34330
- mode: NavigationLightModeSchema,
34331
- level: number().min(40).max(100).optional()
34332
- }), _void(), { kind: "mutation" }),
34333
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
34334
- setLightLevel: method(object({
34335
- deviceId: number(),
34336
- level: number().min(40).max(100)
34337
- }), _void(), { kind: "mutation" }),
34338
- /**
34339
- * Per-device FEATURE-FLAG report for the general primitives — drives which
34340
- * controls the UI shows (the per-entry flags for the dictionary come back on
34341
- * `listActions`).
34342
- */
34343
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
34344
- },
34345
- events: { onStatusChanged: { data: object({
34346
- deviceId: number(),
34347
- status: NavigationStatusSchema
34348
- }) } },
34349
- status: {
34350
- schema: NavigationStatusSchema,
34351
- kind: "push"
34352
- },
34353
- /**
34354
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
34355
- * for live mode / follow / flash changes.
34356
- */
34357
- runtimeState: NavigationRuntimeStateSchema,
34358
- /**
34359
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
34360
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
34361
- * that. The live handle re-publishes on connect.
34362
- *
34363
- * See `RuntimeStateDurability`. Enforced by
34364
- * `scripts/check-runtime-state-durability.ts`.
34365
- */
34366
- durability: "session"
34367
- };
34368
- /**
34369
34521
  * reboot — device-scoped capability for "soft" device reboots (firmware
34370
34522
  * reboot via vendor protocol; cameras, NVRs, doorbells). Surfaces a
34371
34523
  * single mutation so the UI can offer a confirm-and-reboot button for
@@ -38001,6 +38153,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
38001
38153
  storageCapability,
38002
38154
  storageEvictableCapability,
38003
38155
  storageMigrationCapability,
38156
+ storageOccupancyCapability,
38004
38157
  storageProviderCapability,
38005
38158
  streamBrokerCapability,
38006
38159
  streamCatalogCapability,
@@ -42967,13 +43120,13 @@ Object.freeze({
42967
43120
  addonId: null,
42968
43121
  access: "view"
42969
43122
  },
42970
- "storage.getDefaultLocation": {
43123
+ "storage.list": {
42971
43124
  capName: "storage",
42972
43125
  capScope: "system",
42973
43126
  addonId: null,
42974
43127
  access: "view"
42975
43128
  },
42976
- "storage.list": {
43129
+ "storage.listDrainProgress": {
42977
43130
  capName: "storage",
42978
43131
  capScope: "system",
42979
43132
  addonId: null,
@@ -43123,6 +43276,12 @@ Object.freeze({
43123
43276
  addonId: null,
43124
43277
  access: "view"
43125
43278
  },
43279
+ "storageOccupancy.getOccupancy": {
43280
+ capName: "storage-occupancy",
43281
+ capScope: "system",
43282
+ addonId: null,
43283
+ access: "view"
43284
+ },
43126
43285
  "storageProvider.abortUpload": {
43127
43286
  capName: "storage-provider",
43128
43287
  capScope: "system",