1#![allow(dead_code)]
12#![allow(unused_variables)]
13#![allow(deprecated)]
14#![allow(clippy::too_many_arguments)]
15#![allow(clippy::explicit_counter_loop)]
16
17pub mod config;
38pub mod workflows_config;
39pub use config::AgentConfig;
40pub use workflows_config::{SkillsTomlConfig, WorkflowConfig};
41
42pub trait ToonAgents: Send + Sync {
44 fn get(&self, name: &str) -> Option<AgentConfig>;
46 fn names(&self) -> Vec<String>;
48}
49
50pub mod configurable;
51pub mod context_provider;
53pub mod loop_detector;
55pub mod loop_mode;
57pub mod checkpoint;
59pub mod orchestrator;
61pub mod registry;
62pub mod router;
64#[cfg(feature = "postgres")]
66pub mod tenant_agent;
67pub mod memory;
68pub mod research;
69#[cfg(feature = "postgres")]
70pub(crate) mod resolver;
71pub mod external_context;
72pub mod execution;
73pub mod plugins;
74pub mod admit;
75pub mod emergency_stop;
76pub use emergency_stop::EmergencyStop;
77#[cfg(feature = "scheduler")]
78pub mod scheduler;
79#[cfg(feature = "pipeline")]
80pub mod pipeline;
81#[cfg(feature = "trigger")]
82pub mod trigger;
83#[cfg(any(feature = "postgres", feature = "skills"))]
84pub mod skills;
85#[cfg(feature = "workflows")]
86pub mod workflows;
87pub use execution::{
88 request_tenant_ctx, request_user_scope, tenant_scope, user_id_from_ctx, AgentRequest,
89 AgentSource, Execute, ExecutionResult, RunTracker,
90};
91pub use admit::admit;
92pub use plugins::register_plugins;
93pub use external_context::ExternalContext;
94
95use ares_llm::client::TokenUsage;
96use ares_types::types::{AgentContext, AgentType, Result};
97use async_trait::async_trait;
98
99pub use configurable::ConfigurableAgent;
101pub use context_provider::{ContextProvider, ContextProviderHandle, NoOpContextProvider};
102pub use registry::{AgentRegistry, AgentRegistryBuilder};
103#[cfg(feature = "postgres")]
104pub use resolver::TenantId;
105
106#[derive(Debug, Clone, Default)]
108pub struct AgentResponse {
109 pub content: String,
111 pub usage: Option<TokenUsage>,
113 pub metadata: Option<ExecutionMetadata>,
115}
116
117#[derive(Debug, Clone, Default)]
119pub struct ExecutionMetadata {
120 pub model_name: String,
122 pub provider_name: String,
124}
125
126#[async_trait]
128pub trait Agent: Send + Sync {
129 async fn execute(&self, input: &str, context: &AgentContext) -> Result<AgentResponse>;
131
132 fn system_prompt(&self) -> String;
134
135 fn agent_type(&self) -> AgentType;
137}