ahp-types
Wire protocol types for the Agent Host Protocol (AHP).
Rust types for every message, action, command, and state object defined by the AHP specification. All types implement Serialize + Deserialize and use the same JSON field names as the wire format.
Modules
| Module | Contents |
|---|---|
state |
RootState, SessionState, tool-call lifecycle, terminal state |
actions |
StateAction discriminated union and ActionEnvelope |
commands |
Command params and result types |
notifications |
Protocol notifications |
messages |
JSON-RPC wire envelopes |
errors |
AHP and JSON-RPC error codes |
version |
Protocol version constants |
Usage
[]
= "0.1"
= "1"
use ;
let json = r#"{
"channel": "ahp-session:/s1",
"action": { "type": "session/titleChanged", "title": "Hi" },
"serverSeq": 7,
"origin": null
}"#;
let env: ActionEnvelope = from_str.unwrap;
match env.action
See also
ahp— async client, reducers, and transport traitahp-ws— WebSocket transport- Protocol documentation