openstranded-plugin-api
Plugin SDK for OpenStranded — core types and traits that all WASM game plugins use to communicate with the engine and each other.
Core types
Value— dynamic type for cross-plugin arguments and return valuesServiceError— typed errors for Service API callsService+ServiceRegistry— cross-plugin method call interfaceRegistry+RegistryEntry— in-memory content pack dataGameAPI— host-side API surface provided to pluginsContribution— declarative output from WASM plugin build phaseApiVersion— compile-time baked version for compatibility checks
Feature flags
parse(default) — enablesparse_registry_dataandparse_registry_listhelperstest-utils— enablesMockGameAPIfor unit-testing plugins natively
WASM entry points
Every WASM game plugin must export these #[no_mangle] extern "C" functions:
| Export | Required | Called during |
|---|---|---|
plugin_api_version() -> ApiVersion |
Yes | Load, before anything |
plugin_build(ctx) -> Vec<Contribution> |
Yes | Registry phase |
plugin_ready(api) -> bool |
No | Discovery phase |
plugin_finish(api) |
No | Integration phase |
License
GPL-3.0-or-later