Skip to content

OCI and wit-schema#1145

Draft
JakeHartnell wants to merge 6 commits into
mainfrom
oci-and-wit-schema
Draft

OCI and wit-schema#1145
JakeHartnell wants to merge 6 commits into
mainfrom
oci-and-wit-schema

Conversation

@JakeHartnell
Copy link
Copy Markdown
Contributor

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-mcp expose 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) — new packages/wit-schema crate. Parses compiled WASM components, walks
    their WIT type graph, and emits JSON Schema. Workspace gains wit-parser as a dependency.
  • feat(utils) — new utils::oci module for fetching components from OCI registries (GHCR,
    Docker Hub, etc.) via oci-client + oci-wasm. Adds AnyRuntime::enter() so callers running on
    the 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 the
    JSON Schema for a component's WIT interface to stdout. Pipe-friendly; bypasses CliContext since
    it needs no network or signer.

Diff size

24 files changed, +4,109 LOC, 0 deletions. Includes a workspace Cargo.toml slice (new member,
three new deps, one new path dep).

Verification

  • cargo check -p wit-schema -p utils -p wavs-mcp -p wavs-cli — clean
  • cargo doc --no-deps -p wit-schema — succeeds (the new crate generates docs)
  • 2 pre-existing unused-import warnings in wavs-mcp/src/exec.rs are carried in from the source
    branch; not addressed here to keep the diff focused

Test plan

  • cargo build from a fresh clone
  • cargo test -p wit-schema -p utils -p wavs-mcp
  • wavs-cli wit-schema --component examples/build/components/echo_data.wasm returns a
    non-empty JSON Schema
  • Pull an existing WAVS example component from a real OCI registry via the new utils::oci
    path

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).
@JakeHartnell JakeHartnell changed the title OCI and wit schema OCI and wit-schema May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant