WASI Support
The WASI support pages regarding imports and exports below were autogenerated from the wasmcloud runtime crate using wit-bindgen. The autogenerated pages were last updated as of the v0.81.0 release.
Inspecting an actor
wasmCloud supports many WASI APIs out of the box. Any WebAssembly component that uses these APIs will work with wasmCloud, regardless of the source language. Thanks to the embedded wit in each component, you can see what APIs a component uses by running wash inspect --wit <actor_reference>
with either a file or OCI reference.
Inspecting the component from the Hello World example shows the following imports and exports:
wash inspect --wit ./build/hello_world_s.wasm
package root:component;
world root {
import wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-10;
import wasi:io/error@0.2.0-rc-2023-11-10;
import wasi:io/streams@0.2.0-rc-2023-11-10;
import wasi:http/types@0.2.0-rc-2023-12-05;
import wasi:cli/environment@0.2.0-rc-2023-12-05;
import wasi:cli/stdin@0.2.0-rc-2023-12-05;
import wasi:cli/stdout@0.2.0-rc-2023-12-05;
import wasi:cli/stderr@0.2.0-rc-2023-12-05;
import wasi:clocks/wall-clock@0.2.0-rc-2023-11-10;
import wasi:filesystem/types@0.2.0-rc-2023-11-10;
import wasi:filesystem/preopens@0.2.0-rc-2023-11-10;
export wasi:http/incoming-handler@0.2.0-rc-2023-12-05;
}
Imports
When looking at an actor component's wit world, like in the above example, you'll see a list of imports. Each import here needs to be exported by the host, which in our case is wasmCloud. You can see a list of supported imports by checking the guest, logging, and incoming-http pages.
Exports
Just like imports, each export in the wit world needs to be imported by the host in order to satisfy the actor component's requirements. You can see a list of supported exports by checking the interfaces page.