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.46

Published

Drop-in agent chat UI for Angular 20+. Headless primitives that read from a runtime-neutral `Agent` contract, plus opinionated compositions (`<chat>`, `<chat-debug>`, GenUI surfaces) you can ship in days.

Downloads

194

Readme

@ngaf/chat

Drop-in agent chat UI for Angular 20+. Headless primitives that read from a runtime-neutral Agent contract, plus opinionated compositions (<chat>, <chat-debug>, GenUI surfaces) you can ship in days.

Part of Agent UI for Angular. MIT licensed.

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.

A2UI surface theming

<a2ui-surface> declares ~50 internal --a2ui-* tokens at :host with dark-theme defaults (spacing, typography, shape radius, focus ring, motion, elevation, color). Catalog components consume them via var(--a2ui-*). Override at :root to retheme.

Agent-driven theming (v1 wire format)

Agents control exactly two knobs per the canonical A2UI v1-compatible spec, set via beginRendering.styles:

  • font — primary font family
  • primaryColor — hex #RRGGBB

Both flow through to the rendered surface as inline styles on <a2ui-surface> (highest specificity), overriding any consumer :root defaults for the lifetime of that surface.

Built-in theme presets

Four CSS files ship in the package, each declaring :root overrides for the relevant tokens:

/* In your global stylesheet */
@import '@ngaf/chat/themes/default-dark.css';     /* lib defaults, explicit */
@import '@ngaf/chat/themes/default-light.css';    /* neutral light, blue accent */
@import '@ngaf/chat/themes/material-dark.css';    /* Material Design 3 dark */
@import '@ngaf/chat/themes/material-light.css';   /* Material Design 3 light */

Material presets map Material Design 3 color tokens to the --a2ui-* vocabulary — no @angular/material runtime dep, just CSS custom-property declarations.

Custom themes

Override any subset of the ~50 tokens at :root:

:root {
  --a2ui-primary: #FF6B35;        /* brand orange */
  --a2ui-shape-medium: 4px;       /* sharper corners */
  --a2ui-spacing-3: 16px;         /* roomier layouts */
}

The token surface:

  • Color--a2ui-primary, --a2ui-on-primary, --a2ui-secondary, --a2ui-surface, --a2ui-on-surface, --a2ui-surface-variant, --a2ui-on-surface-variant, --a2ui-outline, --a2ui-outline-variant, --a2ui-error, --a2ui-on-error, --a2ui-scrim
  • Spacing--a2ui-spacing-1 (4px) through --a2ui-spacing-7 (40px)
  • Typography--a2ui-typography-{h1..h5,body,caption,label}-{size,weight,line-height}
  • Shape--a2ui-shape-{extra-small,small,medium,large,extra-large}
  • Focus ring--a2ui-focus-ring-color, --a2ui-focus-ring-width
  • Motion--a2ui-motion-duration-{short,medium,long}, --a2ui-motion-easing-{standard,emphasized}
  • Elevation--a2ui-elevation-{0,1,2,3,4,5} (box-shadow tokens)