The Rust SDK for building Astrid capsules.
In the OS model, this is the standard library for user-space processes. It gives capsule authors safe, typed access to every kernel service: filesystem, IPC, networking, storage, approval, scheduling, and more. Capsule authors depend on astrid-sdk and serde. Everything else is handled.
[dependencies]
astrid-sdk = "0.2"
serde = { version = "1.0", features = ["derive"] }use astrid_sdk::prelude::*;
#[derive(Default)]
pub struct MyTools;
#[capsule]
impl MyTools {
#[astrid::tool]
fn search_issues(&self, args: SearchArgs) -> Result<SearchResult, SysError> {
let token = env::var("GITHUB_TOKEN")?;
let resp = http::get(&format!(
"https://api.github.com/search/issues?q={}", args.query
))?;
// ...
}
}The #[capsule] macro generates all WASM ABI boilerplate: extern "C" exports, JSON serialization across the boundary, tool schema generation, and dispatch routing.
Capsules compile to wasm32-wasip2:
rustup target add wasm32-wasip2
cargo build --target wasm32-wasip2 --releasecargo build --workspace
cargo test --workspace -- --quiet
cargo clippy --workspace --all-features -- -D warningsDual-licensed under MIT and Apache 2.0.
Copyright (c) 2025-2026 Joshua J. Bouw and Unicity Labs.
