/* ┌──────────────────────────────────────────────────────────────────────────────┐ │ @author: Davidson Gomes │ │ @file: /app/documentation/components/DocumentationSection.tsx │ │ Developed by: Davidson Gomes │ │ Creation date: May 13, 2025 │ │ Contact: contato@evolution-api.com │ ├──────────────────────────────────────────────────────────────────────────────┤ │ @copyright © Evolution API 2025. All rights reserved. │ │ Licensed under the Apache License, Version 2.0 │ │ │ │ You may not use this file except in compliance with the License. │ │ You may obtain a copy of the License at │ │ │ │ http://www.apache.org/licenses/LICENSE-2.0 │ │ │ │ Unless required by applicable law or agreed to in writing, software │ │ distributed under the License is distributed on an "AS IS" BASIS, │ │ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. │ │ See the License for the specific language governing permissions and │ │ limitations under the License. │ ├──────────────────────────────────────────────────────────────────────────────┤ │ @important │ │ For any future changes to the code in this file, it is recommended to │ │ include, together with the modification, the information of the developer │ │ who changed it and the date of modification. │ └──────────────────────────────────────────────────────────────────────────────┘ */ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { ClipboardCopy, Info, ExternalLink, Users, Shield, Zap, Network, FileText, MessageSquare, Settings, AlertCircle, CheckCircle2, Globe } from "lucide-react"; import { CodeBlock } from "@/app/documentation/components/CodeBlock"; interface DocumentationSectionProps { copyToClipboard: (text: string) => void; } export function DocumentationSection({ copyToClipboard }: DocumentationSectionProps) { const quickStartExample = { jsonrpc: "2.0", id: "req-001", method: "message/send", params: { message: { role: "user", parts: [ { type: "text", text: "Hello! Can you help me analyze this data?" } ], messageId: "6dbc13b5-bd57-4c2b-b503-24e381b6c8d6" } } }; const streamingExample = { jsonrpc: "2.0", id: "req-002", method: "message/stream", params: { message: { role: "user", parts: [ { type: "text", text: "Generate a detailed report on market trends" } ], messageId: "f47ac10b-58cc-4372-a567-0e02b2c3d479" } } }; const fileUploadExample = { jsonrpc: "2.0", id: "req-003", method: "message/send", params: { message: { role: "user", parts: [ { type: "text", text: "Analyze this image and highlight any faces." }, { type: "file", file: { name: "input_image.png", mimeType: "image/png", bytes: "iVBORw0KGgoAAAANSUhEUgAAAAUA..." } } ], messageId: "8f0dc03c-4c65-4a14-9b56-7e8b9f2d1a3c" } } }; return (
{/* Hero Section */}
Agent2Agent Protocol
The Standard for AI Agent Communication

A2A is Google's open protocol enabling seamless communication and interoperability between AI agents across different platforms, providers, and architectures.

Official Specification GitHub Repository
{/* Key Features */} Key Features & Capabilities

Multi-turn Conversations

Support for complex, contextual dialogues between agents

File Exchange

Upload and download files with proper MIME type handling

Real-time Streaming

Server-Sent Events for live response streaming

Task Management

Track, query, and cancel long-running tasks

Enterprise Security

Bearer tokens, API keys, and HTTPS enforcement

Agent Discovery

Standardized agent cards for capability discovery

{/* Protocol Methods */} Protocol Methods

A2A supports multiple RPC methods for different interaction patterns

Messaging Task Management Discovery
message/send

Standard HTTP Request

Send a message and receive a complete response after processing is finished.

  • • Single request/response cycle
  • • Best for simple queries
  • • Lower complexity implementation
  • • Synchronous operation
message/stream

Real-time Streaming

Receive partial responses in real-time via Server-Sent Events.

  • • Progressive response delivery
  • • Better UX for long tasks
  • • Live status updates
  • • Asynchronous operation
tasks/get

Query Task Status

Check the status, progress, and results of a specific task.

  • • Real-time status checking
  • • Progress monitoring
  • • Result retrieval
  • • Error diagnosis
tasks/cancel

Cancel Task

Terminate a running task before completion.

  • • Graceful task termination
  • • Resource cleanup
  • • Cost optimization
  • • User control
agent/authenticatedExtendedCard

Agent Discovery

Retrieve detailed information about agent capabilities, skills, and requirements.

  • • Agent capability discovery
  • • Skill and tool enumeration
  • • Authentication requirements
  • • API version compatibility
{/* Code Examples */} Quick Start Examples

Ready-to-use JSON-RPC examples based on the official A2A specification

Basic Message Streaming File Upload

Key Points:

  • • Uses message/send for standard HTTP requests
  • messageId must be a valid UUID v4
  • • Response contains task ID, status, and artifacts

Streaming Features:

  • • Real-time Server-Sent Events (SSE)
  • • Progressive content delivery
  • • Status updates: submitted → working → completed

File Handling:

  • • Support for multiple file types (images, documents, etc.)
  • • Base64 encoding for binary data
  • • Proper MIME type specification
{/* Security & Best Practices */} Security & Best Practices

Authentication Methods

x-api-key Recommended

Custom header for API key authentication

Authorization: Bearer Standard

OAuth 2.0 Bearer token authentication

Security Requirements

HTTPS/TLS encryption required
Input validation on all parameters
Rate limiting and resource controls
Proper CORS configuration

Important:

Always obtain API credentials out-of-band. Never include sensitive authentication data in client-side code or version control systems.

{/* A2A vs MCP */} A2A vs Model Context Protocol (MCP)
Aspect Agent2Agent (A2A) Model Context Protocol (MCP)
Purpose Agent-to-agent communication Model-to-tool/resource integration
Use Case AI agents collaborating as peers AI models accessing external capabilities
Relationship Partner/delegate work Use specific capabilities
Integration ✓ Can use MCP internally ✓ Complements A2A

Working Together: An A2A client agent might request an A2A server agent to perform a complex task. The server agent, in turn, might use MCP to interact with tools, APIs, or data sources necessary to fulfill the A2A task.

); }