Skip to main content

task_board/
lib.rs

1//! A workshop task board, spoken over AG-UI.
2//!
3//! Two halves of one protocol in one crate, built the way an outside consumer
4//! builds them — against the published crates, with nothing reached into:
5//!
6//! - [`agent`] is the server half: an `impl Agent` that streams a reply,
7//!   executes tools, publishes the board as state, ships it as an A2UI surface,
8//!   and pauses for a human before the one destructive command.
9//! - [`chat`] is the client half: a terminal that folds the run back into
10//!   messages, state and a drawn surface, and answers the pause.
11//!
12//! `src/main.rs` is the CLI over both. The tests under `tests/` drive the same
13//! code paths without a terminal, so what the README shows is what CI runs.
14
15pub mod agent;
16pub mod board;
17pub mod chat;
18pub mod llm;
19
20pub use agent::TaskBoard;
21pub use board::Board;
22
23use ag_ui::axum::RouterExt;
24use axum::Router;
25use axum::routing::get;
26
27/// Where the agent is mounted.
28pub const ROUTE: &str = "/agent";
29
30/// The whole server: an AG-UI endpoint and a health check.
31///
32/// `route_agui` returns an ordinary [`Router`], which is the point — an AG-UI
33/// agent is one route on an application that has others.
34pub fn router(agent: TaskBoard) -> Router {
35    Router::new()
36        .route("/health", get(|| async { "ok" }))
37        .route_agui(ROUTE, agent)
38}