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_control;
19pub mod turn_input;
20pub mod turn_result;
21pub mod usage_activity;
22
23pub use llm::*;
24pub use observations::*;
25pub use processes::*;
26pub use prompt::*;
27pub use registry_errors::*;
28pub use tools::*;
29pub use triggers::*;
30pub use turn_control::*;
31pub use turn_input::*;
32pub use turn_result::*;
33pub use usage_activity::*;
34
35// Bumped to 11: foreground turns carry durable cancellation control/evidence.
36pub const REMOTE_PROTOCOL_VERSION: u32 = 11;
37
38pub fn ensure_protocol_version(actual: u32) -> Result<(), RemoteProtocolError> {
39    if actual == REMOTE_PROTOCOL_VERSION {
40        Ok(())
41    } else {
42        Err(RemoteProtocolError::UnsupportedProtocolVersion {
43            actual,
44            expected: REMOTE_PROTOCOL_VERSION,
45        })
46    }
47}
48
49#[cfg(feature = "core-conversions")]
50mod core_conversions;
51
52#[cfg(feature = "core-conversions")]
53pub use core_conversions::{RemoteTurnActivitySink, replay_collected_activities};
54
55#[cfg(test)]
56mod tests;