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 logger;
36mod messages;
37mod router;
38
39pub use config::{load_config, AgentConfig, ConfigError, ConfigFile, LLMRegistry, ProviderConfig};
40pub use core::{
41    convert_controller_event_to_ui_message, AgentCore, FromControllerRx, FromControllerTx,
42    ToControllerRx, ToControllerTx,
43};
44pub use logger::Logger;
45pub use messages::channels::{create_channels, DEFAULT_CHANNEL_SIZE};
46pub use messages::UiMessage;
47pub use router::InputRouter;
48
49// Re-export common types from llm-controller-rs that agents typically need
50pub use crate::controller::{
51    ControllerEvent, ControllerInputPayload, LLMController, LLMSessionConfig, PermissionRegistry,
52    ToolResultStatus, TurnId, UserInteractionRegistry,
53};