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//! - Error handling
11
12#![forbid(unsafe_code)]
13
14mod agent;
15mod error;
16mod llm;
17pub mod tools;
18
19pub use agent::{spawn, AgentContext, AgentHandle};
20pub use error::{ErrorKind, SageError, SageResult};
21pub use llm::LlmClient;
22pub use tools::{HttpClient, HttpResponse};
23
24/// Prelude for generated code.
25pub mod prelude {
26    pub use crate::agent::{spawn, AgentContext, AgentHandle};
27    pub use crate::error::{ErrorKind, SageError, SageResult};
28    pub use crate::llm::LlmClient;
29    pub use crate::tools::{HttpClient, HttpResponse};
30}