@object-ui/plugin-chatbot 6.2.3 → 7.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/README.md +60 -4
  3. package/dist/{packages/plugin-chatbot/src/AiPendingActionsInbox.d.ts → AiPendingActionsInbox.d.ts} +17 -1
  4. package/dist/AiPendingActionsInbox.d.ts.map +1 -0
  5. package/dist/ChatbotEnhanced.d.ts +568 -0
  6. package/dist/ChatbotEnhanced.d.ts.map +1 -0
  7. package/dist/{packages/plugin-chatbot/src/FloatingChatbot.d.ts → FloatingChatbot.d.ts} +1 -1
  8. package/dist/FloatingChatbot.d.ts.map +1 -0
  9. package/dist/{packages/plugin-chatbot/src/FloatingChatbotPanel.d.ts → FloatingChatbotPanel.d.ts} +1 -1
  10. package/dist/FloatingChatbotPanel.d.ts.map +1 -0
  11. package/dist/{packages/plugin-chatbot/src/FloatingChatbotProvider.d.ts → FloatingChatbotProvider.d.ts} +1 -1
  12. package/dist/FloatingChatbotProvider.d.ts.map +1 -0
  13. package/dist/{packages/plugin-chatbot/src/FloatingChatbotTrigger.d.ts → FloatingChatbotTrigger.d.ts} +2 -1
  14. package/dist/FloatingChatbotTrigger.d.ts.map +1 -0
  15. package/dist/agentAliases.d.ts +57 -0
  16. package/dist/agentAliases.d.ts.map +1 -0
  17. package/dist/{packages/plugin-chatbot/src/elements → elements}/code-block.d.ts +2 -2
  18. package/dist/elements/code-block.d.ts.map +1 -0
  19. package/dist/{packages/plugin-chatbot/src/elements → elements}/conversation.d.ts +4 -4
  20. package/dist/elements/conversation.d.ts.map +1 -0
  21. package/dist/elements/index.d.ts.map +1 -0
  22. package/dist/{packages/plugin-chatbot/src/elements → elements}/loader.d.ts +1 -1
  23. package/dist/elements/loader.d.ts.map +1 -0
  24. package/dist/{packages/plugin-chatbot/src/elements → elements}/message.d.ts +14 -14
  25. package/dist/elements/message.d.ts.map +1 -0
  26. package/dist/{packages/plugin-chatbot/src/elements → elements}/prompt-input.d.ts +38 -37
  27. package/dist/elements/prompt-input.d.ts.map +1 -0
  28. package/dist/{packages/plugin-chatbot/src/elements → elements}/reasoning.d.ts +3 -3
  29. package/dist/elements/reasoning.d.ts.map +1 -0
  30. package/dist/{packages/plugin-chatbot/src/elements → elements}/shimmer.d.ts +2 -2
  31. package/dist/elements/shimmer.d.ts.map +1 -0
  32. package/dist/{packages/plugin-chatbot/src/elements → elements}/sources.d.ts +4 -4
  33. package/dist/elements/sources.d.ts.map +1 -0
  34. package/dist/{packages/plugin-chatbot/src/elements → elements}/suggestion.d.ts +2 -2
  35. package/dist/elements/suggestion.d.ts.map +1 -0
  36. package/dist/{packages/plugin-chatbot/src/elements → elements}/tool.d.ts +5 -5
  37. package/dist/elements/tool.d.ts.map +1 -0
  38. package/dist/{packages/plugin-chatbot/src/elements → elements}/ui/button-group.d.ts +3 -3
  39. package/dist/elements/ui/button-group.d.ts.map +1 -0
  40. package/dist/{packages/plugin-chatbot/src/elements → elements}/ui/input-group.d.ts +6 -6
  41. package/dist/elements/ui/input-group.d.ts.map +1 -0
  42. package/dist/index.d.ts +70 -2
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +2004 -987
  45. package/dist/index.umd.cjs +1 -1
  46. package/dist/mapMessages.d.ts +147 -0
  47. package/dist/mapMessages.d.ts.map +1 -0
  48. package/dist/renderer.d.ts.map +1 -0
  49. package/dist/{packages/plugin-chatbot/src/tool-display.d.ts → tool-display.d.ts} +23 -0
  50. package/dist/tool-display.d.ts.map +1 -0
  51. package/dist/{packages/plugin-chatbot/src/useAgents.d.ts → useAgents.d.ts} +28 -0
  52. package/dist/useAgents.d.ts.map +1 -0
  53. package/dist/useHitlInChat.d.ts.map +1 -0
  54. package/dist/{packages/plugin-chatbot/src/useObjectChat.d.ts → useObjectChat.d.ts} +37 -1
  55. package/dist/useObjectChat.d.ts.map +1 -0
  56. package/dist/usePendingActions.d.ts.map +1 -0
  57. package/dist/utils.d.ts.map +1 -0
  58. package/package.json +16 -16
  59. package/dist/packages/plugin-chatbot/src/AiPendingActionsInbox.d.ts.map +0 -1
  60. package/dist/packages/plugin-chatbot/src/ChatbotEnhanced.d.ts +0 -171
  61. package/dist/packages/plugin-chatbot/src/ChatbotEnhanced.d.ts.map +0 -1
  62. package/dist/packages/plugin-chatbot/src/FloatingChatbot.d.ts.map +0 -1
  63. package/dist/packages/plugin-chatbot/src/FloatingChatbotPanel.d.ts.map +0 -1
  64. package/dist/packages/plugin-chatbot/src/FloatingChatbotProvider.d.ts.map +0 -1
  65. package/dist/packages/plugin-chatbot/src/FloatingChatbotTrigger.d.ts.map +0 -1
  66. package/dist/packages/plugin-chatbot/src/elements/code-block.d.ts.map +0 -1
  67. package/dist/packages/plugin-chatbot/src/elements/conversation.d.ts.map +0 -1
  68. package/dist/packages/plugin-chatbot/src/elements/index.d.ts.map +0 -1
  69. package/dist/packages/plugin-chatbot/src/elements/loader.d.ts.map +0 -1
  70. package/dist/packages/plugin-chatbot/src/elements/message.d.ts.map +0 -1
  71. package/dist/packages/plugin-chatbot/src/elements/prompt-input.d.ts.map +0 -1
  72. package/dist/packages/plugin-chatbot/src/elements/reasoning.d.ts.map +0 -1
  73. package/dist/packages/plugin-chatbot/src/elements/shimmer.d.ts.map +0 -1
  74. package/dist/packages/plugin-chatbot/src/elements/sources.d.ts.map +0 -1
  75. package/dist/packages/plugin-chatbot/src/elements/suggestion.d.ts.map +0 -1
  76. package/dist/packages/plugin-chatbot/src/elements/tool.d.ts.map +0 -1
  77. package/dist/packages/plugin-chatbot/src/elements/ui/button-group.d.ts.map +0 -1
  78. package/dist/packages/plugin-chatbot/src/elements/ui/input-group.d.ts.map +0 -1
  79. package/dist/packages/plugin-chatbot/src/index.d.ts +0 -68
  80. package/dist/packages/plugin-chatbot/src/index.d.ts.map +0 -1
  81. package/dist/packages/plugin-chatbot/src/mapMessages.d.ts +0 -45
  82. package/dist/packages/plugin-chatbot/src/mapMessages.d.ts.map +0 -1
  83. package/dist/packages/plugin-chatbot/src/renderer.d.ts.map +0 -1
  84. package/dist/packages/plugin-chatbot/src/tool-display.d.ts.map +0 -1
  85. package/dist/packages/plugin-chatbot/src/useAgents.d.ts.map +0 -1
  86. package/dist/packages/plugin-chatbot/src/useHitlInChat.d.ts.map +0 -1
  87. package/dist/packages/plugin-chatbot/src/useObjectChat.d.ts.map +0 -1
  88. package/dist/packages/plugin-chatbot/src/usePendingActions.d.ts.map +0 -1
  89. package/dist/packages/plugin-chatbot/src/utils.d.ts.map +0 -1
  90. /package/dist/{packages/plugin-chatbot/src/elements → elements}/index.d.ts +0 -0
  91. /package/dist/{packages/plugin-chatbot/src/renderer.d.ts → renderer.d.ts} +0 -0
  92. /package/dist/{packages/plugin-chatbot/src/useHitlInChat.d.ts → useHitlInChat.d.ts} +0 -0
  93. /package/dist/{packages/plugin-chatbot/src/usePendingActions.d.ts → usePendingActions.d.ts} +0 -0
  94. /package/dist/{packages/plugin-chatbot/src/utils.d.ts → utils.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,99 @@
1
1
  # @object-ui/plugin-chatbot
2
2
 
3
+ ## 7.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 81c0777: feat(studio): ADR-0033 Phase B — draft review surface (chat → designer → generic diff)
8
+
9
+ Closes the AI metadata-authoring loop in Studio. The framework (ADR-0033 Phases A + C) makes the assistant stage every change as a DRAFT; this lets a human see and review those drafts.
10
+
11
+ **`@object-ui/plugin-chatbot`**
12
+
13
+ - `mapMessages` now detects the framework's draft envelopes — `{ status:'drafted', type, name, … }` (single) and `{ status:'drafted', drafted:[{type,name}] }` (apply_blueprint batch) — and lifts the reviewable targets onto `ChatToolInvocation.draftReview` (mirrors the existing HITL `pendingActionId` path; the Vercel `{type:'text',value}` wrapper is peeled). `blueprint_proposed` is intentionally not surfaced (no draft yet).
14
+ - `ChatbotEnhanced` renders a **"Review N change(s)"** button on drafted tool results, driven by a new `onReviewDraft` callback prop.
15
+
16
+ **`@object-ui/app-shell`**
17
+
18
+ - `assistantBus` gains a review channel (`requestReview` / `requestAssistantReview`); `ConsoleFloatingChatbot` wires the chat button to it; a small navigator inside `AppContent` (which knows the app base) routes to `/apps/:appName/metadata/:type/:name?review=1`.
19
+ - `ResourceEditPage` honours `?review=1`: it force-reloads the pending draft (covers the case where the AI drafted the item after the page mounted) and opens the review/diff.
20
+ - New **`DraftReviewPanel`** — a generic, type-agnostic draft↔published structural diff (added / changed / removed by key), reusing `LayeredDiff`'s `computeDiffRows`. It gives **every** metadata type (view, dashboard, flow, …) a real "what will publishing change" review, surfaced as a toolbar affordance + sheet whenever a draft exists. The object designer keeps its richer per-field review.
21
+
22
+ Nothing is published by any of this — the human still clicks Publish.
23
+
24
+ - 9049bbe: Add end-user friendly agent process summaries for chatbot tool calls, with a debug mode for raw reasoning and tool details. Console chat surfaces now keep a sanitized browser-side display cache so refreshes can restore user/assistant text plus grouped tool states when the backend returns no message rows.
25
+ - 053c948: feat(plugin-chatbot): render AI data-query charts inline (`data-chart`)
26
+
27
+ Companion to the framework `visualize_data` tool: the data-query assistant can
28
+ now answer with a CHART rendered right in the assistant bubble.
29
+
30
+ - `mapMessages.ts` — `extractCharts()` lifts every `data-chart` custom stream
31
+ part onto `ChatMessage.charts` (defensive narrowing; preserves multiple charts
32
+ in order), mirroring the existing `data-build-progress` → `buildProgress` path.
33
+ - `ChatbotEnhanced.tsx` — renders each chart via `<SchemaRenderer schema={{
34
+ type:'chart', … }}/>` (decoupled — no hard dep on `plugin-charts`), giving the
35
+ chart a definite `width: min(520px, 80vw)` so recharts' `ResponsiveContainer`
36
+ measures a stable non-zero width inside the `w-fit` bubble (otherwise the
37
+ circular width dependency leaves bars unpainted).
38
+
39
+ - 053c948: feat(plugin-chatbot): honest liveness indicator on running AI turns
40
+
41
+ AI app builds run 1–3 min with long quiet gaps (LLM thinking, sample-data
42
+ generation) where a static spinner is indistinguishable from a dropped
43
+ connection. The chat now shows a Claude-Code-style liveness indicator driven by
44
+ REAL observed stream activity, not a free-running clock:
45
+
46
+ - `useTurnLiveness(active, activityKey)` stamps the moment real data arrives (a
47
+ streamed token / tool delta / `data-build-progress` update) and measures
48
+ seconds-since-last-byte.
49
+ - `LivenessIndicator` renders three honest states — _receiving_ (emerald pulse +
50
+ m:ss, bytes arrived recently), _waiting_ (request in flight, nothing back yet),
51
+ and _stalled_ (amber + "no response for Ns", genuinely silent past 6s).
52
+ - The build panel prefers the server's monotonic `seq` keep-alive heartbeat as
53
+ its activity key (falling back to the content signature on older runtimes), so
54
+ a long quiet seed-generation window reads as honestly _receiving_ rather than
55
+ flipping to amber.
56
+
57
+ ### Patch Changes
58
+
59
+ - 40c79df: Improve the floating chatbot flow with responsive panel bounds, safer FAB placement, inline responding and stop states, and clearer retryable error feedback.
60
+ - Updated dependencies [5976ba3]
61
+ - Updated dependencies [a00e16d]
62
+ - Updated dependencies [eaccefd]
63
+ - Updated dependencies [f7f325d]
64
+ - Updated dependencies [c12986e]
65
+ - Updated dependencies [71d7ce0]
66
+ - Updated dependencies [053c948]
67
+ - Updated dependencies [ddbe4a2]
68
+ - Updated dependencies [2d47e94]
69
+ - Updated dependencies [9049bbe]
70
+ - Updated dependencies [6c0c92c]
71
+ - Updated dependencies [cb2fdb1]
72
+ - Updated dependencies [c3749eb]
73
+ - Updated dependencies [6cfa330]
74
+ - Updated dependencies [ad8ade6]
75
+ - Updated dependencies [d54346c]
76
+ - Updated dependencies [3870c20]
77
+ - Updated dependencies [2eb3096]
78
+ - Updated dependencies [b88c560]
79
+ - Updated dependencies [d16566f]
80
+ - Updated dependencies [90acb7f]
81
+ - Updated dependencies [7913390]
82
+ - Updated dependencies [1394e34]
83
+ - Updated dependencies [e95cc25]
84
+ - Updated dependencies [abe8ebc]
85
+ - Updated dependencies [300d755]
86
+ - Updated dependencies [bd8b054]
87
+ - Updated dependencies [4eb9cb6]
88
+ - Updated dependencies [7c239fd]
89
+ - Updated dependencies [858ad94]
90
+ - Updated dependencies [2270239]
91
+ - Updated dependencies [8d1195d]
92
+ - @object-ui/core@7.0.0
93
+ - @object-ui/components@7.0.0
94
+ - @object-ui/react@7.0.0
95
+ - @object-ui/types@7.0.0
96
+
3
97
  ## 6.2.3
4
98
 
5
99
  ### Patch Changes
package/README.md CHANGED
@@ -161,6 +161,18 @@ VITE_AI_DEFAULT_AGENT=sales_copilot
161
161
  The picker lets the user switch agents at runtime; switching transparently
162
162
  remounts the chat hook against the new agent's `/chat` endpoint.
163
163
 
164
+ The floating panel is responsive by default. On desktop it uses the configured
165
+ `panelWidth` / `panelHeight`; on narrow browser viewports it expands between
166
+ safe side gutters, stays above the mobile bottom navigation area, and hides the
167
+ FAB while open so the close button in the panel header is the only active
168
+ dismiss control.
169
+
170
+ During a conversation, the chat surface renders an inline assistant responding
171
+ indicator while the backend is streaming, keeps message actions quiet until
172
+ hover/focus, and summarizes backend failures into a compact retryable notice
173
+ with optional technical details. The prompt submit control also becomes a
174
+ dedicated stop button while a response is in progress.
175
+
164
176
  This plugin automatically registers with ObjectUI's component registry when imported:
165
177
 
166
178
  ```tsx
@@ -286,17 +298,61 @@ function MyChat() {
286
298
  variant. Both are also used internally by `useObjectChat`, so the
287
299
  mapping logic stays consistent across direct and managed usage.
288
300
 
301
+ ### Surface chrome
302
+
303
+ `ChatbotEnhanced` defaults to `surface="card"`, which keeps the bordered panel
304
+ chrome suitable for dashboards, sidebars, and floating chat windows. Full-page
305
+ chat routes can use `surface="plain"` to remove the outer panel border and let
306
+ messages, controls, and the prompt input sit in a continuous workspace:
307
+
308
+ ```tsx
309
+ <ChatbotEnhanced
310
+ messages={messages}
311
+ surface="plain"
312
+ hideClearBar
313
+ />
314
+ ```
315
+
316
+ ### Agent process visibility
317
+
318
+ `ChatbotEnhanced` defaults to an end-user friendly agent process view. Tool
319
+ calls are grouped into a compact activity summary, repeated calls collapse into
320
+ one row, raw tool names are hidden, and reasoning text is not rendered. This
321
+ keeps the final answer as the primary reading target while still showing that
322
+ the assistant is doing work.
323
+
324
+ Use `processVisibility="debug"` for developer or admin trace surfaces that need
325
+ the full reasoning panel, raw tool names, tool parameters, and tool results:
326
+
327
+ ```tsx
328
+ <ChatbotEnhanced
329
+ messages={messages}
330
+ processVisibility="debug"
331
+ />
332
+ ```
333
+
334
+ Use `processVisibility="hidden"` when a host wants to suppress non-interactive
335
+ agent activity entirely. Human-in-the-loop approvals and draft review actions
336
+ remain visible so users can still complete required decisions.
337
+
338
+ Console hosts also keep a sanitized browser-side display cache for the active
339
+ conversation. If the backend conversation record is available but returns no
340
+ message rows on refresh, the UI can restore user/assistant text plus grouped
341
+ tool names and states. The cache intentionally omits reasoning, tool
342
+ parameters, and raw tool results.
343
+
289
344
  ## Bundle considerations
290
345
 
291
346
  This package depends on `streamdown`, `shiki`, `mermaid`, and `katex`
292
347
  for code/markdown rendering. Together they weigh ~20 MB minified.
293
348
 
294
- In host apps that don't always show the chat panel (e.g. Studio's
349
+ In host apps that don't always show the chat panel (e.g. Console's
295
350
  opt-in AI sidebar), import this package via `React.lazy` so the heavy
296
351
  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.
352
+ `packages/app-shell/src/layout/ConsoleFloatingChatbot.tsx` for the
353
+ reference lazy-load pattern, and `apps/console/vite.config.ts` for the
354
+ `manualChunks` rules that keep the chat-only deps in dedicated,
355
+ lazy-loadable chunks.
300
356
 
301
357
  ## License
302
358
 
@@ -5,6 +5,22 @@
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
+ /**
9
+ * AiPendingActionsInbox — workspace UI for the AI HITL approval queue.
10
+ *
11
+ * Wires `usePendingActions` to a Card/Table layout with an in-place
12
+ * detail drawer and approve / reject buttons. Designed to drop into both
13
+ * Console (`system/ai/pending-actions`) and Studio (assistant builder
14
+ * traces panel) without further glue — pass `apiBase` + `headers` and you
15
+ * get the whole flow.
16
+ *
17
+ * Stays inside `@object-ui/plugin-chatbot` so the AI bundle (already
18
+ * loaded when a chatbot mounts) holds the inbox too. No extra route-
19
+ * level code-split needed.
20
+ *
21
+ * @module
22
+ */
23
+ import * as React from 'react';
8
24
  export interface AiPendingActionsInboxProps {
9
25
  /**
10
26
  * AI service base URL, e.g. `http://localhost:3004/api/v1/ai`.
@@ -34,5 +50,5 @@ export interface AiPendingActionsInboxProps {
34
50
  * renders rows in a table, and exposes Approve / Reject buttons plus a
35
51
  * detail drawer with raw `tool_input` / result / error.
36
52
  */
37
- export declare function AiPendingActionsInbox({ apiBase, headers, pollInterval, conversationId, variant, title, description, className, }: AiPendingActionsInboxProps): import("react/jsx-runtime").JSX.Element;
53
+ export declare function AiPendingActionsInbox({ apiBase, headers, pollInterval, conversationId, variant, title, description, className, }: AiPendingActionsInboxProps): React.JSX.Element;
38
54
  //# sourceMappingURL=AiPendingActionsInbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiPendingActionsInbox.d.ts","sourceRoot":"","sources":["../src/AiPendingActionsInbox.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoD/B,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAyDD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,EACP,OAAO,EACP,YAAmB,EACnB,cAAc,EACd,OAAgB,EAChB,KAAsB,EACtB,WAAuF,EACvF,SAAS,GACV,EAAE,0BAA0B,qBAmW5B"}