@camstack/addon-auth 1.2.86 → 1.2.87

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
@@ -21746,7 +21824,7 @@ method(object({
21746
21824
  }), _void(), {
21747
21825
  kind: "mutation",
21748
21826
  auth: "admin"
21749
- }), method(object({ id: string() }), object({
21827
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
21750
21828
  ok: boolean(),
21751
21829
  error: string().optional()
21752
21830
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -21816,6 +21894,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
21816
21894
  kind: "mutation",
21817
21895
  auth: "admin"
21818
21896
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
21897
+ /**
21898
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
21899
+ * location (D388).
21900
+ *
21901
+ * ## Why this is not `storage-evictable`
21902
+ *
21903
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
21904
+ * not, in two ways that both matter and both bite hardest on the locations an
21905
+ * operator most wants a figure for:
21906
+ *
21907
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
21908
+ * and `recordingsLow:default` deliberately share one root and evict as one
21909
+ * oldest-first pool, so both answer with the SAME combined total. As an
21910
+ * occupancy figure that double-counts the disk.
21911
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
21912
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
21913
+ * is retiring and staring at.
21914
+ *
21915
+ * So this is its own contract with its own quantity, and the quantity is
21916
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
21917
+ * would ever be willing to delete it. A provider that can only answer
21918
+ * "evictable" must not register here — a number that silently means different
21919
+ * things per class is worse than no number.
21920
+ *
21921
+ * ## Absence is an answer
21922
+ *
21923
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
21924
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
21925
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
21926
+ * consuming side has to be written out loud instead of appearing by accident.
21927
+ *
21928
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
21929
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
21930
+ */
21931
+ /** One provider's occupancy answer for one location. */
21932
+ var StorageOccupancyReportSchema = object({
21933
+ locationId: string(),
21934
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
21935
+ * not net of what it is willing to delete. */
21936
+ ownedBytes: number().int().nonnegative(),
21937
+ /** When the provider last actually measured this. The orchestrator carries it
21938
+ * through so a UI can say how old the figure is instead of implying "now". */
21939
+ measuredAtMs: number().int().nonnegative()
21940
+ });
21941
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
21819
21942
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
21820
21943
  providerId: string().min(1),
21821
21944
  displayName: string().min(1),
@@ -23486,39 +23609,6 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, meth
23486
23609
  deviceId: number(),
23487
23610
  status: BatteryStatusSchema
23488
23611
  });
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
23612
  object({
23523
23613
  on: boolean(),
23524
23614
  /** Ms epoch of the last transition. 0 if never observed. */
@@ -25872,6 +25962,236 @@ DeviceType.Camera, method(object({
25872
25962
  detection: NativeDetectionSchema
25873
25963
  });
25874
25964
  /**
25965
+ * `navigation` — a device-scoped capability that natively expresses the FULL
25966
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
25967
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
25968
+ *
25969
+ * Why a NEW cap rather than overloading `ptz`:
25970
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
25971
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
25972
+ * The two are different physical models: PTZ is absolute-position + presets,
25973
+ * navigation is momentary drive nudges + discrete robot ACTIONS
25974
+ * (dock / spot-clean / follow-pet / go-to-point / …).
25975
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
25976
+ * the reverse:
25977
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
25978
+ * / `getOptions`), and
25979
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
25980
+ * robot camera shows up in the existing PTZ control path without every
25981
+ * PTZ provider learning about robots. The mapping lives in the adapter,
25982
+ * not here (see the addon design note):
25983
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
25984
+ * ptz.stop() → navigation.stop()
25985
+ * ptz.goHome() → navigation.runAction('goHome')
25986
+ * ptz.getPresets() → navigation.listActions() (id→preset)
25987
+ * ptz.goToPreset(id) → navigation.runAction(id)
25988
+ *
25989
+ * ## Continuous drive
25990
+ *
25991
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
25992
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
25993
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
25994
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
25995
+ * coalesce them. The UI owns the cadence.
25996
+ *
25997
+ * ## The action dictionary
25998
+ *
25999
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
26000
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
26001
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
26002
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
26003
+ * vendor-specific list. `kind: 'action'` entries are triggered with
26004
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
26005
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
26006
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
26007
+ *
26008
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
26009
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
26010
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
26011
+ * every device handle. A future nodedreame publish adds a typed
26012
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
26013
+ * provider can then swap the raw calls for the typed methods with no change to
26014
+ * THIS contract.
26015
+ */
26016
+ /**
26017
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
26018
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
26019
+ * halts it.
26020
+ *
26021
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
26022
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
26023
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
26024
+ * vector by it (drivers without proportional drive ignore it).
26025
+ *
26026
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
26027
+ * axis alone; an all-undefined nudge is a no-op.
26028
+ */
26029
+ var NavigationMoveCommandSchema = object({
26030
+ pan: number().min(-1).max(1).optional(),
26031
+ tilt: number().min(-1).max(1).optional(),
26032
+ speed: number().min(0).max(1).optional()
26033
+ });
26034
+ /**
26035
+ * The enumerated discrete actions a navigation-capable robot can perform via
26036
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
26037
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
26038
+ * `playSound` (see the `sound` dictionary entries).
26039
+ */
26040
+ var NavigationActionIdSchema = _enum([
26041
+ "goHome",
26042
+ "locate",
26043
+ "spotClean",
26044
+ "findPet",
26045
+ "personFollow",
26046
+ "stop",
26047
+ "startClean",
26048
+ "pauseClean",
26049
+ "dockWash",
26050
+ "autoEmpty",
26051
+ "flashOn",
26052
+ "flashOff"
26053
+ ]);
26054
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
26055
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
26056
+ /**
26057
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
26058
+ * native panel and the PTZ mimic render as a button.
26059
+ *
26060
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
26061
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
26062
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
26063
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
26064
+ * - `label` — operator-facing English label.
26065
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
26066
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
26067
+ * PTZ render ONLY enabled entries. Data-driven: the provider
26068
+ * flips it from config, never by editing code.
26069
+ */
26070
+ var NavigationActionEntrySchema = object({
26071
+ id: string(),
26072
+ kind: NavigationEntryKindSchema,
26073
+ label: string(),
26074
+ icon: string(),
26075
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
26076
+ soundId: number().int().optional(),
26077
+ /** Per-device feature flag — render this entry only when true. */
26078
+ enabled: boolean()
26079
+ });
26080
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
26081
+ var NavigationPointSchema = object({
26082
+ x: number(),
26083
+ y: number()
26084
+ });
26085
+ /**
26086
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
26087
+ * The cap reports which are enabled so the UI / PTZ render only the controls
26088
+ * that are turned on for THIS device. Data-driven: the provider derives these
26089
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
26090
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
26091
+ * that are not dictionary entries.
26092
+ *
26093
+ * - `move` / `stop` — the momentary drive joystick.
26094
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
26095
+ * map-coordinate plumbing is wired.
26096
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
26097
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
26098
+ * - `light` — the on/off fill-light toggle (works anytime).
26099
+ * - `lightMode` — the auto/manual selector + manual level slider (a
26100
+ * camera-service control; needs an active stream).
26101
+ */
26102
+ var NavigationFeaturesSchema = object({
26103
+ move: boolean(),
26104
+ stop: boolean(),
26105
+ goToPoint: boolean(),
26106
+ runAction: boolean(),
26107
+ playSound: boolean(),
26108
+ light: boolean(),
26109
+ lightMode: boolean()
26110
+ });
26111
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
26112
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
26113
+ /**
26114
+ * Live navigation state so the UI can reflect what the robot is doing:
26115
+ * - `mode` — coarse activity (idle / cleaning / following / …).
26116
+ * - `following` — person/pet follow is currently armed.
26117
+ * - `flash` — the on-camera fill light is on.
26118
+ * - `lightMode` — auto vs manual fill-light mode.
26119
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
26120
+ * `lightMode === 'manual'`.
26121
+ */
26122
+ var NavigationStatusSchema = object({
26123
+ mode: _enum([
26124
+ "idle",
26125
+ "cleaning",
26126
+ "spot",
26127
+ "following",
26128
+ "goto",
26129
+ "returning",
26130
+ "paused",
26131
+ "unknown"
26132
+ ]),
26133
+ following: boolean(),
26134
+ flash: boolean(),
26135
+ lightMode: NavigationLightModeSchema,
26136
+ lightLevel: number().min(40).max(100),
26137
+ /** Ms epoch when the slice was last updated. */
26138
+ lastChangedAt: number()
26139
+ });
26140
+ NavigationStatusSchema.extend({ lastFetchedAt: number() });
26141
+ 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({
26142
+ deviceId: number(),
26143
+ actionId: NavigationActionIdSchema
26144
+ }), _void(), { kind: "mutation" }), method(object({
26145
+ deviceId: number(),
26146
+ soundId: number().int()
26147
+ }), _void(), { kind: "mutation" }), method(object({
26148
+ deviceId: number(),
26149
+ on: boolean()
26150
+ }), _void(), { kind: "mutation" }), method(object({
26151
+ deviceId: number(),
26152
+ mode: NavigationLightModeSchema,
26153
+ level: number().min(40).max(100).optional()
26154
+ }), _void(), { kind: "mutation" }), method(object({
26155
+ deviceId: number(),
26156
+ level: number().min(40).max(100)
26157
+ }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), NavigationFeaturesSchema), object({
26158
+ deviceId: number(),
26159
+ status: NavigationStatusSchema
26160
+ });
26161
+ /**
26162
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
26163
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
26164
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
26165
+ * one Home Assistant projection.
26166
+ */
26167
+ var NetworkLinkStatusSchema = object({
26168
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
26169
+ type: _enum([
26170
+ "wifi",
26171
+ "ethernet",
26172
+ "cellular",
26173
+ "unknown"
26174
+ ]),
26175
+ /**
26176
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
26177
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
26178
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
26179
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
26180
+ * SKIP a null rather than coerce it.
26181
+ */
26182
+ signalPercent: number().min(0).max(100).nullable(),
26183
+ /** Raw received signal strength in dBm, when the firmware reports one. */
26184
+ rssiDbm: number().optional(),
26185
+ /** Network name of a wireless link, when the firmware reports it. */
26186
+ ssid: string().optional(),
26187
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
26188
+ lastUpdated: number()
26189
+ });
26190
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.Light, DeviceType.Lock, DeviceType.Siren, object({
26191
+ deviceId: number(),
26192
+ status: NetworkLinkStatusSchema
26193
+ });
26194
+ /**
25875
26195
  * network-quality — system-scoped singleton capability tracking RTT,
25876
26196
  * jitter, and observed/peak bandwidth per device + per client.
25877
26197
  *
@@ -27113,203 +27433,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
27113
27433
  deviceId: number(),
27114
27434
  status: PtzAutotrackStatusSchema
27115
27435
  });
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
27436
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
27314
27437
  kind: "mutation",
27315
27438
  auth: "admin"
@@ -34624,6 +34747,12 @@ Object.freeze({
34624
34747
  addonId: null,
34625
34748
  access: "view"
34626
34749
  },
34750
+ "storage.listDrainProgress": {
34751
+ capName: "storage",
34752
+ capScope: "system",
34753
+ addonId: null,
34754
+ access: "view"
34755
+ },
34627
34756
  "storage.listLocationDeclarations": {
34628
34757
  capName: "storage",
34629
34758
  capScope: "system",
@@ -34768,6 +34897,12 @@ Object.freeze({
34768
34897
  addonId: null,
34769
34898
  access: "view"
34770
34899
  },
34900
+ "storageOccupancy.getOccupancy": {
34901
+ capName: "storage-occupancy",
34902
+ capScope: "system",
34903
+ addonId: null,
34904
+ access: "view"
34905
+ },
34771
34906
  "storageProvider.abortUpload": {
34772
34907
  capName: "storage-provider",
34773
34908
  capScope: "system",
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../chunk-Cek0wNdY.js");
6
- const require_dist = require("../dist-gMSygw5x.js");
6
+ const require_dist = require("../dist-BiBtU0Wh.js");
7
7
  //#region src/magic-link/auth-magic-link.addon.ts
8
8
  /**
9
9
  * Magic-link authentication addon.