@camstack/addon-provider-rademacher 0.2.78 → 0.2.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +500 -365
  2. package/dist/addon.mjs +500 -365
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -983,7 +983,7 @@ var Rademacher = class {
983
983
  }
984
984
  };
985
985
  //#endregion
986
- //#region ../types/dist/event-category-zAv7pMUz.mjs
986
+ //#region ../types/dist/event-category-CnLqLOKs.mjs
987
987
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
988
988
  EventCategory["SystemBoot"] = "system.boot";
989
989
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1178,6 +1178,19 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1178
1178
  EventCategory["ProcessCrashed"] = "process.crashed";
1179
1179
  EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
1180
1180
  EventCategory["ProcessRestarted"] = "process.restarted";
1181
+ /**
1182
+ * The SET of storage locations changed — one was created, edited, enabled,
1183
+ * disabled or deleted through `storage.upsertLocation` / `deleteLocation`.
1184
+ *
1185
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
1186
+ * it must also converge on its own periodic path, because a dropped event
1187
+ * must not leave a node writing to yesterday's disk set forever. It exists
1188
+ * because there was NO signal at all — an operator who added a second
1189
+ * recordings disk in the admin UI got nothing, and the recorder kept its
1190
+ * resolved locations until something else happened to re-resolve them
1191
+ * (D387). Payload `StorageLocationsChangedPayload`.
1192
+ */
1193
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
1181
1194
  EventCategory["RecordingStarted"] = "recording.started";
1182
1195
  EventCategory["RecordingStopped"] = "recording.stopped";
1183
1196
  EventCategory["RecordingError"] = "recording.error";
@@ -9520,6 +9533,21 @@ var StorageCleanupJobSchema = object({
9520
9533
  });
9521
9534
  var StorageCleanupStatusInputSchema = object({ jobId: string().optional() });
9522
9535
  /**
9536
+ * The one typed state of a storage location. Authoritative Zod schema — the TS
9537
+ * alias below is `z.infer<>` of it, never a second spelling.
9538
+ */
9539
+ var StorageLocationModeSchema = _enum([
9540
+ "active",
9541
+ "readonly",
9542
+ "drain",
9543
+ "disabled"
9544
+ ]);
9545
+ _enum([
9546
+ "normal",
9547
+ "never",
9548
+ "drain"
9549
+ ]);
9550
+ /**
9523
9551
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
9524
9552
  * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
9525
9553
  * so the persisted record schema and the consumer-facing cap can both consume it
@@ -9585,6 +9613,21 @@ var StorageLocationSchema = object({
9585
9613
  * stops existing rather than being re-derived on every read.
9586
9614
  */
9587
9615
  enabled: boolean().optional(),
9616
+ /**
9617
+ * THE state of this location (D385), and the only authority on what may be
9618
+ * written, read or evicted here. Interpreted in exactly one place —
9619
+ * `storage-location-mode.ts` — which also folds the legacy
9620
+ * `enabled` / `config.readOnly` pair into a mode so an old row is never
9621
+ * ambiguous.
9622
+ *
9623
+ * OPTIONAL only for the wire and for rows written before D385: absence is
9624
+ * resolved by `resolveLocationMode`, and the orchestrator stamps every
9625
+ * unstamped row ONCE at hydrate so absence stops existing rather than being
9626
+ * re-derived on every read. `enabled` survives one release as a DERIVED
9627
+ * mirror (`mode === 'active'`); `withLocationMode` is the only writer of
9628
+ * either, so the two cannot disagree.
9629
+ */
9630
+ mode: StorageLocationModeSchema.optional(),
9588
9631
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
9589
9632
  * for node-local locations it can reach) — never persisted, absent when the
9590
9633
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -9592,11 +9635,46 @@ var StorageLocationSchema = object({
9592
9635
  totalBytes: number(),
9593
9636
  availableBytes: number()
9594
9637
  }).nullable().optional(),
9638
+ /**
9639
+ * How much of that volume CamStack ITSELF holds on this location (D388) —
9640
+ * COMPUTED at read time from the `storage-occupancy` providers' own figures,
9641
+ * never persisted, never a filesystem walk.
9642
+ *
9643
+ * **ABSENT MEANS UNKNOWN, never zero.** No provider has reported for this
9644
+ * location yet — nobody stores here, the owning addon is down, or the first
9645
+ * refresh has not completed. A UI must omit the segment rather than draw it
9646
+ * at zero, which would claim we occupy nothing (D315). It is an OBJECT and
9647
+ * not a bare number precisely so that a `?? 0` on the consuming side has to
9648
+ * be spelled out loud instead of appearing by accident.
9649
+ *
9650
+ * `measuredAtMs` is the OLDEST contributing measurement, so it is honest
9651
+ * about the whole figure rather than about its freshest part.
9652
+ */
9653
+ owned: object({
9654
+ bytes: number().int().nonnegative(),
9655
+ measuredAtMs: number().int().nonnegative()
9656
+ }).optional(),
9595
9657
  createdAt: number(),
