@twentyfourg/chat-kit 1.0.0-beta.1 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,13 +100,21 @@ const engine = useChatEngine({ transport, agentId, typewriter: { speed: 1.5 } })
100
100
  | `showThinking` | `true`, `false` | `false` | Shows the model's reasoning: live while you wait, folded up on the finished reply. |
101
101
  | `autoScroll` | `'off'`, `'reply'`, `'bottom'` | `'reply'` | How far the view follows a streaming answer. `'reply'` stops once the answer's own header reaches the top, so a long answer can be read from the beginning. `'bottom'` keeps the newest line in view. `'off'` leaves the view alone. Under `'reply'` and `'bottom'`, scrolling up stops the follow until the reader comes back to the bottom. |
102
102
  | `showCopy` | `true`, `false` | `false` | Adds a copy button under each finished answer. |
103
+ | `beforeSend` | `(text, mode) => boolean \| Promise<boolean>` | off | Runs before the composer's text reaches the engine. Return `false` to hold it: your app has something to do first (show an offer, refine the question) and calls `engine.sendMessage` itself when ready. |
104
+
105
+ `copy` is read reactively, so a string that depends on app state (a placeholder
106
+ that changes once the conversation has started, say) can be a computed.
103
107
 
104
108
  ### Slots
105
109
 
106
110
  | Slot | What it's for |
107
111
  | --- | --- |
108
112
  | `welcome` | Replaces the default welcome block that shows before the first message. Use it for a logo, suggested questions, whatever you want. A text-only welcome can just set `copy.welcome` and skip the slot. |
113
+ | `message` | Scoped, gives you `{ message }`. Renders the messages your app put into the conversation itself with `engine.insertMessage`: an offer, a notice, a prompt to answer before the next question. The kit has no bubble for these, so without the slot they render as nothing. |
109
114
  | `message-actions` | Scoped, gives you `{ message }`. Sits on the left of the row that holds the thumbs, on finished replies. This is where an app's own button goes, an export for example, and it comes before the kit's copy button so your actions stay together. |
115
+ | `message-footer` | Scoped, gives you `{ message }`. Whatever your app wants under a reply, below its sources and actions: follow-up prompts, a link back to something above. Rendered for every reply, streaming included, so check `message.isStreaming` if it should wait. |
116
+ | `composer` | Replaces the whole composer. For a state the kit's field has no shape for, such as a locked bar with an upgrade prompt. Your content calls `engine.sendMessage` itself if it needs to send. |
117
+ | `composer-footer` | Sits inside the composer, under the field. An option that changes how the next question is handled, a hint, a counter. |
110
118
 
111
119
  ### Events
112
120