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
//! Core protocol types for taria, the agent accessibility layer for terminal UIs.
//!
//! A TUI app (via a framework adapter such as `taria-ratatui`) publishes a
//! [`Snapshot`] of its semantic state on every meaningful change. Agents read
//! snapshots and submit [`AgentInput`] back, through a transport such as the
//! `taria-mcp` bridge.
//!
//! Around those wire types sit three small modules both sides share, so the app
//! and the bridge cannot disagree about the same string: [`key`] parses the key
//! grammar, [`id`] builds and reads back prefixed node ids, and [`socket`]
//! resolves the socket path. All of them are pure; this crate performs no I/O.
//!
//! One bound applies to every transport rather than to any one of them:
//! [`MAX_NODE_DEPTH`], the deepest tree a peer is expected to parse. Past it a
//! snapshot does not arrive at all, and nothing says so, which is why
//! [`Node::check_depth`] exists for an adapter to call before publishing.
pub use ;
// Re-exported at the root because an app declaring a node id space imports it
// beside `Node`, `NodeId` and `Role`, and reaching one of those four through a
// module path is a difference an adopter has to remember for no reason.
pub use IdSpace;
pub use ;
pub use Snapshot;
/// Protocol version, bumped on breaking changes to the wire format.
///
/// Version 1 is frozen. Within it, changes must be additive: new optional
/// fields and new message variants are fine, because peers skip lines they
/// cannot parse and serde ignores unknown fields. Changing or removing an
/// existing field, or its meaning, requires a bump. See [`wire`] for the full
/// rule.
pub const PROTOCOL_VERSION: u32 = 1;