Skip to main content

Crate aw_event_bridge

Crate aw_event_bridge 

Source
Expand description

Event bridge: consume greentic.agentic.request.v1 from NATS, invoke the local agentic-worker runtime via the AgentDispatchInvoker seam, and publish greentic.agentic.response.v1 echoing the correlation id.

This is the agentic-side counterpart of the runner’s agentic.call flow node (out-of-process path, “Option C”): the runner publishes a dispatch request; this bridge runs one agentic step and publishes the reply.

Unlike sorx-event-bridge, this crate lives inside the runner workspace and pins the same greentic-types lineage as the runner, so the wire contract is SHARED from greentic_types::runtime_dispatch rather than mirrored by hand.

Re-exports§

pub use jetstream::run_bridge_jetstream;

Modules§

jetstream
JetStream durability for the agentic dispatch consumer: a greentic-agentic stream binds greentic.agentic.request.v1; a durable pull consumer agentic-workers (explicit ack) lets aw-serve replicas share the queue and lets KEDA scale on consumer lag.

Structs§

InvokeOutcome
Result of invoking the local agentic-worker runtime for one dispatch.

Constants§

RUNTIME_NAME
Runtime name for the agentic worker; selects the request/response subjects greentic.agentic.request.v1 / greentic.agentic.response.v1.

Traits§

AgentDispatchInvoker
Seam over the actual agentic-worker invocation. The production impl wraps greentic_aw_runtime::AgentRuntime; tests use a stub.

Functions§

build_response
Invoke and build the response (no NATS I/O). Errors map to an error response.
handle_message
Handle one request message end-to-end: decode, invoke, publish response.
request_topic
Request topic/subject for a runtime, e.g. greentic.sorla.request.v1.
response_topic
Response topic/subject for a runtime, e.g. greentic.sorla.response.v1.
run_bridge
Subscribe to greentic.agentic.request.v1 and serve forever (one spawned task per message).