OCI and wit-schema#1145
Draft
JakeHartnell wants to merge 6 commits into
Draft
Conversation
Adds a new packages/wit-schema crate that introspects compiled WASM
component WIT interfaces and emits JSON Schema descriptions. Used by
wavs-mcp (next commit) and wavs-cli to expose component contracts to
MCP-compatible tools.
Workspace plumbing:
- new member: packages/wit-schema
- new dep: wit-parser 0.244.0
- new path dep: wit-schema = { path = "packages/wit-schema" }
Adds utils::oci for fetching WASM components from OCI registries (GHCR, Docker Hub, etc.) via oci-client + oci-wasm. Used by the desktop app's component picker and CLI pull flows. Also adds AnyRuntime::enter() so callers running on the WAVS tokio runtime can establish a runtime context for sync code that needs it (used by the OCI client). Workspace plumbing: - new deps: oci-client 0.16, oci-wasm 0.4
Adds packages/wavs-mcp/src/exec.rs (~1.2k lines): pending-execution state machine, gas estimation, signature flow, and submission helpers used by the MCP server to drive WAVS operations from MCP-compatible tools (Claude, etc.). scaffold.rs and server.rs grow to expose the new exec module and additional service-management surface. client.rs and main.rs get matching wiring updates. Depends on: - wit-schema (introspection for component schemas exposed via MCP) - utils::oci (component pull)
wavs-cli wit-schema --component <path.wasm> [--wit-path <dir>] Dumps the JSON Schema for a compiled component's WIT interface to stdout (pipe-friendly). Handled outside CliContext since it is purely local and needs no network or signer. Includes Cargo.lock update for the new workspace deps from earlier commits in this PR (wit-schema, wit-parser, oci-client, oci-wasm).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the foundational tooling layer that lets WAVS pull compiled components from OCI registries and
introspect their WIT interfaces into JSON Schema. Enables the Components Explorer in the desktop
app and lets
wavs-mcpexpose WAVS components as typed tools to MCP clients (Claude, etc.).This is the first of a stack splitting #1144 into
reviewable pieces. It's self-contained — nothing here depends on later PRs in the stack, and
nothing in this PR is agent-specific.
What's in the box
Four commits, each independently buildable:
feat(wit-schema)— newpackages/wit-schemacrate. Parses compiled WASM components, walkstheir WIT type graph, and emits JSON Schema. Workspace gains
wit-parseras a dependency.feat(utils)— newutils::ocimodule for fetching components from OCI registries (GHCR,Docker Hub, etc.) via
oci-client+oci-wasm. AddsAnyRuntime::enter()so callers running onthe WAVS tokio runtime can establish a context for the sync OCI client.
feat(wavs-mcp)— rewrites the MCP execution layer (exec.rs, ~1.2k lines):pending-execution state machine, gas estimation, signature flow, and submission helpers. Server and
scaffold modules grow to expose the new surface.
feat(wavs-cli)—wavs-cli wit-schema --component <path.wasm> [--wit-path <dir>]dumps theJSON Schema for a component's WIT interface to stdout. Pipe-friendly; bypasses
CliContextsinceit needs no network or signer.
Diff size
24 files changed, +4,109 LOC, 0 deletions. Includes a workspace
Cargo.tomlslice (new member,three new deps, one new path dep).
Verification
cargo check -p wit-schema -p utils -p wavs-mcp -p wavs-cli— cleancargo doc --no-deps -p wit-schema— succeeds (the new crate generates docs)wavs-mcp/src/exec.rsare carried in from the sourcebranch; not addressed here to keep the diff focused
Test plan
cargo buildfrom a fresh clonecargo test -p wit-schema -p utils -p wavs-mcpwavs-cli wit-schema --component examples/build/components/echo_data.wasmreturns anon-empty JSON Schema
utils::ocipath