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/agent-app

v3.5.0

Published

Presentation-safe browser SDK for Nifra agent hosts: negotiated commands, ordered event streaming, and content-free view models over the agent protocol.

Readme

@nifrajs/agent-app

A presentation-safe browser SDK for Nifra agent hosts.

This package depends on only @nifrajs/agent-protocol. It pulls in no backend, model provider, storage, or UI framework, so it can be bundled into browser-facing code without dragging a private engine or payload content across the boundary. Everything it surfaces upward is a content-free view model: identifiers, lifecycle statuses, counters, and opaque references. A prompt becomes a character count; a tool result becomes an ok flag and an error code; a compaction becomes before/after token counts.

What it does

  • Feature negotiation. On session creation the client intersects the features it can drive with the capabilities the host advertises, and gates the matching operations behind requireFeature.
  • Caller auth. An optional authorize hook mints a bearer token per request. The token is placed on the outgoing Authorization header and never stored on the transport, copied into a result, or written to a log.
  • Ordered, deduplicated streaming. A turn arrives as an ordered stream of AgentEventViews. Out-of-order and redelivered frames are reordered and de-duplicated by sequence; a bounded buffer skips an unfilled gap rather than stalling.
  • Cursor resume. A persisted log can be replayed from a cursor. A cursor whose next record was evicted from the retained window asks the caller to resync.
  • Approvals and handoffs. Pending approvals list as identifiers; decisions and handoff outcomes go back through negotiated commands.
  • Run Studio views. Run graphs, retry/recovery timelines, eval comparisons, and fault-injection rows consume only protocol evidence and bounded replay references.
  • Escape hatch. command() reaches host-specific surfaces outside the negotiated contract and still returns a bounded CommandOutcome - it never throws the credential.

Usage

import { AgentAppClient, HttpAgentTransport } from "@nifrajs/agent-app"

const transport = new HttpAgentTransport({
  endpoint: "http://127.0.0.1:8787",
  authorize: () => currentToken(), // per-request; never stored
})
const client = new AgentAppClient(transport)

const session = await client.createSession()
if (client.supports("resume")) {
  const replay = await client.resume({ cursor: lastCursor })
  // replay.entries: { seq, at, type }[] - no payloads
}

for await (const view of client.send("summarize the diff")) {
  // view is content-free: e.g. { kind: "assistant.delta", seq, chars }
}

Boundary

The transport receives the host's full event stream in order to derive counts, but the client's public output is projected to content-free view models. That projection is the seam: an application built on this SDK can render progress and resolve interactions, and cannot reconstruct a prompt, tool payload, model completion, diagnostic report, or filesystem path. The scripts/check-agent-boundary.ts gate enforces that this package imports nothing but @nifrajs/agent-protocol.

The SDK is transport-neutral and opt-in: it does not retain payloads, provide identity or tenancy, claim a remote security boundary, or imply durable delivery. Production hosts own authorization, retention, and adapter policy.

License

MIT

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