# botstadia-interface
The contracts between [BotStadia](https://botstadia.com)'s pieces, in one crate.
| `declaration` | What an arena says about itself: inputs, outputs, bounds, no-action, control rate, budgets, wire sizes, stats, per-turn series and events. `Declaration::problems` lists anything incomplete. |
| `payload` | The per-turn input and output encoding, and the one validity rule for an output: structure, finiteness and declared bounds. Nothing is clamped. |
| `archive` | The replay archive: one session's frames, for the arena's player. |
| `metrics` | The metrics file beside it: series, events, stats and the result, for the site. |
| `copy` | An arena's `arena.toml`: its name and site copy. |
| `player` | The messages between the site and an arena's player frame. |
The WIT worlds are in `wit/`: `botstadia:arena` for arena engines and `botstadia:agent` for bots. Features generate bindings for them:
| `arena-guest` | Arena engines (`wasm32-wasip2`), exported with `export_arena!` |
| `agent-guest` | Bots (`wasm32-wasip2`), exported with `export_agent!` |
| `host` | Anything that runs arenas and bots, on wasmtime |
| `toml` | Reading and writing `arena.toml` |
## Developing
```sh
task check # every target and feature set
task lint # fmt + clippy -D warnings
task test
```
To build a consumer against a local checkout, add an untracked patch to that consumer (for example in its git-ignored `.cargo/config.toml`):
```toml
[patch.crates-io]
botstadia-interface = { path = "/path/to/botstadia-interface" }
```
## Licence
MIT or Apache-2.0, at your choice.