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
42
43
//! A batteries-included Rust library for building agent workflows.
//!
//! Define agents, wire them into workflows, and let the runner execute them.
//! Agents communicate through shared context ([`Ctx`]) and control flow with
//! outcomes like [`Outcome::Continue`], [`Outcome::Next`], [`Outcome::Retry`],
//! and [`Outcome::Done`].
//!
//! # Quick start
//!
//! ```rust
//! use agent_line::{Agent, Ctx, Outcome, Runner, StepResult, Workflow};
//!
//! #[derive(Clone)]
//! struct State { n: i32 }
//!
//! struct AddOne;
//! impl Agent<State> for AddOne {
//! fn name(&self) -> &'static str { "add_one" }
//! fn run(&mut self, state: State, _ctx: &mut Ctx) -> StepResult<State> {
//! Ok((State { n: state.n + 1 }, Outcome::Done))
//! }
//! }
//!
//! let mut ctx = Ctx::new();
//! let wf = Workflow::builder("demo")
//! .register(AddOne)
//! .build()
//! .unwrap();
//!
//! let result = Runner::new(wf).run(State { n: 0 }, &mut ctx).unwrap();
//! assert_eq!(result.n, 1);
//! ```
pub use ;
pub use Ctx;
pub use ;
pub use ;