Getting Started
Installation
bash
npm install agent-spec-client
Basic Usage
javascript
import { AgentSpecClient } from 'agent-spec-client';
const client = new AgentSpecClient({
agentId: 'my-agent',
endpoint: 'https://agents.example.com'
});
// Send a message
await client.send({
type: 'request',
action: 'process_data',
payload: {
data: 'Hello, World!'
}
});
Message Types
agent-spec supports several message types:
request
: Request an action from another agentresponse
: Response to a requestevent
: Broadcast an eventerror
: Error notificationheartbeat
: Connection health check