@object-ui/plugin-chatbot 5.3.1 → 5.4.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +50 -1
  3. package/dist/index.js +1615 -425
  4. package/dist/index.umd.cjs +2 -1
  5. package/dist/packages/plugin-chatbot/src/ChatbotEnhanced.d.ts +74 -5
  6. package/dist/packages/plugin-chatbot/src/ChatbotEnhanced.d.ts.map +1 -1
  7. package/dist/packages/plugin-chatbot/src/elements/code-block.d.ts +18 -0
  8. package/dist/packages/plugin-chatbot/src/elements/code-block.d.ts.map +1 -0
  9. package/dist/packages/plugin-chatbot/src/elements/conversation.d.ts +16 -0
  10. package/dist/packages/plugin-chatbot/src/elements/conversation.d.ts.map +1 -0
  11. package/dist/packages/plugin-chatbot/src/elements/index.d.ts +22 -0
  12. package/dist/packages/plugin-chatbot/src/elements/index.d.ts.map +1 -0
  13. package/dist/packages/plugin-chatbot/src/elements/loader.d.ts +6 -0
  14. package/dist/packages/plugin-chatbot/src/elements/loader.d.ts.map +1 -0
  15. package/dist/packages/plugin-chatbot/src/elements/message.d.ts +47 -0
  16. package/dist/packages/plugin-chatbot/src/elements/message.d.ts.map +1 -0
  17. package/dist/packages/plugin-chatbot/src/elements/prompt-input.d.ts +185 -0
  18. package/dist/packages/plugin-chatbot/src/elements/prompt-input.d.ts.map +1 -0
  19. package/dist/packages/plugin-chatbot/src/elements/reasoning.d.ts +27 -0
  20. package/dist/packages/plugin-chatbot/src/elements/reasoning.d.ts.map +1 -0
  21. package/dist/packages/plugin-chatbot/src/elements/shimmer.d.ts +10 -0
  22. package/dist/packages/plugin-chatbot/src/elements/shimmer.d.ts.map +1 -0
  23. package/dist/packages/plugin-chatbot/src/elements/sources.d.ts +13 -0
  24. package/dist/packages/plugin-chatbot/src/elements/sources.d.ts.map +1 -0
  25. package/dist/packages/plugin-chatbot/src/elements/suggestion.d.ts +10 -0
  26. package/dist/packages/plugin-chatbot/src/elements/suggestion.d.ts.map +1 -0
  27. package/dist/packages/plugin-chatbot/src/elements/tool.d.ts +24 -0
  28. package/dist/packages/plugin-chatbot/src/elements/tool.d.ts.map +1 -0
  29. package/dist/packages/plugin-chatbot/src/elements/ui/button-group.d.ts +12 -0
  30. package/dist/packages/plugin-chatbot/src/elements/ui/button-group.d.ts.map +1 -0
  31. package/dist/packages/plugin-chatbot/src/elements/ui/input-group.d.ts +17 -0
  32. package/dist/packages/plugin-chatbot/src/elements/ui/input-group.d.ts.map +1 -0
  33. package/dist/packages/plugin-chatbot/src/index.d.ts +1 -0
  34. package/dist/packages/plugin-chatbot/src/index.d.ts.map +1 -1
  35. package/dist/packages/plugin-chatbot/src/useObjectChat.d.ts.map +1 -1
  36. package/package.json +13 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,76 @@
1
1
  # @object-ui/plugin-chatbot
2
2
 
3
+ ## 5.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3a8c754: Rebuilt the chatbot UI on top of **Vercel AI Elements** (MIT) and wired in
8
+ the v1 capabilities exposed by `@objectstack/service-ai` (tracing,
9
+ `generateObject`, `query_data` tool, `ModelRegistry`).
10
+ - **What's new**
11
+ - `ChatbotEnhanced` is now composed from `Conversation`, `Message`,
12
+ `PromptInput`, `Suggestion`, `Tool`, `Reasoning`, `Sources`, and friends.
13
+ Sticky-to-bottom scrolling, keyboard-aware textarea, file pill chips,
14
+ copy/retry actions, and the streaming/error banners now match the
15
+ shadcn-style AI surface used across the ecosystem.
16
+ - **Tool / reasoning / sources rendering**: assistant messages with
17
+ `toolInvocations`, `reasoning`, or `sources` automatically render the
18
+ collapsible tool panels, the chain-of-thought block, and the citation
19
+ pill. `useObjectChat` parses these directly from `vercel/ai`'s
20
+ `UIMessage.parts` stream — no extra wiring needed at the call site.
21
+ - **Model picker**: optional `models` + `selectedModelId` + `onModelChange`
22
+ props render an inline `<select>` in the prompt-input toolbar. Designed
23
+ to be fed straight from `GET /api/v1/ai/models` (new in service-ai
24
+ v1).
25
+ - **Trace links**: new optional `traceId` on `ChatMessage` surfaces a
26
+ small "trace" link on assistant messages — pair with the `ai_traces`
27
+ object exposed by service-ai's auto-tracing.
28
+ - New optional `suggestions?: string[]` prop renders a chip row in the
29
+ empty state and forwards the picked suggestion to `onSendMessage`.
30
+ - All vendored AI Elements (10 components) plus two missing shadcn
31
+ primitives (`button-group`, `input-group`) are exported as a namespace —
32
+ `import { AIElements } from '@object-ui/plugin-chatbot'` — so apps can
33
+ compose bespoke chat surfaces without dropping back to the legacy
34
+ primitives.
35
+ - **Type-level changes**
36
+ - `@object-ui/types` `ChatMessage` gains optional `reasoning`, `sources`,
37
+ `traceId` fields, and a new `ChatMessageSource` interface.
38
+ - `ChatToolInvocation` accepts the AI SDK v6 lifecycle states
39
+ (`input-streaming`/`input-available`/`output-available`/`output-error`/
40
+ …) in addition to the legacy `partial-call`/`call`/`result`. `args`
41
+ is now optional and accepts arbitrary shapes; new optional `errorText`
42
+ field.
43
+ - **What hasn't changed**
44
+ - Public prop signature on `FloatingChatbot`, `FloatingChatbotPanel`, and
45
+ the SDUI `"chatbot"` renderer.
46
+ - Hook contracts: `useObjectChat`, `useAgents`,
47
+ `useFloatingChatbot`.
48
+ - SSR / Tailwind 4 / React 18+19 support.
49
+ - **Under the hood**
50
+ - New deps: `streamdown`, `use-stick-to-bottom`, `shiki`, `motion`,
51
+ `nanoid`, `@radix-ui/react-use-controllable-state`,
52
+ `@radix-ui/react-slot`, `class-variance-authority`.
53
+ - Vendored sources live under `src/elements/` with header comments pointing
54
+ back to `registry.ai-sdk.dev`. Rule #7 No-Touch Zones are respected —
55
+ `packages/components/src/ui/**` was not modified.
56
+
57
+ ### Patch Changes
58
+
59
+ - Updated dependencies [3a8c754]
60
+ - @object-ui/types@5.4.0
61
+ - @object-ui/components@5.4.0
62
+ - @object-ui/core@5.4.0
63
+ - @object-ui/react@5.4.0
64
+
65
+ ## 5.3.2
66
+
67
+ ### Patch Changes
68
+
69
+ - @object-ui/types@5.3.2
70
+ - @object-ui/core@5.3.2
71
+ - @object-ui/react@5.3.2
72
+ - @object-ui/components@5.3.2
73
+
3
74
  ## 5.3.1
4
75
 
5
76
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # @object-ui/plugin-chatbot
2
2
 
3
- Chatbot interface plugin for Object UI with full AI SDUI support.
3
+ Chatbot interface plugin for Object UI with full AI SDUI support, built on
4
+ [Vercel AI Elements](https://elements.ai-sdk.dev) (MIT) and
5
+ [shadcn/ui](https://ui.shadcn.com) (MIT).
6
+
7
+ > Why AI Elements? They give us a production-grade, shadcn-style chat
8
+ > surface — conversation, message bubbles, streaming reasoning, tool calls,
9
+ > sources, code blocks, suggestions — that already matches our Tailwind 4
10
+ > design tokens. We vendor them into `src/elements/` so we can ship without a
11
+ > network dep, and we wrap them inside `ChatbotEnhanced` to keep the public
12
+ > ObjectUI prop API stable. See [Architecture](#architecture) below.
4
13
 
5
14
  ## Installation
6
15
 
@@ -210,6 +219,46 @@ const aiSchema = {
210
219
  - 🤝 [Contributing Guide](https://github.com/objectstack-ai/objectui/blob/main/CONTRIBUTING.md)
211
220
  - 🗺️ [Roadmap](https://github.com/objectstack-ai/objectui/blob/main/ROADMAP.md)
212
221
 
222
+ ## Architecture
223
+
224
+ Internally the chatbot is composed from three layers:
225
+
226
+ ```
227
+ ┌─────────────────────────────────────────────────────┐
228
+ │ ChatbotEnhanced (public surface, stable props) │
229
+ │ ├─ Conversation / Message (AI Elements) │
230
+ │ ├─ PromptInput (AI Elements) │
231
+ │ └─ Suggestion / Reasoning / Tool (AI Elements) │
232
+ ├─────────────────────────────────────────────────────┤
233
+ │ src/elements/ │
234
+ │ Vendored Vercel AI Elements + missing shadcn │
235
+ │ primitives (button-group, input-group). Rewritten │
236
+ │ to import from `@object-ui/components`. Do NOT │
237
+ │ edit — re-sync from registry.ai-sdk.dev. │
238
+ ├─────────────────────────────────────────────────────┤
239
+ │ @object-ui/components (shadcn + Tailwind 4) │
240
+ └─────────────────────────────────────────────────────┘
241
+ ```
242
+
243
+ The vendored components are also re-exported under a namespace for advanced
244
+ users who want to compose their own chat surface:
245
+
246
+ ```tsx
247
+ import { AIElements } from '@object-ui/plugin-chatbot';
248
+
249
+ <AIElements.Conversation>
250
+ <AIElements.ConversationContent>
251
+ <AIElements.Message from="assistant">
252
+ <AIElements.MessageContent>Hello.</AIElements.MessageContent>
253
+ </AIElements.Message>
254
+ </AIElements.ConversationContent>
255
+ </AIElements.Conversation>;
256
+ ```
257
+
213
258
  ## License
214
259
 
215
260
  MIT © ObjectStack Inc.
261
+
262
+ Third-party code shipped under `src/elements/`:
263
+ - **Vercel AI Elements** — MIT © Vercel, Inc.
264
+ - **shadcn/ui** primitives (`button-group`, `input-group`) — MIT © shadcn.