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

@gnldev/a2a

v0.5.0

Published

Remote agent-to-agent tool over @gnldev/server REST. Deterministic remote runId → exactly-once across the network.

Readme

@gnldev/a2a

Remote agent-to-agent: calls a remote agent on a @gnldev/server REST endpoint as an AI SDK tool. Deduped across the network: runId is deterministic — a2a:${idempotencyKey ?? toolCallId} → the remote runDurable replays the same runId, so a second POST has no side effect (at-most-once for the remote effect).

A runId has two shapes, and this one is deliberate. Most runIds are opaque run1_… digests the engine mints from a caller's workKey. Engine-issued runs keep readable composite ids on purpose (sched:, job:, a2a:, eval:, wf:, batch:): the engine writes them itself, they are already deterministic, and nothing is stored that a hash would protect. a2a: in particular must stay readable — hashing it would make the two deployments derive different ids for the same call, and cross-network dedup is precisely what that would break. idempotencyKey is what durableTool injects (parent-run-scoped, so it is globally unique); the bare toolCallId is only the fallback for a plain AI SDK loop, where two different parent runs can emit the same short id (call_1) and collide. When wrapped in durableTool inside a parent runDurable, the remote call is skipped on parent resume.

Install: pnpm add @gnldev/a2a on both ends of the call — or run both from a repo clone (pnpm install && pnpm -r build).

npm i @gnldev/a2a   # peer: ai, zod
import { createA2ATool } from '@gnldev/a2a';

const tools = {
  research: createA2ATool({ endpoint: 'https://agents.internal', agentName: 'researcher' }),
};

// Router/parent agent calls the 'research' tool → POSTs to remote /agents/researcher/run.
await runDurable({ runId: 'parent-1', journal, model, tools, prompt: 'Research X' });

API

  • createA2ATool({ endpoint, agentName, description?, headers?, fetchImpl?, timeoutMs?, secret?, budgetGuard? }) → AI SDK tool
    • fetchImpl: for test/custom transport (e.g. Hono app.request).
    • timeoutMs: remote-call timeout, default 30_000. On expiry a StepTimeoutError is thrown, so the wrapping durableTool journals a failed record and the model sees the real error — never a silent hang.
    • secret: opt-in HMAC-SHA256 request signing. The body goes out with x-gnl-signature (HMAC(secret, timestamp + '.' + body)) and x-gnl-timestamp; the remote verifies it via createRestApi({ a2aSecret }). Omit it and requests are unsigned, exactly as before.
    • budgetGuard: called before the fetch — typically @gnldev/durable's assertBudget. It gates the call made from this process only; a2a cannot see or enforce the remote endpoint's own quota. Throwing propagates as-is. Omit it and no quota check happens.

How it works

The tool POSTs to the remote REST endpoint with a deterministic runId. Since both the remote and parent are durable, there's no double-execution even across the network — deterministic for distributed agent calls.

License

Apache-2.0 — see LICENSE.