ryo-plugin-loader 0.1.0

[experimental] WASM plugin loader for ryo mutations
Documentation

ryo-plugin-loader

crates.io docs.rs License: MIT OR Apache-2.0

Status: experimental. APIs may change in v0.x. Part of the ryo workspace — AST-centric Rust programming for AI agents.

WASM plugin loader for ryo mutations. Provides PluginLoader which parses WASM components, instantiates them with fuel + stack limits, validates API version, and exposes the loaded plugin as a LoadedPlugin you can call execute_transform on.

Built on wasmtime v45 with the WASI p2 sandbox. Security defaults: fuel cap (10 M instructions for init, 1 M per transform call), 1 MB WASM stack, WASI sandbox restricting filesystem / network access.

Install

cargo add ryo-plugin-loader

Quickstart

use ryo_plugin_loader::PluginLoader;

let loader = PluginLoader::new()?;
let mut plugin = loader.load(&wasm_bytes)?;

println!("Loaded mutation: {}", plugin.manifest.name);

// For complex transforms (TransformDef::WasmExecute)
let edits = plugin.execute_transform(matches, context)?;

API Summary

Item Purpose
PluginLoader WASM engine + linker, builds LoadedPlugin from bytes
LoadedPlugin Live plugin with manifest, additional patterns, and execute
LoaderError Engine / setup / parse / instantiate / version error variants

Plugin API types (MutationManifest, MatchResult, TextEdit, …) are re-exported from ryo-plugin-api.

Status

Experimental. Loader behaviour, fuel limits, and sandbox configuration may change as the plugin ecosystem matures.

License

Licensed under either of Apache-2.0 or MIT at your option.