WIT Tool Authoring
Every tool in RunVero implements the centralized WebAssembly Interface Type (WIT) contract defined in wit/agent-tool.wit.
The WIT Contract
Section titled “The WIT Contract”package runvero:agent;
interface execution { record tool-request { tool-name: string, params-json: string, context-id: string, }
record tool-response { success: bool, output-json: string, error: option<string>, fuel-consumed: u64, }
execute: func(req: tool-request) -> tool-response;}
world agent-tool { export execution;}Authoring Tools in Rust
Section titled “Authoring Tools in Rust”-
Create a library targeting
wasm32-wasip2usingcargo-component:Terminal window cargo component new --lib my-tool -
Implement the generated WIT bindings:
use bindings::exports::runvero::agent::execution::{Guest, ToolRequest, ToolResponse};struct MyTool;impl Guest for MyTool {fn execute(req: ToolRequest) -> ToolResponse {ToolResponse {success: true,output_json: format!("Processed {}", req.params_json),error: None,fuel_consumed: 0,}}} -
Build to
wasm32-wasip2:Terminal window cargo component build --release --target wasm32-wasip2
Authoring Tools in Python
Section titled “Authoring Tools in Python”Using componentize-py, you can compile Python scripts into standalone WASI 0.2 components without needing an external Python runtime on the host!