What you get
Reactions and replies
Reactions ride the sameapp.messages stream as text. They arrive as a reaction content message:
replyTo field:
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Use reactions, replies, attachments, inline images, typing indicators, and console capture in the terminal provider.
| Feature | How |
|---|---|
| Multiple chats | Ctrl+N opens a new chat. Ctrl+J and Ctrl+K switch between them. Each chat is its own Spectrum space. |
| Reactions | Press r on a message to react. It arrives in your code as a reaction content message. |
| Replies | Press e to reply inline. It arrives with a replyTo: { messageId } extra on the message. |
| File attachments | Drag-and-drop into the terminal. Messages arrive with name, MIME type, and buffer. |
| Inline images | Rendered with the Kitty graphics protocol when supported, with a half-block fallback. |
| Typing indicators | space.startTyping() and space.stopTyping() show a live indicator. |
| Console capture | console.log, info, warn, error, and debug from your agent are forwarded into a pinned __system__ chat instead of garbling the UI. |
app.messages stream as text. They arrive as a reaction content message:
for await (const [space, message] of app.messages) {
if (message.content.type === "reaction") {
console.log(`${message.sender?.id ?? "unknown"} reacted ${message.content.emoji}`);
continue;
}
if (message.content.type === "text") {
await message.react("👀");
await space.send(`echo: ${message.content.text}`);
}
}
replyTo field:
const replyTo = (message as { replyTo?: { messageId: string } }).replyTo;
if (replyTo) {
await message.reply(`acknowledged your reply to ${replyTo.messageId}`);
}
Was this page helpful?