a2a
Installation
bun add @regent/a2aBasic Usage
import { createAgent } from '@regent/core';
import { http } from '@regent/http';
import { a2a } from '@regent/a2a';
const agent = await createAgent({
name: 'my-agent',
version: '1.0.0',
})
.use(http())
.use(a2a())
.build();
// Build this agent's card
const card = agent.a2a.buildCard('https://my-agent.example.com');
// Fetch another agent's card
const otherCard = await agent.a2a.fetchCard('https://other-agent.example.com');
// Invoke another agent
const result = await agent.a2a.client.invoke(otherCard, 'echo', { text: 'hello' });API Reference
a2a()
A2ARuntime
Agent Cards
Building Cards
Fetching Cards
AgentCard Structure
Card Utilities
A2A Client
Direct Invocation
invoke()
stream()
fetchAndInvoke()
Task-Based Operations
Sending Messages
Getting Task Status
Subscribing to Updates
Listing Tasks
Cancelling Tasks
Waiting for Tasks
Multi-Turn Conversations
A2AClient Interface
Types
InvokeAgentResult
SendMessageResponse
Task
ListTasksRequest
ListTasksResponse
Exports
Last updated