Demonstrates interception of direct function exports with primitive integer types.
- Target: calculator (Python) exports
addandsubtract - Advice: squarer (Rust) squares the return value of every intercepted call
world calculator-world {
export add: func(a: s32, b: s32) -> s32;
export subtract: func(a: s32, b: s32) -> s32;
}./build.sh- Generates the interceptor component from the WIT world using
cargo run(interceptor CLI) - Builds the Python calculator target using
componentize-py - Builds the Rust squarer advice using
cargo component - Composes all three into
composed.wasmusingwac plug
./run.shCalls add(3, 4) — the calculator returns 7, the squarer advice squares it to 49.