Skip to main content

ares_server/
lib.rs

1//! ARES agent library facade.
2//!
3//! Downstream crates inject [`Execute`], [`Tools`], and [`Llm`] on a Cordis
4//! [`Context`] and run an agent with no HTTP stack on the graph.
5//!
6//! ```rust
7//! use ares_server::{Context, Execute, Tools, Llm};
8//! ```
9//!
10//! The `ares-server` binary (same package) binds the Axum router; the HTTP
11//! stack is an unconditional dependency of this package. Default features are
12//! the server defaults: postgres, openai, ares-vector, mcp, inventory,
13//! rhai-policy. For an embed-only build use `--no-default-features`.
14//!
15//! Public surface: [`Context`], [`Execute`], [`Tools`], [`Llm`], [`Store`]
16//! (postgres), [`Plugin`], [`Loader`], [`Dispatch`], [`register_plugins`].
17//! Construct in-memory [`Llm`] with [`Llm::from_client`] for the library proof.
18
19pub use ares_agent::{AgentConfig, AgentRegistry, AgentRequest, Execute, ExecutionResult};
20pub use ares_llm::coordinator::ConversationMessage;
21pub use ares_llm::{LLMClient, LLMResponse, Llm};
22pub use ares_tools::{Calculator, Tool, Tools};
23pub use ares_types::types::ToolDefinition;
24pub use ares_types::{AppError, TenantContext, TenantTier};
25
26/// Daemon-side supervised-worker protocol: restart loop and child spawn.
27pub mod supervisor;
28pub use cordis::{Context, Dispatch, Loader, Plugin, PluginRegistry, Service};
29
30/// Tenant database. Gated so `--no-default-features` builds do not enable
31/// postgres.
32#[cfg(feature = "postgres")]
33pub use ares_store::Store;
34
35/// Register capability-crate loader factories on `reg`.
36///
37pub fn register_plugins(reg: &PluginRegistry) {
38    cordis::register_plugins(reg);
39    ares_store::register_plugins(reg);
40    ares_tools::register_plugins(reg);
41    ares_llm::register_plugins(reg);
42    ares_agent::register_plugins(reg);
43    ares_http::register_plugins(reg);
44}