@camstack/addon-auth 1.2.86 → 1.2.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-zAv7pMUz.mjs
1
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -193,6 +193,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
193
193
  EventCategory["ProcessCrashed"] = "process.crashed";
194
194
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
195
195
  EventCategory["ProcessRestarted"] = "process.restarted";
196
+ /**
197
+ * The SET of storage locations changed — one was created, edited, enabled,
198
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
199
+ *
200
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
201
+ * it must also converge on its own periodic path, because a dropped event
202
+ * must not leave a node writing to yesterday's disk set forever. It exists
203
+ * because there was NO signal at all — an operator who added a second
204
+ * recordings disk in the admin UI got nothing, and the recorder kept its
205
+ * resolved locations until something else happened to re-resolve them
206
+ * (D387). Payload `StorageLocationsChangedPayload`.
207
+ */
208
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
196
209
  EventCategory["RecordingStarted"] = "recording.started";
197
210
  EventCategory["RecordingStopped"] = "recording.stopped";
198
211
  EventCategory["RecordingError"] = "recording.error";
@@ -8650,6 +8663,21 @@ var StorageCleanupJobSchema = object({
8650
8663
  });
8651
8664
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
8652
8665
  /**
8666
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
8667
+ * alias below is `z.infer<>` of it, never a second spelling.
8668
+ */
8669
+ var StorageLocationModeSchema = _enum([
8670
+ "active",
8671
+ "readonly",
8672
+ "drain",
8673
+ "disabled"
8674
+ ]);
8675
+ _enum([
8676
+ "normal",
8677
+ "never",
8678
+ "drain"
8679
+ ]);
8680
+ /**
8653
8681
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
8654
8682
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
8655
8683
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -8715,6 +8743,21 @@ var StorageLocationSchema = object({
8715
8743
  * stops existing rather than being re-derived on every read.
8716
8744
  */
8717
8745
  enabled: boolean().optional(),
8746
+ /**
8747
+ * THE state of this location (D385), and the only authority on what may be
8748
+ * written, read or evicted here. Interpreted in exactly one place —
8749
+ * `storage-location-mode.ts` — which also folds the legacy
8750
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
8751
+ * ambiguous.
8752
+ *
8753
+ * OPTIONAL only for the wire and for rows written before D385: absence is
8754
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
8755
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
8756
+ * re-derived on every read. `enabled` survives one release as a DERIVED
8757
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
8758
+ * either, so the two cannot disagree.
8759
+ */
8760
+ mode: StorageLocationModeSchema.optional(),
8718
8761
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8719
8762
  * for node-local locations it can reach) — never persisted, absent when the
8720
8763
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -8722,11 +8765,46 @@ var StorageLocationSchema = object({
8722
8765
  totalBytes: number(),
8723
8766
  availableBytes: number()
8724
8767
  }).nullable().optional(),
8768
+ /**
8769
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
8770
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
8771
+ * never persisted, never a filesystem walk.
8772
+ *
8773
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
8774
+ * location yet — nobody stores here, the owning addon is down, or the first
8775
+ * refresh has not completed. A UI must omit the segment rather than draw it
8776
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
8777
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
8778
+ * be spelled out loud instead of appearing by accident.
8779
+ *
8780
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
8781
+ * about the whole figure rather than about its freshest part.
8782
+ */
8783
+ owned: object({
8784
+ bytes: number().int().nonnegative(),
8785
+ measuredAtMs: number().int().nonnegative()
8786
+ }).optional(),
8725
8787
  createdAt: number(),
8726
8788
  updatedAt: number()
8727
8789
  });
8728
8790
  object({ isDefault: boolean().optional() });
