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
33// Bumped to 10: LLM responses can carry provider-reported execution evidence.
34pub const REMOTE_PROTOCOL_VERSION: u32 = 10;
35
36pub fn ensure_protocol_version(actual: u32) -> Result<(), RemoteProtocolError> {
37    if actual == REMOTE_PROTOCOL_VERSION {
38        Ok(())
39    } else {
40        Err(RemoteProtocolError::UnsupportedProtocolVersion {
41            actual,
42            expected: REMOTE_PROTOCOL_VERSION,
43        })
44    }
45}
46
47#[cfg(feature = "core-conversions")]
48mod core_conversions;
49
50#[cfg(feature = "core-conversions")]
51pub use core_conversions::{RemoteTurnActivitySink, replay_collected_activities};
52
53#[cfg(test)]
54mod tests;