Skip to content

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 agent
  • response: Response to a request
  • event: Broadcast an event
  • error: Error notification
  • heartbeat: Connection health check