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

@edjbarron/netapp-chat-component

v0.1.17

Published

React chat UI component for the netapp-chat-service agentic chat backend (LLM + MCP tool routing).

Readme

@edjbarron/netapp-chat-component

React chat UI component for the netapp-chat-service agentic chat backend (LLM + MCP tool routing).

Provides a ChatPanel, optional CanvasPanel, capability/mode controls, and a chart/dashboard rendering kit.

Install

npm install @edjbarron/netapp-chat-component

Peer dependencies

You must install these in your host app:

npm install react react-dom \
  @mantine/core @mantine/charts @mantine/hooks \
  @tabler/icons-react

Supports React 18 and 19, Mantine 8.x.

Usage

import { MantineProvider } from '@mantine/core';
import {
  ChatAPIProvider,
  ChatPanel,
  createChatAPI,
} from '@edjbarron/netapp-chat-component';

import '@mantine/core/styles.css';
import '@mantine/charts/styles.css';
import '@edjbarron/netapp-chat-component/styles.css';

const api = createChatAPI('https://your-chat-service.example.com/api');

export function App() {
  return (
    <MantineProvider>
      <ChatAPIProvider value={api}>
        <ChatPanel />
      </ChatAPIProvider>
    </MantineProvider>
  );
}

Initial chat mode

<ChatPanel> opens in read-write mode by default. To start in read-only mode (information-retrieval tools only), pass defaultMode:

<ChatPanel defaultMode="read-only" />

The user can still toggle mode at runtime via the in-panel ModeToggle; defaultMode only sets the initial value. The backend filters tools by mode based on each MCP tool's ToolAnnotations.ReadOnlyHint — if your MCP servers don't yet emit annotations, leave defaultMode at its default so all their tools remain available.

Driving the panel from the host

The host can open the panel and auto-send a prompt programmatically — useful for "Explain this" / "Ask about this" buttons elsewhere in your app that deep-link a question into the assistant. Three optional props support this:

| Prop | Type | Description | |------|------|-------------| | pendingPrompt | string | A prompt to auto-send once. When it changes to a non-empty value while the panel is opened and not streaming, it is sent as a user message exactly once. | | onPromptConsumed | () => void | Called after pendingPrompt has been submitted. Clear your own state here so the same prompt isn't resent on a later re-render. | | onBusyChange | (busy: boolean) => void | Notifies the host when the assistant's busy (streaming) state changes, so you can disable your trigger control while a turn is in flight. | | onCanvasEvent | (info: { action: 'open' \| 'close'; tabId: string; title: string; kind: string }) => void | Fired when a canvas tab opens/updates or closes. Lets the host react to a specific canvas (e.g. refresh a page when a matching canvas changes). A canvas payload whose content.close is truthy closes the matching tab and reports action: 'close'. |

function App() {
  const [opened, setOpened] = useState(false);
  const [pendingPrompt, setPendingPrompt] = useState('');
  const [busy, setBusy] = useState(false);

  const askAssistant = (prompt: string) => {
    setPendingPrompt(prompt);
    setOpened(true);
  };

  return (
    <>
      <button disabled={busy} onClick={() => askAssistant('Explain rule X')}>
        Explain this
      </button>

      <ChatPanel
        opened={opened}
        onClose={() => setOpened(false)}
        pendingPrompt={pendingPrompt}
        onPromptConsumed={() => setPendingPrompt('')}
        onBusyChange={setBusy}
      />
    </>
  );
}

A common pattern is to expose askAssistant and busy through a React context so any page can request a prompt and grey out its trigger while the assistant is busy. If the host opens the panel mid-turn, the prompt is held until the current turn finishes, then sent.

The injected prompt is sent as a normal user message and is subject to the same mode (read-only/read-write), capability filtering, and action-approval gating as any typed prompt — the host cannot bypass these.

Auth headers and credentials

createChatAPI accepts custom headers and a credentials mode that are applied to every request (including the streaming POST /chat/message):

const api = createChatAPI('/api', {
  headers: {
    Authorization: `Bearer ${token}`,
    'X-Tenant': 'acme',
  },
  credentials: 'same-origin', // defaults to 'include'
});

If you implement ChatAPI yourself instead of using createChatAPI, you must implement stream(path, body, signal?): Promise<Response> in addition to get/post/delete. The component uses stream() for the SSE message endpoint so your transport layer can apply auth uniformly.

Backend

This component talks to the netapp-chat-service Go backend. See the main repo for the API contract, configuration, and deployment.

Exports

  • Components: ChatPanel, CanvasPanel, ModeToggle, CapabilityControls, ActionConfirmation, ToolStatusCard
  • Charts: ChartBlock, DashboardBlock, ObjectDetailBlock, AutoJsonBlock
  • API: createChatAPI, ChatAPIProvider, useChatAPI
  • Hook: useChatPanel
  • Types: ChatMessage, Capability, PendingApproval, ChatMode, CanvasTab, PanelData, DashboardData, ChartData, PanelWidth, ObjectDetailData

License

MIT