Skip to main content
The WASM runtime compiles the Meerkat agent stack to wasm32 for browser deployment. It routes through the same AgentFactory::build_agent() pipeline as the native surfaces, but intentionally uses standalone in-memory session and mob state. It does not provide runtime-backed keep-alive recovery or cross-process persistence.
This page is intentionally browser/WASM-specific rather than a cross-surface tabbed page. Use Examples: Mobpack first if you want the packaging/deployment path that usually leads into browser delivery.

Build the WASM bundle

Assemble a self-contained browser bootstrap from a .mobpack artifact. The command does not compile wasm32; it copies the required prebuilt meerkat-web-runtime from the generated wasm-pack --target web output directory named by --wasm:
Then serve and open it: python3 -m http.server -d ./dist/web-bundle. The generated page trust-verifies the pack and initializes the runtime. A host application must still create the mob, spawn members, and provide its own prompt/transcript UI.

Initialize runtime

Use init-time credentials and provider base URLs to seed the browser runtime’s realm config. The @rkat/web RuntimeConfig is provider-specific: anthropicApiKey, openaiApiKey, geminiApiKey, and the matching provider base URL fields (anthropicBaseUrl, openaiBaseUrl, geminiBaseUrl). The old generic apiKey/baseUrl compatibility fields are deleted, and SessionConfig does not accept per-session apiKey or baseUrl.
Mobpack ingress is fail-closed. The default is strict trust with an empty signer store, which rejects unsigned packs and unknown signers. Supply trusted signers for deployed packs. For a locally generated unsigned demo only, opt in explicitly with mobpackTrust: { policy: "permissive" }. initFromMobpack() verifies the archive and makes its skills available to standalone sessions. It does not create a mob or expose the complete packed definition. A host that wants the declared topology must separately load a MobDefinition, call createMob(), and spawn its members as shown below. For proxy deployments, pass a provider-specific dummy key and base URL. The proxy injects the real server-side credential.

Create session and run turn

Stock MeerkatRuntime.init() and initFromMobpack() only synthesize InlineSecret bindings in the in-memory global realm from provider keys and URLs. They do not accept realm/binding configuration or load native realm files. Registering an external resolver does not create a realm or convert those bindings. Use the key/proxy examples above for stock browser sessions; OAuth or cloud credential handling can stay in the server-side proxy.
External auth is a custom Rust/WASM composition seam. A custom bootstrap must install a binding with credential source CredentialSourceSpec::ExternalResolver { handle: "wasm_host" } before that binding can use the callback. The following fragment only shows registration; it is not an external-binding bootstrap for the stock npm bundle:
Register before building the externally bound session. First runtime installation preserves a registration made after binary initialization; reinitializing an existing runtime clears it, so register again afterward. withAuthBinding(authBinding, config) only sets a structural selector for an already-configured binding; it cannot install one.

Poll events

Mob lifecycle in browser

Subscribe to member events

Cross-mob comms

Wire ambassadors across mobs for inter-faction communication. Resolve each member’s opaque peer target through its owning mob, then install trust in both directions. This keeps address and Ed25519 identity construction inside the runtime rather than hand-authoring an external target.
Direct comms_send and comms_peers are reserved low-level placeholders rather than current wasm-bindgen exports or public @rkat/web wrapper methods. Inter-agent messaging happens through member-directed turn submission and the comms tools available to agents during their turns (send_message, send_request, send_response, and peers).

What is available on wasm32

Next step

  • Examples: Mobpack - the packaging/deployment path that often comes before browser delivery
  • Examples: Mobs - the multi-agent runtime model behind many WASM demos