Skip to main content

lash_remote_protocol/
lib.rs

1//! Wire DTOs for driving a lash runtime across a process boundary.
2//!
3//! Each domain module carries one slice of the protocol vocabulary
4//! ([`llm`], [`turn_input`], [`turn_result`], [`processes`], [`triggers`],
5//! [`prompt`], [`tools`], [`observations`], [`usage_activity`],
6//! [`registry_errors`]); the crate root re-exports all of them, which is the
7//! established public API for direct consumers of this crate. The
8//! cross-cutting protocol handshake ([`REMOTE_PROTOCOL_VERSION`],
9//! [`ensure_protocol_version`]) lives at the root itself.
10
11pub mod llm;
12pub mod observations;
13pub mod processes;
14pub mod prompt;
15pub mod registry_errors;
16pub mod tools;
17pub mod triggers;
18pub mod turn_input;
19pub mod turn_result;
20pub mod usage_activity;
21
22pub use llm::*;
23pub use observations::*;
24pub use processes::*;
25pub use prompt::*;
26pub use registry_errors::*;
27pub use tools::*;
28pub use triggers::*;
29pub use turn_input::*;
30pub use turn_result::*;
31pub use usage_activity::*;
32
33pub const REMOTE_PROTOCOL_VERSION: u32 = 6;
34
35pub fn ensure_protocol_version(actual: u32) -> Result<(), RemoteProtocolError> {
36    if actual == REMOTE_PROTOCOL_VERSION {
37        Ok(())
38    } else {
39        Err(RemoteProtocolError::UnsupportedProtocolVersion {
40            actual,
41            expected: REMOTE_PROTOCOL_VERSION,
42        })
43    }
44}
45
46#[cfg(feature = "core-conversions")]
47mod core_conversions;
48
49#[cfg(feature = "core-conversions")]
50pub use core_conversions::{RemoteTurnActivitySink, replay_collected_activities};
51
52#[cfg(test)]
53mod tests;