@mast-ai/react-ui 0.2.0 → 0.3.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/dist/components/MessageList.d.ts +4 -2
- package/dist/context.d.ts +25 -10
- package/dist/index.js +526 -493
- package/package.json +2 -2
|
@@ -49,8 +49,10 @@ export interface MessageListProps {
|
|
|
49
49
|
* `virtualizer.measureElement`, so messages with long tool call results or
|
|
50
50
|
* large markdown blocks expand the viewport correctly.
|
|
51
51
|
*
|
|
52
|
-
* Auto-scrolls to the bottom whenever
|
|
53
|
-
*
|
|
52
|
+
* Auto-scrolls to the bottom whenever the content grows (new entry, streaming
|
|
53
|
+
* text deltas, thinking/tool blocks expanding) **only if** the user is already
|
|
54
|
+
* at the bottom of the list. If the user has scrolled up to read an earlier
|
|
55
|
+
* message, their scroll position is preserved until they scroll back down.
|
|
54
56
|
*
|
|
55
57
|
* Reads `messages` from `useAgent()`, so this component must be rendered
|
|
56
58
|
* inside an `<AgentProvider>`.
|
package/dist/context.d.ts
CHANGED
|
@@ -35,8 +35,13 @@ export interface AgentProviderProps {
|
|
|
35
35
|
* {@link import('./approval.js').INLINE_APPROVAL} to defer to the inline
|
|
36
36
|
* approval queue exposed via `useAgent().pendingApprovals`.
|
|
37
37
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
38
|
+
* Defaults to a callback that returns `INLINE_APPROVAL` for every call when
|
|
39
|
+
* omitted, so tools marked `requiresApproval: true` always pause for user
|
|
40
|
+
* confirmation by default. Apps that already render `<InlineApproval>` (or
|
|
41
|
+
* read `useAgent().pendingApprovals`) get a working approval flow with no
|
|
42
|
+
* additional wiring. Provide a custom callback to plug in a different
|
|
43
|
+
* confirmation UI, auto-approve specific tools, inject canned results, or
|
|
44
|
+
* short-circuit cancellations.
|
|
40
45
|
*/
|
|
41
46
|
onApprovalRequired?: OnApprovalRequired;
|
|
42
47
|
/**
|
|
@@ -66,18 +71,28 @@ export interface AgentProviderProps {
|
|
|
66
71
|
*/
|
|
67
72
|
onConversationChange?: (history: Message[], entries: ConversationEntry[]) => void;
|
|
68
73
|
/**
|
|
69
|
-
* Forces a theme on the auto-rendered `[data-mast-root]` wrapper.
|
|
70
|
-
*
|
|
71
|
-
*
|
|
74
|
+
* Forces a theme on the auto-rendered `[data-mast-root]` wrapper. Only
|
|
75
|
+
* meaningful when `disableRoot` is explicitly `false` (so the provider
|
|
76
|
+
* actually renders the wrapper); when omitted or `true`, this prop has no
|
|
77
|
+
* effect and consumers should set `data-mast-theme` themselves on whatever
|
|
78
|
+
* element carries `data-mast-root`. When the wrapper is rendered without a
|
|
79
|
+
* theme set, the panel follows OS preference via the default stylesheet's
|
|
80
|
+
* `prefers-color-scheme` media query.
|
|
72
81
|
*/
|
|
73
82
|
theme?: 'light' | 'dark';
|
|
74
83
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* tree yourself, e.g. on a chat sidebar's outer container so additional
|
|
78
|
-
* non-library UI inside also picks up the library's CSS variables.
|
|
84
|
+
* Controls whether the provider renders an auto wrapper `<div data-mast-root>`
|
|
85
|
+
* around `children`.
|
|
79
86
|
*
|
|
80
|
-
* Default: `
|
|
87
|
+
* Default: `true` — the provider is transparent in the DOM and consumers
|
|
88
|
+
* are responsible for placing `data-mast-root` themselves (typically on the
|
|
89
|
+
* outermost container, or implicitly via `<ConversationPanel>` which carries
|
|
90
|
+
* its own `data-mast-root`). This avoids the auto wrapper's panel chrome
|
|
91
|
+
* (border, padding, `height: 100%`) leaking onto whatever subtree the
|
|
92
|
+
* provider wraps, including app-root mounts.
|
|
93
|
+
*
|
|
94
|
+
* Set to `false` to opt back into the auto wrapper for zero-config setups
|
|
95
|
+
* that compose primitives directly without their own root container.
|
|
81
96
|
*/
|
|
82
97
|
disableRoot?: boolean;
|
|
83
98
|
}
|