camel-wit 0.26.0

WIT interface definitions for rust-camel WASM plugins
Documentation
package camel:plugin;

// TODO(WIT-001): This file is a canonical source; camel-all.wit duplicates its content.
// TODO(WIT-006): WIT interface versioning strategy is not yet defined.

/// Guest bean plugin with multi-method dispatch and init-time configuration.
///
/// Beans declare their methods via `methods()` and handle invocations
/// via `invoke(method, exchange)`. The host calls `init(config)` once at
/// registration with key-value pairs from Camel.toml `[beans.<name>.config]`,
/// and `invoke()` for each route step that targets this bean.
world bean {
    import host;
    use types.{wasm-exchange, wasm-error};

    export invoke: async func(method: string, exchange: wasm-exchange) -> result<wasm-exchange, wasm-error>;
    export methods: func() -> list<string>;
    export init: func(config: list<tuple<string, string>>) -> result<_, string>;
}