Skip to main content

Crate astrid_sdk

Crate astrid_sdk 

Source
Expand description

Safe Rust SDK for building User-Space Capsules on Astrid OS.

§Design Intent

This SDK is meant to feel like using std. Module names, function signatures, and type patterns follow Rust standard library conventions so that a Rust developer’s instinct for “where would I find X?” gives the right answer without reading docs. When Astrid adds a concept that has no std counterpart (IPC, capabilities, interceptors), the API still follows the same style: typed handles, Result-based errors, and impl AsRef parameters.

See docs/sdk-ergonomics.md for the full design rationale.

§Module Layout (mirrors std where applicable)

Modulestd equivalentPurpose
fsstd::fsVirtual filesystem
netstd::netUnix domain sockets
processstd::processHost process execution
[env]std::envCapsule configuration / env vars
timestd::timeWall-clock access
loglog crateStructured logging
runtimeN/AOS signaling and caller context
ipcN/AEvent bus messaging
kvN/APersistent key-value storage
httpN/AOutbound HTTP requests
cronN/AScheduled background tasks
uplinkN/ADirect frontend messaging
hooksN/AUser middleware triggers
elicitN/AInteractive install/upgrade prompts
identityN/APlatform user identity resolution
approvalN/AHuman approval for sensitive actions

Re-exports§

pub use borsh;
pub use serde;
pub use serde_json;

Modules§

approval
capabilities
Cross-capsule capability queries.
cron
The Cron Airlock — Dynamic Background Scheduling
elicit
The Elicit Airlock - User Input During Install/Upgrade Lifecycle
env
Capsule configuration (like std::env).
fs
Virtual filesystem (mirrors std::fs naming).
hooks
The Hooks Airlock — Executing User Middleware
http
The HTTP Airlock — External Network Requests
identity
Request human approval for sensitive actions from within a capsule.
interceptors
Auto-subscribed interceptor bindings for run-loop capsules.
ipc
Event bus messaging (like std::sync::mpsc but topic-based).
kv
The KV Airlock — Persistent Key-Value Storage
log
Structured logging.
net
prelude
process
runtime
OS runtime introspection and signaling.
time
Wall-clock access (like std::time).
types
uplink
Direct frontend messaging (uplinks to CLI, Telegram, etc.).

Enums§

SysError
Core error type for SDK operations