1#![allow(clippy::result_large_err)]
121#![deny(missing_docs)]
122
123pub mod acting;
126pub mod action_ledger;
128pub mod agent;
130pub mod agent_invoker;
132pub mod agent_loader;
134pub mod approval;
137pub mod audit_log;
139pub mod budget;
141pub mod callbacks;
143pub mod clock;
145pub mod computer;
147#[cfg(feature = "conformance")]
149pub mod conformance;
150pub mod context;
152pub mod credential;
154pub mod decision;
157pub mod egress;
158pub mod error;
160pub mod event;
162mod event_stream;
163pub mod event_summarizer;
165pub mod evidence;
167pub mod governance;
169pub mod governance_state;
171pub mod grounding;
173pub mod history;
176pub mod identity;
178pub mod instruction_template;
180pub mod intra_compaction;
182pub mod lease;
184pub mod metering;
186pub mod model;
188#[cfg(feature = "ort")]
190pub mod onnx;
191pub mod policy;
193pub mod principal;
195pub mod queue_source;
196pub mod request_context;
198pub mod review;
200pub mod run_store;
202pub mod schedule;
204pub mod schema_adapter;
206pub mod schema_cache;
208pub mod schema_utils;
210pub mod shared_state;
212pub mod spend;
214pub mod steering;
217pub mod subagent;
220pub mod subject;
221pub mod tool;
223pub mod tool_concurrency;
225pub mod tool_response;
227pub mod types;
229pub mod usage;
231#[cfg(feature = "webhooks")]
232pub mod webhook;
233#[cfg(feature = "webhook-delivery")]
234pub mod webhook_delivery;
235
236pub use acting::{
237 ActingConfig, PRINCIPAL_NOT_ALLOWED_CODE, SUBJECT_MISMATCH_CODE, StaticSubjectDelegation,
238 SubjectDelegationPolicy, SubjectDelegationRequest, subject_mismatch_error,
239};
240pub use action_ledger::{
241 ActionLedger, ActionOutcome, ActionRecord, InMemoryActionLedger, LedgerAnswer, LedgeredCall,
242 NOT_RUN_PREFIX, OUTCOME_UNKNOWN_STATUS, begin_ledgered_call, held_call_ledger_key,
243 interrupted_call_response, is_not_run, is_outcome_unknown, json_digest, not_run_text,
244 outcome_unknown_response, record_outcome_unknown,
245};
246pub use agent::{
247 Agent, AgentCapabilities, AgentInteractionMode, AgentKind, AgentProfile, AgentRelationshipKind,
248 AgentTopology, AgentTopologyMember, AgentTopologyRelationship, AgentTransferDecision,
249 AgentTransferRequest, EventStream, ResolvedContext, ToolProfile, screen_user_input_with,
250};
251pub use agent_invoker::AgentInvoker;
252pub use agent_loader::{AgentLoader, MultiAgentLoader, SingleAgentLoader};
253pub use approval::{
254 APPROVAL_REAPPLY_GRACE, ApprovalAction, ApprovalCall, ApprovalCursor, ApprovalDecision,
255 ApprovalDelegation, ApprovalEventKind, ApprovalNotification, ApprovalNotifier, ApprovalPolicy,
256 ApprovalRequest, ApprovalRequestQuery, ApprovalResolution, ApprovalRisk, ApprovalRoute,
257 ApprovalRouter, ApprovalService, ApprovalState, ApprovalTick, ApproverDirectory,
258 ApproverSelector, DEFAULT_APPROVAL_PAGE, DelegationScope, DelegationWindow, EscalationStep,
259 ExpiryAction, InboxPage, InboxQuery, StoreApprovalService,
260};
261pub use budget::{
262 BUDGET_LIMIT_KEY, BUDGET_RECORDED_KEY, BudgetExceeded, BudgetLimit, BudgetTracker, BudgetUsage,
263 ModelCallMeter, RunBudget, budget_exceeded_event, generate_with_budget, meter_stream,
264};
265pub use callbacks::{
266 AfterAgentCallback, AfterModelCallback, AfterToolCallback, AfterToolCallbackFull,
267 BaseEventsSummarizer, BeforeAgentCallback, BeforeModelCallback, BeforeModelResult,
268 BeforeToolCallback, CALLBACK_PANICKED_CODE, EventsCompactionConfig, GlobalInstructionProvider,
269 HistoryProcessor, InstructionProvider, InvocationHooks, OnToolErrorCallback, guard_callback,
270};
271pub use clock::{Clock, ManualClock, SystemClock};
272pub use computer::{
273 ActuationOutput, ComputerAction, ComputerActionKind, ComputerActuator, MouseButton,
274 ScreenPoint, Screenshot, ScrollDirection,
275};
276pub use context::{
277 Artifacts, BUILTIN_TOOL_ORIGIN, BackpressurePolicy, BatchCall, CallbackContext,
278 IncludeContents, InvocationContext, MAX_STATE_KEY_LEN, Memory, MemoryEntry, ReadonlyContext,
279 ReadonlyState, RunConfig, RunConfigBuilder, RuntimeToolset, STATIC_TOOL_ORIGIN, SecretRequest,
280 SecretService, Session, State, StreamingMode, ToolCallbackContext, ToolConcurrencyConfig,
281 ToolConfirmationDecision, ToolConfirmationHandler, ToolConfirmationPolicy,
282 ToolConfirmationRequest, ToolOrigin, ToolOutcome, tool_call_fingerprint, validate_state_key,
283};
284pub use credential::{
285 AgentCredential, CredentialBroker, CredentialKind, CredentialSecret, IdentitySource,
286 RevocationScope, ScopedToken, StaticIdentitySource, resource_indicator,
287};
288pub use decision::{Choice, ChoiceOption, Decider, Decision, decide};
289pub use error::{
290 AdkError, ErrorCategory, ErrorComponent, ErrorDetails, ErrorDiagnostics, Result, RetryHint,
291 UPSTREAM_EXCERPT_BYTES, json_error_summary, upstream_excerpt,
292};
293pub use event::{
294 Event, EventActions, EventCompaction, KEY_PREFIX_APP, KEY_PREFIX_TEMP, KEY_PREFIX_USER,
295 TOOL_PROGRESS_CALL_ID_KEY, TOOL_PROGRESS_STREAM_KEY, ToolCallView, ToolResultView,
296 WorkflowPosition, event_belongs_to_branch,
297};
298pub use event_stream::EventTextDeltas;
299pub use event_summarizer::LlmEventSummarizer;
300pub use evidence::{ArtifactLocator, Evidence, ImageEvidence};
301pub use governance::{
302 ApprovalScope, ApprovalStore, BUILTIN_TOOLS_WITHHELD_KEY, BuiltinToolGovernor,
303 BuiltinToolWithholding, CONFIRMATION_PENDING_STATUS, DEFAULT_TOOL_CONFIRMATION_TIMEOUT,
304 DRAW_TOOL_NAMES, GOVERNANCE_FROZEN_CODE, GOVERNANCE_STALE_CODE, GovernanceControl,
305 GovernanceMirrorConfig, GovernanceWatch, GovernedCall, HeldToolCall, InMemoryApprovalStore,
306 PendingApproval, REQUESTED_CALL_ID_PREFIX, REQUESTED_CALL_METADATA_KEY, RequestedCall,
307 RequestedCallSeal, RequestedVia, RequestedViaKind, SealedCall, ToolApproval, ToolAuthorization,
308 ToolCallScreen, ToolGate, WithheldBuiltinTool, authorize_tool_call, builtin_tool_configuration,
309 confirm_tool_call, confirmation_decision_available, confirmation_pending_response,
310 held_call_compaction_limit, held_tool_calls, is_confirmation_pending,
311 supersede_pending_responses, untrusted_block, withdraw_held_call, workflow_resume_positions,
312};
313pub use governance_state::{
314 GovernanceScope, GovernanceState, GovernanceStateStore, InMemoryGovernanceStateStore,
315};
316pub use grounding::{GroundingSource, bind_markdown_citations, record_grounding_sources};
317pub use identity::{
318 AdkIdentity, AppName, ExecutionIdentity, IdentityError, InvocationId, SessionId, UserId,
319};
320pub use instruction_template::inject_session_state;
321pub use intra_compaction::{
322 CompactedHistory, CompactionTrigger, HistoryCompactionRequest, HistoryCompactor,
323 IntraCompactionConfig, NativeCompactionRequest,
324};
325pub use lease::{InMemoryLeaseStore, Lease, LeaseStore};
326pub use metering::{
327 LlmSpendEstimate, MeteredLlm, MeteredUsage, ModelCallScope, ModelSpendHold,
328 UNBOUNDED_HOLD_MICRO_USD, UsageCall, UsageHold, generate_metered, meter_usage,
329 vendor_for_model,
330};
331pub use model::{
332 BuiltinToolUse, CacheCapable, CitationMetadata, CitationSource, ContextCacheConfig, Effort,
333 FinishReason, GenerateContentConfig, Llm, LlmRequest, LlmResponse, LlmResponseStream,
334 ToolDeclarations, ToolDeclarationsIter, ToolDeclarationsKeys, ToolDeclarationsValues,
335 UsageMetadata, nullable_count,
336};
337pub use model::{
338 DataDestination, DataLocality, NativeCompaction, NativeWebSearch, NativeWebSearchTool,
339};
340pub use policy::{
341 ArgPredicate, DeclarativePolicy, DeclarativePolicyBuilder, PolicyCall, PolicyDecision,
342 PolicyRule, StrictestPolicy, ToolPolicy, ToolPolicyRequest,
343};
344pub use principal::{
345 ActingContext, AgentId, AgentPrincipal, PrincipalError, SubjectKind, SubjectRef,
346};
347pub use queue_source::{
348 InMemoryQueueSource, IngressReport, QueueIngress, QueueMessage, QueueSource,
349};
350pub use request_context::RequestContext;
351pub use review::{
352 DEFAULT_REVIEW_TIMEOUT, MODEL_REVIEWER_PREFIX, ModelApprover, REVIEW_SOURCE, ReviewScope,
353 ReviewVerdict, ToolReview, ToolReviewer,
354};
355pub use run_store::{
356 ClaimedRun, DurableRunStore, Enqueued, InMemoryRunStore, NewRun, OnConflict, RetryBackoff,
357 RunCheckpointRef, RunFilter, RunOutcome, RunRecord, RunState,
358};
359pub use schedule::{
360 FirePlan, InMemoryScheduleStore, Jitter, MissedFirePolicy, Schedule, ScheduleSpec,
361 ScheduleStore, firing_idempotency_key, manual_idempotency_key, plan_fires,
362};
363pub use schema_adapter::{GenericSchemaAdapter, SchemaAdapter};
364pub use schema_cache::SchemaCache;
365pub use shared_state::{SharedState, SharedStateError};
366pub use spend::{
367 DEFAULT_RESERVATION_TTL, InMemorySpendLedger, ReservationId, SPEND_LIMIT_EXCEEDED_CODE,
368 SpendError, SpendKey, SpendLedger, SpendLimit, SpendLimits, SpendPeriod, usd_to_micro_usd,
369};
370pub use steering::{
371 STEER_INVALID_MESSAGE_CODE, STEER_NO_ACTIVE_RUN_CODE, SteerOutcome, SteerReceipt,
372 SteeringInbox, SteeringMarker, SteeringMessage, validate_steering_message,
373};
374pub use subagent::{
375 FollowUp, RunLimits, SubagentHost, SubagentLaunch, SubagentMode, SubagentParent,
376 SubagentRecord, SubagentRequest, SubagentScope, SubagentStart, SubagentStatus, SubagentTarget,
377 ToolCeiling,
378};
379pub use tool::{
380 BatchGroup, DUPLICATE_TOOL_NAME_CODE, RetryBudget, Tool, ToolContext, ToolEffect,
381 ToolExecutionStrategy, ToolPredicate, ToolRegistry, Toolset, ValidationMode,
382 ensure_unique_tool_names,
383};
384pub use tool_concurrency::{ConcurrencyPermit, ToolConcurrencyManager};
385pub use tool_response::{
386 INVALID_TOOL_ARGUMENTS_KEY, RESULT_WITHHELD_STATUS, TOOL_ERROR_MESSAGE_LIMIT,
387 TOOL_INVALID_ARGUMENTS_CODE, TOOL_PERMISSION_DENIED_CODE, TOOL_RESULT_ERROR_CATEGORY_KEY,
388 TOOL_RESULT_ERROR_CODE_KEY, TOOL_RESULT_STATUS_KEY, ToolResultScreen, ToolResultStatus,
389 invalid_tool_arguments, invalid_tool_arguments_reason, result_blocked_response,
390 result_withheld_response, screen_tool_result, tool_error_response,
391};
392pub use types::{
393 BlobResourceContents, Content, EmbeddedResource, FileDataPart, FunctionResponseData,
394 GENERATED_CALL_ID_PREFIX, InlineDataPart, MAX_INLINE_DATA_SIZE, Part, TextResourceContents,
395};
396pub use url::Url;
397pub use usage::{UnitRate, UsageUnit, UsageVector};
398
399pub use async_trait::async_trait;
402
403pub fn ensure_crypto_provider() {
410 #[cfg(feature = "rustls")]
411 {
412 static CRYPTO_INIT: std::sync::Once = std::sync::Once::new();
413 CRYPTO_INIT.call_once(|| {
414 let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
417 });
418 }
419}