Overview

API reference for the chat package. All exports are available from the top-level import:

import { Chat, root, paragraph, text, Card, Button, emoji } from "chat";

Core

ExportDescription
ChatMain class that registers adapters, event handlers, and webhook routing
ThreadConversation thread with methods for posting, subscribing, and state
ChannelChannel or conversation container that holds threads
MessageNormalized message with text, AST, author, and metadata
ScheduledMessageReturned by thread.schedule() and channel.schedule(), with a cancel() method

Message formats

ExportDescription
PostableMessageUnion type accepted by thread.post()
PlanStep-by-step task list that mutates after posting
StreamingPlanWraps an async iterable with platform-specific streaming options
CardsRich card components: Card, Text, Button, Actions, and more
MarkdownAST builder functions: root, paragraph, text, strong, and more
ModalsModal form components: Modal, TextInput, Select, and more

History

ExportDescription
bot.history.userCross-platform per-user message store with append, list, count, and delete
bot.history.threadPer-thread message reads from the platform API, with SDK cache fallback
bot.history.channelPer-channel reads through listMessages, listThreads, and related adapter APIs
TranscriptsDeprecated alias for bot.history.user

AI utilities

toAiMessages, createChatTools, and the supporting types live in the chat/ai subpath. See the AI section for the full reference.

Read more