adk_managed/lib.rs
1//! # adk-managed
2//!
3//! Managed agent runtime for ADK-Rust — a provider-neutral, durable, resumable
4//! agent execution engine.
5//!
6//! ## Overview
7//!
8//! `adk-managed` provides the `ManagedAgentRuntime` trait and its default implementation.
9//! It takes a declarative `ManagedAgentDef`, builds a runnable agent, and operates it as
10//! a durable, resumable, event-streaming background session. The runtime composes existing
11//! shipping components behind a unified lifecycle trait.
12//!
13//! ## Architecture
14//!
15//! The runtime is a **library**, not a service. The platform hosts it. This means:
16//!
17//! - **Testable in isolation**: Zero HTTP/auth/billing dependencies
18//! - **Embeddable**: Self-hosted deployments use the same runtime trait directly
19//! - **Swappable platform**: Different platforms can host the same runtime
20//! - **Provider-neutral**: Identical event sequences regardless of model provider
21//!
22//! ## Quick Start
23//!
24//! ```rust,ignore
25//! use adk_managed::types::ManagedAgentDef;
26//!
27//! // Define an agent declaratively
28//! let def = ManagedAgentDef {
29//! name: "my-agent".to_string(),
30//! model: ModelRef::Shorthand("gemini-2.5-flash".to_string()),
31//! system_prompt: "You are a helpful assistant.".to_string(),
32//! // ...
33//! };
34//! ```
35
36pub mod agent_builder;
37pub mod checkpoint;
38pub mod default_runtime;
39pub mod event_mapping;
40pub mod parking;
41pub mod replay;
42pub mod resolver;
43pub mod runtime;
44pub mod schema_normalization;
45pub mod sequence;
46pub mod session_loop;
47pub mod testing;
48pub mod types;
49pub mod usage;
50
51pub use agent_builder::{BuildError, ManagedBuiltinTool, ManagedCustomTool, build_agent};
52pub use checkpoint::{CheckpointManager, RunState};
53pub use default_runtime::DefaultManagedAgentRuntime;
54pub use event_mapping::{
55 RunnerOutput, ToolKind, custom_tool_use_id, map_runner_output, requires_parking,
56};
57pub use parking::ToolParkingLot;
58pub use replay::{create_event_stream, get_seq};
59pub use resolver::{DefaultModelResolver, ModelResolver, ResolverError, ResolverResult};
60pub use runtime::{AgentHandle, EnvironmentConfig, ManagedAgentRuntime, SessionHandle};
61pub use schema_normalization::{normalize_for_provider, representative_mcp_schema};
62pub use sequence::SequenceCounter;
63pub use session_loop::SessionLoop;
64pub use testing::{ScriptedLlm, ScriptedToolCall, ScriptedTurn};
65pub use usage::{SessionUsageTracker, UsageReport};