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

@alis-build/a2a-history

v1.0.541

Published

Protobufs generated by Alis Build

Readme

a2a-history

TypeScript/JavaScript client and protobuf definitions for the A2A History API — an extension for managing agent-to-agent (A2A) conversation histories and their events.

Overview

This package provides:

  • Generated protobuf types (alis/a2a/extension/history/v1/) — Message classes and AsObject types for history resources, events, and requests/responses
  • JSON-RPC transport (transport/jsonrpc/) — HTTP JSON-RPC 2.0 client for calling the A2A history service

Installation

pnpm add @alis-build/a2a-history
# or
npm install @alis-build/a2a-history

Peer dependencies

  • google-protobuf — protobuf runtime
  • grpc-web / @grpc/grpc-js — gRPC support (if using gRPC transport)
  • @alis-build/google-common-protos — shared Google API protos

Import paths

  • JSON-RPC client: @alis-build/a2a-history/transport/jsonrpc (or @alis-build/a2a-history/dist/transport/jsonrpc if built)
  • Protobuf types: @alis-build/a2a-history/alis/a2a/extension/history/v1/history_pb

Quick start

import {
  A2AHistoryClient,
  JsonRpcProtocolError,
  JsonRpcTransportError,
} from "@alis-build/a2a-history/transport/jsonrpc";

const client = new A2AHistoryClient({
  baseUrl: "https://api.example.com",
  // Optional: bearer token when not behind auth gateway
  getToken: async () => (await getAuthToken()).accessToken,
});

// Fetch a single history by resource name
const history = await client.getHistory({ name: "histories/abc123" });

// List histories with pagination
const { historiesList, nextPageToken } = await client.listHistories({
  parent: "agents/xyz",
  pageSize: 20,
  pageToken: "",
});

// List events within a history
const { eventsList } = await client.listEvents({
  parent: "histories/abc123",
  pageSize: 50,
});

JSON-RPC client

Configuration

| Option | Type | Required | Description | |-------------|----------------------------------|----------|-----------------------------------------------------------------------------| | baseUrl | string | Yes | Base URL of the A2A history service (e.g. https://api.example.com). No trailing slash. | | getToken | () => string \| Promise<string> | No | Bearer token provider. Use when calling the service directly (not via auth gateway). Can be async for token refresh. |

API methods

| Method | JSON-RPC method | Description | |------------------|---------------------------|------------------------------------------------------| | getHistory | history/get | Get a single history by resource name | | listHistories | history/list | List histories with optional filtering & pagination | | listEvents | history/events/list | List events within a history with pagination |

Error handling

Two error types can be thrown:

  • JsonRpcTransportError — Network failure, non-2xx HTTP response, or invalid JSON in the response. Has optional status for HTTP status code (e.g. 401, 500).
  • JsonRpcProtocolError — Server returned a JSON-RPC error object (e.g. method not found, invalid params). Has code and data for application-level handling.
try {
  const history = await client.getHistory({ name: "histories/123" });
} catch (err) {
  if (err instanceof JsonRpcTransportError) {
    console.error("HTTP/network:", err.message, err.status);
  } else if (err instanceof JsonRpcProtocolError) {
    console.error("RPC error:", err.code, err.message, err.data);
  }
}

Endpoint

All requests are sent as HTTP POST to:

{baseUrl}/extensions/a2ahistory

Protobuf types

The generated protobuf definitions live under alis/a2a/extension/history/v1/ and include:

  • Resources: A2AHistory, Thread, ThreadEvent
  • Requests/responses: GetA2AHistoryRequest, ListA2AHistoriesRequest, ListEventsRequest, etc.

Use .AsObject types for plain JSON-like objects returned by the JSON-RPC client.

Project structure

a2a-history-ts/
├── alis/a2a/extension/history/v1/   # Generated protobuf code
│   ├── history_pb.js / .d.ts       # Message types
│   ├── history_grpc_pb.js / .d.ts  # gRPC Node
│   └── history_grpc_web_pb.js / .d.ts  # gRPC-Web
├── transport/jsonrpc/               # JSON-RPC transport
│   ├── client.ts                   # A2AHistoryClient
│   ├── types.ts                    # JsonRpc* types, config
│   └── index.ts                    # Public exports
├── package.json
└── README.md

License

Internal Alis Build package.