ryo-plugin-api 0.1.0

[experimental] WebAssembly Interface Types for ryo mutation plugins
Documentation
  • Coverage
  • 46.07%
    41 out of 89 items documented0 out of 17 items with examples
  • Size
  • Source code size: 23 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 908.37 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • ynishi/ryo-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ynishi

ryo-plugin-api

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.

WebAssembly Interface Types for ryo mutation plugins. WIT-generated Rust types that define the host ↔ guest contract: plugins act as "Definition Providers" supplying mutation metadata and transformation logic.

Install

cargo add ryo-plugin-api

Quickstart

For plugin authors (guest side):

use ryo_plugin_api::*;

wit_bindgen::generate!({
    world: "mutation-plugin",
    path: "../../wit",
    exports: {
        "ryo:transform/mutation": MyMutation,
    }
});

struct MyMutation;

impl exports::ryo::transform::mutation::Guest for MyMutation {
    fn get_manifest() -> MutationManifest {
        MutationManifest {
            api_version: CURRENT_API_VERSION,
            name: "bool-simplify".into(),
            description: "Simplify boolean comparisons".into(),
            category: MutationCategory::Idiom,
            tier: 1,
            pattern: "...".into(),
            transform: TransformDef::Template("{{var}}".into()),
        }
    }
    // ... get_pattern_source(), execute_transform(), ...
}

API Summary

Item Purpose
MutationManifest Plugin metadata returned from get-manifest()
MutationCategory Idiom / Refactor / Generate / Custom
TransformDef Template-based or WASM-executed transforms
MatchResult / Capture / NodeKind Pattern-match payloads
TextEdit Replacement instructions returned to host
TransformContext / TypeHint Per-call context information
TransformError Plugin-side error reporting
CURRENT_API_VERSION Version constant for compatibility check

Status

Experimental. WIT definitions and plugin loader contract are evolving. Production-quality stability is deferred to v1.0.

License

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