The JavaScript on-ramp to a Rust agent OS
Astrid is a microkernel agent OS where everything above the kernel is a WASM capsule, and historically writing one meant writing Rust. sdk-js is the companion that opens that door to JavaScript and TypeScript developers. The claim that makes it interesting is binary equivalence: it produces the same WIT contract, the same wasip2 Component Model output, and the same .capsule archive format as the Rust SDK, so the kernel cannot tell which language built the component. You get into the Astrid ecosystem without leaving the Node toolchain.
The design goal is idiom, not just access. Where the Rust SDK feels like writing against std, this one feels like writing against node:fs/promises, WHATWG APIs, and Node’s EventEmitter. The host ABI is identical underneath; the surface is translated to what a JavaScript developer already knows.
The three packages
The SDK is split by job:
@unicity-astrid/sdkis the capsule author API, a module-by-module mirror of the Rust SDK’s prelude:fs,net,process,env,time,log, plus Astrid-specific modules likeipc,kv,http,hooks,identity,approval,capabilities, andinterceptors. TypeScript decorators (@capsule,@tool,@interceptor,@command,@install,@upgrade,@run) stand in for the Rust attribute macros.@unicity-astrid/buildis the build orchestrator, runningtsc, esbuild, and the ComponentizeJS programmatic API to emit awasm32-wasip2component that the Rust-sideastrid-buildpacks into a.capsule.@unicity-astrid/sdk/contractsholds auto-generated TypeScript types fromastrid-contracts.wit, the IPC event types usable on both ends of cross-capsule communication, so a JS capsule and a Rust capsule can exchange typed messages.
Install
mkdir my-capsule && cd my-capsule
npm init -y
npm install @unicity-astrid/sdk
npm install --save-dev @unicity-astrid/build typescript
You then write a Capsule.toml describing the component and build with the @unicity-astrid/build toolchain, which produces the WASM component for the Astrid kernel to load.
What writing a capsule looks like
The authoring model is decorator-driven, which is what makes it feel like ordinary TypeScript rather than a foreign ABI. You annotate a class and its methods with @capsule, @tool, @interceptor, @command, and lifecycle decorators like @install, @upgrade, and @run; those stand in for the Rust SDK’s attribute macros and let the build step generate the WASM boilerplate for you. You declare what the capsule provides and requires in a Capsule.toml, write the logic against the familiar fs, net, process, and Astrid-specific ipc, kv, and http modules, and then the @unicity-astrid/build toolchain runs tsc, esbuild, and ComponentizeJS to emit a wasm32-wasip2 component. From there the kernel treats it exactly like a Rust-authored capsule. The point is that the WASM and Component Model machinery stays out of your way: you write TypeScript, the toolchain produces a component, and the OS loads it.
Why a second-language SDK is a real signal
It is worth reading what this repo’s existence says about Astrid. Shipping a JavaScript SDK that compiles to the identical component format as the Rust one is a bet that the capsule boundary is stable enough to support multiple author languages, which is the kind of thing you only build once the core contract has settled. The WIT-plus-Component-Model approach is doing the heavy lifting: it defines the interface once, and any language that targets wasip2 can implement against it. For the broader agent-tooling world, that is the more interesting story than any single capsule, a real, language-agnostic component boundary for agent software.
How early it is
Set expectations accordingly. This SDK was created in 2026-05 and is young, with a handful of open issues. Its README states MIT OR Apache-2.0, but no LICENSE file is committed at the time of writing and GitHub detects no license, so confirm the terms before building anything you intend to ship or redistribute on top of it. More fundamentally, it is only as useful as Astrid itself, which is at v0.5.0 with a young capsule ecosystem. Adopt sdk-js if you want to write Astrid capsules in TypeScript and you are comfortable building on a fast-moving v0.x platform. If you are evaluating whether to use Astrid at all, start with the OS itself and treat this SDK as the JavaScript door once you have decided to go in.
Related
This is the companion to the Astrid agent OS; read that first to understand what a capsule is and why the component boundary matters. For what else is climbing, see LLM tooling, the daily digest, and the weekly report.
FAQ
What is sdk-js for? Writing capsules for the Astrid agent OS in JavaScript or TypeScript, compiling to the same WASM component format the Rust SDK produces.
Can a JS capsule talk to a Rust capsule? Yes. Both share the same WIT contract and auto-generated IPC types, so cross-capsule messages are typed on both ends regardless of source language.
How do I install it? npm install @unicity-astrid/sdk plus @unicity-astrid/build and TypeScript as dev dependencies, then build with the provided toolchain.
Should I use it now? Only if you want to build Astrid capsules in TypeScript and are comfortable on a v0.x platform whose README declares MIT OR Apache-2.0 but has no committed LICENSE file yet. Evaluate Astrid itself first.