wasm32-wasip2 target — no separate componentization step. It is also the
toolchain the platform’s own AI plugin builds use.
Prerequisites
- A Rust toolchain with
rustupon yourPATH. - The Noorle CLI.
- The shared WebAssembly tools, installed once with
noorle plugin prepare.
wasm32-wasip2 target itself if it is missing, so you do
not have to run rustup target add by hand.
Layout
The interface
Exported functions become tools, and the/// doc comment above each one
becomes the description a model reads.
record
rather than a JSON string is worth doing — the tool schema then carries the
field names and types.
The implementation
wit_bindgen::generate! reads the world and produces a Guest trait. You
implement it on a unit struct and hand that struct to export!.
waki, a WASI-native client. reqwest does
not compile to a WASI component.
Cargo.toml
crate-type = ["cdylib"] is required. Without it the build produces something
that is not a component, and admission validation rejects it.
noorle.yaml
Build
build.sh, which compiles in release mode and copies
the artifact to the standard location:
dist/plugin.wasm.
Test locally
unit argument is a WIT enum, so it is written bare — metric, not
"metric".
Deploy
publish builds and deploys in one step; noorle plugin deploy sends an
archive you already built.