vlo_types/lib.rs
1//! Wire types for the Vlo kernel protocol (see `docs/kernel-protocol.md`).
2//!
3//! Everything that crosses the wasm boundary or lands in a journal is defined here,
4//! once, with `serde` for the wire and `schemars` for the generated JSON Schema that
5//! the TypeScript SDK types are derived from.
6//!
7//! Rules:
8//! - No floats in anything that is hashed (`KernelState`, `Usage`). Money is micro-USD.
9//! - Time is milliseconds since the Unix epoch (`*_ms`), never a date type.
10//! - JSON that must survive byte-exact (user state, payloads) is carried as `String`
11//! at the storage edge and as `serde_json::Value` inside the kernel.
12
13#![deny(missing_docs)]
14
15pub mod command;
16pub mod envelope;
17pub mod kernel_state;
18pub mod protocol;
19pub mod retry;
20pub mod transition;
21
22pub use command::*;
23pub use envelope::*;
24pub use kernel_state::*;
25pub use protocol::*;
26pub use retry::*;
27pub use transition::*;
28
29/// Kernel protocol version. The host refuses a kernel whose protocol differs.
30pub const PROTOCOL_VERSION: u32 = 1;
31
32/// Inline payload / state limit in bytes before the host offloads to the blob store
33/// (see `docs/limits.md`).
34pub const INLINE_LIMIT_BYTES: usize = 256 * 1024;