Skip to content

A2A

Keep task state, artifacts and authentication requirements alongside conversation messages.

Load a native task

Install @a2a-js/sdk@1.3.0; this recipe targets A2A v1. Create an authenticated native Client through ClientFactory and the agent card for your server. Keep agent discovery, trust and credentials in your application. Follow Ghost view setup.

a2a-task.tsx
a2a-send.ts

The native response distinguishes a message from a task. Project messages with normalizeA2aMessages and tasks with normalizeA2aTask. Use the native sendMessageStream or task subscription API for live task updates; apply its task/status/artifact events in the native application task store, then pass the next snapshot to this view.

A transcript is only one view of a task

normalizeA2aTask keeps task ID, context ID, status and artifacts in a2a-task data. input_required and auth_required need application flows; neither means a pending boolean tool approval. Artifacts can contain structured data or files independently of a message. Validate and render them with MessageParts.renderers.data, or show an application artifact panel beside the transcript.

The normalizer accepts protobuf v1 oneof parts/enums and their JSON representation. Native message IDs and ordered history survive projection. A2A v0.3 uses the SDK's separate compatibility entry; do not treat those shapes as v1.

Troubleshooting

A visible data notice can be an unrendered task/artifact, not a lost answer. Retain task IDs for cancellation/resubscription and context IDs for follow-up messages. Task cancellation is a request to the remote agent, not a guaranteed local status transition. See A2A specification and the SDK for streaming, discovery and authentication.