pub struct AgentKernel { /* private fields */ }Expand description
The stateless Agent Kernel — a single-turn ReAct executor.
Cheap to create, safe to clone, safe to share across threads. Does not own transcript, session, or any cross-turn state.
NOTE: The run() method is NOT implemented in this goal.
This goal only defines the struct and its builder. The actual
execution logic will be wired in Goal C (Phase 2).
Implementations§
Source§impl AgentKernel
impl AgentKernel
Sourcepub fn builder() -> AgentKernelBuilder
pub fn builder() -> AgentKernelBuilder
Create a new builder for AgentKernel.
Sourcepub fn llm(&self) -> &Arc<dyn LlmProvider> ⓘ
pub fn llm(&self) -> &Arc<dyn LlmProvider> ⓘ
Access the LLM provider.
Sourcepub fn tools(&self) -> &ToolRegistry
pub fn tools(&self) -> &ToolRegistry
Access the tool registry.
Sourcepub fn tools_mut(&mut self) -> &mut ToolRegistry
pub fn tools_mut(&mut self) -> &mut ToolRegistry
Mutable access to the tool registry.
Used by [AgentRuntime::enable_checkpoints] to register
session-scoped read-only tools (checkpoint_list,
checkpoint_diff) once the session id is known.
Sourcepub fn shutdown_token(&self) -> Option<&CancellationToken>
pub fn shutdown_token(&self) -> Option<&CancellationToken>
Access the cancellation token, if one was configured.
Useful for tests verifying that token propagation through
with_tools (and other clones) preserves the handle.
Sourcepub fn storage(&self) -> &Arc<dyn StorageBackend> ⓘ
pub fn storage(&self) -> &Arc<dyn StorageBackend> ⓘ
Access the storage backend.
Sourcepub fn session_store(&self) -> &Arc<dyn SessionStore> ⓘ
pub fn session_store(&self) -> &Arc<dyn SessionStore> ⓘ
Access the session store.
Sourcepub fn hooks(&self) -> &HookRegistry
pub fn hooks(&self) -> &HookRegistry
Public access to the hook registry. Used by AgentRuntime to
dispatch cross-turn PreCompact / PostCompact events that are
not handled by RunCore.
Sourcepub fn with_tools(&self, tools: ToolRegistry) -> Self
pub fn with_tools(&self, tools: ToolRegistry) -> Self
Create a new kernel with a different tool registry (same LLM, same config). Useful for Multi-Agent scenarios where sub-agents get restricted tool subsets.
Sourcepub async fn run(&self, ctx: TurnContext) -> Result<TurnOutcome>
pub async fn run(&self, ctx: TurnContext) -> Result<TurnOutcome>
Execute one turn of the ReAct loop.
Takes a TurnContext prepared by the Wrapper and returns a
TurnOutcome containing only the new messages produced during
this turn, plus usage stats and finish reason.
The Kernel is stateless: it does not retain any state between calls. All cross-turn concerns (transcript accumulation, compaction, persistence) are the Wrapper’s responsibility.
Trait Implementations§
Source§impl Clone for AgentKernel
impl Clone for AgentKernel
Source§fn clone(&self) -> AgentKernel
fn clone(&self) -> AgentKernel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AgentKernel
impl !UnwindSafe for AgentKernel
impl Freeze for AgentKernel
impl Send for AgentKernel
impl Sync for AgentKernel
impl Unpin for AgentKernel
impl UnsafeUnpin for AgentKernel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more