ReqManagedAgents.Event (ReqManagedAgents v0.1.0)

Copy Markdown View Source

Outbound event builders and inbound event classification for Managed Agents.

Events are plain JSON maps with string keys (the wire shape). Builders produce events to POST to /v1/sessions/{id}/events; classify/1 reduces an inbound event to a terminal/flow atom for loop control.

Summary

Functions

Classify an inbound event into a flow-control atom.

Build a user.custom_tool_result event. Pass is_error: true for failures.

Build a user.tool_confirmation event (:allow or :deny).

Build a user.message text event.

Types

event()

@type event() :: %{required(String.t()) => term()}

terminal()

@type terminal() ::
  :end_turn
  | :requires_action
  | :retries_exhausted
  | :terminated
  | :error
  | :unknown_idle
  | :other

Functions

classify(arg1)

@spec classify(event()) :: terminal()

Classify an inbound event into a flow-control atom.

custom_tool_result(custom_tool_use_id, text, opts \\ [])

@spec custom_tool_result(String.t(), String.t(), keyword()) :: event()

Build a user.custom_tool_result event. Pass is_error: true for failures.

tool_confirmation(tool_use_id, decision)

@spec tool_confirmation(String.t(), :allow | :deny) :: event()

Build a user.tool_confirmation event (:allow or :deny).

user_message(text)

@spec user_message(String.t()) :: event()

Build a user.message text event.