adk_runner/lib.rs
1//! # adk-runner
2#![allow(clippy::result_large_err)]
3#![deny(missing_docs)]
4//!
5//! Agent execution runtime for ADK.
6//!
7//! ## Overview
8//!
9//! This crate provides the execution runtime:
10//!
11//! - [`Runner`] - Manages agent execution with full context
12//! - [`RunnerConfig`] - Configuration for the runner
13//! - [`InvocationContext`] - Execution context implementation
14//! - [`Callbacks`] - Hook points during execution
15//!
16//! ## What's New in 0.6.0
17//!
18//! - **`InvocationContext::shared_state()`**: Propagates [`SharedState`](adk_core::SharedState)
19//! from `ParallelAgent` through the runner context chain, making it accessible to tools.
20//!
21//! ## Quick Start
22//!
23//! ```rust,no_run
24//! use adk_runner::{Runner, RunnerConfig};
25//! use std::sync::Arc;
26//!
27//! // Configure runner with services
28//! // let config = RunnerConfig {
29//! // app_name: "my_app".to_string(),
30//! // session_service: sessions,
31//! // artifact_service: Some(artifacts),
32//! // memory_service: None,
33//! // };
34//! //
35//! // let runner = Runner::new(config);
36//! ```
37//!
38//! ## Features
39//!
40//! - Automatic session management
41//! - Memory injection
42//! - Artifact handling
43//! - Callback hooks at every stage
44
45mod agent_invoker;
46pub mod builder;
47mod cache;
48mod callbacks;
49#[cfg(feature = "context-compaction")]
50pub mod compaction;
51mod context;
52pub mod intra_compaction;
53mod launcher;
54mod runner;
55#[cfg(feature = "sandbox-runner")]
56pub mod sandbox_runner;
57pub mod tool_concurrency;
58
59pub use builder::RunnerConfigBuilder;
60pub use callbacks::{
61 AfterModelCallback, AfterToolCallback, BeforeModelCallback, BeforeToolCallback, Callbacks,
62};
63pub use context::{InvocationContext, MutableSession};
64pub use launcher::Launcher;
65pub use runner::{Runner, RunnerConfig};
66
67// Re-export RequestContext for convenience
68pub use adk_core::RequestContext;
69
70// Re-export compaction types for convenience
71pub use adk_core::IntraCompactionConfig;
72pub use adk_core::{BaseEventsSummarizer, EventsCompactionConfig};
73pub use intra_compaction::IntraInvocationCompactor;
74
75// Re-export secret service trait for convenience
76pub use adk_core::SecretService;
77
78// Re-export cache types for convenience
79pub use adk_core::{CacheCapable, ContextCacheConfig};
80pub use cache::{CacheMetrics, CachePerformanceAnalyzer};