9596
9658
  updatedAt: number()
9597
9659
  });
9598
9660
  object({ isDefault: boolean().optional() });
9599
9661
  /**
9662
+ * How far a `drain` has got (D386) — the read a UI renders, and nothing more.
9663
+ *
9664
+ * `estimatedEmptyAtMs` is derived from the growth the ratchet has actually
9665
+ * OBSERVED and is `null` when it has observed none. Never a fabricated date: a
9666
+ * drain with no observed growth has no honest ETA, and inventing one is how an
9667
+ * operator learns not to believe the screen.
9668
+ */
9669
+ var StorageDrainProgressSchema = object({
9670
+ locationId: string(),
9671
+ startedAtMs: number(),
9672
+ startBytes: number(),
9673
+ bytesRemaining: number(),
9674
+ drained: boolean(),
9675
+ estimatedEmptyAtMs: number().nullable()
9676
+ });
9677
+ /**
9600
9678
  * Reference accepted by consumer-facing `api.storage.*` calls.
9601
9679
  * Either:
9602
9680
  * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
@@ -22925,7 +23003,7 @@ method(object({
22925
23003
  }), _void(), {
22926
23004
  kind: "mutation",
22927
23005
  auth: "admin"
22928
- }), method(object({ id: string() }), object({
23006
+ }), method(_void(), array(StorageDrainProgressSchema).readonly()), method(object({ id: string() }), object({
22929
23007
  ok: boolean(),
22930
23008
  error: string().optional()
22931
23009
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
@@ -22995,6 +23073,51 @@ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin"
22995
23073
  kind: "mutation",
22996
23074
  auth: "admin"
22997
23075
  }), method(object({}), array(StorageMigrationJobSchema).readonly(), { auth: "admin" });
23076
+ /**
23077
+ * `storage-occupancy` — how many bytes an addon actually HOLDS on a storage
23078
+ * location (D388).
23079
+ *
23080
+ * ## Why this is not `storage-evictable`
23081
+ *
23082
+ * `storage-evictable.getEvictableUsage` looks like the same question and is
23083
+ * not, in two ways that both matter and both bite hardest on the locations an
23084
+ * operator most wants a figure for:
23085
+ *
23086
+ * - it reports the whole eviction DOMAIN, not the location. `recordings:default`
23087
+ * and `recordingsLow:default` deliberately share one root and evict as one
23088
+ * oldest-first pool, so both answer with the SAME combined total. As an
23089
+ * occupancy figure that double-counts the disk.
23090
+ * - it reports ZERO for a location whose eviction policy is `never` (D385) —
23091
+ * a `readonly` or `disabled` disk. Those are exactly the disks an operator
23092
+ * is retiring and staring at.
23093
+ *
23094
+ * So this is its own contract with its own quantity, and the quantity is
23095
+ * OCCUPIED: every byte the addon holds on that location, whether or not it
23096
+ * would ever be willing to delete it. A provider that can only answer
23097
+ * "evictable" must not register here — a number that silently means different
23098
+ * things per class is worse than no number.
23099
+ *
23100
+ * ## Absence is an answer
23101
+ *
23102
+ * A location nobody reports for is UNKNOWN, never zero (D315). The orchestrator
23103
+ * stamps `StorageLocation.owned` only for locations it has a report for, and
23104
+ * the field is an OBJECT rather than a bare number so that a `?? 0` on the
23105
+ * consuming side has to be written out loud instead of appearing by accident.
23106
+ *
23107
+ * `internal: true` — consumed by the orchestrator's `listLocations` stamp, never
23108
+ * a public client surface. Clients read the stamped `StorageLocation.owned`.
23109
+ */
23110
+ /** One provider's occupancy answer for one location. */
23111
+ var StorageOccupancyReportSchema = object({
23112
+ locationId: string(),
23113
+ /** Bytes this provider holds on THAT location — not its eviction domain, and
23114
+ * not net of what it is willing to delete. */
23115
+ ownedBytes: number().int().nonnegative(),
23116
+ /** When the provider last actually measured this. The orchestrator carries it
23117
+ * through so a UI can say how old the figure is instead of implying "now". */
23118
+ measuredAtMs: number().int().nonnegative()
23119
+ });
23120
+ method(object({ locationIds: array(string()).readonly() }), array(StorageOccupancyReportSchema).readonly(), { auth: "admin" });
22998
23121
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
22999
23122
  providerId: string().min(1),
