pub struct RuntimeAgentNodeHandler { /* private fields */ }Expand description
Production AgentNodeHandler wrapping the agentic-worker runtime.
Holds a shared AgentRuntime and translates a DwAgent flow node’s
JSON payload into an AgentInput, invoking one Plan-Act-Observe step
per call. Construction (Task 4.3b) lives in the runner binary; the engine
only ever sees this through the AgentNodeHandler trait object.
Implementations§
Source§impl RuntimeAgentNodeHandler
impl RuntimeAgentNodeHandler
Sourcepub fn new(
runtime: Arc<AgentRuntime>,
audit_sink: Option<AuditSink>,
project_id: Option<String>,
) -> RuntimeAgentNodeHandler
pub fn new( runtime: Arc<AgentRuntime>, audit_sink: Option<AuditSink>, project_id: Option<String>, ) -> RuntimeAgentNodeHandler
Wrap a shared AgentRuntime in a flow-node handler. audit_sink
is Some only when a NATS audit client was configured; execute
then drives the step via AgentRuntime::step_with_observer with
an AgentAuditObserver so tool calls/results are published to
audit.<tenant>.agent.<event>. When None, execute uses
AgentRuntime::step directly (no observer, no behaviour change).
project_id is the deployed unit’s bundle_id (None on the
legacy tenant-only path); it becomes the project_id billing
dimension of every step this handler runs.
Trait Implementations§
Source§impl AgentNodeHandler for RuntimeAgentNodeHandler
impl AgentNodeHandler for RuntimeAgentNodeHandler
Source§fn execute<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
tenant_id: &'life1 str,
env_id: &'life2 str,
agent_id: &'life3 str,
session_id: &'life4 str,
flow_input: &'life5 Value,
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
RuntimeAgentNodeHandler: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
tenant_id: &'life1 str,
env_id: &'life2 str,
agent_id: &'life3 str,
session_id: &'life4 str,
flow_input: &'life5 Value,
) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
RuntimeAgentNodeHandler: 'async_trait,
flow_input is the upstream node’s
JSON payload (expects at least {"user_text": "..."}); returns
the node output JSON ({"reply", "trail", "terminated_by"}).Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeAgentNodeHandler
impl !UnwindSafe for RuntimeAgentNodeHandler
impl Freeze for RuntimeAgentNodeHandler
impl Send for RuntimeAgentNodeHandler
impl Sync for RuntimeAgentNodeHandler
impl Unpin for RuntimeAgentNodeHandler
impl UnsafeUnpin for RuntimeAgentNodeHandler
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request