beam_types
beam_types holds the serializable types that cross process boundaries. It has no dependencies on
the rest of Riverbeam, so clients and tools can use it on its own.
beam_types = { path = "../riverbeam/crates/beam_types" }
Types
| Type | Role |
|---|---|
InvokeRequest | An invocation: agent, content, session, optional ids, stream, actions, auth_context |
InvokeAuthContext | user_id, profile_id, org_id (alias organization_id), mcp_token |
ChatRequest | A text-only request shape: agent_name, message, session_id, metadata, request_id, stream |
ContentPart, ContentPartType, Modality | Message content and its modality; ContentPart::text(..) builds a text part |
AgentInput | What an agent receives: the request plus run_id; modalities() and user_id() helpers |
AgentContext | History, resolved ModelConfig, tools and metadata, built by the pipeline |
AgentMetadata | Agent name, description, input and output modalities, tags, version |
AgentMessage, AgentMessageRole, AgentMessageType, AgentMessagePhase | One message in a conversation or stream |
AgentResult, TokenUsage, ToolCallRecord | The outcome of a run |
StreamChunk, StreamChunkType | One stream frame |
ActionResponseEnvelope, ActionResponseStatus | A response to a pending approval |
ModelConfig, ModelProvider | A model the router can pick |
Field-by-field JSON shapes are in Wire types.
Conventions
- Empty optional fields and empty
metadataobjects are left out of the JSON. - Enums serialize in lowercase or snake case:
"type": "image_url","role": "ai","status": "submitted". - The repository's
tests/wire_compatfixtures check that the JSON round-trips unchanged.