← ClaudeAtlas

meerkat-wasmlisted

Developer guide for the Meerkat WASM embedded runtime (meerkat-web-runtime) and the `@rkat/web` browser SDK. Covers wasm32 compilation, building/deploying WASM bundles, writing/auditing wasm_bindgen exports (sessions, mobs, comms, JS tool callbacks, external auth resolver, subscription handles), the auth_binding + registerExternalAuthResolver auth model, tokio_with_wasm aliasing, cfg-gating patterns, mobpack bootstrap, and common wasm32 gotchas. Use when touching meerkat-web-runtime, sdks/web, browser auth flows, or making a meerkat crate wasm32-compatible.
lukacf/meerkat · ★ 14 · AI & Automation · score 73
Install: claude install-skill lukacf/meerkat
# Meerkat WASM Embedded Runtime The `meerkat-web-runtime` crate compiles the full meerkat agent stack to `wasm32-unknown-unknown`. It is an embedded deployment target for mobpacks — the JavaScript equivalent of the Rust SDK. Not a protocol server like RPC/REST. ## Crate Compatibility Pattern To make a meerkat crate compile for wasm32, apply this pattern: **Cargo.toml** — gate platform-specific deps: ```toml [target.'cfg(not(target_arch = "wasm32"))'.dependencies] tokio = { workspace = true } rusqlite = { workspace = true } [target.'cfg(target_arch = "wasm32")'.dependencies] tokio_with_wasm = { workspace = true } ``` **lib.rs** — tokio alias + module gating: ```rust #[cfg(target_arch = "wasm32")] pub mod tokio { pub use tokio_with_wasm::alias::*; } #[cfg(not(target_arch = "wasm32"))] mod filesystem_module; ``` **async_trait** — dual cfg_attr: ```rust #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] #[cfg_attr(not(target_arch = "wasm32"), async_trait)] ``` **Time types** — use `meerkat_core::time_compat::{SystemTime, Instant, Duration}`, never `std::time::*`. **Tokio imports** in wasm32-visible code — add `#[cfg(target_arch = "wasm32")] use crate::tokio;` then existing `use tokio::...` paths resolve through the alias. ## Override-First Resource Injection `AgentBuildConfig` has 4 override fields. When set, `build_agent()` uses them directly, skipping filesystem resolution. On wasm32, these are always set. | Field | Skips | wasm32 default | |-------|-------|--