Request-scoped runtime event streaming helpers.
The stream transport is intentionally narrow: callers can provide a pid sink and receive canonical runtime events for one request.
Summary
Functions
Creates a synthetic terminal cancellation event.
Builds an enumerable over runtime events for a request handle.
Creates a synthetic terminal failure event for non-worker rejection paths.
Returns the mailbox tag used for request stream messages.
Normalizes public stream sink options.
Sends one runtime event to a normalized stream sink.
Returns true when the event kind terminates a request stream.
Types
@type sink() :: {:pid, pid()}
Functions
@spec cancelled_event(String.t(), term(), keyword()) :: Jido.AI.Runtime.Event.t()
Creates a synthetic terminal cancellation event.
@spec events(Jido.AI.Request.Handle.t(), keyword()) :: Enumerable.t()
Builds an enumerable over runtime events for a request handle.
The enumerable halts after receiving :request_completed,
:request_failed, or :request_cancelled.
ReAct worker events retain runtime order. The final runtime checkpoint is
delivered before the terminal event, while the request sink is still active.
Synthetic rejection and caller cancellation events use seq: 0 and can stop
a request before its worker finishes.
@spec failed_event(String.t(), term(), keyword()) :: Jido.AI.Runtime.Event.t()
Creates a synthetic terminal failure event for non-worker rejection paths.
@spec message_tag() :: atom()
Returns the mailbox tag used for request stream messages.
Normalizes public stream sink options.
@spec send_event(sink() | nil, Jido.AI.Runtime.Event.t() | map()) :: :ok
Sends one runtime event to a normalized stream sink.
Returns true when the event kind terminates a request stream.