Yukti
Yukti (Sanskrit: युक्ति — reasoning, contrivance, application) — device abstraction layer for AGNOS
Unified API for detecting, monitoring, and managing hardware devices on Linux — USB storage, optical drives, block devices, and udev hotplug events.
Linux-native, zero-alloc hot paths — built on libc syscalls, bitflag capabilities, tracing instrumentation.
Features
| Module | Feature | Description |
|---|---|---|
| device | always | DeviceInfo, DeviceClass (8 types), DeviceCapabilities (O(1) bitflags), DeviceHealth |
| event | always | DeviceEvent pub/sub with EventListener trait and class-based filtering |
| storage | storage |
mount() / unmount() / eject(), filesystem detection (17 types), /proc/mounts parsing |
| optical | optical |
Tray control, disc TOC reading, DVD Video detection, drive status via ioctl |
| udev | udev |
Netlink hotplug monitor, sysfs enumeration, device classification, uevent parsing |
| linux | always | LinuxDeviceManager — ties it all together with Arc cache and lifecycle management |
Default features: udev, storage, optical.
Optional: ai (daimon/hoosh integration, requires reqwest, tokio).
[]
= "0.22"
Quick Start
Enumerate Devices
use ;
let mgr = new;
for dev in mgr.enumerate.unwrap
Monitor Hotplug Events
use ;
let mgr = new;
let rx = mgr.start_monitor.unwrap;
for event in rx.iter
Mount a Device
use ;
use Path;
let result = mount.unwrap;
println!;
Optical Drive
use ;
use Path;
let dev = new;
let toc = read_toc.unwrap;
println!;
open_tray.unwrap;
Filesystem & Device Queries
use ;
use ;
use Path;
let fs: Filesystem = "ext4".into;
assert!;
let usage = filesystem_usage.unwrap;
println!;
let health = query_device_health;
if let Some = health.temperature_celsius
Modules
| Module | Key Types |
|---|---|
device |
DeviceInfo, DeviceId, DeviceClass, DeviceCapabilities, DeviceState, DevicePermissions, DeviceHealth, Device trait |
event |
DeviceEvent, DeviceEventKind, EventListener trait, EventCollector |
storage |
Filesystem (17 types), MountOptions (builder), MountResult, FilesystemUsage, mount(), unmount(), eject() |
optical |
DiscType (10), TrayState, DiscToc, open_tray(), close_tray(), drive_status(), read_toc(), is_dvd_video() |
udev |
UdevEvent, UdevMonitor (netlink, filtered, bounded), classify_device(), enumerate_devices() |
linux |
LinuxDeviceManager — Device impl, mount(), unmount(), eject(), start_monitor(), dispatch_event() |
error |
YuktiError (15 variants) |
Feature Flags
| Feature | Default | Description |
|---|---|---|
udev |
Yes | Device enumeration and hotplug via sysfs + netlink |
storage |
Yes | Mount/unmount/eject via libc syscalls |
optical |
Yes | Tray control and TOC reading via CD-ROM ioctls |
ai |
No | AI-assisted device management (planned) |
Consumers
| Project | Integration |
|---|---|
| jalwa | Hotplug → detect → mount → auto-import music from USB/CD |
| file manager | Device sidebar, mount/eject actions |
| aethersafha | Desktop mount/unmount notifications |
| argonaut | Policy-driven automount on boot |
License
GPL-3.0-only — see LICENSE for details.