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

@texuli/chat

v0.18.0

Published

Chat interfaces: thread, message list, composer and typing indicator, generic for people and agents.

Readme

@texuli/chat

Chat interfaces for Svelte 5: a conversation thread, a virtualized message list, a composer and a typing indicator, generic enough for conversations between people or between a person and an agent. It handles message grouping, date separators, streamed agent replies and screen-reader announcements, and it renders message text without ever injecting HTML. It is part of Texuli, "Small pieces. Infinite possibilities.": an MIT Svelte 5 component library by Dailybot, Inc.

In the stack: layer L4, a domain package on the @texuli/core texels, @texuli/primitives, the @texuli/tokens token engine and the texuli components. The player paints it for agent blueprints.

Status: 0.x release. @texuli/chat is published on npm as 0.18.0, a pre-1.0 release (1.0.0 will be the first stable release). Under 0.x, a new minor (0.14.0) may contain breaking changes, so pin the exact version or use ^0.18.0, which accepts only 0.18.x.

Install

npm install @texuli/chat @texuli/tokens svelte
  • svelte (^5.57.2) is a peer dependency.
  • The components style themselves with the Texuli --tx-* design tokens. Import the token stylesheet once in your app (installing @texuli/tokens directly lets your bundler resolve it).
@import '@texuli/tokens/base.css';

Quick start

<script lang="ts">
  import { ChatThread, type ChatMessage } from '@texuli/chat';

  const me = { id: 'u-1', name: 'Ada' };
  const agent = { id: 'agent', name: 'Helper' };

  let messages = $state<ChatMessage[]>([
    { id: 'm1', author: agent, body: 'Hi! How can I help?', at: '2026-01-05T09:00:00Z' },
  ]);

  function send(body: string) {
    messages = [...messages, { id: crypto.randomUUID(), author: me, body, at: new Date() }];
  }
</script>

<ChatThread {messages} currentUserId="u-1" onSend={send} label="Support chat" />

ChatThread combines the message list with the built-in composer; omit onSend for a read-only thread, or pass a composer snippet to supply your own input chrome.

Streaming an agent reply

applyChatStreamEvent(messages, event) folds start, delta, end and error events into the message list immutably:

import { applyChatStreamEvent } from '@texuli/chat';

messages = applyChatStreamEvent(messages, { type: 'start', id: 'r1', author: agent, at: new Date() });
messages = applyChatStreamEvent(messages, { type: 'delta', id: 'r1', text: 'Checking your order' });
messages = applyChatStreamEvent(messages, { type: 'end', id: 'r1' });

While a message streams it shows a caret; its partial text stays out of the live region and is announced once, when it finishes.

What's inside

Everything is exported from the package root, @texuli/chat:

| Export | What it does | | --- | --- | | ChatThread | The full conversation view: message list plus composer, typing indicator and header slots | | MessageList | The message log on its own: grouping, date separators, avatars, timestamps, status, virtualization, per-message actions, inline edit and jump to latest | | Composer | Message input: Enter to send, Shift+Enter for a new line, auto-growing, with attachments, actions, a key hook, pending states and Stop for a streaming reply | | TypingIndicator | Localized "is typing" labels for one or more authors | | ChatThreadDisplay, ChatMessageDisplay | A static transcript view (no composer, no live region) for rendering saved or generated conversations | | CHAT_DISPLAY_LOADERS | Loaders that map the display components for a @texuli/player host | | applyChatStreamEvent | Folds streamed reply events into a message list | | groupMessages, parseMessageText, messageTokens | The grouping and text-parsing helpers behind the list |

Key guarantees

  • No HTML sinks. Message bodies support a small text format (**strong**, *emphasis*, backtick code and [label](https://example.com) links), and it renders as Svelte text nodes, never as HTML.
  • URL policy on links. Link destinations pass the Texuli URL policy at the untrusted tier; a rejected link stays visible as literal text.
  • Closed inline tokens. Mentions (@[Name](mention:id)), dates ([[date:ISO]]) and status chips ([[status:tone|Label]]) are parsed against strict patterns; anything that fails a check stays literal text. Mentions are display-only and do not notify anyone.
  • Screen-reader friendly. The list is a polite live log, streamed replies are announced once on completion, and the list, thread and composer take translatable labels.
  • Input-method safe. The composer ignores Enter while an input method editor is composing, and async submissions prevent duplicate sends.
  • Scales to long threads. The list virtualizes from 100 messages with measured row heights, and keeps your place when older history is prepended.

New in 0.6.0

Ships in 0.6.0; the 0.5.0 release predates it:

  • MessageList and ChatThread: a reading position (bind:anchor, onAnchorChange) restored when you set it (G71), ChatAuthor.avatarSrcset through the untrusted image URL policy (G59), and onEditUnchanged for an edit saved unchanged (G85) (chat-thread).
  • Breaking: day separators are their own full-width row above the avatar and bubbles (G70); host CSS on the group's structure needs a look.

New in 0.5.0

Ships in 0.5.0; the 0.4.0 release predates it:

  • Composer: streaming with onStop (a Stop button and Escape), an onkeydown hook that runs before the built-in keys, and an actions snippet (chat-composer).
  • MessageList: per-message actions, inline edit with onEdit, and a bottom-anchored scroll with "Jump to latest" (chat-thread). ChatThread forwards all of these.

Not yet available

These are planned and do not work today: a mention picker in the built-in composer, and localized role labels in the transcript display components (they are English only for now).

Documentation

Contributing

Contributions are welcome; start at the GitHub repository.

License

MIT © Dailybot, Inc. Powered by Dailybot.