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)
| Module | std equivalent | Purpose |
|---|---|---|
fs | std::fs | Virtual filesystem |
net | std::net | Unix domain sockets |
process | std::process | Host process execution |
[env] | std::env | Capsule configuration / env vars |
time | std::time | Wall-clock access |
log | log crate | Structured logging |
runtime | N/A | OS signaling and caller context |
ipc | N/A | Event bus messaging |
kv | N/A | Persistent key-value storage |
http | N/A | Outbound HTTP requests |
cron | N/A | Scheduled background tasks |
uplink | N/A | Direct frontend messaging |
hooks | N/A | User middleware triggers |
elicit | N/A | Interactive install/upgrade prompts |
identity | N/A | Platform user identity resolution |
approval | N/A | Human 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::fsnaming). - 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::mpscbut 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