vox-plugin-sdk API Reference (generated)
vox-plugin-sdk
Section titled “vox-plugin-sdk”Crate: vox-plugin-sdk · Version: 0.6.0 · Target: Library (lib.rs)
Authoring SDK for Vox code plugins: re-exports the stable plugin ABI + the declare_plugin! glue macro so plugins drop ~25 lines of identical dylib-export boilerplate. ABI-neutral (byte-identical exports).
Crate Overview
Section titled “Crate Overview”Vox Plugin SDK
Section titled “Vox Plugin SDK”Ergonomic authoring surface for Vox code plugins. It re-exports the stable
plugin ABI ([vox_plugin_api]) plus the [abi_stable] types plugin authors need,
and provides the [declare_plugin!] macro that emits the dylib export glue
(root_module / manifest_json / init) every plugin otherwise hand-copies.
Why this exists / how it stays in sync
Section titled “Why this exists / how it stays in sync”The SDK adds zero new ABI surface — declare_plugin! expands to exactly the
#[export_root_module] + #[sabi_extern_fn] pattern plugins write by hand today, so a
macro-built plugin and a hand-built one produce byte-identical exports. Because the
macro stamps [vox_plugin_api::VOX_PLUGIN_ABI_VERSION] (not a hard-coded number) and
plugins implement the [VoxPlugin] trait from vox-plugin-api directly, new extension
points are picked up on recompile without touching the SDK. See
docs/superpowers/plans/2026-06-06-plugin-sdk-and-abi-sync.md.
Minimal plugin
Section titled “Minimal plugin”use vox_plugin_sdk::prelude::*;
#[derive(Clone)]struct MyPlugin;
impl VoxPlugin for MyPlugin {fn id(&self) -> RString { RString::from("my-plugin") }fn shutdown(&self) -> RResult<(), RBoxError> { ROk(()) }// ...optional `as_*` extension accessors...}
vox_plugin_sdk::declare_plugin! {// id + version are read from the crate's Plugin.toml — no duplication.init: |_host| ROk(wrap(MyPlugin)),}Workspace Dependencies
Section titled “Workspace Dependencies”| Dependency | Kind |
|---|---|
vox-plugin-api | Normal |
Public API Surface
Section titled “Public API Surface”Modules
Section titled “Modules”| Module | Description |
|---|---|
prelude | Glob-import surface for plugin authors: use vox_plugin_sdk::prelude::*;. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
wrap | Wrap a concrete [VoxPlugin] value into the stable-ABI trait object the host loads. Equivalent to the hand-written VoxPlugin_TO::from_value(plugin, TD_Opaque). |
manifest_id_version_json | Build the manifest_json ABI probe ({"id":..,"version":..}) from an embedded Plugin.toml string. Used by [declare_plugin!] so id/version have a single authoring site (the manifest) rather than being re-typed as macro arguments. On a parse failure or a missing [plugin] id/version, falls back to empty/0.0.0 — the host reads the real Plugin.toml from disk anyway; this probe is advisory. |