npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

a2a-sdk-google

v0.2.0

Published

JavaScript/TypeScript SDK for Google's A2A Protocol

Readme

A2A SDK for JavaScript/TypeScript

Este SDK proporciona una implementación del protocolo Agent-to-Agent (A2A) de Google en JavaScript/TypeScript. Permite crear agentes que pueden comunicarse entre sí siguiendo el estándar A2A.

Cumplimiento del Patrón A2A

El SDK implementa todos los requisitos fundamentales del protocolo A2A:

1. Descubrimiento de Agentes ✅

// Endpoint de descubrimiento estándar
GET /.well-known/agent.json

// Ejemplo de Agent Card
{
  "name": "Mi Agente",
  "description": "Descripción del agente",
  "url": "http://localhost:3000",
  "version": "1.0.0",
  "capabilities": {
    "streaming": true
  }
}

2. Métodos RPC Requeridos ✅

  • message/send: Envío de mensajes entre agentes
  • tasks/get: Consulta del estado de tareas
  • tasks/cancel: Cancelación de tareas en curso

3. Tipos de Respuesta ✅

// Respuesta Inmediata
{
  kind: "message",
  role: "agent",
  parts: [{ kind: "text", text: "Respuesta inmediata" }]
}

// Respuesta Basada en Tareas
{
  kind: "task",
  id: "task-id",
  status: {
    state: "working" | "completed" | "error",
    progress: { percentage: number, message: string }
  }
}

4. Gestión de Tareas ✅

  • Creación y seguimiento de tareas
  • Actualización de estado
  • Consulta de progreso

5. Formato de Mensajes ✅

{
  role: "user" | "agent",
  parts: [
    {
      kind: "text",
      text: string
    }
  ]
}

6. Manejo de Errores JSON-RPC ✅

{
  jsonrpc: "2.0",
  id: string,
  error: {
    code: number,
    message: string
  }
}

Instalación

npm install a2a-sdk-google

Uso Básico

Crear un Servidor A2A

import { A2AServer, A2AServerConfig } from "a2a-sdk-google";

const config: A2AServerConfig = {
  card: {
    name: "Mi Agente",
    description: "Un agente simple",
    url: "http://localhost:3000",
    version: "1.0.0",
  },
  port: 3000,
};

const handler = async (message) => {
  return {
    kind: "message",
    role: "agent",
    parts: [{ kind: "text", text: "¡Hola!" }],
  };
};

const server = new A2AServer(handler, config);
server.start();

Crear un Cliente A2A

import { A2AClient } from "a2a-sdk-google";

const client = new A2AClient("http://localhost:3000");

// Enviar mensaje
const response = await client.sendMessage({
  role: "user",
  parts: [{ kind: "text", text: "Hola" }],
});

// Consultar estado de tarea
const taskStatus = await client.getTaskStatus("task-id");

Características

  • ✅ Implementación completa del protocolo A2A
  • ✅ Soporte para TypeScript
  • ✅ Manejo de tareas asíncronas
  • ✅ Gestión de errores JSON-RPC
  • ✅ Comunicación bidireccional entre agentes

Documentación

Para más detalles sobre la implementación y uso del SDK, consulta la documentación del servidor.

Contribuir

Las contribuciones son bienvenidas. Por favor, asegúrate de actualizar las pruebas según corresponda.

Licencia

MIT