@cool-ai/beach-a2ui-renderer-text
v0.1.0
Published
Beach renderer — joins a reply's text parts into plain text. The lightweight output type for WhatsApp, SMS, and archives.
Readme
@cool-ai/beach-a2ui-renderer-text
The lightweight renderer: it joins a reply's text parts into a single plain-text string. This is the output type for channels that show plain text — WhatsApp, SMS, an archive. It walks no A2UI surface and emits no HTML; for those, reach for @cool-ai/beach-a2ui-renderer-static or @cool-ai/beach-a2ui-renderer-lit.
Use
import { renderText } from '@cool-ai/beach-a2ui-renderer-text';
renderText([{ text: 'Your flight is confirmed.' }, { text: 'Booking ref: ABC123' }]);
// → "Your flight is confirmed.\n\nBooking ref: ABC123"It accepts a single part, an array of parts, or a { parts: [...] } envelope. Each part's text is taken; empty and non-string parts are skipped. Pass { separator } to change the join (the default is a blank line).
A channel adaptor is wired with a renderer by the consumer; for a text channel, that renderer is this one.
