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

@ngaf/chat

v0.0.29

Published

This library was generated with [Nx](https://nx.dev).

Downloads

2,147

Readme

chat

This library was generated with Nx.

Runtime adapters

Chat primitives consume a runtime-neutral Agent contract. Two adapters ship today:

  • @ngaf/langgraph — for LangGraph / LangGraph Platform backends.
  • @ngaf/ag-ui — for any AG-UI-compatible backend (LangGraph, CrewAI, Mastra, Microsoft Agent Framework, AG2, Pydantic AI, AWS Strands, CopilotKit runtime).

Custom backends can implement Agent directly with no library dependency.

See the capability matrix in the docs site for which primitives require which runtime capabilities.

Citations

Chat messages can include citations to sources. The Citation interface provides structured metadata for each source:

interface Citation {
  id: string;          // Unique identifier for the citation
  index?: number;      // Display index (1-based) for inline markers
  title?: string;      // Source title
  url?: string;        // Source URL
  snippet?: string;    // Quoted excerpt
  extra?: unknown;     // Custom fields per adapter
}

Message citations

Adapters populate Message.citations?: Citation[] from their respective backends. Messages are rendered with the <chat-citations [message]="message" /> primitive, which displays a collapsible sources panel under assistant messages.

Rendering sources

Use the <chat-citations> component to render a sources panel. Customize the card layout with the optional chatCitationCard ng-template:

<chat [agent]="agent" />
<!-- or explicit: -->
<chat-citations [message]="message">
  <ng-template chatCitationCard let-citation>
    <div class="custom-card">
      <a [href]="citation.url">{{ citation.title }}</a>
      <p class="text-sm text-gray-600">{{ citation.snippet }}</p>
    </div>
  </ng-template>
</chat-citations>

Inline markers

Markdown rendering registers chat-md-citation-reference in the markdown view registry. Citation indices are rendered as superscript markers inline with the message text. The markers link to the corresponding citation in the sources panel.

Adapter integration

Each runtime adapter extracts citations into the Message.citations array:

  • LangGraph — reads from message.additional_kwargs.citations (preferred) or message.additional_kwargs.sources (fallback)
  • AG-UI — reads from STATE_DELTA at JSON Pointer /citations/{messageId}

The CitationsResolverService is provided to query citations in message-first or markdown-fallback order.