@object-ui/plugin-chatbot 5.4.2 → 6.0.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @object-ui/plugin-chatbot
2
2
 
3
+ ## 6.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @object-ui/types@6.0.1
8
+ - @object-ui/core@6.0.1
9
+ - @object-ui/react@6.0.1
10
+ - @object-ui/components@6.0.1
11
+
12
+ ## 6.0.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 451bbee: **HITL conversation loop:** `useHitlInChat` now accepts a
17
+ `continueConversation(prompt, ctx)` callback. After the operator approves
18
+ or rejects a tool call from inline chat buttons, the hook synthesises a
19
+ short follow-up user prompt (tagged `[HITL pa_xxx]`, with the executed
20
+ result or rejection reason) and invokes the callback so the LLM
21
+ continues the conversation with full awareness of the outcome.
22
+
23
+ `ConsoleFloatingChatbot` wires this callback to `useObjectChat`'s
24
+ `sendMessage`, closing the loop end-to-end. Execution failures stay
25
+ visible in the inline status badge but do NOT continue automatically —
26
+ the operator decides next steps.
27
+
28
+ No framework changes required. Internal `idMap` now also tracks the
29
+ tool name so the synthesised prompt is human-readable. New test suite
30
+ `useHitlInChat.test.tsx` covers approve/reject/failed/no-callback
31
+ branches.
32
+
33
+ ### Patch Changes
34
+
35
+ - @object-ui/types@6.0.0
36
+ - @object-ui/core@6.0.0
37
+ - @object-ui/react@6.0.0
38
+ - @object-ui/components@6.0.0
39
+
3
40
  ## 5.4.2
4
41
 
5
42
  ### Patch Changes
package/README.md CHANGED
@@ -255,6 +255,49 @@ import { AIElements } from '@object-ui/plugin-chatbot';
255
255
  </AIElements.Conversation>;
256
256
  ```
257
257
 
258
+ ### Message mapping helpers
259
+
260
+ If you wire `@ai-sdk/react`'s `useChat()` directly and want to render its
261
+ `UIMessage[]` with `<ChatbotEnhanced>`, use the exported mappers instead
262
+ of writing your own — they handle `parts: [{ type: 'text' | 'reasoning'
263
+ | 'tool-*' | 'source-*' }]`, the streaming-cursor flag, and the legacy
264
+ `msg.toolInvocations` fallback:
265
+
266
+ ```tsx
267
+ import { useChat } from '@ai-sdk/react';
268
+ import {
269
+ ChatbotEnhanced,
270
+ uiMessagesToChatMessages,
271
+ } from '@object-ui/plugin-chatbot';
272
+
273
+ function MyChat() {
274
+ const { messages, status } = useChat({ api: '/api/chat' });
275
+ const isStreaming = status === 'streaming' || status === 'submitted';
276
+ return (
277
+ <ChatbotEnhanced
278
+ messages={uiMessagesToChatMessages(messages, { isStreaming })}
279
+ onSend={/* … */}
280
+ />
281
+ );
282
+ }
283
+ ```
284
+
285
+ `uiMessageToChatMessage(msg, { streaming })` is the single-message
286
+ variant. Both are also used internally by `useObjectChat`, so the
287
+ mapping logic stays consistent across direct and managed usage.
288
+
289
+ ## Bundle considerations
290
+
291
+ This package depends on `streamdown`, `shiki`, `mermaid`, and `katex`
292
+ for code/markdown rendering. Together they weigh ~20 MB minified.
293
+
294
+ In host apps that don't always show the chat panel (e.g. Studio's
295
+ opt-in AI sidebar), import this package via `React.lazy` so the heavy
296
+ chunks only download when the panel actually opens. See
297
+ `apps/studio/src/routes/__root.tsx` for the reference pattern, and
298
+ `apps/studio/vite.config.ts` for the `manualChunks` rules that keep
299
+ the chat-only deps in dedicated, lazy-loadable chunks.
300
+
258
301
  ## License
259
302
 
260
303
  MIT © ObjectStack Inc.