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

@optizon/chat

v0.4.0

Published

Components for AI agent chat interfaces: transcript, tool calls, prompts, composer, status and sessions, for agents such as Claude Code and Pi.

Readme

Optizon Chat

Components for AI agent chat interfaces, for agents such as Claude Code and Pi: a message model of typed parts, a store your app streams its agent's events into, and a transcript that stays fast for thousands of turns (finished turns are virtualized, the streaming one stays live, each streamed token re-renders only its part). Replies render as streaming-safe Markdown; the transcript is a screen-reader log with a status region that announces what changes. Every point where an agent waits for the person has a prompt (permissions, questions, plan approval, forms, sign-in), answerable by keyboard alone, and PromptInput is the composer: queueing while the agent works, stopping, history, / and @ menus at the caret, attachments by drop and paste, and never a send while an input method composes. Every Claude Code and Pi tool call renders in its own card: shell output as a colored terminal that streams, edits as diffs, reads as file previews, searches as results, subagents with their own nested transcript, task lists; MCP and unknown tools get a card with JSON trees.

Use

Install it next to @optizon/ui and @optizon/tokens, at the same version, with React 19 and Tailwind CSS 4 (4.1.14 or later; keep @tailwindcss/vite on the same version as tailwindcss). It brings @optizon/markdown and @optizon/code, at the same version:

npm install @optizon/[email protected] @optizon/[email protected] @optizon/[email protected] @optizon/[email protected] @optizon/[email protected] react@^19 react-dom@^19
npm install -D tailwindcss@^4.1 @tailwindcss/vite@^4.1

In your application stylesheet, scan the packages' source (paths are relative to the stylesheet):

@import "@optizon/tokens";
@source "../node_modules/@optizon/ui/src";
@source "../node_modules/@optizon/markdown/src";
@source "../node_modules/@optizon/code/src";
@source "../node_modules/@optizon/chat/src";

Code blocks, diffs and editors come from @optizon/code: give Monaco its worker factory once at startup with configureMonaco({ getWorker }) (the setups for Vite, webpack and Rspack, and the Content Security Policy: https://github.com/optzn/ui/blob/main/docs/CODE.md). For math and diagrams in replies, install @optizon/math or @optizon/diagrams and register mathPlugin() or diagramsPlugin() on a MarkdownProvider at the app's root; chat's Markdown adds codeFencePlugin() itself.

import { useMemo } from "react";
import { UIProvider } from "@optizon/ui";
import { Thread, createChatStore } from "@optizon/chat";

export function Conversation() {
  const store = useMemo(() => createChatStore(), []);
  // As your agent's events arrive:
  //   store.append({ id, role: "assistant", parts: [{ type: "text", text: "", state: "streaming" }], metadata: { status: "streaming" } });
  //   store.appendText(id, 0, delta);
  //   store.finish(id);
  return <UIProvider><Thread store={store} className="h-[40rem]" /></UIProvider>;
}

There are no adapters: your app maps its agent's events onto the store. The guide has the model, the store, the renderer registry and the mapping tables for the Claude Agent SDK and Pi: https://github.com/optzn/ui/blob/main/docs/AGENT-CHAT.md

The package is ESM-only, ships compiled JavaScript, TypeScript declarations and source, and has @optizon/tokens, @optizon/ui, @optizon/markdown and @optizon/code (same version) and React 19 as peers. Licensed under Apache-2.0.

The agent skill for Codex and Claude Code ships in @optizon/ui and covers chat too: npx @optizon/[email protected] install-skill.

Documentation, examples and source: https://github.com/optzn/ui