botstadia-interface 0.2.0

BotStadia's shared contracts: arena and agent WIT worlds, arena declarations, payloads, bundles, the policy shell's ONNX contract, replay archives, metrics files and player messages.
Documentation
//! Generated bindings for the WIT worlds, one feature each.

/// The `arena` world, guest side. `arena-kit` implements `Guest` and exports
/// it with [`export_arena!`](crate::export_arena).
#[cfg(feature = "arena-guest")]
#[allow(unsafe_code, clippy::all)]
pub mod arena {
    wit_bindgen::generate!({
        path: "wit/arena",
        world: "arena",
        pub_export_macro: true,
        export_macro_name: "export_arena",
        default_bindings_module: "botstadia_interface::bindings::arena",
    });
}

/// The `agent` world, guest side, for bots.
#[cfg(feature = "agent-guest")]
#[allow(unsafe_code, clippy::all)]
pub mod agent {
    wit_bindgen::generate!({
        path: "wit/agent",
        world: "agent",
        pub_export_macro: true,
        export_macro_name: "export_agent",
        default_bindings_module: "botstadia_interface::bindings::agent",
    });
}

/// Both worlds, host side.
#[cfg(feature = "host")]
#[allow(unsafe_code, clippy::all)]
pub mod host {
    pub mod arena {
        wasmtime::component::bindgen!({
            path: "wit/arena",
            world: "arena",
        });
    }

    /// Bots run on async stores, so a bot that runs out of fuel pauses
    /// (Wasmtime's fuel yield) rather than trapping. Imports get the store, so
    /// `budget` and `infer` read and charge its fuel.
    pub mod agent {
        wasmtime::component::bindgen!({
            path: "wit/agent",
            world: "agent",
            imports: { default: store },
            exports: { default: async },
        });
    }
}