23000
23123
  displayName: string().min(1),
@@ -24830,88 +24953,6 @@ onStatusChanged: { data: object({
24830
24953
  volatileStateFields: ["lastUpdated"]
24831
24954
  };
24832
24955
  /**
24833
- * Network-link snapshot. Same shape for every provider (a Reolink wifi
24834
- * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24835
- * plug): one slice under `device.runtimeState['network-link']`, one badge,
24836
- * one Home Assistant projection.
24837
- */
24838
- var NetworkLinkStatusSchema = object({
24839
- /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24840
- type: _enum([
24841
- "wifi",
24842
- "ethernet",
24843
- "cellular",
24844
- "unknown"
24845
- ]),
24846
- /**
24847
- * Link quality, 0..100 inclusive, normalised by the provider from whatever
24848
- * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24849
- * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24850
- * one whose reading has not landed must not be drawn at 0 %. Consumers
24851
- * SKIP a null rather than coerce it.
24852
- */
24853
- signalPercent: number().min(0).max(100).nullable(),
24854
- /** Raw received signal strength in dBm, when the firmware reports one. */
24855
- rssiDbm: number().optional(),
24856
- /** Network name of a wireless link, when the firmware reports it. */
24857
- ssid: string().optional(),
24858
- /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24859
- lastUpdated: number()
24860
- });
24861
- var networkLinkCapability = {
24862
- name: "network-link",
24863
- scope: "device",
24864
- deviceNative: true,
24865
- mode: "singleton",
24866
- deviceTypes: [
24867
- DeviceType.Camera,
24868
- DeviceType.Sensor,
24869
- DeviceType.Button,
24870
- DeviceType.Switch,
24871
- DeviceType.Light,
24872
- DeviceType.Lock,
24873
- DeviceType.Siren
24874
- ],
24875
- methods: {},
24876
- events: {
24877
- /**
24878
- * Emitted whenever the cached status changes (a link switch, a signal
24879
- * reading that moved). Mirrored on the parent chain by the
24880
- * DeviceEventPropagator like `battery.onStatusChanged`.
24881
- */
24882
- onStatusChanged: { data: object({
24883
- deviceId: number(),
24884
- status: NetworkLinkStatusSchema
24885
- }) } },
24886
- status: {
24887
- schema: NetworkLinkStatusSchema,
24888
- kind: "push",
24889
- empty: {
24890
- type: "unknown",
24891
- signalPercent: null,
24892
- lastUpdated: 0
24893
- }
24894
- },
24895
- /**
24896
- * Runtime-state slice — every provider stores the same shape under
24897
- * `device.runtimeState['network-link']`, read once by the badge and the
24898
- * Home Assistant projector regardless of the driver.
24899
- */
24900
- runtimeState: NetworkLinkStatusSchema,
24901
- /**
24902
- * Runtime-state durability: **restored** — a link reading is slow to
24903
- * change and a sleeping battery camera may not report for hours; the
24904
- * restored slice is what the badge shows until the next read.
24905
- *
24906
- * See `RuntimeStateDurability`. Enforced by
24907
- * `scripts/check-runtime-state-durability.ts`.
24908
- */
24909
- durability: "restored",
24910
- /** Clock fields: written, but excluded from the compare that decides
24911
- * whether persisting is worth a SQLite commit. */
24912
- volatileStateFields: ["lastUpdated"]
24913
- };
24914
- /**
24915
24956
  * Generic boolean sensor — last-resort fallback when no domain-
24916
24957
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24917
24958
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -28441,6 +28482,369 @@ var nativeObjectDetectionCapability = {
28441
28482
  volatileStateFields: ["lastFetchedAt"]
28442
28483
  };
28443
28484
  /**
28485
+ * `navigation` — a device-scoped capability that natively expresses the FULL
28486
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
28487
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
28488
+ *
28489
+ * Why a NEW cap rather than overloading `ptz`:
28490
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
28491
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
28492
+ * The two are different physical models: PTZ is absolute-position + presets,
28493
+ * navigation is momentary drive nudges + discrete robot ACTIONS
28494
+ * (dock / spot-clean / follow-pet / go-to-point / …).
28495
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
28496
+ * the reverse:
28497
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
28498
+ * / `getOptions`), and
28499
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
28500
+ * robot camera shows up in the existing PTZ control path without every
28501
+ * PTZ provider learning about robots. The mapping lives in the adapter,
28502
+ * not here (see the addon design note):
28503
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
28504
+ * ptz.stop() → navigation.stop()
28505
+ * ptz.goHome() → navigation.runAction('goHome')
28506
+ * ptz.getPresets() → navigation.listActions() (id→preset)
28507
+ * ptz.goToPreset(id) → navigation.runAction(id)
28508
+ *
28509
+ * ## Continuous drive
28510
+ *
28511
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
28512
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
28513
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
28514
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
28515
+ * coalesce them. The UI owns the cadence.
28516
+ *
28517
+ * ## The action dictionary
28518
+ *
28519
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
28520
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
28521
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
28522
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
28523
+ * vendor-specific list. `kind: 'action'` entries are triggered with
28524
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
28525
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
28526
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
28527
+ *
28528
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
28529
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
28530
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
28531
+ * every device handle. A future nodedreame publish adds a typed
28532
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
28533
+ * provider can then swap the raw calls for the typed methods with no change to
28534
+ * THIS contract.
28535
+ */
28536
+ /**
28537
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
28538
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
28539
+ * halts it.
28540
+ *
28541
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
28542
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
28543
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
28544
+ * vector by it (drivers without proportional drive ignore it).
28545
+ *
28546
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
28547
+ * axis alone; an all-undefined nudge is a no-op.
28548
+ */
28549
+ var NavigationMoveCommandSchema = object({
28550
+ pan: number().min(-1).max(1).optional(),
28551
+ tilt: number().min(-1).max(1).optional(),
28552
+ speed: number().min(0).max(1).optional()
28553
+ });
28554
+ /**
28555
+ * The enumerated discrete actions a navigation-capable robot can perform via
28556
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
28557
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
28558
+ * `playSound` (see the `sound` dictionary entries).
28559
+ */
28560
+ var NavigationActionIdSchema = _enum([
28561
+ "goHome",
28562
+ "locate",
28563
+ "spotClean",
28564
+ "findPet",
28565
+ "personFollow",
28566
+ "stop",
28567
+ "startClean",
28568
+ "pauseClean",
28569
+ "dockWash",
28570
+ "autoEmpty",
28571
+ "flashOn",
28572
+ "flashOff"
28573
+ ]);
28574
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
28575
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
28576
+ /**
28577
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
28578
+ * native panel and the PTZ mimic render as a button.
28579
+ *
28580
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
28581
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
28582
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
28583
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
28584
+ * - `label` — operator-facing English label.
28585
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
28586
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
28587
+ * PTZ render ONLY enabled entries. Data-driven: the provider
28588
+ * flips it from config, never by editing code.
28589
+ */
28590
+ var NavigationActionEntrySchema = object({
28591
+ id: string(),
28592
+ kind: NavigationEntryKindSchema,
28593
+ label: string(),
28594
+ icon: string(),
28595
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
28596
+ soundId: number().int().optional(),
28597
+ /** Per-device feature flag — render this entry only when true. */
28598
+ enabled: boolean()
28599
+ });
28600
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
28601
+ var NavigationPointSchema = object({
28602
+ x: number(),
28603
+ y: number()
28604
+ });
28605
+ /**
28606
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
28607
+ * The cap reports which are enabled so the UI / PTZ render only the controls
28608
+ * that are turned on for THIS device. Data-driven: the provider derives these
28609
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
28610
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
28611
+ * that are not dictionary entries.
28612
+ *
28613
+ * - `move` / `stop` — the momentary drive joystick.
28614
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
28615
+ * map-coordinate plumbing is wired.
28616
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
28617
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
28618
+ * - `light` — the on/off fill-light toggle (works anytime).
28619
+ * - `lightMode` — the auto/manual selector + manual level slider (a
28620
+ * camera-service control; needs an active stream).
28621
+ */
28622
+ var NavigationFeaturesSchema = object({
28623
+ move: boolean(),
28624
+ stop: boolean(),
28625
+ goToPoint: boolean(),
28626
+ runAction: boolean(),
28627
+ playSound: boolean(),
28628
+ light: boolean(),
28629
+ lightMode: boolean()
28630
+ });
28631
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
28632
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
28633
+ /**
28634
+ * Live navigation state so the UI can reflect what the robot is doing:
28635
+ * - `mode` — coarse activity (idle / cleaning / following / …).
28636
+ * - `following` — person/pet follow is currently armed.
28637
+ * - `flash` — the on-camera fill light is on.
28638
+ * - `lightMode` — auto vs manual fill-light mode.
28639
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
28640
+ * `lightMode === 'manual'`.
28641
+ */
28642
+ var NavigationStatusSchema = object({
28643
+ mode: _enum([
28644
+ "idle",
28645
+ "cleaning",
28646
+ "spot",
28647
+ "following",
28648
+ "goto",
28649
+ "returning",
28650
+ "paused",
28651
+ "unknown"
28652
+ ]),
28653
+ following: boolean(),
28654
+ flash: boolean(),
28655
+ lightMode: NavigationLightModeSchema,
28656
+ lightLevel: number().min(40).max(100),
28657
+ /** Ms epoch when the slice was last updated. */
28658
+ lastChangedAt: number()
28659
+ });
28660
+ /**
28661
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
28662
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
28663
+ * convention.
28664
+ */
28665
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
28666
+ var navigationCapability = {
28667
+ name: "navigation",
28668
+ scope: "device",
28669
+ deviceNative: true,
28670
+ mode: "singleton",
28671
+ deviceTypes: [DeviceType.Camera],
28672
+ deviceConfig: { ui: {
28673
+ kind: "widget",
28674
+ widgetId: "host/navigation-panel",
28675
+ tab: "navigation",
28676
+ topTab: true,
28677
+ label: "Navigation",
28678
+ order: 0
28679
+ } },
28680
+ methods: {
28681
+ /**
28682
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
28683
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
28684
+ * path) works for any authenticated user, not admin-only. The UI sends
28685
+ * these at ~1 Hz while a control is held; the provider forwards each one to
28686
+ * a single drive write WITHOUT debouncing.
28687
+ */
28688
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
28689
+ /** Halt all motion immediately (zero drive vector). */
28690
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
28691
+ /** Send the robot to a point on its live map. */
28692
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
28693
+ /**
28694
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
28695
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
28696
+ */
28697
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
28698
+ /**
28699
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
28700
+ * unsupported action ids are rejected by the provider.
28701
+ */
28702
+ runAction: method(object({
28703
+ deviceId: number(),
28704
+ actionId: NavigationActionIdSchema
28705
+ }), _void(), { kind: "mutation" }),
28706
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
28707
+ playSound: method(object({
28708
+ deviceId: number(),
28709
+ soundId: number().int()
28710
+ }), _void(), { kind: "mutation" }),
28711
+ /**
28712
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
28713
+ * works anytime, no active stream required).
28714
+ */
28715
+ setLightOn: method(object({
28716
+ deviceId: number(),
28717
+ on: boolean()
28718
+ }), _void(), { kind: "mutation" }),
28719
+ /**
28720
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
28721
+ * initial `level`. The auto/manual + level control is a CAMERA-service
28722
+ * action that generally needs an active camera stream/monitor session — the
28723
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
28724
+ */
28725
+ setLightMode: method(object({
28726
+ deviceId: number(),
28727
+ mode: NavigationLightModeSchema,
28728
+ level: number().min(40).max(100).optional()
28729
+ }), _void(), { kind: "mutation" }),
28730
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
28731
+ setLightLevel: method(object({
28732
+ deviceId: number(),
28733
+ level: number().min(40).max(100)
28734
+ }), _void(), { kind: "mutation" }),
28735
+ /**
28736
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
28737
+ * controls the UI shows (the per-entry flags for the dictionary come back on
28738
+ * `listActions`).
28739
+ */
28740
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
28741
+ },
28742
+ events: { onStatusChanged: { data: object({
28743
+ deviceId: number(),
28744
+ status: NavigationStatusSchema
28745
+ }) } },
28746
+ status: {
28747
+ schema: NavigationStatusSchema,
28748
+ kind: "push"
28749
+ },
28750
+ /**
28751
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
28752
+ * for live mode / follow / flash changes.
28753
+ */
28754
+ runtimeState: NavigationRuntimeStateSchema,
28755
+ /**
28756
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
28757
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
28758
+ * that. The live handle re-publishes on connect.
28759
+ *
28760
+ * See `RuntimeStateDurability`. Enforced by
28761
+ * `scripts/check-runtime-state-durability.ts`.
28762
+ */
28763
+ durability: "session"
28764
+ };
28765
+ /**
28766
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
28767
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
28768
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
28769
+ * one Home Assistant projection.
28770
+ */
28771
+ var NetworkLinkStatusSchema = object({
28772
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
28773
+ type: _enum([
28774
+ "wifi",
28775
+ "ethernet",
28776
+ "cellular",
28777
+ "unknown"
28778
+ ]),
28779
+ /**
28780
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
28781
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
28782
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
28783
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
28784
+ * SKIP a null rather than coerce it.
28785
+ */
28786
+ signalPercent: number().min(0).max(100).nullable(),
28787
+ /** Raw received signal strength in dBm, when the firmware reports one. */
28788
+ rssiDbm: number().optional(),
28789
+ /** Network name of a wireless link, when the firmware reports it. */
28790
+ ssid: string().optional(),
28791
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
28792
+ lastUpdated: number()
28793
+ });
28794
+ var networkLinkCapability = {
28795
+ name: "network-link",
28796
+ scope: "device",
28797
+ deviceNative: true,
28798
+ mode: "singleton",
28799
+ deviceTypes: [
28800
+ DeviceType.Camera,
28801
+ DeviceType.Sensor,
28802
+ DeviceType.Button,
28803
+ DeviceType.Switch,
28804
+ DeviceType.Light,
28805
+ DeviceType.Lock,
28806
+ DeviceType.Siren
28807
+ ],
28808
+ methods: {},
28809
+ events: {
28810
+ /**
28811
+ * Emitted whenever the cached status changes (a link switch, a signal
28812
+ * reading that moved). Mirrored on the parent chain by the
28813
+ * DeviceEventPropagator like `battery.onStatusChanged`.
28814
+ */
28815
+ onStatusChanged: { data: object({
28816
+ deviceId: number(),
28817
+ status: NetworkLinkStatusSchema
28818
+ }) } },
28819
+ status: {
28820
+ schema: NetworkLinkStatusSchema,
28821
+ kind: "push",
28822
+ empty: {
28823
+ type: "unknown",
28824
+ signalPercent: null,
28825
+ lastUpdated: 0
28826
+ }
28827
+ },
28828
+ /**
28829
+ * Runtime-state slice — every provider stores the same shape under
28830
+ * `device.runtimeState['network-link']`, read once by the badge and the
28831
+ * Home Assistant projector regardless of the driver.
28832
+ */
28833
+ runtimeState: NetworkLinkStatusSchema,
28834
+ /**
28835
+ * Runtime-state durability: **restored** — a link reading is slow to
28836
+ * change and a sleeping battery camera may not report for hours; the
28837
+ * restored slice is what the badge shows until the next read.
28838
+ *
28839
+ * See `RuntimeStateDurability`. Enforced by
28840
+ * `scripts/check-runtime-state-durability.ts`.
28841
+ */
28842
+ durability: "restored",
28843
+ /** Clock fields: written, but excluded from the compare that decides
28844
+ * whether persisting is worth a SQLite commit. */
28845
+ volatileStateFields: ["lastUpdated"]
28846
+ };
28847
+ /**
28444
28848
  * network-quality — system-scoped singleton capability tracking RTT,
28445
28849
  * jitter, and observed/peak bandwidth per device + per client.
28446
28850
  *
@@ -30021,287 +30425,6 @@ var ptzAutotrackCapability = {
30021
30425
  */
30022
30426
  durability: "session"
30023
30427
  };
30024
- /**
30025
- * `navigation` — a device-scoped capability that natively expresses the FULL
30026
- * navigation / action surface of a robot that DRIVES ITSELF and carries an
30027
- * on-board camera (the Dreame robot-vacuum camera is the first provider).
30028
- *
30029
- * Why a NEW cap rather than overloading `ptz`:
30030
- * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
30031
- * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
30032
- * The two are different physical models: PTZ is absolute-position + presets,
30033
- * navigation is momentary drive nudges + discrete robot ACTIONS
30034
- * (dock / spot-clean / follow-pet / go-to-point / …).
30035
- * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
30036
- * the reverse:
30037
- * 1. a native CamStack navigation panel (data-driven from `listActions`
30038
- * / `getOptions`), and
30039
- * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
30040
- * robot camera shows up in the existing PTZ control path without every
30041
- * PTZ provider learning about robots. The mapping lives in the adapter,
30042
- * not here (see the addon design note):
30043
- * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
30044
- * ptz.stop() → navigation.stop()
30045
- * ptz.goHome() → navigation.runAction('goHome')
30046
- * ptz.getPresets() → navigation.listActions() (id→preset)
30047
- * ptz.goToPreset(id) → navigation.runAction(id)
30048
- *
30049
- * ## Continuous drive
30050
- *
30051
- * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
30052
- * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
30053
- * one `stop()` on release — exactly like the robot app's remote-drive joystick.
30054
- * The provider forwards EACH `move` to one drive write; it must NOT debounce or
30055
- * coalesce them. The UI owns the cadence.
30056
- *
30057
- * ## The action dictionary
30058
- *
30059
- * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
30060
- * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
30061
- * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
30062
- * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
30063
- * vendor-specific list. `kind: 'action'` entries are triggered with
30064
- * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
30065
- * (the entry carries the `soundId` to pass). The general primitives — `move`,
30066
- * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
30067
- *
30068
- * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
30069
- * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
30070
- * that the currently-published `@apocaliss92/nodedreame` already exposes on
30071
- * every device handle. A future nodedreame publish adds a typed
30072
- * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
30073
- * provider can then swap the raw calls for the typed methods with no change to
30074
- * THIS contract.
30075
- */
30076
- /**
30077
- * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
30078
- * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
30079
- * halts it.
30080
- *
30081
- * - `pan` — turn: negative = left, positive = right, 0 = straight.
30082
- * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
30083
- * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
30084
- * vector by it (drivers without proportional drive ignore it).
30085
- *
30086
- * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
30087
- * axis alone; an all-undefined nudge is a no-op.
30088
- */
30089
- var NavigationMoveCommandSchema = object({
30090
- pan: number().min(-1).max(1).optional(),
30091
- tilt: number().min(-1).max(1).optional(),
30092
- speed: number().min(0).max(1).optional()
30093
- });
30094
- /**
30095
- * The enumerated discrete actions a navigation-capable robot can perform via
30096
- * `runAction`. This is the CLOSED vocabulary; a given device advertises the
30097
- * subset it supports through `listActions`. Sounds are NOT here — they go through
30098
- * `playSound` (see the `sound` dictionary entries).
30099
- */
30100
- var NavigationActionIdSchema = _enum([
30101
- "goHome",
30102
- "locate",
30103
- "spotClean",
30104
- "findPet",
30105
- "personFollow",
30106
- "stop",
30107
- "startClean",
30108
- "pauseClean",
30109
- "dockWash",
30110
- "autoEmpty",
30111
- "flashOn",
30112
- "flashOff"
30113
- ]);
30114
- /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
30115
- var NavigationEntryKindSchema = _enum(["action", "sound"]);
30116
- /**
30117
- * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
30118
- * native panel and the PTZ mimic render as a button.
30119
- *
30120
- * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
30121
- * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
30122
- * (`sound:meow`) whose `soundId` is passed to `playSound`.
30123
- * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
30124
- * - `label` — operator-facing English label.
30125
- * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
30126
- * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
30127
- * PTZ render ONLY enabled entries. Data-driven: the provider
30128
- * flips it from config, never by editing code.
30129
- */
30130
- var NavigationActionEntrySchema = object({
30131
- id: string(),
30132
- kind: NavigationEntryKindSchema,
30133
- label: string(),
30134
- icon: string(),
30135
- /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
30136
- soundId: number().int().optional(),
30137
- /** Per-device feature flag — render this entry only when true. */
30138
- enabled: boolean()
30139
- });
30140
- /** Coordinates for `goToPoint` — a point on the robot's live map. */
30141
- var NavigationPointSchema = object({
30142
- x: number(),
30143
- y: number()
30144
- });
30145
- /**
30146
- * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
30147
- * The cap reports which are enabled so the UI / PTZ render only the controls
30148
- * that are turned on for THIS device. Data-driven: the provider derives these
30149
- * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
30150
- * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
30151
- * that are not dictionary entries.
30152
- *
30153
- * - `move` / `stop` — the momentary drive joystick.
30154
- * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
30155
- * map-coordinate plumbing is wired.
30156
- * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
30157
- * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
30158
- * - `light` — the on/off fill-light toggle (works anytime).
30159
- * - `lightMode` — the auto/manual selector + manual level slider (a
30160
- * camera-service control; needs an active stream).
30161
- */
30162
- var NavigationFeaturesSchema = object({
30163
- move: boolean(),
30164
- stop: boolean(),
30165
- goToPoint: boolean(),
30166
- runAction: boolean(),
30167
- playSound: boolean(),
30168
- light: boolean(),
30169
- lightMode: boolean()
30170
- });
30171
- /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
30172
- var NavigationLightModeSchema = _enum(["auto", "manual"]);
30173
- /**
30174
- * Live navigation state so the UI can reflect what the robot is doing:
30175
- * - `mode` — coarse activity (idle / cleaning / following / …).
30176
- * - `following` — person/pet follow is currently armed.
30177
- * - `flash` — the on-camera fill light is on.
30178
- * - `lightMode` — auto vs manual fill-light mode.
30179
- * - `lightLevel` — manual fill-light level (40..100); meaningful when
30180
- * `lightMode === 'manual'`.
30181
- */
30182
- var NavigationStatusSchema = object({
30183
- mode: _enum([
30184
- "idle",
30185
- "cleaning",
30186
- "spot",
30187
- "following",
30188
- "goto",
30189
- "returning",
30190
- "paused",
30191
- "unknown"
30192
- ]),
30193
- following: boolean(),
30194
- flash: boolean(),
30195
- lightMode: NavigationLightModeSchema,
30196
- lightLevel: number().min(40).max(100),
30197
- /** Ms epoch when the slice was last updated. */
30198
- lastChangedAt: number()
30199
- });
30200
- /**
30201
- * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
30202
- * observable). Adds `lastFetchedAt` on top of the status shape per the
30203
- * convention.
30204
- */
30205
- var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
30206
- var navigationCapability = {
30207
- name: "navigation",
30208
- scope: "device",
30209
- deviceNative: true,
30210
- mode: "singleton",
30211
- deviceTypes: [DeviceType.Camera],
30212
- deviceConfig: { ui: {
30213
- kind: "widget",
30214
- widgetId: "host/navigation-panel",
30215
- tab: "navigation",
30216
- topTab: true,
30217
- label: "Navigation",
30218
- order: 0
30219
- } },
30220
- methods: {
30221
- /**
30222
- * Momentary drive nudge (the robot moves). `protected` — mirrors
30223
- * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
30224
- * path) works for any authenticated user, not admin-only. The UI sends
30225
- * these at ~1 Hz while a control is held; the provider forwards each one to
30226
- * a single drive write WITHOUT debouncing.
30227
- */
30228
- move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
30229
- /** Halt all motion immediately (zero drive vector). */
30230
- stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
30231
- /** Send the robot to a point on its live map. */
30232
- goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
30233
- /**
30234
- * Enumerate the discrete controls THIS device supports (data-driven UI +
30235
- * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
30236
- */
30237
- listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
30238
- /**
30239
- * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
30240
- * unsupported action ids are rejected by the provider.
30241
- */
30242
- runAction: method(object({
30243
- deviceId: number(),
30244
- actionId: NavigationActionIdSchema
30245
- }), _void(), { kind: "mutation" }),
30246
- /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
30247
- playSound: method(object({
30248
- deviceId: number(),
30249
- soundId: number().int()
30250
- }), _void(), { kind: "mutation" }),
30251
- /**
30252
- * Turn the on-camera fill light on / off (the `OpenFullLight` control —
30253
- * works anytime, no active stream required).
30254
- */
30255
- setLightOn: method(object({
30256
- deviceId: number(),
30257
- on: boolean()
30258
- }), _void(), { kind: "mutation" }),
30259
- /**
30260
- * Set the fill-light mode (auto vs manual). `manual` optionally carries the
30261
- * initial `level`. The auto/manual + level control is a CAMERA-service
30262
- * action that generally needs an active camera stream/monitor session — the
30263
- * UI shows the manual level slider ONLY when `mode === 'manual'`.
30264
- */
30265
- setLightMode: method(object({
30266
- deviceId: number(),
30267
- mode: NavigationLightModeSchema,
30268
- level: number().min(40).max(100).optional()
30269
- }), _void(), { kind: "mutation" }),
30270
- /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
30271
- setLightLevel: method(object({
30272
- deviceId: number(),
30273
- level: number().min(40).max(100)
30274
- }), _void(), { kind: "mutation" }),
30275
- /**
30276
- * Per-device FEATURE-FLAG report for the general primitives — drives which
30277
- * controls the UI shows (the per-entry flags for the dictionary come back on
30278
- * `listActions`).
30279
- */
30280
- getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
30281
- },
30282
- events: { onStatusChanged: { data: object({
30283
- deviceId: number(),
30284
- status: NavigationStatusSchema
30285
- }) } },
30286
- status: {
30287
- schema: NavigationStatusSchema,
30288
- kind: "push"
30289
- },
30290
- /**
30291
- * Runtime-state slice mirrored by the kernel. The navigation panel watches it
30292
- * for live mode / follow / flash changes.
30293
- */
30294
- runtimeState: NavigationRuntimeStateSchema,
30295
- /**
30296
- * Runtime-state durability: **session** — like `vacuum-control`, a restored
30297
- * `mode: cleaning` / `following: true` is a robot that is not actually doing
30298
- * that. The live handle re-publishes on connect.
30299
- *
30300
- * See `RuntimeStateDurability`. Enforced by
30301
- * `scripts/check-runtime-state-durability.ts`.
30302
- */
30303
- durability: "session"
30304
- };
30305
30428
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
30306
30429
  kind: "mutation",
30307
30430
  auth: "admin"
@@ -39764,6 +39887,12 @@ Object.freeze({
39764
39887
  addonId: null,
39765
39888
  access: "view"
39766
39889
  },
39890
+ "storage.listDrainProgress": {
39891
+ capName: "storage",
39892
+ capScope: "system",
39893
+ addonId: null,
39894
+ access: "view"
39895
+ },
39767
39896
  "storage.listLocationDeclarations": {
39768
39897
  capName: "storage",
39769
39898
  capScope: "system",
@@ -39908,6 +40037,12 @@ Object.freeze({
39908
40037
  addonId: null,
39909
40038
  access: "view"
39910
40039
  },
40040
+ "storageOccupancy.getOccupancy": {
40041
+ capName: "storage-occupancy",
40042
+ capScope: "system",
40043
+ addonId: null,
40044
+ access: "view"
40045
+ },
39911
40046
  "storageProvider.abortUpload": {
39912
40047
  capName: "storage-provider",
39913
40048
  capScope: "system",