1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! # SombraX Agentic Core (`sombrax_agentic_core`)
//!
//! SombraX Agentic Core (SAC) is a Rust library for LLM agent orchestration with content-modifying hooks,
//! MCP tool integration, cross-agent communication, and context optimization.
//!
//! ## Features
//!
//! - **Content-Modifying Hooks**: Intercept and modify messages before/after LLM calls
//! - **MCP Tool Integration**: Connect to MCP servers for tool discovery and execution
//! - **Cross-Agent Communication**: Registry for agent discovery and invocation
//! - **Context Optimization**: Automatic context management for long conversations
//! - **OpenTelemetry**: Built-in observability with tracing and metrics
//! - **LLM Providers**: OpenAI, Anthropic, ZAI, Cerebras, OpenRouter (`sombrax_agentic_core::providers`)
//! - **Agent Tools**: File, shell, web, and task tools (`sombrax_agentic_core::tools`)
//!
//! ## Quick Start
//!
//! ```ignore
//! use sombrax_agentic_core::prelude::*;
//!
//! #[derive(Clone)]
//! struct LoggingHook;
//!
//! impl Hook for LoggingHook {
//! async fn pre_completion(
//! &self,
//! message: Message,
//! _history: &[Message],
//! ctx: &mut HookContext,
//! ) -> HookResult<Message> {
//! println!("[{}] Processing message", ctx.request_id);
//! Ok(message)
//! }
//! }
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = OpenAIClientBuilder::new(&std::env::var("OPENAI_API_KEY")?).build();
//! let model = client.completion_model_adapter("gpt-4");
//!
//! let agent = AgentBuilder::new(model)
//! .preamble("You are a helpful assistant.")
//! .hook(LoggingHook)
//! .build();
//!
//! let response = agent.prompt("Hello!").await?;
//! println!("{}", response.content());
//! Ok(())
//! }
//! ```
/// Experience-based learning system for agent self-improvement.
/// System prompts as first-class on-disk assets with a name-based
/// resolution ladder — analog of [`skill`] for persona prompts.
/// Skill system for discovering and loading user-defined agent skills.
/// Pluggable pipeline / bundle / job runtime.
///
/// See [`runs`] (and `src/runs/mod.rs`) for the design and contract.
// Re-export commonly used types at crate root
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;