Skip to main content

sage_runtime/
lib.rs

1//! Runtime library for compiled Sage programs.
2//!
3//! This crate provides the types and functions that generated Rust code
4//! depends on. It handles:
5//!
6//! - Agent spawning and lifecycle
7//! - Message passing between agents
8//! - LLM inference calls
9//! - RFC-0011: Tool execution (Http, Fs, etc.)
10//! - RFC-0012: Mock infrastructure for testing
11//! - Error handling
12
13#![forbid(unsafe_code)]
14
15mod agent;
16mod error;
17mod llm;
18pub mod mock;
19pub mod stdlib;
20pub mod tools;
21
22pub use agent::{spawn, AgentContext, AgentHandle};
23pub use error::{ErrorKind, SageError, SageResult};
24pub use llm::LlmClient;
25pub use mock::{MockLlmClient, MockQueue, MockResponse};
26pub use tools::{HttpClient, HttpResponse};
27
28/// Prelude for generated code.
29pub mod prelude {
30    pub use crate::agent::{spawn, AgentContext, AgentHandle};
31    pub use crate::error::{ErrorKind, SageError, SageResult};
32    pub use crate::llm::LlmClient;
33    pub use crate::mock::{MockLlmClient, MockQueue, MockResponse};
34    pub use crate::tools::{HttpClient, HttpResponse};
35}