camel-wit
WIT interface definitions for rust-camel WASM components (processors, beans, sources, authorization policies).
Published to crates.io with raw .wit files included in the tarball,
making them accessible to any language toolchain.
Rust usage
// Embed the combined WIT package as a &str
let wit: &str = FULL_WIT;
// Or individual worlds
let plugin: &str = PLUGIN_WIT;
let bean: &str = BEAN_WIT;
let source: &str = SOURCE_WIT;
WIT files
wit/camel-all.wit— canonical merged package (all worlds, single file)wit/camel-plugin.wit—pluginworld standalone (also definesauthorization-policy)wit/camel-bean.wit—beanworld standalonewit/camel-source.wit—sourceworld standalone
All four files belong to package camel:plugin@1.0.0;.
Worlds
plugin— route processor. The host drives each call; the guest exportsinit/process.bean— multi-method DI component. The guest exportsinit/methods/invoke(method).authorization-policy— security backend. The guest exportsinit/evaluate; defined incamel-plugin.wit.source— inbound source. The guest owns the consumption loop (configure→run) over a host-grantedhttp-listenerresource.
Other languages
Guest authors in Python, Go, JavaScript, and other wit-bindgen-supported
languages compile against the camel:plugin WIT package shipped in this crate.
Quickstart
-
Fetch the WIT. Either add the crate to read the embedded strings (
camel_wit::PLUGIN_WIT,BEAN_WIT,SOURCE_WIT,FULL_WIT), or download the raw.witfiles from the crates.io source tarball or the GitHub repository (crates/camel-wit/wit/). -
Generate bindings. Run your language's
wit-bindgenagainst the world you target — one world per compilation unit:camel-plugin.wit→pluginorauthorization-policycamel-bean.wit→beancamel-source.wit→source
-
Implement the guest. Export the world entrypoints:
plugin:init,processbean:init,methods,invokeauthorization-policy:init,evaluatesource:configure,run(drives the loop over a host-grantedhttp-listener)
The Rust reference guests under
examples/wasm-*/guest/show the full contract shape. -
Compile and deploy. Build to
wasm32-wasip2and register the component with the rust-camel host.
The package follows ADR-0053: one SemVer (camel:plugin@1.0.0) covers every
interface and world and is independent of the Rust crate version.