gskinnerteam/flutter-hatcha-app/genui-a2a
Claude Code and agent skill by gskinnerteam/flutter-hatcha-app
- community
Checking that the SKILL.md file is still in the repository.
Integration package connecting genui to A2A servers via the A2UI Streaming UI Protocol. Use when: working with A2uiAgentConnector, A2AClient, Transport, SseTransport, A2A protocol events, agent cards, task/context IDs, sending UI events to server, streaming A2UI messages over SSE, or configuring the A2A connection layer.
Install
npx vskill@latest install gskinnerteam/flutter-hatcha-app/genui-a2aSKILL.md
genui_a2a Package — API Reference
The genui_a2a package (v0.9.0, renamed from genui_a2ui at v0.8.0) connects the genui framework to A2A (Agent-to-Agent) servers via the A2UI Streaming UI Protocol. It provides A2uiAgentConnector — a Transport implementation that communicates over SSE with an A2A server, receives A2UI messages, and feeds them into genui's rendering pipeline.
When to Use
- Connecting a Flutter app to an A2A server endpoint
- Configuring
A2uiAgentConnectoras the transport forConversation - Handling A2A streaming events (status updates, artifacts)
- Managing
taskId/contextIdfor stateful conversations - Sending user interaction events back to the server
- Fetching agent cards for capability discovery
- Working with SSE or HTTP transports
Architecture — Data Flow
A2uiAgentConnector
Manages the A2A protocol: SSE connection, message conversion, A2UI message extraction, and event sending.
Constructor
v0.9 change: Must provide exactly one ofurlorclient. Providing both or neither throws.
Key Members
| Member | Type | Purpose | |
|---|---|---|---|
client | A2AClient | Underlying A2A client | |
stream | Stream<A2uiMessage> | Parsed A2UI messages extracted from A2A DataParts | |
errorStream | Stream<Object> | Errors from A2A connection | |
taskId | String? | Current task ID (set by server responses) | |
contextId | String? | Current context ID (set by server responses) |
Key Methods
| Method | Signature | Purpose | |
|---|---|---|---|
connectAndSend | Future<String?> connectAndSend(ChatMessage, {clientCapabilities?, clientDataModel?, cancellationSignal?}) | Convert message → A2A, stream, extract A2UI | |
sendEvent | Future<void> sendEvent(Map<String, Object?> event) | Send user interaction event (requires taskId) | |
getAgentCard | Future<AgentCard> getAgentCard() | Fetch agent metadata | |
dispose | void dispose() | Close streams |
connectAndSend Parameters (v0.9)
| Parameter | Type | Purpose | |
|---|---|---|---|
clientCapabilities | A2UiClientCapabilities? | Widget catalog capabilities for the agent | |
clientDataModel | Map<String, Object?>? | Current client data model state | |
cancellationSignal | CancellationSignal? | Signal to cancel in-flight request |
Message Conversion Flow (connectAndSend)
- Extracts
partsfromChatMessage(text →TextPart, image →FilePart, data →DataPart) - Attaches
referenceTaskIdsandcontextIdif available - Attaches
clientCapabilitiesandclientDataModelin message metadata - Streams
Events from server; for eachStatusUpdate/TaskStatusUpdate:
- Updates
taskIdandcontextId - Extracts
DataParts containing A2UI JSON - Parses via
A2uiMessage.fromJson()and emits onstream
- Returns final text response (if any
TextPartin last message)
Event Sending (sendEvent)
Wraps interaction data in a DataPart with key a2uiEvent:
A2uiTransportAdapter
Wraps A2uiAgentConnector as a Transport (the genui interface). Used to connect the connector to Conversation.
This class implements Transport from genui and delegates to the connector's connectAndSend.
A2AClient
JSON-RPC 2.0 client for the A2A protocol. Re-exported from the a2a_sdk package.
Constructor
Static Factory
Fetches the agent card, selects the best transport (SSE if streaming supported), returns configured client.
Key Methods
| Method | Signature | Purpose | |
|---|---|---|---|
getAgentCard() | Future<AgentCard> | Fetch agent card | |
messageStream(message) | Stream<Event> | Send message, receive streaming events | |
messageSend(message) | Future<Task> | Send message, receive single response |
Transport (Interface)
Communication between A2AClient and an A2A server.
Implementations
| Transport | Purpose | |
|---|---|---|
SseTransport | SSE-based streaming (default). Accepts authHeaders including X-A2A-Extensions. | |
HttpTransport | Simple HTTP request/response. Used as fallback when streaming not supported. |
A2A Protocol Models (Freezed)
Event (Sealed)
Message
Part Types
| Type | Factory | Key Fields | |
|---|---|---|---|
TextPart | Part.text(text:) | text | |
DataPart | Part.data(data:) | data: Map<String, Object?> | |
FilePart | Part.file(file:) | file: FileType (.uri() or .bytes()) |
TaskState
AgentCard
Agent metadata fetched from /.well-known/agent-card.json. Contains name, description, URL, capabilities (streaming, push notifications), supported extensions, security schemes.
Error Handling
A2AException (Freezed)
| Factory | Code | Purpose | |
|---|---|---|---|
taskNotFound | -32001 | Task ID not found on server | |
taskNotCancelable | -32002 | Task cannot be canceled | |
pushNotificationNotSupported | -32006 | Push notifications not available | |
pushNotificationConfigNotFound | -32007 | Push notification config missing | |
jsonRpc | Custom | Generic JSON-RPC error | |
http | — | HTTP transport failure (non-2xx) | |
network | — | Connection / network error | |
parsing | — | Malformed server response | |
unsupportedOperation | — | Operation not supported |
Usage Pattern
Migration from genui_a2ui (v0.7)
| Old (v0.7) | New (v0.9) | |
|---|---|---|
import 'package:genui_a2ui/...' | import 'package:genui_a2a/...' | |
A2uiContentGenerator | Use A2uiAgentConnector + A2uiTransportAdapter | |
A2uiAgentConnector(url: ..., client: ...) | Provide exactly ONE of url or client | |
connectAndSend(msg, {clientCapabilities?}) | + clientDataModel, cancellationSignal | |
GenUiConversation | Conversation | |
A2uiMessageProcessor | SurfaceController |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/genui-a2a/SKILL.md
Popularity
- Repository stars
- 66
- Repository forks
- 7
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/gskinnerteam/flutter-hatcha-app/genui-a2a)