agent_core/agent/mod.rs
1//! Agent Infrastructure
2//!
3//! Core infrastructure for building LLM-powered agents.
4//!
5//! This module provides:
6//! - AgentCore - Complete working agent infrastructure
7//! - Message types for TUI-Controller communication
8//! - Input routing between TUI and controller
9//! - Logging infrastructure
10//! - Configuration management with trait-based customization
11//!
12//! # Quick Start
13//!
14//! ```ignore
15//! use agent_core::agent::{AgentConfig, AgentCore};
16//!
17//! struct MyConfig;
18//! impl AgentConfig for MyConfig {
19//! fn config_path(&self) -> &str { ".myagent/config.yaml" }
20//! fn default_system_prompt(&self) -> &str { "You are helpful." }
21//! fn log_prefix(&self) -> &str { "myagent" }
22//! fn name(&self) -> &str { "MyAgent" }
23//! }
24//!
25//! fn main() -> std::io::Result<()> {
26//! let mut core = AgentCore::new(&MyConfig)?;
27//! core.start_background_tasks();
28//! // Wire up your TUI and run
29//! Ok(())
30//! }
31//! ```
32
33mod config;
34mod core;
35mod error;
36mod logger;
37mod messages;
38mod router;
39
40pub use config::{load_config, AgentConfig, ConfigError, ConfigFile, LLMRegistry, ProviderConfig};
41pub use error::AgentError;
42pub use core::{
43 convert_controller_event_to_ui_message, AgentCore, FromControllerRx, FromControllerTx,
44 ToControllerRx, ToControllerTx,
45};
46pub use logger::Logger;
47pub use messages::channels::{create_channels, DEFAULT_CHANNEL_SIZE};
48pub use messages::UiMessage;
49pub use router::InputRouter;
50
51// Re-export common types from llm-controller-rs that agents typically need
52pub use crate::controller::{
53 ControllerEvent, ControllerInputPayload, LLMController, LLMSessionConfig, PermissionRegistry,
54 ToolResultStatus, TurnId, UserInteractionRegistry,
55};