1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! 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`] — `StateAction` discriminated union and `ActionEnvelope`
//! - [`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 ahp_types::actions::{ActionEnvelope, StateAction};
//! use ahp_types::state::SessionStatus;
//!
//! let json = r#"{
//! "action": { "type": "session/titleChanged", "session": "copilot:/s1", "title": "Hi" },
//! "serverSeq": 7,
//! "origin": null
//! }"#;
//! let env: ActionEnvelope = serde_json::from_str(json).unwrap();
//! assert_eq!(env.server_seq, 7);
//! match env.action {
//! StateAction::SessionTitleChanged(a) => assert_eq!(a.title, "Hi"),
//! _ => panic!("unexpected variant"),
//! }
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use PROTOCOL_VERSION;