Expand description
Async client for stdio_bus - AI agent transport layer
§Example
use stdiobus_client::StdioBus;
#[tokio::main]
async fn main() -> stdiobus_core::Result<()> {
let bus = StdioBus::builder()
.config(stdiobus_core::BusConfig {
pools: vec![stdiobus_core::PoolConfig {
id: "worker".into(),
command: "node".into(),
args: vec!["./worker.js".into()],
instances: 2,
}],
limits: None,
})
.build()?;
bus.start().await?;
let result = bus.request("tools/list", serde_json::json!({})).await?;
println!("Tools: {:?}", result);
bus.stop().await?;
Ok(())
}Structs§
- BusConfig
- stdio_bus JSON configuration.
- BusMessage
- Message received from the bus
- BusStats
- Runtime statistics
- Extensions
- Extension negotiation data
- Identity
- Identity extension data
- Json
RpcRequest - JSON-RPC 2.0 request
- Json
RpcResponse - JSON-RPC 2.0 response
- Limits
Config - Operational limits.
- Pool
Config - Worker pool configuration.
- Request
Options - Options for individual requests
- Stdio
Bus - Main stdio_bus client
- Stdio
BusBuilder - Builder for creating StdioBus instances
Enums§
- Backend
Mode - Backend mode selection
- BusState
- State of the stdio_bus instance
- Config
Source - Configuration source for the bus.
- Error
- Main error type for stdio_bus operations
- Error
Code - Canonical error codes for stdio_bus operations
- Json
RpcMessage - Generic JSON-RPC message (can be request or response)
Traits§
- Backend
- Backend trait that all implementations must satisfy
Type Aliases§
- Result
- Result type alias for stdio_bus operations