pub struct AgentRuntime { /* private fields */ }Implementations§
Source§impl AgentRuntime
impl AgentRuntime
pub fn new( agent: Arc<Agent>, broker: AnyBroker, sessions: Arc<SessionManager>, ) -> Self
pub fn with_memory(self, memory: Arc<LongTermMemory>) -> Self
pub fn with_redactor(self, redactor: Arc<Redactor>) -> Self
Sourcepub fn with_processing_store(
self,
store: Arc<dyn ProcessingControlStore>,
) -> Self
pub fn with_processing_store( self, store: Arc<dyn ProcessingControlStore>, ) -> Self
Phase 82.13.c — install the operator pause-check store.
Pass the SAME Arc boot wired into the admin RPC
dispatcher so a pause RPC reaches the inbound loop on
the very next message. Without this builder, the
runtime processes every inbound regardless of operator
pause state (legacy / tests).
Sourcepub fn with_event_emitter(self, emitter: Arc<dyn AgentEventEmitter>) -> Self
pub fn with_event_emitter(self, emitter: Arc<dyn AgentEventEmitter>) -> Self
Phase 82.13.c — install the agent event emitter for
firehose drop notifications when the per-scope pending
queue evicts an oldest entry. Production wires the same
BroadcastAgentEventEmitter Phase 82.11 already plumbs
to TranscriptWriter. None keeps eviction silent
(tracing only).
pub fn with_transcripts_index(self, index: Arc<TranscriptsIndex>) -> Self
Sourcepub fn with_link_extractor(self, ext: Arc<LinkExtractor>) -> Self
pub fn with_link_extractor(self, ext: Arc<LinkExtractor>) -> Self
Attach the shared link extractor. All AgentContexts built by
this runtime inherit it so llm_behavior can fetch URLs in
inbound messages and build the # LINK CONTEXT block.
Sourcepub fn with_web_search_router(self, router: Arc<WebSearchRouter>) -> Self
pub fn with_web_search_router(self, router: Arc<WebSearchRouter>) -> Self
Attach the shared web-search router. Every AgentContext built
by this runtime inherits it so the web_search tool can route.
Sourcepub fn with_pairing_gate(self, gate: Arc<PairingGate>) -> Self
pub fn with_pairing_gate(self, gate: Arc<PairingGate>) -> Self
Attach the shared pairing gate. Consulted before the per-sender rate limiter in the intake hot path so unknown senders never reach the agent’s behavior.
Sourcepub fn with_pairing_adapters(self, registry: PairingAdapterRegistry) -> Self
pub fn with_pairing_adapters(self, registry: PairingAdapterRegistry) -> Self
Attach the pairing channel-adapter registry. Adapters registered
here are looked up by source_plugin on every inbound message
when the gate is active, and used to normalise sender ids before
store lookup. None (default) preserves legacy zero-adapter
behaviour.
Sourcepub fn with_dispatch_ctx(self, ctx: Arc<DispatchToolContext>) -> Self
pub fn with_dispatch_ctx(self, ctx: Arc<DispatchToolContext>) -> Self
Phase 67 — install the DispatchToolContext shared by every AgentContext this runtime builds. Without this the dispatch tool handlers return a friendly error.
Sourcepub fn with_plan_approval_registry(
self,
registry: Arc<PlanApprovalRegistry>,
) -> Self
pub fn with_plan_approval_registry( self, registry: Arc<PlanApprovalRegistry>, ) -> Self
Phase 79.1 — install a process-shared plan-mode approval
registry. Production wiring creates one per process and passes
it here so the broker subscriber can resolve pending approvals
from inbound [plan-mode] chat messages.
pub fn with_peers(self, peers: Arc<PeerDirectory>) -> Self
Sourcepub fn with_tool_base(self, tools: Arc<ToolRegistry>) -> Self
pub fn with_tool_base(self, tools: Arc<ToolRegistry>) -> Self
Attach the base tool registry used by this agent so the runtime can hand each session a per-binding filtered view via its internal cache. Without this, sessions fall back to the behavior’s own registry and pay a per-turn filter cost.
Sourcepub fn snapshot_handle(&self) -> Arc<ArcSwap<RuntimeSnapshot>> ⓘ
pub fn snapshot_handle(&self) -> Arc<ArcSwap<RuntimeSnapshot>> ⓘ
Expose the runtime’s ArcSwap<RuntimeSnapshot> so the reload
coordinator can swap a freshly-built snapshot in atomically
without tearing down the runtime. Cheap Arc clone — callers
typically stash the handle once at boot.
Sourcepub fn swap_snapshot(&self, new: Arc<RuntimeSnapshot>)
pub fn swap_snapshot(&self, new: Arc<RuntimeSnapshot>)
Atomic swap of the per-agent snapshot. Readers that already
hold an Arc<RuntimeSnapshot> (session tasks mid-turn) keep
their copy for the lifetime of that Arc; subsequent
snapshot.load() calls see the new value.
Sourcepub fn reload_sender(&self) -> Sender<ReloadCommand>
pub fn reload_sender(&self) -> Sender<ReloadCommand>
Clone the ReloadCommand sender so the coordinator can push
Apply commands. One sender per agent runtime; the receiver is
drained inside start().
Sourcepub fn with_credentials(self, credentials: Arc<AgentCredentialResolver>) -> Self
pub fn with_credentials(self, credentials: Arc<AgentCredentialResolver>) -> Self
Attach the credential resolver. All AgentContexts built by
this runtime inherit it so outbound tools can look up the
agent’s bound instance instead of publishing to the legacy
single-account topic.
pub fn with_breakers(self, breakers: Arc<BreakerRegistry>) -> Self
pub fn router(&self) -> Arc<AgentRouter> ⓘ
pub async fn start(&self) -> Result<()>
pub async fn stop(&self)
Auto Trait Implementations§
impl Freeze for AgentRuntime
impl !RefUnwindSafe for AgentRuntime
impl Send for AgentRuntime
impl Sync for AgentRuntime
impl Unpin for AgentRuntime
impl UnsafeUnpin for AgentRuntime
impl !UnwindSafe for AgentRuntime
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> 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