Skip to main content

ai_agents/
lib.rs

1//! # AI Agents Framework
2//!
3//! **One YAML = Any Agent.** A Rust framework for building AI agents from a single YAML
4//! specification. No code required for common use cases.
5//!
6//! # Quick Start
7//!
8//! ### From YAML
9//!
10//! ```rust,ignore
11//! use ai_agents::{Agent, AgentBuilder};
12//!
13//! #[tokio::main]
14//! async fn main() -> ai_agents::Result<()> {
15//!     let agent = AgentBuilder::from_yaml_file("agent.yaml")?
16//!         .auto_configure_llms()?
17//!         .build()?;
18//!
19//!     let response = agent.chat("Hello!").await?;
20//!     println!("{}", response.content);
21//!     Ok(())
22//! }
23//! ```
24//!
25//! ### From Rust API
26//!
27//! ```rust,ignore
28//! use ai_agents::{Agent, AgentBuilder, UnifiedLLMProvider, ProviderType};
29//! use std::sync::Arc;
30//!
31//! #[tokio::main]
32//! async fn main() -> ai_agents::Result<()> {
33//!     let llm = UnifiedLLMProvider::from_env(ProviderType::OpenAI, "gpt-4.1-nano")?;
34//!
35//!     let agent = AgentBuilder::new()
36//!         .system_prompt("You are a helpful assistant.")
37//!         .llm(Arc::new(llm))
38//!         .build()?;
39//!
40//!     let response = agent.chat("Hello!").await?;
41//!     println!("{}", response.content);
42//!     Ok(())
43//! }
44//! ```
45//!
46//! # Modules
47//!
48//! | Module | Description |
49//! |--------|-------------|
50//! | [`agent`] | Agent builder, runtime, streaming, and response types |
51//! | [`llm`] | LLM providers and registry |
52//! | [`memory`] | Conversation memory with compression and token budgeting |
53//! | [`tools`] | Built-in tools and extensible tool registry |
54//! | [`state`] | Hierarchical state machine with LLM-evaluated transitions |
55//! | [`context`] | Dynamic context injection from multiple sources |
56//! | [`skill`] | Reusable workflows with LLM-based intent routing |
57//! | [`hitl`] | Human-in-the-loop approval system |
58//! | [`reasoning`] | Chain-of-thought, ReAct, plan-and-execute modes |
59//! | [`disambiguation`] | Intent ambiguity detection and clarification |
60//! | [`persistence`] | SQLite, Redis, and file storage backends |
61//! | [`process`] | Input/output processing pipeline |
62//! | [`recovery`] | Error recovery with retry and fallback strategies |
63//! | [`hooks`] | Lifecycle event hooks for logging, metrics, monitoring |
64//! | [`spec`] | YAML agent specification types |
65//! | [`template`] | Template loading with Jinja2 rendering and inheritance |
66//! | [`spawner`] | Dynamic agent spawning, registry, and inter-agent messaging |
67//! | [`observability`] | Latency, token, cost, trace, and export metrics |
68//!
69//! # Feature Flags
70//!
71//! | Flag | Description |
72//! |------|-------------|
73//! | `sqlite` | SQLite storage backend |
74//! | `redis-storage` | Redis storage backend |
75//! | `http-context` | HTTP context source for dynamic context injection |
76//! | `full-storage` | All storage backends (`sqlite` + `redis-storage`) |
77//! | `full` | All optional features enabled |
78
79pub mod agent {
80    pub use ai_agents_runtime::{
81        Agent, AgentBuilder, AgentInfo, AgentResponse, ParallelToolsConfig, RuntimeAgent,
82        StreamChunk, StreamingConfig, ToolCall, TurnActorContext,
83    };
84}
85
86pub mod context {
87    pub use ai_agents_context::{
88        BuiltinSource, ContextManager, ContextProvider, ContextSource, RefreshPolicy,
89        TemplateRenderer,
90    };
91}
92
93pub mod error {
94    pub use ai_agents_core::{AgentError, Result};
95}
96
97pub mod dot_path {
98    pub use ai_agents_core::{get_dot_path, get_dot_path_from_map, set_dot_path};
99}
100
101pub mod hitl {
102    pub use ai_agents_hitl::{
103        ApprovalCondition, ApprovalHandler, ApprovalMessage, ApprovalRequest, ApprovalResult,
104        ApprovalTrigger, AutoApproveHandler, CallbackHandler, HITLCheckResult, HITLConfig,
105        HITLEngine, LlmGenerateConfig, LocalizedHandler, MessageLanguageConfig,
106        MessageLanguageStrategy, MessageResolver, RejectAllHandler, StateApprovalConfig,
107        StateApprovalTrigger, TimeoutAction, ToolApprovalConfig, create_handler,
108        create_localized_handler, resolve_best_language, resolve_tool_message,
109    };
110}
111
112pub mod hooks {
113    pub use ai_agents_hooks::{AgentHooks, CompositeHooks, HookTimer, LoggingHooks, NoopHooks};
114}
115
116pub mod llm {
117    pub use ai_agents_core::{
118        ChatMessage, FinishReason, LLMCapability, LLMChunk, LLMConfig, LLMError, LLMFeature,
119        LLMProvider, LLMResponse, Role, TaskContext, TokenUsage, ToolSelection,
120    };
121    pub use ai_agents_llm::LLMRegistry;
122    pub use ai_agents_llm::multi::MultiLLMRouter;
123
124    pub mod providers {
125        pub use ai_agents_llm::providers::{ProviderBuilder, ProviderType, UnifiedLLMProvider};
126    }
127}
128
129pub mod memory {
130    use std::sync::Arc;
131
132    use ai_agents_core::LLMProvider;
133
134    pub use ai_agents_core::MemorySnapshot;
135    pub use ai_agents_memory::{
136        CompactingMemory, CompactingMemoryConfig, CompressResult, CompressionEvent,
137        ConversationContext, EvictionReason, FactExtractedEvent, InMemoryStore, LLMSummarizer,
138        Memory, MemoryBudgetEvent, MemoryBudgetState, MemoryCompressEvent, MemoryEvictEvent,
139        MemoryTokenBudget, NoopSummarizer, OverflowStrategy, Summarizer, TokenAllocation,
140        estimate_message_tokens, estimate_tokens,
141    };
142    pub use ai_agents_runtime::spec::MemoryConfig;
143
144    pub fn create_memory(memory_type: &str, max_messages: usize) -> Arc<dyn Memory> {
145        match memory_type {
146            "in-memory" => Arc::new(InMemoryStore::new(max_messages)),
147            "compacting" => {
148                let summarizer: Arc<dyn Summarizer> = Arc::new(NoopSummarizer);
149                Arc::new(CompactingMemory::with_default_config(summarizer))
150            }
151            _ => Arc::new(InMemoryStore::new(max_messages)),
152        }
153    }
154
155    pub fn create_memory_from_config(config: &MemoryConfig) -> Arc<dyn Memory> {
156        if config.is_compacting() {
157            let summarizer: Arc<dyn Summarizer> = Arc::new(NoopSummarizer);
158            let compacting_config = config.to_compacting_config();
159            Arc::new(CompactingMemory::new(summarizer, compacting_config))
160        } else {
161            Arc::new(InMemoryStore::new(config.max_messages))
162        }
163    }
164
165    pub fn create_memory_from_config_with_llm(
166        config: &MemoryConfig,
167        llm: Option<Arc<dyn LLMProvider>>,
168    ) -> Arc<dyn Memory> {
169        if config.is_compacting() {
170            let summarizer: Arc<dyn Summarizer> = match llm {
171                Some(provider) => Arc::new(LLMSummarizer::new(provider)),
172                None => Arc::new(NoopSummarizer),
173            };
174            let compacting_config = config.to_compacting_config();
175            Arc::new(CompactingMemory::new(summarizer, compacting_config))
176        } else {
177            Arc::new(InMemoryStore::new(config.max_messages))
178        }
179    }
180
181    pub fn create_compacting_memory(
182        summarizer: Arc<dyn Summarizer>,
183        config: CompactingMemoryConfig,
184    ) -> Arc<dyn Memory> {
185        Arc::new(CompactingMemory::new(summarizer, config))
186    }
187
188    pub fn create_compacting_memory_from_config(
189        summarizer: Arc<dyn Summarizer>,
190        config: &MemoryConfig,
191    ) -> Arc<dyn Memory> {
192        let compacting_config = config.to_compacting_config();
193        Arc::new(CompactingMemory::new(summarizer, compacting_config))
194    }
195}
196
197pub mod persistence {
198    use std::sync::Arc;
199
200    pub use ai_agents_core::{
201        AgentSnapshot, AgentStorage, MemorySnapshot, Result, SpawnedAgentEntry,
202    };
203    #[cfg(feature = "sqlite")]
204    pub use ai_agents_storage::SqliteStorage;
205    pub use ai_agents_storage::{
206        FileStorage, SessionInfo, SessionMetadata, SessionOrderBy, SessionQuery,
207    };
208    #[cfg(feature = "redis-storage")]
209    pub use ai_agents_storage::{RedisSessionMeta, RedisStorage};
210
211    pub async fn create_storage(
212        config: &crate::spec::StorageConfig,
213    ) -> Result<Option<Arc<dyn AgentStorage>>> {
214        let storage_config = match config {
215            crate::spec::StorageConfig::None => ai_agents_storage::StorageConfig::None,
216            crate::spec::StorageConfig::File(fc) => ai_agents_storage::StorageConfig::File {
217                path: fc.path.clone(),
218            },
219            crate::spec::StorageConfig::Sqlite(sc) => ai_agents_storage::StorageConfig::Sqlite {
220                path: sc.path.clone(),
221            },
222            crate::spec::StorageConfig::Redis(rc) => ai_agents_storage::StorageConfig::Redis {
223                url: rc.url.clone(),
224                prefix: rc.prefix.clone(),
225                ttl_seconds: rc.ttl_seconds,
226            },
227        };
228
229        ai_agents_storage::create_storage(&storage_config).await
230    }
231}
232
233pub mod process {
234    pub use ai_agents_process::{ProcessConfig, ProcessData, ProcessProcessor};
235}
236
237pub mod recovery {
238    pub use ai_agents_recovery::{
239        ByRoleFilter, ErrorRecoveryConfig, FilterConfig, KeepRecentFilter, MessageFilter,
240        RecoveryManager, SkipPatternFilter,
241    };
242}
243
244pub mod skill {
245    pub use ai_agents_skills::{
246        SkillContext, SkillDefinition, SkillExecutor, SkillLoader, SkillRef, SkillRouter,
247        SkillStep, StepResult,
248    };
249}
250
251pub mod spec {
252    pub use ai_agents_observability::ObservabilityConfig;
253    pub use ai_agents_runtime::spec::{
254        AgentSpec, BuiltinProviderConfig, CliHitlMetadata, CliHitlStyle, CliMetadata,
255        CliPromptStyle, FileStorageConfig, LLMConfig, LLMSelector, MemoryConfig,
256        ProviderPolicyConfig, ProviderSecurityConfig, ProvidersConfig, RedisStorageConfig,
257        SpawnerConfig, SqliteStorageConfig, StorageConfig, StructuredToolEntry, ToolAliasesConfig,
258        ToolConfig, ToolEntry, ToolPolicyConfig, YamlProviderConfig, YamlToolConfig,
259    };
260}
261
262pub mod state {
263    pub use ai_agents_state::{
264        CompareOp, ContextExtractor, ContextMatcher, DelegateContextMode, GuardConditions,
265        GuardOnlyEvaluator, HandoffStateConfig, LLMTransitionEvaluator, PipelineStageEntry,
266        PipelineStateConfig, PromptMode, StateAction, StateConfig, StateDefinition, StateMachine,
267        StateMachineSnapshot, StateMatcher, StateTransitionEvent, TimeMatcher, ToolCondition,
268        ToolRef, Transition, TransitionContext, TransitionEvaluator, TransitionGuard,
269    };
270}
271
272pub mod template {
273    use std::collections::HashMap;
274    use std::path::PathBuf;
275
276    use ai_agents_template::TemplateLoader as InnerTemplateLoader;
277    pub use ai_agents_template::{TemplateInheritance, TemplateRenderer};
278
279    use crate::error::Result;
280    use crate::spec::AgentSpec;
281
282    pub struct TemplateLoader {
283        inner: InnerTemplateLoader,
284    }
285
286    impl TemplateLoader {
287        pub fn new() -> Self {
288            Self {
289                inner: InnerTemplateLoader::new(),
290            }
291        }
292
293        pub fn add_search_path(&mut self, path: impl Into<PathBuf>) -> &mut Self {
294            self.inner.add_search_path(path);
295            self
296        }
297
298        pub fn set_variable(
299            &mut self,
300            key: impl Into<String>,
301            value: impl Into<String>,
302        ) -> &mut Self {
303            self.inner.set_variable(key, value);
304            self
305        }
306
307        pub fn set_variables(&mut self, vars: HashMap<String, String>) -> &mut Self {
308            self.inner.set_variables(vars);
309            self
310        }
311
312        pub fn get_variable(&self, key: &str) -> Option<&str> {
313            self.inner.get_variable(key)
314        }
315
316        pub fn load_template(&self, name: &str) -> Result<String> {
317            self.inner.load_template(name)
318        }
319
320        pub fn template_exists(&self, name: &str) -> bool {
321            self.inner.template_exists(name)
322        }
323
324        pub fn search_paths(&self) -> &[PathBuf] {
325            self.inner.search_paths()
326        }
327
328        pub fn variables(&self) -> &HashMap<String, String> {
329            self.inner.variables()
330        }
331
332        pub fn load_and_parse(&self, template_name: &str) -> Result<AgentSpec> {
333            let renderer = TemplateRenderer::new();
334            let variables = self.variables();
335
336            let load_and_render = |name: &str| -> Result<String> {
337                let content = self.load_template(name)?;
338                renderer.render(&content, variables)
339            };
340
341            let rendered_root = load_and_render(template_name)?;
342            let processed = TemplateInheritance::process(&rendered_root, load_and_render)?;
343            let spec: AgentSpec = serde_yaml::from_str(&processed)?;
344            spec.validate()?;
345
346            Ok(spec)
347        }
348    }
349
350    impl Default for TemplateLoader {
351        fn default() -> Self {
352            Self::new()
353        }
354    }
355
356    impl AsRef<InnerTemplateLoader> for TemplateLoader {
357        fn as_ref(&self) -> &InnerTemplateLoader {
358            &self.inner
359        }
360    }
361
362    impl From<InnerTemplateLoader> for TemplateLoader {
363        fn from(inner: InnerTemplateLoader) -> Self {
364            Self { inner }
365        }
366    }
367}
368
369pub mod persona {
370    pub use ai_agents_persona::{
371        EvolutionConfig, PERSONA_CHANGE_METADATA_KEY, PersonaChange, PersonaConfig,
372        PersonaEvolveTool, PersonaGoals, PersonaIdentity, PersonaManager, PersonaRenderResult,
373        PersonaSecret, PersonaSnapshot, PersonaTemplateRef, PersonaTemplateRegistry, PersonaTraits,
374        SecretRevealCondition, VALID_EVOLVE_PATHS,
375    };
376}
377
378pub mod relationships {
379    pub use ai_agents_relationships::{
380        AutoUpdateConfig, DimensionChange, EventEvictionStrategy, InjectionConfig, InjectionFormat,
381        NotableEventsConfig, PersistenceConfig, ProposedDimensionChange, ProposedRelationshipEvent,
382        Relationship, RelationshipConfig, RelationshipDimensionDefinition,
383        RelationshipDimensionsConfig, RelationshipEvaluation, RelationshipEvaluator,
384        RelationshipEvaluatorTrait, RelationshipEvent, RelationshipManager, RelationshipModel,
385        RelationshipPerspective, RelationshipSnapshot, RelationshipUpdate, format_relationship,
386        relationship_from_value, relationship_to_context_value, relationship_to_value,
387    };
388}
389
390pub mod observability {
391    pub use ai_agents_observability::{
392        AggregatedMetrics, AggregationConfig, AggregationDimension, BufferConfig, CostBreakdown,
393        CostConfig, CostEstimate, CostEstimator, CostSource, CostStats, EventStatus, EventType,
394        ExportConfig, ExportFormat, ExportResult, LanguageConfig, LatencyConfig, LatencyStats,
395        ModelPricing, ObservabilityConfig, ObservabilityHooks, ObservabilityManager,
396        ObservabilityReport, ObservationError, ObservationEvent, ObservationPurpose,
397        ObservationTokenUsage, ObservedLLMProvider, ObservedTool, PrivacyConfig, RawEventsFormat,
398        Redactor, ReportSummary, SpanContext, SpanGuard, TokenBreakdown, TokenConfig, TokenStats,
399        TokenUsageSource, UnknownPricePolicy, current_observation_context,
400        resolve_language_from_context, stable_hash, truncate_chars, with_observation_context,
401        with_observation_purpose, with_updated_observation_context,
402    };
403}
404
405pub mod reasoning {
406    pub use ai_agents_reasoning::{
407        CriterionResult, EvaluationResult, Plan, PlanAction, PlanAvailableActions,
408        PlanReflectionConfig, PlanStatus, PlanStep, PlanningConfig, ReasoningConfig,
409        ReasoningMetadata, ReasoningMode, ReasoningOutput, ReflectionAttempt, ReflectionConfig,
410        ReflectionMetadata, ReflectionMode, StepFailureAction, StepStatus, StringOrList,
411    };
412}
413
414pub mod disambiguation {
415    pub use ai_agents_disambiguation::{
416        AmbiguityAspect, AmbiguityDetectionResult, AmbiguityDetector, AmbiguityType, CacheConfig,
417        ClarificationConfig, ClarificationGenerator, ClarificationOption, ClarificationParseResult,
418        ClarificationQuestion, ClarificationStyle, ContextConfig, DetectionConfig,
419        DisambiguationConfig, DisambiguationContext, DisambiguationManager, DisambiguationResult,
420        MaxAttemptsAction, SkillDisambiguationOverride, SkipCondition, StateDisambiguationOverride,
421    };
422}
423
424pub mod tool_security {
425    pub use ai_agents_tools::{
426        SecurityCheckResult, ToolPolicyConfig, ToolSecurityConfig, ToolSecurityEngine,
427    };
428}
429
430pub mod tools {
431    pub use ai_agents_core::{Tool, ToolInfo, ToolResult};
432    pub use ai_agents_tools::{
433        CalculatorTool, ConditionEvaluator, DateTimeTool, EchoTool, EvaluationContext, FileTool,
434        JsonTool, LLMGetter, MathTool, ProviderHealth, RandomTool, SimpleLLMGetter, TemplateTool,
435        TextTool, ToolAliases, ToolCallRecord, ToolContext, ToolDescriptor, ToolMetadata,
436        ToolProvider, ToolProviderError, ToolProviderType, ToolRegistry, TrustLevel,
437        create_builtin_registry,
438    };
439    pub use ai_agents_tools::{HttpTool, generate_schema};
440}
441
442/// MCP (Model Context Protocol) integration types.
443pub mod mcp {
444    pub use ai_agents_tools::mcp::{
445        MCPViewConfig, MCPViewTool, MCPWrapperConfig, MCPWrapperSecurity, MCPWrapperTool,
446        MCPWrapperTransport,
447    };
448}
449
450/// Dynamic agent spawning, registry, and inter-agent messaging.
451pub mod spawner {
452    pub use ai_agents_runtime::spawner::{
453        AgentRegistry, AgentSpawner, GenerateAgentTool, ListAgentsTool, NamespacedStorage,
454        RegistryHooks, RemoveAgentTool, ResolvedTemplate, SendMessageTool, SpawnedAgent,
455        SpawnedAgentInfo, auto_configure_spawner, configure_spawner_tools, resolve_templates,
456        spawner_from_config,
457    };
458}
459
460// Multi-agent orchestration patterns and tool wrappers.
461/// Key facts extraction and actor memory.
462pub mod facts {
463    pub use ai_agents_core::{SessionFilter, SessionMetadata, SessionSummary};
464    pub use ai_agents_facts::deduplicate_exact;
465    pub use ai_agents_facts::{
466        ActorMemoryConfig, CategoryDefinition, DedupConfig, DedupMethod, FactExtractor, FactStore,
467        FactsConfig, IdentificationConfig, IdentificationMethod, InjectionConfig, InjectionMode,
468        LLMFactExtractor, PrivacyConfig, SessionConfig,
469    };
470    pub use ai_agents_facts::{FactCategory, FactFilter, KeyFact};
471}
472
473pub mod eval {
474    pub use ai_agents_eval::*;
475}
476
477pub mod orchestration {
478    pub use ai_agents_runtime::orchestration::context::prepare_delegate_input;
479    pub use ai_agents_runtime::orchestration::tools::{
480        ConcurrentAskTool, GroupDiscussionTool, HandoffConversationTool, PipelineProcessTool,
481        RouteToAgentTool, configure_orchestration_tools,
482    };
483    pub use ai_agents_runtime::orchestration::types::{
484        AgentResult, ChatTurn, ConcurrentResult, GroupChatResult, HandoffEvent, HandoffResult,
485        PipelineResult, PipelineStage, RouteResult, RoutingMethod, StageOutput,
486    };
487    pub use ai_agents_runtime::orchestration::{concurrent, group_chat, handoff, pipeline, route};
488}
489
490// Top-level re-exports (legacy interface)
491pub use agent::{
492    Agent, AgentBuilder, AgentInfo, AgentResponse, ParallelToolsConfig, RuntimeAgent, StreamChunk,
493    StreamingConfig, TurnActorContext,
494};
495pub use error::{AgentError, Result};
496pub use memory::{
497    CompactingMemory, CompactingMemoryConfig, CompressResult, CompressionEvent,
498    ConversationContext, EvictionReason, FactExtractedEvent, InMemoryStore, LLMSummarizer, Memory,
499    MemoryBudgetEvent, MemoryBudgetState, MemoryCompressEvent, MemoryEvictEvent, MemoryTokenBudget,
500    NoopSummarizer, OverflowStrategy, Summarizer, TokenAllocation, create_memory,
501    create_memory_from_config, create_memory_from_config_with_llm, estimate_message_tokens,
502    estimate_tokens,
503};
504pub use skill::{SkillDefinition, SkillExecutor, SkillLoader, SkillRef, SkillRouter, SkillStep};
505pub use spec::{
506    AgentSpec, BuiltinProviderConfig, FileStorageConfig, LLMConfig, LLMSelector, MemoryConfig,
507    ProviderPolicyConfig, ProviderSecurityConfig, ProvidersConfig, RedisStorageConfig,
508    SqliteStorageConfig, StorageConfig, ToolAliasesConfig, ToolConfig,
509    ToolPolicyConfig as SpecToolPolicyConfig, YamlProviderConfig, YamlToolConfig,
510};
511pub use template::TemplateLoader;
512pub use tools::HttpTool;
513pub use tools::{
514    CalculatorTool, DateTimeTool, EchoTool, FileTool, JsonTool, MathTool, RandomTool, TemplateTool,
515    TextTool, Tool, ToolRegistry, ToolResult, create_builtin_registry,
516};
517
518pub use llm::providers::{ProviderType, ProviderType as LLMProviderType, UnifiedLLMProvider};
519pub use llm::{ChatMessage, LLMProvider, LLMRegistry, LLMResponse, MultiLLMRouter, Role};
520
521pub use process::{ProcessConfig, ProcessData, ProcessProcessor};
522pub use recovery::{
523    ByRoleFilter, ErrorRecoveryConfig, FilterConfig, KeepRecentFilter, MessageFilter,
524    RecoveryManager, SkipPatternFilter,
525};
526pub use tool_security::{
527    SecurityCheckResult, ToolPolicyConfig, ToolSecurityConfig, ToolSecurityEngine,
528};
529
530pub use eval::{EvalResult, EvalRunner, EvalRunnerOptions, EvalSettings, EvalSuite};
531pub use observability::{ObservabilityConfig, ObservabilityManager, ObservabilityReport};
532
533pub use context::{
534    BuiltinSource, ContextManager, ContextProvider, ContextSource, RefreshPolicy, TemplateRenderer,
535};
536#[cfg(feature = "sqlite")]
537pub use persistence::SqliteStorage;
538pub use persistence::{
539    AgentSnapshot, AgentStorage, FileStorage, MemorySnapshot, SessionInfo, SessionMetadata,
540    SessionOrderBy, SessionQuery, SpawnedAgentEntry, create_storage,
541};
542#[cfg(feature = "redis-storage")]
543pub use persistence::{RedisSessionMeta, RedisStorage};
544
545pub use state::{
546    CompareOp, ContextExtractor, ContextMatcher, GuardConditions, GuardOnlyEvaluator,
547    LLMTransitionEvaluator, PromptMode, StateAction, StateConfig, StateDefinition, StateMachine,
548    StateMachineSnapshot, StateMatcher, StateTransitionEvent, TimeMatcher, ToolCondition, ToolRef,
549    Transition, TransitionContext, TransitionEvaluator, TransitionGuard,
550};
551pub use tools::{
552    ConditionEvaluator, EvaluationContext, LLMGetter, SimpleLLMGetter, ToolCallRecord,
553};
554
555pub use hooks::{AgentHooks, CompositeHooks, HookTimer, LoggingHooks, NoopHooks};
556
557pub use hitl::{
558    ApprovalCondition, ApprovalHandler, ApprovalMessage, ApprovalRequest, ApprovalResult,
559    ApprovalTrigger, AutoApproveHandler, HITLCheckResult, HITLConfig, HITLEngine,
560    LlmGenerateConfig, LocalizedHandler, MessageLanguageConfig, MessageLanguageStrategy,
561    MessageResolver, RejectAllHandler, StateApprovalConfig, StateApprovalTrigger, TimeoutAction,
562    ToolApprovalConfig, create_handler, create_localized_handler, resolve_best_language,
563    resolve_tool_message,
564};
565
566#[cfg(test)]
567mod tests {
568    #[test]
569    fn test_facade_reexports_multi_llm_router() {
570        fn assert_type<T>() {}
571        assert_type::<crate::llm::MultiLLMRouter>();
572        assert_type::<crate::MultiLLMRouter>();
573    }
574}
575
576// Tool Provider System (v0.5.1 - Simplified)
577pub use tools::{
578    ProviderHealth, ToolAliases, ToolContext, ToolDescriptor, ToolMetadata, ToolProvider,
579    ToolProviderError, ToolProviderType, TrustLevel,
580};
581
582// Reasoning & Reflection (v0.5.3)
583pub use reasoning::{
584    CriterionResult, EvaluationResult, Plan, PlanAction, PlanAvailableActions,
585    PlanReflectionConfig, PlanStatus, PlanStep, PlanningConfig, ReasoningConfig, ReasoningMetadata,
586    ReasoningMode, ReasoningOutput, ReflectionAttempt, ReflectionConfig, ReflectionMetadata,
587    ReflectionMode, StepFailureAction, StepStatus, StringOrList,
588};
589
590// Intent Disambiguation (v0.5.4)
591pub use disambiguation::{
592    AmbiguityAspect, AmbiguityDetectionResult, AmbiguityDetector, AmbiguityType, CacheConfig,
593    ClarificationConfig, ClarificationGenerator, ClarificationOption, ClarificationParseResult,
594    ClarificationQuestion, ClarificationStyle, ContextConfig, DetectionConfig,
595    DisambiguationConfig, DisambiguationContext, DisambiguationManager, DisambiguationResult,
596    MaxAttemptsAction, SkillDisambiguationOverride, SkipCondition, StateDisambiguationOverride,
597};