Skip to main content

Crate agentzero_plugin_sdk

Crate agentzero_plugin_sdk 

Source
Expand description

AgentZero Plugin SDK

Minimal SDK for building WASM plugins that integrate with AgentZero’s tool system. Plugins compile to wasm32-wasip1 and are loaded by the AgentZero runtime via the ABI v2 protocol.

§Quick Start

use agentzero_plugin_sdk::prelude::*;

declare_tool!("my_tool", execute);

fn execute(input: ToolInput) -> ToolOutput {
    ToolOutput::success(format!("got: {}", input.input))
}

Build with: cargo build --target wasm32-wasip1 --release

Modules§

prelude

Macros§

declare_tool
Declare a WASM plugin tool with ABI v2 exports.

Structs§

ToolInput
Input provided to a plugin tool by the AgentZero runtime.
ToolOutput
Output returned by a plugin tool to the AgentZero runtime.

Functions§

pack_ptr_len
Pack a (ptr, len) pair into a single i64 for the ABI v2 return convention.
sdk_alloc
Allocate size bytes via the Rust allocator and leak the allocation.
write_to_memory
Write bytes into WASM linear memory at the given pointer.