ahp
Async Rust client for the Agent Host Protocol (AHP).
Transport-agnostic SDK that builds on ahp-types. Bring your own transport — WebSocket, stdio, TCP, or an in-memory channel pair for tests.
Features
Client— async JSON-RPC client with action subscription, write-ahead dispatch, and background I/O taskreducers— pure state reducers; applyStateActions toRootState/SessionState/ terminal stateTransport— pluggable trait for any framed message stream
Usage
[]
= "0.1"
= "0.1" # or bring your own transport
= { = "1", = ["full"] }
use ;
async
Custom transport
Implement ahp::Transport for any framed byte stream:
use ;
use Future;
See tests/client_roundtrip.rs for a complete in-memory example.
See also
ahp-types— wire types only (no I/O)ahp-ws— WebSocket transport- Connecting to multiple hosts — the
hostsmodule wraps multi-host registry, reconnect, fan-in, and aggregated views; single-host consumers useMultiHostClient::single - Protocol documentation