An agent that answers in a single body and sends nothing out of band.
Every public name.
Every public type, function and constant, grouped by package. Generated from pkg.generated.mbti and the sources' own documentation comments, so it says what the code says.
@moona2a
Types
AgentCapabilities
structWhat optional parts of the protocol an agent does (A2A AgentCapabilities).
- streaming : Bool
- push_notifications : Bool
- extended_agent_card : Bool
- extensions : Array[AgentExtension]
An agent that streams, sends push notifications and serves no extended card.
Structural equality from Eq.
The negation of equal, from Eq.
AgentCard
structAn agent's self-description, the document a caller reads before talking to it (A2A AgentCard).
- name : String
- description : String
- supported_interfaces : Array[AgentInterface]
- provider : AgentProvider?
- version : String
- documentation_url : String?
- capabilities : AgentCapabilities
- security_schemes : @json.Json?
- security_requirements : @json.Json?
- default_input_modes : Array[String]
- default_output_modes : Array[String]
- skills : Array[AgentSkill]
- signatures : @json.Json?
- icon_url : String?
A card with no provider, no security and no signatures, serving text in and out.
The same card advertising capabilities.
The media types the card offers to take, from its defaults and its skills together.
The interface a client should try first, which is the one the card lists first.
Structural equality from Eq.
The negation of equal, from Eq.
AgentExtension
structA protocol extension an agent speaks (A2A AgentExtension).
- uri : String
- description : String?
- required : Bool
- params : @json.Json?
Structural equality from Eq.
The negation of equal, from Eq.
AgentInterface
structOne address an agent answers on (A2A AgentInterface).
- url : String
- protocol_binding : String
- protocol_version : String
- tenant : String?
An interface speaking JSON-RPC at url.
Structural equality from Eq.
The negation of equal, from Eq.
AgentProvider
structThe provider of an agent (A2A AgentProvider).
- organization : String
- url : String
Structural equality from Eq.
The negation of equal, from Eq.
AgentSkill
structOne thing an agent is good at (A2A AgentSkill).
- id : String
- name : String
- description : String
- tags : Array[String]
- examples : Array[String]
- input_modes : Array[String]
- output_modes : Array[String]
A skill named and described, tagged with tags, with no examples or modes of its own.
Structural equality from Eq.
The negation of equal, from Eq.
Artifact
structAn output a task produced (A2A Artifact).
- artifact_id : String
- name : String?
- description : String?
- parts : Array[Part]
- extensions : Array[String]?
- metadata : @json.Json?
An artifact carrying parts under artifact_id.
The same artifact under name.
An artifact carrying one text part.
The text of every text part, in order and with nothing added: a part is content, so joining must not invent characters between them.
Structural equality from Eq.
The negation of equal, from Eq.
AuthenticationInfo
structHow the agent proves itself to the caller's webhook (A2A AuthenticationInfo).
- scheme : String
- credentials : String?
A bearer token the agent sends with each notification.
Structural equality from Eq.
The negation of equal, from Eq.
CallableExecutor
struct- run : async (RequestContext, &EventSink) -> Unit
- stop : async (String) -> Unit
An executor that works requests with run and stops tasks with stop.
Client
struct- transport : &Transport
- mut next : Int64
A client talking to the agent behind transport.
Collected
struct- taken : Array[StreamEvent]
An empty collection.
The events the sink took, in the order they happened.
The message the agent answered with directly, when the run produced one instead of a task.
Discard
structListTasksQuery
structThe filters a list request carries (A2A ListTasksRequest).
- context_id : String?
- state : TaskState?
- page_size : Int32?
- page_token : String?
- history_length : Int32?
- status_timestamp_after : String?
- include_artifacts : Bool
- tenant : String?
No filter at all: every task the caller may see.
The same query, limited to one conversation.
Structural equality from Eq.
The negation of equal, from Eq.
MemoryStore
struct- tasks : Map[String, Task]
- mut order : Array[String]
- capacity : Int32
An empty store holding up to capacity tasks.
Message
structOne turn of a conversation between a client and an agent (A2A Message).
- message_id : String
- role : Role
- parts : Array[Part]
- context_id : String?
- task_id : String?
- reference_task_ids : Array[String]?
- extensions : Array[String]?
- metadata : @json.Json?
A message from role carrying parts.
A message from the agent, carrying one text part.
The same message, continuing the task and context given.
The text of every text part, in order and with nothing added: a part is content, so joining must not invent characters between them.
A message from the client, carrying one text part.
Structural equality from Eq.
The negation of equal, from Eq.
Method
enumEvery method of the JSON-RPC binding.
- SendMessage
- SendStreamingMessage
- GetTask
- ListTasks
- CancelTask
- SubscribeToTask
- CreatePushConfig
- GetPushConfig
- ListPushConfigs
- DeletePushConfig
- GetExtendedCard
The method that goes by name, when it is one of the protocol's.
The name the method goes by on the wire: PascalCase, as section 9.1 requires.
Whether the answer to this method is a stream of events rather than a single body.
Structural equality from Eq.
The negation of equal, from Eq.
Part
structOne piece of a message or an artifact (A2A Part).
- content : PartContent
- metadata : @json.Json?
A part carrying bytes inline.
A part carrying a structured JSON value.
The media type this part declares, when it declares one.
A text part.
The text this part carries, when it is a text part.
A part pointing at content by URL.
The same part with metadata attached.
Structural equality from Eq.
The negation of equal, from Eq.
PartContent
enumWhat a part carries (A2A Part.content oneof).
- Text(String)
- Raw(bytes~ : Bytes, filename~ : String?, media_type~ : String?)
- Url(url~ : String, filename~ : String?, media_type~ : String?)
- Data(@json.Json)
Structural equality from Eq.
The negation of equal, from Eq.
PushConfigPage
structOne page of a task's registrations (A2A ListTaskPushNotificationConfigsResponse).
- configs : Array[TaskPushConfig]
- next_page_token : String
Structural equality from Eq.
The negation of equal, from Eq.
RequestContext
structWhat an executor is given when it is asked to work a request: the message, the ids it belongs to, and the task as it stands when the message continues one.
- message : Message
- task_id : String
- context_id : String
- task : Task?
The event that hands this request's caller artifact, or more of one.
A message this request's caller receives outside the task. An executor that says only this answers with a message instead of opening a task.
The event that moves this request's task to state.
Role
enumThe sender of a message (A2A Role).
- Unspecified
- User
- Agent
The role named by its wire form. Both the proto name and the bare word are read, because clients written against earlier drafts send the bare word.
The wire name of the role, as ProtoJSON writes an enum.
Structural equality from Eq.
The negation of equal, from Eq.
SendMessageConfig
structHow a send request should be handled: whether to wait, how much history to bring back, and what the caller is willing to receive.
- return_immediately : Bool
- history_length : Int32?
- accepted_output_modes : Array[String]
- push : TaskPushConfig?
The same configuration, bringing back at most history_length messages.
The same configuration, returning before the task finishes.
The same configuration, registering push for the task it creates.
Wait for the task to finish, and bring back its whole history.
Structural equality from Eq.
The negation of equal, from Eq.
SendMessageRequest
structEverything a send request carries (A2A SendMessageRequest).
- message : Message
- configuration : SendMessageConfig?
- metadata : @json.Json?
- tenant : String?
A request to send message with nothing else set.
Structural equality from Eq.
The negation of equal, from Eq.
Server
struct- state : ServerState
A server for executor and card, keeping tasks in its own memory and sending no notifications.
Let the server start runs in group when a caller asks not to wait. A run started this way outlives the request that asked for it, and stops when the group does.
The card this server publishes.
The public card as the well-known document serves it.
A server over the given store, notifier and configuration.
The same server, sending its push notifications through notifier.
The same server, keeping its tasks in store and sending notifications through notifier.
The same server under config.
The same server, handing an authenticated caller card instead of the public one.
ServerConfig
structThe defaults a server runs with.
- history_limit : Int32
- page_size : Int32
- max_page_size : Int32
- refuse_unknown_media : Bool
A server that brings back the whole history, 50 tasks to a page, and no more than 100.
StreamEvent
enumOne item of a streamed response (A2A StreamResponse.payload oneof).
- TaskSnapshot(Task)
- TaskMessage(Message)
- StatusChange(TaskStatusUpdate)
- ArtifactChunk(TaskArtifactUpdate)
Whether the event ends the task for good.
The state this event reports, when it reports one.
The task this event belongs to, when it belongs to one.
Structural equality from Eq.
The negation of equal, from Eq.
Task
structA unit of work an agent runs on a caller's behalf (A2A Task).
- id : String
- context_id : String
- status : TaskStatus
- artifacts : Array[Artifact]
- history : Array[Message]
- metadata : @json.Json?
A new task in context_id, submitted and not yet worked on.
The artifact with artifact_id, when the task has one.
The task as the wire wants it, cut down to view.
The most recent limit messages of the history; all of them when limit is unset.
The same task with message appended to its history.
The same task with artifact added, or with the parts of an existing artifact of the same id replaced or appended to.
The same task in state, with the clock stamped.
Structural equality from Eq.
The negation of equal, from Eq.
TaskArtifactUpdate
structAn artifact was produced, or more of it arrived (A2A TaskArtifactUpdateEvent).
- task_id : String
- context_id : String
- artifact : Artifact
- append : Bool
- last_chunk : Bool
- metadata : @json.Json?
An artifact update event carrying artifact for the task with task_id.
Structural equality from Eq.
The negation of equal, from Eq.
TaskLog
struct- events : Array[StreamEvent]
- mut open : Bool
An empty log for a task that has not finished.
TaskPage
structOne page of tasks (A2A ListTasksResponse).
- tasks : Array[Task]
- next_page_token : String
- page_size : Int32
- total_size : Int32
Structural equality from Eq.
The negation of equal, from Eq.
TaskPushConfig
structWhere the agent posts a task's updates, and how it authenticates there (A2A TaskPushNotificationConfig).
- id : String
- task_id : String
- url : String
- token : String?
- authentication : AuthenticationInfo?
- tenant : String?
A registration of url for task_id, under id.
The same registration, authenticating with authentication.
The same registration, carrying the caller's own token in each notification's headers.
Structural equality from Eq.
The negation of equal, from Eq.
TaskState
enumThe lifecycle state of a task (A2A TaskState).
- Unspecified
- Submitted
- Working
- Completed
- Failed
- Canceled
- InputRequired
- Rejected
- AuthRequired
The state named by its wire form. The proto name, the bare word and the hyphenated draft name are all read: a client written against an earlier draft sends input-required.
Whether the task is waiting on the caller and processing can resume from here.
Whether the task has finished for good: no further message, cancel or transition can apply.
The wire name of the state, as ProtoJSON writes an enum.
Structural equality from Eq.
The negation of equal, from Eq.
TaskStatus
structThe state of a task, with the message and time that go with it (A2A TaskStatus).
- state : TaskState
- message : Message?
- timestamp : String?
A status with no message and no timestamp.
The status of state, recorded now.
Structural equality from Eq.
The negation of equal, from Eq.
TaskStatusUpdate
structA task changed state (A2A TaskStatusUpdateEvent).
- task_id : String
- context_id : String
- status : TaskStatus
- metadata : @json.Json?
A status update event for the task with task_id, moving it to state.
Structural equality from Eq.
The negation of equal, from Eq.
View
structHow much of a task a reply carries: whether its artifacts travel with it, and how many of the most recent messages do. None history means all of them.
- artifacts : Bool
- history : Int32?
The task alone, without what it produced.
Everything the task has.
Structural equality from Eq.
The negation of equal, from Eq.
Errors
Refused
suberrorA refused operation, named as the specification names it. The string is the server's own note on what the caller did, empty when the name says everything.
- TaskNotFound(String)
- TaskNotCancelable(String)
- PushNotificationNotSupported(String)
- UnsupportedOperation(String)
- ContentTypeNotSupported(String)
- InvalidAgentResponse(String)
- ExtendedAgentCardNotConfigured(String)
- ExtensionSupportRequired(String)
- VersionNotSupported(String)
- InvalidRequest(String)
- InvalidParams(String)
Functions
Whether name is one of the methods whose answer is a stream, for a transport that has to decide before reading the whole request.
The method this request asks for, so a transport can decide whether its answer is a stream before reading the whole body.
The current instant as an ISO 8601 timestamp in UTC, e.g. 2026-11-06T02:02:55.123Z.
Millisecond precision is what the specification asks for and all @env.now offers on every backend; a timestamp that is a few milliseconds coarse still orders correctly.
Constants
Where the card is served (section 8.2).
How many tasks an in-memory store keeps before it starts forgetting the ones that finished. 1024 is enough for a session's worth of work and small enough that a forgotten task cannot grow without bound.
How long a follower waits between looks at the log it is watching.
The log is the ordering guarantee, not the wake-up: a follower reads forward from its own cursor, so it sees every event once, in order, whether it woke on the first tick or the fifth. 25 milliseconds is short enough that a stream feels live and long enough that an idle subscription costs nothing worth measuring.
The protocol version this library speaks, as a client writes it in A2A-Version.
@asgi
Types
Options
structWhere the endpoint answers, and how long a client may cache the card.
- rpc_path : String
- card_path : String
- cache_seconds : Int32
The endpoint at /, the card at its well-known address, and a card a client may keep for five minutes.
Functions
The ASGI application for server: a GET of the card's well-known address answers with the card, a POST of a JSON-RPC body answers with a body or, for a streaming method, with a stream of server-sent events.
The application writes its events as it goes, rather than assembling one Response: a stream answer is only worth having if each event leaves as it happens.
@fetch
Types
HttpTransport
structThe JSON-RPC endpoint of one agent, reached over HTTP.
- client : @moonfetch.Client
- path : String
- card_path : String
A transport to the agent at url, e.g. https://agent.example.com, answering JSON-RPC on the root path and serving its card at the well-known one.
Webhook
structA notifier that posts to whatever URL a registration names.
Errors
Unreachable
suberror- Unreachable(String)
WrongShape
suberror- WrongShape(String)
Functions
The headers a delivery goes out under: the payload type, the registration's token, and the credentials it names. Separate from the send so the part a caller cares about can be read without a webhook to read it from.
Constants
How the token in a registration travels, when the caller set one. The specification names the field but not the header, so this is the name the rest of the ecosystem uses.
How long to wait for the caller's webhook before giving up on this delivery. Section 4.3.3 suggests ten to thirty seconds; ten keeps a slow webhook from holding a task's run.