ai_agent/
lib.rs

1//! AI-Native Code Agent
2//!
3//! A minimal, AI-native code assistant that maximizes AI autonomy
4//! while providing reliable execution capabilities.
5//!
6//! ## Features
7//!
8//! - **AI-Native Design**: Built from the ground up for AI autonomy
9//! - **Multiple AI Models**: Support for OpenAI, Anthropic, Zhipu, and local models
10//! - **Tool System**: Extensible tool system for file operations, command execution, etc.
11//! - **Service Architecture**: Optional HTTP service with REST API (requires "service" feature)
12//! - **Metrics & Monitoring**: Comprehensive metrics and health checking (requires "service" feature)
13
14pub mod agent;
15pub mod config;
16pub mod models;
17pub mod tools;
18pub mod types;
19pub mod errors;
20pub mod understanding;
21pub mod execution;
22
23// Service modules (optional, enabled with "service" feature)
24#[cfg(feature = "service")]
25pub mod service_types;
26
27#[cfg(feature = "service")]
28pub mod service;
29
30// CLI module (always available but optional for library usage)
31pub mod cli;
32
33// Re-export main types and functions for convenience
34pub use agent::CodeAgent;
35pub use config::AgentConfig;
36pub use models::LanguageModel;
37pub use tools::Tool;
38pub use types::*;
39pub use errors::AgentError;
40
41// Service exports (only available with "service" feature)
42#[cfg(feature = "service")]
43pub use service_types::{
44    TaskRequest, TaskResponse, BatchTaskRequest, BatchTaskResponse,
45    TaskContext, TaskPriority, TaskStatus, TaskResult,
46    ServiceConfig, ServiceStatus, ServiceError,
47};
48
49#[cfg(feature = "service")]
50pub use service::{
51    AiAgentService, AiAgentApi, AiAgentClient, ApiClientBuilder, ServiceResult,
52    MetricsSnapshot,
53};