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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@artinet/a2a

v0.0.1

Published

An easy to use SDK for creating Agent2Agent (A2A) agents.

Readme

@artinet/a2a

An easy-to-use SDK for creating Agent2Agent (A2A) agents with OpenAI-compatible APIs.

Overview

@artinet/a2a provides a fluent builder for constructing multi-step AI agents with type-safe composition and automatic execution orchestration. Build agents that can communicate with other agents and easily manage complex multi-agent interactions.

Installation

npm install @artinet/a2a

Quick Start

import { AIAgentBuilder } from "@artinet/a2a";

// Create an AI agent with OpenAI
const agent = AIAgentBuilder({ apiKey: "your-api-key" })
  .ai("You are a helpful assistant.")
  .createAgent({
    agentCard: "MyAgent",
  });

// Send a message
const result = await agent.sendMessage("Hello!");

Features

  • Fluent Builder API: Define your agents behaviour with chainable methods
  • Multi-Agent Orchestration: Connect to other agents via the AgentRelay.
  • Tool Integration: Automatically convert A2A agents into OpenAI-compatible function tools
  • Executor Conversion: Convert A2A executors into AgentEngine for advanced workflows

Multi-Agent Example

import { AgentBuilder, getContent } from "@artinet/sdk";
import { AIAgentBuilder } from "@artinet/a2a";

// Create helper agents
const echoAgent = AgentBuilder()
  .text(({ content }) => content ?? "No content")
  .createAgent({ agentCard: "EchoAgent" });

const testAgent = AgentBuilder()
  .text(({ content }) => "You have successfully reached the test agent.")
  .createAgent({ agentCard: "TestAgent" });

// Expose them to your AI Agent
const aiAgent = AIAgentBuilder(
  { apiKey: "your-api-key" },
  {
    callerId: "main-agent",
    agents: new Map([
      ["echo-agent", echoAgent],
      ["test-agent", testAgent],
    ]),
  }
)
  .text(() => "Message Recieved")
  .ai("Use your agents to fulfill the request.")
  .createAgent({ agentCard: "MainAgent" });

// The AI agent can now call or be called by other A2A agents
console.log(
  getContent(
    await aiAgent.sendMessage("Call the test agent and tell me what it says")
  )
);

Response:

I have access to the test agent and sent a message to it. The test agent responded, saying:

"You have successfully reached the test agent."

API

AIAgentBuilder(client, agents?)

Creates a new agent builder with an OpenAI client and optional agent relay.

Parameters:

  • client: OpenAI instance or ClientOptions
  • agents?: AgentRelay, AgentRelayConfig, or A2AClient, Agent for multi-agent communication

.ai(body, options?)

Adds an AI step to the agent workflow.

Parameters:

  • body: System prompt string or full ChatCompletionCreateParams
  • options?: Request options including history/args/content inclusion settings

convertExecutor(executor)

Converts an AgentExecutor(from @a2a-js/sdk) into an AgentEngine.

License

Apache-2.0

Resources