Skip to main content

awaken_runtime/
lib.rs

1//! Agent runtime engine for the awaken framework.
2//!
3//! Implements the execution loop, phase pipeline, plugin system, state store,
4//! and agent registry. Extension crates hook into this crate via the [`phase`],
5//! [`plugins`], and [`extensions`] traits. Most users interact with this crate
6//! indirectly through the `awaken` facade and `awaken::prelude`.
7
8#![allow(missing_docs)]
9
10pub mod agent;
11pub mod backend;
12pub mod builder;
13pub(crate) mod cancellation;
14pub mod context;
15pub mod engine;
16mod error;
17pub mod execution;
18pub mod extensions;
19mod hooks;
20pub mod inbox;
21pub mod loop_runner;
22pub mod phase;
23pub mod plugins;
24pub mod policies;
25pub mod profile;
26pub mod registry;
27pub mod runtime;
28pub mod state;
29
30// ── Core re-exports: types used directly by extension crates ──
31
32// CancellationToken now lives in awaken-contract; re-export for backward compat.
33pub use awaken_contract::{CancellationHandle, CancellationToken};
34pub use error::RuntimeError;
35pub use profile::ProfileAccess;
36
37pub use backend::{
38    BackendAbortRequest, BackendCancellationCapability, BackendCapabilities,
39    BackendContinuationCapability, BackendControl, BackendDelegateContinuation,
40    BackendDelegatePersistence, BackendDelegatePolicy, BackendDelegateRunRequest,
41    BackendLocalRootContext, BackendOutputArtifact, BackendOutputCapability, BackendParentContext,
42    BackendRootRunRequest, BackendRunOutput, BackendRunResult, BackendRunStatus,
43    BackendTranscriptCapability, BackendWaitCapability, ExecutionBackend, ExecutionBackendError,
44    ExecutionBackendFactory, ExecutionBackendFactoryError, LocalBackend,
45};
46pub use builder::{AgentRuntimeBuilder, BuildError};
47pub use phase::{
48    DEFAULT_MAX_PHASE_ROUNDS, ExecutionEnv, PhaseContext, PhaseHook, PhaseRuntime, ToolGateHook,
49    ToolPolicyHook, TypedEffectHandler, TypedScheduledActionHandler,
50};
51pub use plugins::{Plugin, PluginDescriptor, PluginRegistrar};
52pub use registry::{AgentResolver, ExecutionResolver, ResolvedAgent, ResolvedExecution};
53pub use runtime::{AgentRuntime, RunRequest};
54pub use state::{CommitEvent, CommitHook, MutationBatch, StateCommand, StateStore};