trae_agent_rs_core/
lib.rs

1//! # Trae Agent Core
2//!
3//! Core library for Trae Agent - an LLM-based agent for software engineering tasks.
4//!
5//! This library provides the fundamental building blocks for creating AI agents
6//! that can interact with codebases, execute tools, and perform complex software
7//! engineering tasks.
8
9// Core modules
10pub mod config;
11pub mod error;
12pub mod agent;
13pub mod output;
14pub mod trajectory;
15pub mod llm;
16pub mod tools;
17
18// Re-export commonly used types
19pub use config::{Config, AgentConfig, ModelConfig, ProviderConfig, ConfigLoader, ApiProvider, ApiProviderConfig};
20pub use agent::TraeAgent;
21pub use trajectory::TrajectoryRecorder;
22
23/// Current version of the trae-agent-core library
24pub const VERSION: &str = env!("CARGO_PKG_VERSION");
25
26/// Initialize tracing for the library
27pub fn init_tracing() {
28    tracing_subscriber::fmt()
29        .with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
30        .init();
31}
32
33/// Initialize tracing with a specific debug mode
34pub fn init_tracing_with_debug(debug: bool) {
35    let filter = if debug {
36        "debug"
37    } else {
38        "info"
39    };
40
41    tracing_subscriber::fmt()
42        .with_env_filter(tracing_subscriber::EnvFilter::new(filter))
43        .init();
44}