@mast-ai/react-ui 0.4.0 → 0.6.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/index.d.ts +1 -1
- package/dist/index.js +381 -360
- package/dist/types.d.ts +31 -9
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -83,6 +83,29 @@ export interface ToolEventEntry {
|
|
|
83
83
|
*/
|
|
84
84
|
status?: ToolCallStatus;
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* A thinking/reasoning block produced during one LLM turn.
|
|
88
|
+
*
|
|
89
|
+
* Created when the first `thinking` delta arrives after a tool call (or at
|
|
90
|
+
* the very start of the stream) and accumulated until the next tool call or
|
|
91
|
+
* the end of the turn. Multiple `ThinkingEntry` blocks may appear in
|
|
92
|
+
* `ConversationEntry.contentBlocks` when the model thinks, calls a tool,
|
|
93
|
+
* then thinks again.
|
|
94
|
+
*/
|
|
95
|
+
export interface ThinkingEntry {
|
|
96
|
+
/** Stable identifier used as the React `key` for this block. */
|
|
97
|
+
id: string;
|
|
98
|
+
/** Discriminator. */
|
|
99
|
+
type: 'thinking';
|
|
100
|
+
/** Accumulated reasoning text. Grows with each `thinking` delta. */
|
|
101
|
+
content: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A single content block within an assistant turn. Either a thinking/reasoning
|
|
105
|
+
* trace or a tool invocation. The array is ordered by arrival time, so
|
|
106
|
+
* thinking blocks and tool calls are interleaved in the sequence they occurred.
|
|
107
|
+
*/
|
|
108
|
+
export type ContentBlock = ThinkingEntry | ToolEventEntry;
|
|
86
109
|
/**
|
|
87
110
|
* The rendered state of a single turn in the conversation.
|
|
88
111
|
*
|
|
@@ -104,16 +127,15 @@ export interface ConversationEntry {
|
|
|
104
127
|
*/
|
|
105
128
|
text: string;
|
|
106
129
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* in-place as the tool executes.
|
|
130
|
+
* Ordered list of content blocks produced during this assistant turn.
|
|
131
|
+
*
|
|
132
|
+
* Each `thinking` delta is accumulated into the last `ThinkingEntry` block,
|
|
133
|
+
* or starts a new one when the previous block is a tool call. Each
|
|
134
|
+
* `tool_call_started` event appends a `ToolEventEntry`. The ordering
|
|
135
|
+
* faithfully reflects the sequence in which thinking and tool calls occurred,
|
|
136
|
+
* so multi-turn reasoning (think → tool → think again) renders correctly.
|
|
115
137
|
*/
|
|
116
|
-
|
|
138
|
+
contentBlocks: ContentBlock[];
|
|
117
139
|
/**
|
|
118
140
|
* `true` while the assistant is generating this entry; `false` once `done`,
|
|
119
141
|
* an error, or a cancellation is received.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mast-ai/react-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"format": "prettier --write src"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@mast-ai/core": "^0.
|
|
38
|
+
"@mast-ai/core": "^0.6.0",
|
|
39
39
|
"@tanstack/react-virtual": ">=3.0.0",
|
|
40
40
|
"react": ">=19.0.0",
|
|
41
41
|
"react-dom": ">=19.0.0"
|