Skip to main content

klieo_flows/
lib.rs

1#![deny(missing_docs)]
2#![deny(rustdoc::broken_intra_doc_links)]
3//! Multi-agent composition shapes for the klieo agent framework.
4//!
5//! Foundation Plan #10 fixed the [`klieo_core::Agent`] trait with associated
6//! types `Input`, `Output`, `Error`. That choice prevents `Box<dyn Agent>`,
7//! which composition shapes (Sequential / Parallel / Loop / Graph) need.
8//!
9//! `klieo-flows` introduces a separate type-erased [`Flow`] trait with
10//! `serde_json::Value` I/O. The [`AgentFlow<A>`] adapter wraps any concrete
11//! `Agent` implementation into a `Flow` by JSON-marshalling at the boundary.
12//! Concrete shapes ([`SequentialFlow`], [`ParallelFlow`], [`LoopFlow`],
13//! [`GraphFlow`]) compose `Arc<dyn Flow>` references freely.
14//!
15//! The cost: one JSON serialise/deserialise per `Flow::run` boundary.
16//! Acceptable for v0.0.1; a typed-builder follow-up is listed in the plan's
17//! carryovers section.
18
19mod error;
20mod flow;
21mod graph;
22mod loop_flow;
23mod parallel;
24mod sequential;
25mod typed;
26
27#[cfg(test)]
28pub(crate) mod test_helpers;
29
30pub use error::FlowError;
31pub use flow::{AgentFlow, Flow};
32pub use graph::{Edge, GraphFlow};
33pub use loop_flow::{LoopFlow, LoopVerdict};
34pub use parallel::ParallelFlow;
35pub use sequential::SequentialFlow;
36pub use typed::TypedSequentialFlow;