mirror of
https://github.com/hanzoai/zip-rs.git
synced 2026-10-30 18:16:57 +00:00
Rust crate for writing zip-mounted wasm handlers per HIP-0105. - zip-rs lib: #[handler] proc macro, __base_alloc/__base_free allocator exports, JSON envelope helpers, Error/Result types. - zip-rs-macros: proc macro implementation (syn 2 + quote). - Three end-to-end examples: hello, validate-email (port of canonical AssemblyScript fixture), policy-eval. - CI workflow builds wasm32-wasip1 artifacts and verifies them against the production wasmvm host in hanzoai/base. 12 unit tests pass. Wasm sizes: hello 87 KB, validate-email 91 KB, policy-eval 100 KB. validate-email emits byte-equivalent JSON output to the AS reference fixture.
wasmvm-run
Standalone integration harness for zip-rs handlers. Loads a HIP-0105 extension directory and invokes one or more functions against the production wasmvm host.
The source depends on github.com/hanzoai/base/plugins/wasmvm so it
isn't a standalone Go program — copy it into a module that already
imports base (the most convenient is base itself):
cp tools/wasmvm-run/main.go ~/work/hanzo/base/cmd/zip-rs-integration/main.go
cd ~/work/hanzo/base
go run ./cmd/zip-rs-integration \
~/work/hanzo/zip-rs/examples/validate-email \
validate '{"email":"[email protected] ","age":25}'
# validate {"email":"[email protected] ","age":25} -> {"ok":true,"email":"[email protected]","age":25}
CI in .github/workflows/ci.yml automates this against a checked-out
base tree.