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

@textui/chat

v0.9.2

Published

The TextUI chat components - transcript, composer, tool calls, questions, sessions and diffs

Readme

@textui/chat

npm license

The components of an agent chat: the transcript, what is said in it, what the agent did, the composer, the block that waits on a person, the sessions and the diffs. Built on @textui/core and @textui/widgets, and on nothing that talks to a host.

npm install @textui/chat
import { useState } from '@textui/core';
import { Column } from '@textui/widgets';
import { ChatComposer, ChatTranscript } from '@textui/chat';
import type { Block } from '@textui/chat';

const blocks: Block[] = [
  { kind: 'said', id: 's1', turnId: 't1', text: 'Rename the package.' },
  { kind: 'header', id: 'h2', turnId: 't2', model: 'claude', meta: '4.1s', state: 'complete' },
  { kind: 'prose', id: 'p2', turnId: 't2', content: 'Done. Three files changed.', streaming: false },
];

function Chat() {
  const [expanded, setExpanded] = useState<Record<string, boolean>>({});
  const [draft, setDraft] = useState('');
  return (
    <Column flex={1}>
      <ChatTranscript
        blocks={blocks}
        expanded={expanded}
        onToggle={(id) => setExpanded({ ...expanded, [id]: !expanded[id] })}
        flex={1}
      />
      <ChatComposer value={draft} onChange={setDraft} onSubmit={() => setDraft('')} />
    </Column>
  );
}

Its own shapes

Every component takes a shape of this package's own - a ChatToolCall, a ChatSession whose status is already a word, a tone and a glyph, a ChatPendingInput with its questions - and nothing else. There is no protocol here. A client that speaks the Agent Host Protocol, or anything else, maps its records onto these and the components never learn where a session came from. The field names follow AHP's where one exists, so that mapping is a pick rather than a rename.

Nothing is read from the store. The markdown switch is StreamingText's markdown prop, the draft answers of a question are ChatHitl's draft and onDraft, the row under the composer is ChatInputStatus's status, and where the composer and the waiting block sit is reported through onMeasure. Whoever mounts them holds all of that, wherever it likes.

What is here

| | | |---|---| | ChatTranscript, Block | The conversation as blocks in a Feed: said, header, prose, reasoning, notice, failure, tool, queued. match colours a found term through every block and pinCursor keeps the cursor in view while a search moves it | | blockText, findBlocks | The words of a block, and the indexes of the blocks a query is found in, which a find walks the cursor through | | ChatBubble, Gutter, StreamingText, ReasoningBlock | One thing said, and the two ways it is still being said | | ToolCallRow | What the agent did, one row per call, opening onto its input and output. A ChatToolCall names its tool (toolName, where the id differs from the display name) and, while it runs, says what it is doing (progress) on the row | | ChatComposer, ComposerBar, ComposerOption | The field, the slash and path menus sized to the terminal, and the control rows of chips. A ChatCommand.hint is drawn under the menu for the command under the cursor; a ComposerOption.where chip puts where the session runs on a second row, and escape on any chip is onLeave, back to the field | | ChatHitl, ConfirmRequest, QuestionForm, ChatInputStatus | The block that means the agent is stopped, waiting on a person | | SessionList, ConnectionBadge | The catalogue, and which host it came from. A ChatSession row says its project, branch and pullRequest (a label the host formats, #412 merged) | | ChatSessionHead, SessionDetails | The head over a conversation, and the pane where long values are read whole | | FileDiff, diffLines, toLines | One file, both sides lined up | | openPicker | The command palette, anchored above the chip that asked; a command with nothing to ask is run instead | | settingIcon, valueIcon | The marks beside a setting and beside its values, down to ascii |

What is not here

A host connection, a controller, terminals, changesets, automations, the fake host. Those are an application's, and the application these came from is softov/ahpc.

Runtime

No dependencies beyond @textui/core and @textui/widgets, and no node: imports. Node 22+ and Bun.