Skip to main content
Rust compiles straight to a WASI Preview 2 component through the 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 rustup on your PATH.
  • The Noorle CLI.
  • The shared WebAssembly tools, installed once with noorle plugin prepare.
The build adds the 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.
Rust handles the full WIT type system comfortably, so returning a 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!.
Outbound HTTP goes through 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

Same shape in every language. Full key-by-key reference: noorle.yaml.

Build

That runs the project’s build.sh, which compiles in release mode and copies the artifact to the standard location:
The component lands at dist/plugin.wasm.

Test locally

The 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.

Next