Skip to main content

botstadia_interface/
lib.rs

1//! BotStadia's shared contracts.
2//!
3//! - [`declaration`]: what an arena says about itself, and its checks
4//! - [`payload`]: the per-turn input and output encoding, and the host's
5//!   validity rule for an output
6//! - [`bundle`]: a bot's bundle and its manifest, `botstadia.toml`
7//! - [`policy`]: the policy shell's ONNX contract
8//! - [`archive`]: the replay archive the player reads
9//! - [`metrics`]: the metrics file the site reads
10//! - [`copy`]: an arena's `arena.toml`, its site copy
11//! - [`player`]: the messages between the site and an arena's player
12//!
13//! The WIT worlds ship in `wit/`: `botstadia:arena` for arenas' engines and
14//! `botstadia:agent` for bots. Features generate bindings for them:
15//! `arena-guest`, `agent-guest` and `host`.
16
17pub mod archive;
18pub mod bundle;
19pub mod copy;
20pub mod declaration;
21pub mod metrics;
22pub mod payload;
23pub mod player;
24pub mod policy;
25
26/// This crate's version: what generated bot projects depend on.
27pub const VERSION: &str = env!("CARGO_PKG_VERSION");
28
29/// The `agent` world's WIT, for tools that generate a bot's bindings (the CLI
30/// writes C bindings from it).
31pub const AGENT_WIT: &str = include_str!("../wit/agent/agent.wit");
32
33/// The `arena` world's WIT.
34pub const ARENA_WIT: &str = include_str!("../wit/arena/arena.wit");
35
36#[cfg(any(feature = "arena-guest", feature = "agent-guest", feature = "host"))]
37pub mod bindings;