Skip to main content

Types

All core types are immutable Java records. Required fields are null-checked in the constructor. List fields are copied into unmodifiable lists, and a null list becomes an empty one.

RunAgentInput

com.agui.community.core.agent.RunAgentInput is the payload an agent receives for a single run.
Convenience constructors:
state and forwardedProps are typed as Object because they hold arbitrary JSON. With JacksonSerializer they deserialize to Map, List, String, Number, Boolean or null.

Context

Messages

com.agui.community.core.message.Message is a sealed interface. Every message has an id(), a role() and content(). Each record has short constructors that skip the optional fields:
Because the interface is sealed, a switch over a Message can be exhaustive. This needs Java 21 or later:
ReasoningMessage.encryptedValue holds an encrypted chain-of-thought blob from providers that don’t expose reasoning in plain text. Keep it when you send the history back to the agent so that the reasoning survives the round trip.

Role

Role is an enum with the constants DEVELOPER, SYSTEM, ASSISTANT, USER, TOOL and REASONING. role.value() returns the wire value ("assistant"), and Role.fromValue("assistant") converts back.

ToolCall and FunctionCall

Tools

com.agui.community.core.tool.Tool describes a tool the agent may call. The front end supplies tools on RunAgentInput.tools.
ToolParameters is a JSON Schema object. type defaults to "object", and each value in properties is a JSON Schema fragment:
When the agent calls a tool, it emits TOOL_CALL_START / TOOL_CALL_ARGS / TOOL_CALL_END events. The front end runs the tool and sends the result back as a ToolMessage on the next run.

Interrupts

com.agui.community.core.interrupt models human-in-the-loop interrupts. A run can finish in a paused state. The client then answers the open interrupts on the next run.

RunOutcome

RunFinishedEvent.outcome() is a sealed RunOutcome: A null outcome means the run completed normally. Runs from before interrupts were added have no outcome.

Resume

The client answers interrupts with Resume entries on the next RunAgentInput:
ResumeStatus is either RESOLVED (the payload carries the user’s answer) or CANCELLED. Example: an agent that pauses for confirmation, and a client that detects the pause: