@object-ui/plugin-chatbot 5.4.2 → 6.0.0
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 +28 -0
- package/README.md +43 -0
- package/dist/index.js +1311 -581
- package/dist/index.umd.cjs +1 -1
- package/dist/packages/plugin-chatbot/src/AiPendingActionsInbox.d.ts +38 -0
- package/dist/packages/plugin-chatbot/src/AiPendingActionsInbox.d.ts.map +1 -0
- package/dist/packages/plugin-chatbot/src/ChatbotEnhanced.d.ts +27 -0
- package/dist/packages/plugin-chatbot/src/ChatbotEnhanced.d.ts.map +1 -1
- package/dist/packages/plugin-chatbot/src/index.d.ts +7 -1
- package/dist/packages/plugin-chatbot/src/index.d.ts.map +1 -1
- package/dist/packages/plugin-chatbot/src/mapMessages.d.ts.map +1 -1
- package/dist/packages/plugin-chatbot/src/useHitlInChat.d.ts +66 -0
- package/dist/packages/plugin-chatbot/src/useHitlInChat.d.ts.map +1 -0
- package/dist/packages/plugin-chatbot/src/usePendingActions.d.ts +120 -0
- package/dist/packages/plugin-chatbot/src/usePendingActions.d.ts.map +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @object-ui/plugin-chatbot
|
|
2
2
|
|
|
3
|
+
## 6.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 451bbee: **HITL conversation loop:** `useHitlInChat` now accepts a
|
|
8
|
+
`continueConversation(prompt, ctx)` callback. After the operator approves
|
|
9
|
+
or rejects a tool call from inline chat buttons, the hook synthesises a
|
|
10
|
+
short follow-up user prompt (tagged `[HITL pa_xxx]`, with the executed
|
|
11
|
+
result or rejection reason) and invokes the callback so the LLM
|
|
12
|
+
continues the conversation with full awareness of the outcome.
|
|
13
|
+
|
|
14
|
+
`ConsoleFloatingChatbot` wires this callback to `useObjectChat`'s
|
|
15
|
+
`sendMessage`, closing the loop end-to-end. Execution failures stay
|
|
16
|
+
visible in the inline status badge but do NOT continue automatically —
|
|
17
|
+
the operator decides next steps.
|
|
18
|
+
|
|
19
|
+
No framework changes required. Internal `idMap` now also tracks the
|
|
20
|
+
tool name so the synthesised prompt is human-readable. New test suite
|
|
21
|
+
`useHitlInChat.test.tsx` covers approve/reject/failed/no-callback
|
|
22
|
+
branches.
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- @object-ui/types@6.0.0
|
|
27
|
+
- @object-ui/core@6.0.0
|
|
28
|
+
- @object-ui/react@6.0.0
|
|
29
|
+
- @object-ui/components@6.0.0
|
|
30
|
+
|
|
3
31
|
## 5.4.2
|
|
4
32
|
|
|
5
33
|
### 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.
|