Skip to main content

entelix_agents/
lib.rs

1//! # entelix-agents
2//!
3//! Production agent SDK on top of the entelix `Runnable` /
4//! `StateGraph` foundation. Two layers:
5//!
6//! - **[`Agent<S>`]** — runtime entity wrapping any `Runnable<S, S>`
7//!   with an event sink and (subsequent slices) execution mode +
8//!   lifecycle observers. The production-facing surface every
9//!   consumer constructs.
10//! - **Recipes** — [`create_react_agent`], [`create_supervisor_agent`],
11//!   [`create_chat_agent`]. Each returns a ready-to-stream
12//!   `Agent<StateType>` so common patterns are a single call.
13//!   Nested-supervisor topologies wire a [`team_from_supervisor`]
14//!   adapter into a parent [`create_supervisor_agent`].
15//!
16//! Sub-agent permissions follow F7 (default-filtered hand) via
17//! [`Subagent`].
18
19#![cfg_attr(docsrs, feature(doc_cfg))]
20#![doc(html_root_url = "https://docs.rs/entelix-agents/0.5.3")]
21#![deny(missing_docs)]
22// Doc-prose lints fire on legitimate proper nouns (ReAct,
23// AgentBuilder, LangGraph) and on long opening paragraphs that
24// explain recipe intent. `pub(crate)` items inside a `pub(crate)`
25// module are visibility-equivalent to plain `pub` per clippy, but
26// the explicit form documents intent.
27#![allow(
28    clippy::doc_markdown,
29    clippy::missing_errors_doc,
30    clippy::missing_panics_doc,
31    clippy::redundant_pub_crate,
32    clippy::too_long_first_doc_paragraph
33)]
34
35pub(crate) mod agent;
36mod chat_agent;
37mod compaction;
38mod react_agent;
39mod state;
40mod subagent;
41mod summarizer;
42mod supervisor;
43
44pub use agent::{
45    Agent, AgentBuilder, AgentEvent, AgentEventSink, AgentObserver, AgentRunResult, AlwaysApprove,
46    ApprovalDecision, ApprovalLayer, ApprovalRequest, ApprovalService, Approver, BroadcastSink,
47    CaptureSink, ChannelApprover, ChannelApproverConfig, ChannelSink, DroppingSink, DynObserver,
48    EffectGate, ExecutionMode, FailOpenSink, FanOutSink, PendingApproval, StateErasureSink,
49    ToolApprovalEventSink, ToolApprovalEventSinkHandle, ToolEventLayer, ToolEventService, ToolHook,
50    ToolHookDecision, ToolHookLayer, ToolHookRegistry, ToolHookRequest, ToolHookService,
51};
52pub use chat_agent::{build_chat_graph, create_chat_agent};
53pub use compaction::{
54    DEFAULT_SUMMARY_KEEP_RECENT_TURNS, DEFAULT_SUMMARY_SYSTEM_PROMPT, MessageRunnableCompactionExt,
55    RunnableCompacting, SummaryCompactor,
56};
57pub use react_agent::{ReActAgentBuilder, build_react_graph, create_react_agent};
58pub use state::{ChatState, ReActState, SupervisorState};
59pub use subagent::{Subagent, SubagentBuilder, SubagentMetadata, SubagentTool};
60pub use summarizer::RunnableToSummarizerAdapter;
61pub use supervisor::{
62    AgentEntry, SupervisorDecision, build_supervisor_graph, create_supervisor_agent,
63    team_from_supervisor,
64};