sdk-rust README

The project's README from github.com/astrid-runtime/sdk-rust. As one markdown file: README.md.

astrid-sdk

License: MIT OR Apache-2.0 MSRV: 1.94

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.

Crates

Crate Role
astrid-sdk Safe Rust SDK for capsule authors. Mirrors std module layout: fs, net, process, env, time, log, plus Astrid-specific modules: ipc, kv, http, hooks, cron, uplink, identity, approval, runtime.
astrid-sdk-macros #[capsule] proc macro. Generates WASM ABI exports from annotated impl blocks: tool dispatch, command routing, hook handlers, cron handlers, install/upgrade entry points.
astrid-sys Raw WASM-to-host FFI bindings. The syscall table. Every parameter crosses as Vec<u8>. You should not use this directly.

Quick start

[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.

Building capsules

Capsules compile to wasm32-wasip2:

rustup target add wasm32-wasip2
cargo build --target wasm32-wasip2 --release

Development

cargo build --workspace
cargo test --workspace -- --quiet
cargo clippy --workspace --all-features -- -D warnings

License

Dual-licensed under MIT and Apache 2.0.

Copyright (c) 2025-2026 Joshua J. Bouw and Unicity Labs.

sdk-rust (astrid-runtime/sdk-rust)

sandboxing
Searching Database…

What is this?This is the Rust SDK for building Astrid 'capsules' - sandboxed WASM modules that act as user-space processes in the Astrid OS model, with safe typed access to kernel services like filesystem, IPC, networking, storage, approval, and scheduling.
Is astrid-sdk a library or a code generator?Both: astrid-sdk is the safe Rust library mirroring std's module layout (fs, net, process, env, time, log) plus Astrid-specific modules, while astrid-sdk-macros provides the #[capsule] proc macro that generates all the WASM ABI boilerplate for you.
How do I build a capsule with this SDK?Depend on astrid-sdk (and serde) in your crate, annotate your implementation with the #[capsule] macro, then compile the crate to the wasm32-wasip2 target.
Do I need anything besides astrid-sdk itself?Capsule authors only need to add astrid-sdk and serde as dependencies - the SDK handles JSON serialization across the WASM boundary, tool schema generation, and dispatch routing for you.
Should I call astrid-sys directly instead of astrid-sdk?No - astrid-sys is just the raw WASM-to-host FFI syscall table and the README explicitly warns against using it directly; stick to the safe wrappers in astrid-sdk.
What exactly is a capsule?A capsule is a sandboxed WASM module that behaves like a user-space process in the Astrid OS model, getting typed access to kernel services instead of raw syscalls.
Which kernel services can a capsule talk to?Through dedicated SDK modules it can reach IPC, key-value storage, HTTP, hooks, cron scheduling, uplink, identity, approval, and general runtime services, alongside std-like fs, net, process, env, time, and log modules.
What does the #[capsule] macro save me from writing by hand?It auto-generates the extern "C" WASM ABI exports, JSON serialization across the host boundary, tool schema generation, and dispatch routing, so you never touch astrid-sys directly.
Size
0.4 MB
Stars
4.3K
Age
7mo
Commits · 90 Days