Wire protocol types for the Agent Host Protocol (AHP).
This crate provides Rust counterparts for the TypeScript source-of-truth
types in types/. All types are Serialize + Deserialize and use the
same JSON field names as the protocol.
Modules
- [
state] —RootState,SessionState, tool call lifecycle, terminal state - [
actions] —StateActiondiscriminated union andActionEnvelope - [
commands] — command params and results - [
notifications] — protocol notifications - [
messages] — JSON-RPC wire envelopes - [
errors] — AHP and JSON-RPC error codes - [
version] — protocol version constants
Example
use ;
use SessionStatus;
let json = r#"{
"action": { "type": "session/titleChanged", "session": "copilot:/s1", "title": "Hi" },
"serverSeq": 7,
"origin": null
}"#;
let env: ActionEnvelope = from_str.unwrap;
assert_eq!;
match env.action