A2AClientWrapper
Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/modules/a2a/A2AClientWrapper.ts:61
Wrapper around the A2A SDK client for communicating with external agents.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new A2AClientWrapper(
config):A2AClientWrapper
Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/modules/a2a/A2AClientWrapper.ts:65
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”A2AClientWrapper
Methods
Section titled “Methods”sendMessage()
Section titled “sendMessage()”sendMessage(
messageText):Promise<string>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/modules/a2a/A2AClientWrapper.ts:98
Sends a message to the A2A agent and returns the response.
Parameters
Section titled “Parameters”messageText
Section titled “messageText”string
The message to send to the agent
Returns
Section titled “Returns”Promise<string>
The agent’s response as a string
sendMessageWithContext()
Section titled “sendMessageWithContext()”sendMessageWithContext(
messageText,context?):Promise<A2AMessageResult>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/modules/a2a/A2AClientWrapper.ts:135
BATCH-14 — send one message and return its text ALONG WITH the A2A contextId/taskId needed to
thread a multi-turn conversation. Reads the real @a2a-js/sdk result shapes rather than a
loose envelope:
- A Message result carries its text in
partsandcontextId/taskIddirectly (both optional, and empty-string when absent in the v1.0 proto model). - A Task result — what Google ADK agents commonly return — carries text in
status.message.parts(falling back to the last artifact’s parts),contextId(required), and the taskId asTask.id.
context.contextId/taskId are attached to the OUTGOING message only when defined, so a
first-turn send stays byte-identical to a contextless one.
Parameters
Section titled “Parameters”messageText
Section titled “messageText”string
The message to send to the agent.
context?
Section titled “context?”Optional context/task ids to continue an existing conversation.
Returns
Section titled “Returns”Promise<A2AMessageResult>
The agent’s text answer plus the context/task ids from its response.