Skip to content

Module manifest

{
"slug": "tournament",
"version": "1.0.0",
"language": "go",
"abi": "rudder_v1",
"sdk": "0.1.0",
"source": "rudder/tournament@1.0.0",
"deps": ["reward"],
"config": { "schema": {}, "values": {} },
"resources": {
"entries": {
"scope": "player",
"fields": { "board": { "type": "string", "required": true }, "score": { "type": "number", "required": true } },
"indexes": ["board", "score"]
}
},
"functions": {
"submit": { "trigger": "client" },
"reset": { "trigger": "schedule", "cron": "0 * * * *" },
"resetNow": { "trigger": "admin", "roles": ["admin"] }
},
"admin": { "pages": [] }
}
  • slug, version and sdk are required.
  • language is go. abi must be rudder_v1.
  • deps is a DAG. Install fails on a missing dependency or a cycle. A module can only call functions of modules listed in deps.
  • source points at the marketplace package. Eject copies the version to a project-owned row; marketplace updates stop. Eject and publishing are available only to allowlisted publisher accounts (early access).
  • resources are created on install and dropped on uninstall (with confirmation). scope is project or player. Resources have no permissions block: their rows are reachable only from module functions and admin tools, never directly from game clients. See Resources.
  • functions declare trigger: client, admin, event, schedule or module. event names the event for event functions, and roles limits admin functions. Do not write input, output or errors: the build generates them from Go types (see Function schemas).
  • A schedule function needs a valid 5-field cron expression in cron. Publish and dry run reject a package with an invalid or missing cron with HTTP 400. Schedules run in both staging and prod. See Functions runtime.
  • admin describes the module’s dashboard section: title, icon, order, palette, pages (resource pages with table, cards, timeline, track, results or list layouts, detail sections, widgets and hooks), plus player and dashboard widgets. Widget types: stat, action-button, resource-table, markdown, tabs, table, chart, alert, results.
  • samples are optional starter rows the dashboard can create for the module.

The published package is manifest.json, module.wasm and, for marketplace modules, source.tar. The server checks that the wasm compiles, that it imports only rudder_v1 and the allowed WASI functions, and that the functions it registers match the manifest.

rudder module build builds the wasm, calls its describe export and writes functions.<fn>.input, output and errors into dist/manifest.json. A manifest.json that declares any of these fields by hand fails the build. The backend validates call arguments against input.

type SubmitArgs struct {
Slug string `json:"slug" rudder:"pattern=^[a-z0-9_]+$"`
Score int `json:"score" rudder:"min=0"`
Mode string `json:"mode,omitempty" rudder:"enum=best|last"`
}
func init() {
rudder.Register("submit", rudder.Typed(submit), rudder.Errors("board_not_found"))
}
  • rudder.Typed records the argument and result types. rudder.Errors declares the module’s error codes; kernel codes (invalid_parameters, forbidden, conflict, internal, …) are never declared.
  • The json tag gives the name and - skips a field. A field without omitempty (or omitzero) is required. Embedded structs are flattened, pointers are nullable, slices and arrays are arrays, []byte is a byte string, maps are objects with additionalProperties, time.Time is a date-time string, and encoding.TextMarshaler types are strings.
  • any, interfaces, json.RawMessage, other json.Marshaler types and maps of any are untyped. Recursive types fail the build.
  • The rudder tag lists comma-separated constraints: min, max (numbers), minLength, maxLength, pattern (strings), enum=a|b|c (strings and numbers), format. pattern takes the rest of the tag, so put it last. An invalid tag fails the build with the field name.
  • Functions with trigger client must be fully typed: an untyped node in the arguments or the result fails the build with its path, for example client function submit input.score is untyped. Other triggers may stay untyped.

The generated schemas are what generated module clients are built from.