@runmu.sh/ext-wasm-add
v1.0.1
Published
The mu.wasm.load example: a panel that calls add(a, b) in a 41-byte hand-written WebAssembly module (wasm/add.wat), pinned by sha256 in muclient.wasm.
Maintainers
Readme
WASM Add (@runmu.sh/ext-wasm-add)
The example for mu.wasm.load (SDK 1.3, https://runmu.sh/docs/extensions/wasm). Install it from
☰ → Extensions → Discover (marketplace listing).
wasm/add.watis the source ofwasm/add.wasm(41 bytes, one exportedadd(i32, i32) → i32). The binary is committed, so the build needs nowat2wasmor Rust toolchain.package.jsonlists it inmuclient.wasmwith its sha256, andfilesincludeswasm/, so it ships in the package. μClient refuses bytes that do not match that hash, pins it at install and re-checks it on every load.activateawaitsmu.wasm.load('wasm/add.wasm'), then registers a panel that callsadd.
Commands
npm install
npm run build # dist/index.js + manifest check
npm run typecheck # tsc --noEmit against the SDK types
npm run dev # dev server on http://localhost:5199/ with hot reloadAfter editing add.wat, rebuild the binary (wat2wasm wasm/add.wat -o wasm/add.wasm) and put its new sha256
in muclient.wasm.
Publish
This repository is linked to the marketplace listing wasm-add: a version tag is imported within seconds (webhook), or within 30 minutes (poll).
npm run build && git commit -am "WASM Add x.y.z" && git tag vx.y.z && git push origin main vx.y.zVersions are immutable.
