# ryo-plugin-loader
[](https://crates.io/crates/ryo-plugin-loader)
[](https://docs.rs/ryo-plugin-loader)
[](#license)
> **Status:** experimental. APIs may change in v0.x.
> Part of the [ryo](https://github.com/ynishi/ryo-rs) 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
```sh
cargo add ryo-plugin-loader
```
## Quickstart
```rust,ignore
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
| `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`](https://crates.io/crates/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](https://github.com/ynishi/ryo-rs/blob/main/LICENSE-APACHE)
or [MIT](https://github.com/ynishi/ryo-rs/blob/main/LICENSE-MIT) at your option.