8729
8791
  /**
8792
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
8793
+ *
8794
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
8795
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
8796
+ * drain with no observed growth has no honest ETA, and inventing one is how an
8797
+ * operator learns not to believe the screen.
8798
+ */
8799
+ var StorageDrainProgressSchema = object({
8800
+ locationId: string(),
8801
+ startedAtMs: number(),
8802
+ startBytes: number(),
8803
+ bytesRemaining: number(),
8804
+ drained: boolean(),
8805
+ estimatedEmptyAtMs: number().nullable()
8806
+ });
8807
+ /**
8730
8808
  * Reference accepted by consumer-facing `api.storage.*` calls.
8731
8809
  * Either:
8732
8810
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -20226,8 +20304,25 @@ var occupancyRecheckFramesField = {
20226
20304
  * (analyzer attaches detected `regions[]`; onboard does not — the
20227
20305
  * camera typically only reports a binary signal plus an optional
20228
20306
  * channel/AI class which lives in dedicated event channels).
20229
- */
20230
- var MotionSourceEnum = _enum(["onboard", "analyzer"]);
20307
+ *
20308
+ * - `onboard` — the camera's firmware said something moved.
20309
+ * - `analyzer` — this runner's frame-diff said so, and attaches `regions[]`.
20310
+ * - `device-activity` — the DEVICE said it is doing its job: the
20311
+ * `recording-signal` LEVEL the same device raises for the recorder
20312
+ * ([D380](../../../../docs/decisions/adr-0380-a-device-decided-recording-is-a-mode-with-no-schedule-seeded-once.md)),
20313
+ * republished as a motion source. It attaches **nothing** — no regions, no
20314
+ * class: the only fact it carries is that the device is active, and a robot
20315
+ * vacuum that is itself the moving object has no region worth sending. It is
20316
+ * a LEVEL, so unlike `onboard` it has a real falling edge, and unlike
20317
+ * `analyzer` it must not open the frame-diff side-channel — the runner's
20318
+ * `handleOnboardMotionAnalyzer` gate is `source === 'onboard'` and stays that
20319
+ * way ([D392](../../../../docs/decisions/adr-0392-a-device-that-says-it-is-working-is-a-motion-source-of-its-own.md)).
20320
+ */
20321
+ var MotionSourceEnum = _enum([
20322
+ "onboard",
20323
+ "analyzer",
20324
+ "device-activity"
20325
+ ]);
20231
20326
  /**
20232
20327
  * List of motion sources active on a camera. Empty array is valid:
20233
20328
  * "no source" — happens for battery cams without firmware motion when
@@ -21746,7 +21841,7 @@ method(object({
21746
21841
  }), _void(), {
21747
21842
  kind: "mutation",
21748
21843
  auth: "admin"
21749
- }), method(object({ id: string() }), object({
21844
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21750
21845
  ok: boolean(),
21751
21846
  error: string().optional()
21752
21847
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21816,6 +21911,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21816
21911
  kind: "mutation",
21817
21912
  auth: "admin"
21818
21913
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21914
+ /**
21915
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21916
+ * location (D388).
21917
+ *
21918
+ * ## Why this is not `storage-evictable`
21919
+ *
21920
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21921
+ * not, in two ways that both matter and both bite hardest on the locations an
21922
+ * operator most wants a figure for:
21923
+ *
21924
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21925
+ * and `recordingsLow:default` deliberately share one root and evict as one
21926
+ * oldest-first pool, so both answer with the SAME combined total. As an
21927
+ * occupancy figure that double-counts the disk.
21928
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21929
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21930
+ * is retiring and staring at.
21931
+ *
21932
+ * So this is its own contract with its own quantity, and the quantity is
21933
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21934
+ * would ever be willing to delete it. A provider that can only answer
21935
+ * "evictable" must not register here — a number that silently means different
21936
+ * things per class is worse than no number.
21937
+ *
21938
+ * ## Absence is an answer
21939
+ *
21940
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21941
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21942
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21943
+ * consuming side has to be written out loud instead of appearing by accident.
21944
+ *
21945
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21946
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21947
+ */
21948
+ /** One provider's occupancy answer for one location. */
21949
+ var StorageOccupancyReportSchema = object({
21950
+ locationId: string(),
21951
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21952
+ * not net of what it is willing to delete. */
21953
+ ownedBytes: number().int().nonnegative(),
21954
+ /** When the provider last actually measured this. The orchestrator carries it
21955
+ * through so a UI can say how old the figure is instead of implying "now". */
21956
+ measuredAtMs: number().int().nonnegative()
21957
+ });
21958
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21819
21959
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21820
21960
  providerId: string().min(1),
21821
21961
  displayName: string().min(1),
