Skip to main content

Crate brainwires_wasm

Crate brainwires_wasm 

Source
Expand description

§Brainwires WASM

WASM bindings for the Brainwires Agent Framework.

This crate provides a JavaScript-friendly API for the WASM-compatible subset of the Brainwires framework, enabling browser-based AI agent applications. All public functions are exposed via wasm-bindgen and can be called directly from JavaScript/TypeScript.

§Features

  • Core types (messages, tools, tasks) — always available
  • MDAP types and configuration — always available
  • Code interpreters — enabled with the interpreters feature
  • Tool orchestrator — enabled with the orchestrator feature; provides a Rhai-based script engine that can invoke JavaScript tool callbacks from WASM

§JS Usage

import init, { version, validate_message, serialize_history } from 'brainwires-wasm';

await init();
console.log(version()); // e.g. "0.4.1"

Re-exports§

pub use brainwires_core;

Modules§

mdap
Re-export of the MDAP module from brainwires_agents for Rust consumers who need MDAP (Multi-Dimensional Adaptive Planning) types and configuration. MDAP - MAKER voting framework (merged from brainwires-mdap)

Functions§

serialize_history
Serializes a conversation history to the stateless protocol format.
validate_message
Validates and normalizes a JSON-encoded message.
validate_tool
Validates and normalizes a JSON-encoded tool definition.
version
Returns the crate version string (e.g. "0.4.1").