The JavaScript / TypeScript SDK for building Astrid capsules. Companion to sdk-rust. Same WIT contract, same wasip2 Component Model output, same .capsule archive format — your kernel can't tell which language built the binary. Where the Rust SDK feels like writing against std, this one feels like writing against node:fs/promises / WHATWG / Node's EventEmitter. Same host ABI, idiom translated. [package] name = "my-capsule" version = "0.1.0"
The JavaScript / TypeScript SDK for building Astrid capsules.
Companion to sdk-rust. Same WIT contract, same wasip2 Component Model output, same .capsule archive format — your kernel can't tell which language built the binary. Where the Rust SDK feels like writing against std, this one feels like writing against node:fs/promises / WHATWG / Node's EventEmitter. Same host ABI, idiom translated.
| Package | Role |
|---|---|
| @unicity-astrid/sdk | The capsule author API. Module-by-module mirror of astrid-sdk's prelude — fs, net, process, env, time, log, plus Astrid-specific ipc, kv, http, hooks, uplink, identity, approval, runtime, elicit, capabilities, interceptors. TypeScript decorators (@capsule, @tool, @interceptor, @command, @install, @upgrade, @run) replace #[capsule]. |
| @unicity-astrid/build | Build orchestrator. Runs tsc + esbuild + ComponentizeJS programmatic API. Emits a wasm32-wasip2 component that the Rust-side astrid-build packs into a .capsule archive. |
| @unicity-astrid/sdk/contracts | Auto-generated TS types from astrid-contracts.wit — IPC event types (Message, ToolCall, GenerateRequest, StreamEvent, etc.) usable on both ends of cross-capsule IPC. |
mkdir my-capsule && cd my-capsule
npm init -y
npm install @unicity-astrid/sdk
npm install --save-dev @unicity-astrid/build typescript
Capsule.toml:
[package]
name = "my-capsule"
version = "0.1.0"
[[component]]
id = "my-capsule"
file = "my-capsule.wasm"
type = "executable"
[capabilities]
ipc_publish = ["tool.v1.execute.*"]
kv = ["*"]
src/index.ts:
import { capsule, tool, install, log, kv } from "@unicity-astrid/sdk";
@capsule
export class MyCapsule {
greetings = 0;
@tool("greet", { mutable: true })
greet({ name }: { name: string }): { message: string; count: number } {
this.greetings++;
log.info(`greeting ${name} (#${this.greetings})`);
return { message: `Hello, ${name}!`, count: this.greetings };
}
@install
onInstall(): void {
log.info("my-capsule installed");
}
}
Build:
astrid build # or: astrid capsule install .
That's it. tsc compiles your TypeScript, esbuild bundles in the SDK, ComponentizeJS produces a wasip2 component, the Rust-side astrid-build packs it into dist/my-capsule.capsule.
End-to-end pipeline:
src/*.ts
↓ tsc (typecheck + emit dist/*.js)
↓ esbuild (bundle dist/ + @unicity-astrid/sdk into one ESM, mark astrid:* WIT specifiers external)
↓ ComponentizeJS programmatic API (StarlingMonkey + your bundle → wasip2 Component)
target/<name>.wasm
↓ pack_capsule_archive (Rust side)
dist/<name>.capsule (Capsule.toml + .wasm + wit/, gzipped tar)
tsc and esbuild run from @unicity-astrid/build/src/index.mjs — a small Node CLI invoked by Rust's astrid build when it detects a package.json + Capsule.toml project.
JS capsules cost ~11 MB raw (3.5 MB gzipped in the .capsule archive). That's the StarlingMonkey embed. Rust capsules are ~200 KB. Acceptable for daemon-mode workloads (capsules load once); if size matters more than ergonomics, write Rust.
The host ABI is identical, so a hot capsule can be ported between languages without kernel changes.
sdk-js/
├── packages/
│ ├── astrid-sdk/ @unicity-astrid/sdk — public API
│ ├── astrid-build/ @unicity-astrid/build — build orchestrator
│ └── ...
├── examples/
│ └── test-capsule/ Minimal end-to-end example mirroring sdk-rust/examples/test-capsule
├── notes/ Phase-by-phase development notes (Phase 0–3)
├── package.json npm workspace root
└── tsconfig.base.json
npm install
npm --workspace @unicity-astrid/sdk run build
node packages/astrid-build/src/index.mjs examples/test-capsule
Or, from a kernel checkout with the JS dispatch wired into astrid-build:
cd core
cargo build -p astrid-build
./target/debug/astrid-build ../sdk-js/examples/test-capsule
Alpha. The vertical slice (TypeScript → wasip2 component → .capsule → installed by astrid capsule install → kernel lifecycle hook execution) is proven end-to-end. Daemon-mode tool-dispatch round-trip (/tool greet { "name": "world" }) is on the same code path as install — same wasmtime instantiation, same linker contract — and ready for human-operator smoke testing.
See notes/phase-{0,1,2,3-install}.md for development history, design decisions, and known follow-ups.
Dual-licensed under MIT and Apache 2.0.
Copyright (c) 2025-2026 Joshua J. Bouw and Unicity Labs.
“Updates to gist are getting lost. It accepts them as normal but the next page load for the gist is the previous version. Twitter accounts describe the same sort of problem for git repos. status.github.com reports "We're …”
“ZA̡͊͠͝LGΌ causes "Invalid MD5 checksum on messages"”
“FileKit: An open source end-to-end encrypted cloud storage service in JavaScript”
“Dotfiles.github.com - A guide to dotfiles on GitHub”
“Hi HN, I built Webtor — an open-source engine that lets you stream .torrent and magnet links directly in the browser. - No swarm exposure — all torrent traffic runs server-side - In-browser playback via HLS - Progressive…”
Web
Author: lewis <sudolewis@gmail.com> License: MIT 中文文档: README.zh-CN.md Press S on any deck to pop open a dedicated presenter window with four draggable, resizable magnetic cards: current slide, next slide preview, speaker script (逐字稿), and timer. Two windows stay in sync via BroadcastChannel. Why previews are pixel-perfect: each card is an that loads the same deck HTML with a ?preview=N query param. The runtime detects this and renders only slide N with no chrome — so the preview uses the same CSS, theme, fonts and viewport as the audience view. Colors and layout are guaranteed identical.
Web
dontbesilent 商业诊断工具箱。从 12,307 条推文中提炼方法论,做成 21 个 Agent skill。 可在 Claude Code、Codex、Cursor、Trae Solo 等任意支持 skill / system prompt 的 Agent 上使用。 v2.14.1 更新:修复 /dbs-content-system 发布包缺少 scaffold/root/AGENTS.md、CLAUDE.md、SOURCEOFTRUTH.md 的问题。v2.14.0 新增了正式版内容结构化系统,本版本补齐初始化脚本依赖的根级脚手架文件。
Web
Try an idea, measure it, keep what works, discard what doesn't, repeat forever. An extension for pi — an AI coding agent that runs in your terminal. pi-autoresearch gives pi the tools and workflow to run autonomous optimization loops: try an idea, benchmark it, keep improvements, revert regressions, repeat. Inspired by karpathy/autoresearch. Works for any optimization target: test speed, bundle size, LLM training, build times, Lighthouse scores.
Web
Pixel-perfect skeleton loading screens, extracted from your real UI. No manual measurement, no hand-tuned placeholders. Works with React, Preact, Vue, Svelte 5, Angular, and React Native. import { Skeleton } from 'boneyard-js/react'