@@ -23486,39 +23626,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23486
23626
  deviceId: number(),
23487
23627
  status: BatteryStatusSchema
23488
23628
  });
23489
- /**
23490
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
23491
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23492
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
23493
- * one Home Assistant projection.
23494
- */
23495
- var NetworkLinkStatusSchema = object({
23496
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23497
- type: _enum([
23498
- "wifi",
23499
- "ethernet",
23500
- "cellular",
23501
- "unknown"
23502
- ]),
23503
- /**
23504
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
23505
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23506
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23507
- * one whose reading has not landed must not be drawn at 0 %. Consumers
23508
- * SKIP a null rather than coerce it.
23509
- */
23510
- signalPercent: number().min(0).max(100).nullable(),
23511
- /** Raw received signal strength in dBm, when the firmware reports one. */
23512
- rssiDbm: number().optional(),
23513
- /** Network name of a wireless link, when the firmware reports it. */
23514
- ssid: string().optional(),
23515
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23516
- lastUpdated: number()
23517
- });
23518
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
23519
- deviceId: number(),
23520
- status: NetworkLinkStatusSchema
23521
- });
23522
23629
  object({
23523
23630
  on: boolean(),
23524
23631
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25872,6 +25979,236 @@ DeviceType.Camera, method(object({
25872
25979
  detection: NativeDetectionSchema
25873
25980
  });
25874
25981
  /**
25982
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25983
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25984
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25985
+ *
25986
+ * Why a NEW cap rather than overloading `ptz`:
25987
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25988
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25989
+ * The two are different physical models: PTZ is absolute-position + presets,
25990
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25991
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25992
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25993
+ * the reverse:
25994
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25995
+ * / `getOptions`), and
25996
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25997
+ * robot camera shows up in the existing PTZ control path without every
25998
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25999
+ * not here (see the addon design note):
26000
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
26001
+ * ptz.stop() → navigation.stop()
26002
+ * ptz.goHome() → navigation.runAction('goHome')
26003
+ * ptz.getPresets() → navigation.listActions() (id→preset)
26004
+ * ptz.goToPreset(id) → navigation.runAction(id)
26005
+ *
26006
+ * ## Continuous drive
26007
+ *
26008
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
26009
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
26010
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
26011
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
26012
+ * coalesce them. The UI owns the cadence.
26013
+ *
26014
+ * ## The action dictionary
26015
+ *
26016
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
26017
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
26018
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
26019
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
26020
+ * vendor-specific list. `kind: 'action'` entries are triggered with
26021
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
26022
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
26023
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26024
+ *
26025
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26026
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26027
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
26028
+ * every device handle. A future nodedreame publish adds a typed
26029
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
26030
+ * provider can then swap the raw calls for the typed methods with no change to
26031
+ * THIS contract.
26032
+ */
26033
+ /**
26034
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
26035
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
26036
+ * halts it.
26037
+ *
26038
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
26039
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26040
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26041
+ * vector by it (drivers without proportional drive ignore it).
26042
+ *
26043
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26044
+ * axis alone; an all-undefined nudge is a no-op.
26045
+ */
26046
+ var NavigationMoveCommandSchema = object({
26047
+ pan: number().min(-1).max(1).optional(),
26048
+ tilt: number().min(-1).max(1).optional(),
26049
+ speed: number().min(0).max(1).optional()
26050
+ });
26051
+ /**
26052
+ * The enumerated discrete actions a navigation-capable robot can perform via
26053
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26054
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26055
+ * `playSound` (see the `sound` dictionary entries).
26056
+ */
26057
+ var NavigationActionIdSchema = _enum([
26058
+ "goHome",
26059
+ "locate",
26060
+ "spotClean",
26061
+ "findPet",
26062
+ "personFollow",
26063
+ "stop",
26064
+ "startClean",
26065
+ "pauseClean",
26066
+ "dockWash",
26067
+ "autoEmpty",
26068
+ "flashOn",
26069
+ "flashOff"
26070
+ ]);
26071
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
26072
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
26073
+ /**
26074
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
26075
+ * native panel and the PTZ mimic render as a button.
26076
+ *
26077
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
26078
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
26079
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
26080
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
26081
+ * - `label` — operator-facing English label.
26082
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
26083
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
26084
+ * PTZ render ONLY enabled entries. Data-driven: the provider
26085
+ * flips it from config, never by editing code.
26086
+ */
26087
+ var NavigationActionEntrySchema = object({
26088
+ id: string(),
26089
+ kind: NavigationEntryKindSchema,
26090
+ label: string(),
26091
+ icon: string(),
26092
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
26093
+ soundId: number().int().optional(),
26094
+ /** Per-device feature flag — render this entry only when true. */
26095
+ enabled: boolean()
26096
+ });
26097
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
26098
+ var NavigationPointSchema = object({
26099
+ x: number(),
26100
+ y: number()
26101
+ });
26102
+ /**
26103
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
26104
+ * The cap reports which are enabled so the UI / PTZ render only the controls
26105
+ * that are turned on for THIS device. Data-driven: the provider derives these
26106
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
26107
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
26108
+ * that are not dictionary entries.
26109
+ *
26110
+ * - `move` / `stop` — the momentary drive joystick.
26111
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26112
+ * map-coordinate plumbing is wired.
26113
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26114
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26115
+ * - `light` — the on/off fill-light toggle (works anytime).
26116
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26117
+ * camera-service control; needs an active stream).
26118
+ */
26119
+ var NavigationFeaturesSchema = object({
26120
+ move: boolean(),
26121
+ stop: boolean(),
26122
+ goToPoint: boolean(),
26123
+ runAction: boolean(),
26124
+ playSound: boolean(),
26125
+ light: boolean(),
26126
+ lightMode: boolean()
26127
+ });
26128
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26129
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26130
+ /**
26131
+ * Live navigation state so the UI can reflect what the robot is doing:
26132
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26133
+ * - `following` — person/pet follow is currently armed.
26134
+ * - `flash` — the on-camera fill light is on.
26135
+ * - `lightMode` — auto vs manual fill-light mode.
26136
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26137
+ * `lightMode === 'manual'`.
26138
+ */
26139
+ var NavigationStatusSchema = object({
26140
+ mode: _enum([
26141
+ "idle",
26142
+ "cleaning",
26143
+ "spot",
26144
+ "following",
26145
+ "goto",
26146
+ "returning",
26147
+ "paused",
26148
+ "unknown"
26149
+ ]),
26150
+ following: boolean(),
26151
+ flash: boolean(),
26152
+ lightMode: NavigationLightModeSchema,
26153
+ lightLevel: number().min(40).max(100),
26154
+ /** Ms epoch when the slice was last updated. */
26155
+ lastChangedAt: number()
26156
+ });
26157
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26158
+ DeviceType.Camera, method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(NavigationActionEntrySchema)), method(object({
26159
+ deviceId: number(),
26160
+ actionId: NavigationActionIdSchema
26161
+ }), _void(), { kind: "mutation" }), method(object({
26162
+ deviceId: number(),
26163
+ soundId: number().int()
26164
+ }), _void(), { kind: "mutation" }), method(object({
26165
+ deviceId: number(),
26166
+ on: boolean()
26167
+ }), _void(), { kind: "mutation" }), method(object({
26168
+ deviceId: number(),
26169
+ mode: NavigationLightModeSchema,
26170
+ level: number().min(40).max(100).optional()
26171
+ }), _void(), { kind: "mutation" }), method(object({
26172
+ deviceId: number(),
26173
+ level: number().min(40).max(100)
26174
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26175
+ deviceId: number(),
26176
+ status: NavigationStatusSchema
26177
+ });
26178
+ /**
26179
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26180
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26181
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26182
+ * one Home Assistant projection.
26183
+ */
26184
+ var NetworkLinkStatusSchema = object({
26185
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26186
+ type: _enum([
26187
+ "wifi",
26188
+ "ethernet",
26189
+ "cellular",
26190
+ "unknown"
26191
+ ]),
26192
+ /**
26193
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26194
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26195
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26196
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26197
+ * SKIP a null rather than coerce it.
26198
+ */
26199
+ signalPercent: number().min(0).max(100).nullable(),
26200
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26201
+ rssiDbm: number().optional(),
26202
+ /** Network name of a wireless link, when the firmware reports it. */
26203
+ ssid: string().optional(),
26204
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26205
+ lastUpdated: number()
26206
+ });
26207
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26208
+ deviceId: number(),
26209
+ status: NetworkLinkStatusSchema
26210
+ });
26211
+ /**
25875
26212
  * network-quality — system-scoped singleton capability tracking RTT,
25876
26213
  * jitter, and observed/peak bandwidth per device + per client.
25877
26214
  *
@@ -27113,203 +27450,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
27113
27450
  deviceId: number(),
27114
27451
  status: PtzAutotrackStatusSchema
27115
27452
  });
27116
- /**
27117
- * `navigation` — a device-scoped capability that natively expresses the FULL
27118
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
27119
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
27120
- *
27121
- * Why a NEW cap rather than overloading `ptz`:
27122
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
27123
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
27124
- * The two are different physical models: PTZ is absolute-position + presets,
27125
- * navigation is momentary drive nudges + discrete robot ACTIONS
27126
- * (dock / spot-clean / follow-pet / go-to-point / …).
27127
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
27128
- * the reverse:
27129
- * 1. a native CamStack navigation panel (data-driven from `listActions`
27130
- * / `getOptions`), and
27131
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
27132
- * robot camera shows up in the existing PTZ control path without every
27133
- * PTZ provider learning about robots. The mapping lives in the adapter,
27134
- * not here (see the addon design note):
27135
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
27136
- * ptz.stop() → navigation.stop()
27137
- * ptz.goHome() → navigation.runAction('goHome')
27138
- * ptz.getPresets() → navigation.listActions() (id→preset)
27139
- * ptz.goToPreset(id) → navigation.runAction(id)
27140
- *
27141
- * ## Continuous drive
27142
- *
27143
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
27144
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
27145
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
27146
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
27147
- * coalesce them. The UI owns the cadence.
27148
- *
27149
- * ## The action dictionary
27150
- *
27151
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
27152
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
27153
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
27154
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
27155
- * vendor-specific list. `kind: 'action'` entries are triggered with
27156
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
27157
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
27158
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
27159
- *
27160
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
27161
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
27162
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
27163
- * every device handle. A future nodedreame publish adds a typed
27164
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
27165
- * provider can then swap the raw calls for the typed methods with no change to
27166
- * THIS contract.
27167
- */
27168
- /**
27169
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
27170
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
27171
- * halts it.
27172
- *
27173
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
27174
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
27175
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
27176
- * vector by it (drivers without proportional drive ignore it).
27177
- *
27178
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
27179
- * axis alone; an all-undefined nudge is a no-op.
27180
- */
27181
- var NavigationMoveCommandSchema = object({
27182
- pan: number().min(-1).max(1).optional(),
27183
- tilt: number().min(-1).max(1).optional(),
27184
- speed: number().min(0).max(1).optional()
27185
- });
27186
- /**
27187
- * The enumerated discrete actions a navigation-capable robot can perform via
27188
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
27189
- * subset it supports through `listActions`. Sounds are NOT here — they go through
27190
- * `playSound` (see the `sound` dictionary entries).
27191
- */
27192
- var NavigationActionIdSchema = _enum([
27193
- "goHome",
27194
- "locate",
27195
- "spotClean",
27196
- "findPet",
27197
- "personFollow",
27198
- "stop",
27199
- "startClean",
27200
- "pauseClean",
27201
- "dockWash",
27202
- "autoEmpty",
27203
- "flashOn",
27204
- "flashOff"
27205
- ]);
27206
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
27207
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
27208
- /**
27209
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
27210
- * native panel and the PTZ mimic render as a button.
27211
- *
27212
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
27213
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
27214
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
27215
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
27216
- * - `label` — operator-facing English label.
27217
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
27218
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
27219
- * PTZ render ONLY enabled entries. Data-driven: the provider
27220
- * flips it from config, never by editing code.
27221
- */
27222
- var NavigationActionEntrySchema = object({
27223
- id: string(),
27224
- kind: NavigationEntryKindSchema,
27225
- label: string(),
27226
- icon: string(),
27227
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
27228
- soundId: number().int().optional(),
27229
- /** Per-device feature flag — render this entry only when true. */
27230
- enabled: boolean()
27231
- });
27232
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
27233
- var NavigationPointSchema = object({
27234
- x: number(),
27235
- y: number()
27236
- });
27237
- /**
27238
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
27239
- * The cap reports which are enabled so the UI / PTZ render only the controls
27240
- * that are turned on for THIS device. Data-driven: the provider derives these
27241
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
27242
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
27243
- * that are not dictionary entries.
27244
- *
27245
- * - `move` / `stop` — the momentary drive joystick.
27246
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
27247
- * map-coordinate plumbing is wired.
27248
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
27249
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
27250
- * - `light` — the on/off fill-light toggle (works anytime).
27251
- * - `lightMode` — the auto/manual selector + manual level slider (a
27252
- * camera-service control; needs an active stream).
27253
- */
27254
- var NavigationFeaturesSchema = object({
27255
- move: boolean(),
27256
- stop: boolean(),
27257
- goToPoint: boolean(),
27258
- runAction: boolean(),
27259
- playSound: boolean(),
27260
- light: boolean(),
27261
- lightMode: boolean()
27262
- });
27263
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
27264
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
27265
- /**
27266
- * Live navigation state so the UI can reflect what the robot is doing:
27267
- * - `mode` — coarse activity (idle / cleaning / following / …).
27268
- * - `following` — person/pet follow is currently armed.
27269
- * - `flash` — the on-camera fill light is on.
27270
- * - `lightMode` — auto vs manual fill-light mode.
27271
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
27272
- * `lightMode === 'manual'`.
27273
- */
27274
- var NavigationStatusSchema = object({
27275
- mode: _enum([
27276
- "idle",
27277
- "cleaning",
27278
- "spot",
27279
- "following",
27280
- "goto",
27281
- "returning",
27282
- "paused",
27283
- "unknown"
27284
- ]),
27285
- following: boolean(),
27286
- flash: boolean(),
27287
- lightMode: NavigationLightModeSchema,
27288
- lightLevel: number().min(40).max(100),
27289
- /** Ms epoch when the slice was last updated. */
27290
- lastChangedAt: number()
27291
- });
27292
- NavigationStatusSchema.extend({ lastFetchedAt: number() });
27293
- DeviceType.Camera, method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(NavigationActionEntrySchema)), method(object({
27294
- deviceId: number(),
27295
- actionId: NavigationActionIdSchema
27296
- }), _void(), { kind: "mutation" }), method(object({
27297
- deviceId: number(),
27298
- soundId: number().int()
27299
- }), _void(), { kind: "mutation" }), method(object({
27300
- deviceId: number(),
27301
- on: boolean()
27302
- }), _void(), { kind: "mutation" }), method(object({
27303
- deviceId: number(),
27304
- mode: NavigationLightModeSchema,
27305
- level: number().min(40).max(100).optional()
27306
- }), _void(), { kind: "mutation" }), method(object({
27307
- deviceId: number(),
27308
- level: number().min(40).max(100)
27309
- }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
27310
- deviceId: number(),
27311
- status: NavigationStatusSchema
27312
- });
27313
27453
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27314
27454
  kind: "mutation",
27315
27455
  auth: "admin"
@@ -34624,6 +34764,12 @@ Object.freeze({
34624
34764
  addonId: null,
34625
34765
  access: "view"
34626
34766
  },
34767
+ "storage.listDrainProgress": {
34768
+ capName: "storage",
34769
+ capScope: "system",
34770
+ addonId: null,
34771
+ access: "view"
34772
+ },
34627
34773
  "storage.listLocationDeclarations": {
34628
34774
  capName: "storage",
34629
34775
  capScope: "system",
@@ -34768,6 +34914,12 @@ Object.freeze({
34768
34914
  addonId: null,
34769
34915
  access: "view"
34770
34916
  },
34917
+ "storageOccupancy.getOccupancy": {
34918
+ capName: "storage-occupancy",
34919
+ capScope: "system",
34920
+ addonId: null,
34921
+ access: "view"
34922
+ },
34771
34923
  "storageProvider.abortUpload": {
34772
34924
  capName: "storage-provider",
34773
34925
  capScope: "system",