Skip to main content

AgentRuntime

Struct AgentRuntime 

Source
pub struct AgentRuntime { /* private fields */ }

Implementations§

Source§

impl AgentRuntime

Source

pub fn new( agent: Arc<Agent>, broker: AnyBroker, sessions: Arc<SessionManager>, ) -> Self

Source

pub fn with_memory(self, memory: Arc<LongTermMemory>) -> Self

Source

pub fn with_redactor(self, redactor: Arc<Redactor>) -> Self

Source

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).

Source

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).

Source

pub fn with_transcripts_index(self, index: Arc<TranscriptsIndex>) -> 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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn with_peers(self, peers: Arc<PeerDirectory>) -> Self

Source

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.

Source

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.

Source

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.

Source

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().

Source

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.

Source

pub fn with_breakers(self, breakers: Arc<BreakerRegistry>) -> Self

Source

pub fn router(&self) -> Arc<AgentRouter> ⓘ

Source

pub async fn start(&self) -> Result<()>

Source

pub async fn stop(&self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more