Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Mod contract reference

The mod contract is a set of versioned WIT packages that a mod imports from and exports to the engine (mod contract, design (docs/superpowers/specs/2026-09-29-contract-foundation-design.md)). These pages are generated from it.

Contract 0.2.0, track 0.2: open, unreleased. Nothing on track 0.2 is released yet, so any item may still change in place (spec §7.2).

Machine-readable: contract.json (crates/manifold-wasm-abi/wit/contract.json) (format 1): every package, interface, function and type with its docs, track and consent class, and every payload’s shape. An index for tools and language models: llms.txt.

Packages

PackageVersionInterfacesAbout
manifold:core0.2.0logging, ops, plugin-lifecycle, text, types
manifold:ecs0.2.0plugin-systems, resource-bundle
manifold:world0.2.0block-world
manifold:worlds0.2.0world host, world imports

Reading the badges

  • Kind. import: the host defines it and a mod calls it. export: a mod implements it and the host calls it; an export’s functions are fixed within a track (spec §7.1). types-only: declares types; importing it links nothing.
  • Consent (spec §10.2), per interface; a function’s class is its interface’s. silent: never prompted. listed: shown in the operator’s install view. operator: needs the operator’s explicit approval. player: also shown to each player at join. An interface imported only for a resource is silent.
  • Sides: where its functions work (both, server, client); on the wrong side they return the interface’s wrong-side error.
  • Owner: the program that specifies the interface and approves its changes (spec §4.4).
  • Kernel profiles: the functions a kernel or hook instance may call (spec §10.6); every other import traps there.
  • since X: stable since contract X. Items with no since badge date from the package’s track opening (0.2.0 for track 0.2).
  • preview (feature): @unstable, may change or disappear in any release, and needs the world’s opt-in (spec §8).
  • deprecated X: still linked until its track retires.
  • other codes: values a function reports as its error’s other("<code>"), conditions added within a track that become cases at the next minor (spec §5.7).

Payloads and changes

  • Payloads: what every list<u8> carries. Schema payloads with their full postcard shape, packed layouts and opaque bytes.
  • Changelog: what each contract version added, from @since and the released snapshots.

Legacy (0.1)

The contract 0.1 packages, linked by a mod’s [caps] until migration steps M2 and M3 move their interfaces into the packages above (spec §14). They have no consent class or owner in the contract table.

PackageVersionInterfacesAbout
manifold:client0.1.0action, client-clock, client-state-read, draw, hud-catalog, hud-layout, hud-reskinclient-plugin WIT world — DISJOINT from manifold:game.
manifold:game0.1.0asset-source, clock, persistent-storage, plugin, text, ui

Internal

Interfaces for host tests, linked only with the contract-internal feature and refused for mods (spec §8.4).

PackageVersionInterfacesAbout
manifold:internal0.2.0plugin-probe, probe, shapesmanifold:internal: interfaces for host tests (contract foundation spec §8.4).

Regenerating

cargo run -p contract-describe rewrites contract.json and these pages; cargo test -p contract-describe fails when they are stale (MANIFOLD_REGEN_REFERENCE=1 rewrites them instead) and runs the breaking-change gate. See the contract description.