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

@nifrajs/a2a

v3.5.0

Published

Mount a nifra agent as an Agent2Agent (A2A) protocol server - the agent card on GET, the A2A 1.0 JSON-RPC binding on POST with SendMessage, streaming SendStreamingMessage over SSE, and GetTask projected from the runner's turn state. A protocol bridge over

Readme

@nifrajs/a2a

Mount a nifra agent as an Agent2Agent (A2A) protocol server. The agent card is served on GET, the A2A 1.0 JSON-RPC binding on POST: SendMessage runs one bounded agent turn, SendStreamingMessage streams step evidence over SSE, GetTask projects the stored turn state.

A protocol bridge over @nifrajs/agent - the request body reuses core's single bounded, prototype-guarded trust boundary, and the model, durable state store, and approval transport are injected per request through the same ports factory mountAgent uses. Dependency-free beyond the two nifra peers.

Install

bun add @nifrajs/a2a @nifrajs/agent

Mount

import { server } from "@nifrajs/core"
import { mountA2A } from "@nifrajs/a2a"
import { agent } from "./agent" // an AgentDefinition

const app = server()
mountA2A(app, {
  agent,
  card: { url: "https://api.example.com/a2a", version: "1.0.0" },
  ports: (c) => ({
    model: myModelPort,        // scope to the request subject
    capabilities: ["search.read"],
    state: myStateStore,       // required for GetTask and resume
  }),
})
// GET  /.well-known/agent-card.json  - the agent card
// POST /a2a                          - SendMessage | SendStreamingMessage | GetTask

Task mapping

One A2A task is one agent turn: taskId is the runner's turnId.

| Run result | Task state | | --- | --- | | completed with output | TASK_STATE_COMPLETED + an output artifact | | completed with a typed error | TASK_STATE_FAILED (error in metadata) | | suspended (approval, budget, model, max turns) | TASK_STATE_INPUT_REQUIRED | | suspended (cancelled) | TASK_STATE_CANCELED |

Agent input is message.metadata.input when present, otherwise the first text part. Structured output returns as a text part carrying JSON.

Human-in-the-loop resume

A suspended task's status message carries the pending continuation in metadata. Send it back to continue the same task - the runtime keeps state token-only, so a suspended tool's input must be replayed in continuation.input:

{
  "jsonrpc": "2.0", "id": 2, "method": "SendMessage",
  "params": {
    "message": {
      "messageId": "m2", "role": "ROLE_USER", "parts": [],
      "taskId": "<task id from the suspension>",
      "metadata": {
        "input": { "prompt": "go" },
        "resume": {
          "continuation": { "kind": "approval", "tool": "search.read", "effectId": "…", "input": { "q": "…" } },
          "approval": { "granted": true }
        }
      }
    }
  }
}

Cross-request registries (cancellation, subscription fan-out, push notifications) are deliberately out of scope for the stateless seam; those spec methods answer UnsupportedOperationError (-32004).

The seam performs no authentication or authorization - wrap it with your app's route guards and scope every port in ports(c) to the caller.

Docs

Part of the nifra full-stack TypeScript framework - one core, five UI libraries, every runtime. Scaffold a new app with bun create nifra.

For AI agents, see LLM.md and the full corpus ../../llms-full.txt.