Overview
API reference for the chat package. All exports are available from the top-level import:
Core
| Export | Description |
|---|---|
Chat | Main class that registers adapters, event handlers, and webhook routing |
Thread | Conversation thread with methods for posting, subscribing, and state |
Channel | Channel or conversation container that holds threads |
Message | Normalized message with text, AST, author, and metadata |
ScheduledMessage | Returned by thread.schedule() and channel.schedule(), with a cancel() method |
Message formats
| Export | Description |
|---|---|
PostableMessage | Union type accepted by thread.post() |
Plan | Step-by-step task list that mutates after posting |
StreamingPlan | Wraps an async iterable with platform-specific streaming options |
Cards | Rich card components: Card, Text, Button, Actions, and more |
Markdown | AST builder functions: root, paragraph, text, strong, and more |
Modals | Modal form components: Modal, TextInput, Select, and more |
History
| Export | Description |
|---|---|
bot.history.user | Cross-platform per-user message store with append, list, count, and delete |
bot.history.thread | Per-thread message reads from the platform API, with SDK cache fallback |
bot.history.channel | Per-channel reads through listMessages, listThreads, and related adapter APIs |
Transcripts | Deprecated 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
Chat
The class that coordinates adapters, state, and event handlers for a multi-platform chat bot.
Thread
Represents a conversation thread with methods for posting, subscribing, and state management.
Channel
Channel container that holds threads, with methods for listing, posting, and iteration.
Message
Normalized message format with text, AST, author, and metadata.