@assistant-ui/react 0.7.69 → 0.7.71
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api/MessageRuntime.d.ts +2 -1
- package/dist/api/MessageRuntime.d.ts.map +1 -1
- package/dist/api/MessageRuntime.js +9 -2
- package/dist/api/MessageRuntime.js.map +1 -1
- package/dist/api/MessageRuntime.mjs +9 -2
- package/dist/api/MessageRuntime.mjs.map +1 -1
- package/dist/cloud/auiV0.d.ts +3 -0
- package/dist/cloud/auiV0.d.ts.map +1 -1
- package/dist/cloud/auiV0.js +6 -0
- package/dist/cloud/auiV0.js.map +1 -1
- package/dist/cloud/auiV0.mjs +6 -0
- package/dist/cloud/auiV0.mjs.map +1 -1
- package/dist/context/providers/ThreadRuntimeProvider.d.ts.map +1 -1
- package/dist/context/providers/ThreadRuntimeProvider.js +3 -5
- package/dist/context/providers/ThreadRuntimeProvider.js.map +1 -1
- package/dist/context/providers/ThreadRuntimeProvider.mjs +3 -5
- package/dist/context/providers/ThreadRuntimeProvider.mjs.map +1 -1
- package/dist/context/providers/ThreadViewportProvider.d.ts +3 -0
- package/dist/context/providers/ThreadViewportProvider.d.ts.map +1 -0
- package/dist/context/providers/ThreadViewportProvider.js +63 -0
- package/dist/context/providers/ThreadViewportProvider.js.map +1 -0
- package/dist/context/providers/ThreadViewportProvider.mjs +42 -0
- package/dist/context/providers/ThreadViewportProvider.mjs.map +1 -0
- package/dist/context/react/ThreadContext.d.ts +0 -18
- package/dist/context/react/ThreadContext.d.ts.map +1 -1
- package/dist/context/react/ThreadContext.js +2 -11
- package/dist/context/react/ThreadContext.js.map +1 -1
- package/dist/context/react/ThreadContext.mjs +1 -8
- package/dist/context/react/ThreadContext.mjs.map +1 -1
- package/dist/context/react/ThreadViewportContext.d.ts +24 -0
- package/dist/context/react/ThreadViewportContext.d.ts.map +1 -0
- package/dist/context/react/ThreadViewportContext.js +44 -0
- package/dist/context/react/ThreadViewportContext.js.map +1 -0
- package/dist/context/react/ThreadViewportContext.mjs +18 -0
- package/dist/context/react/ThreadViewportContext.mjs.map +1 -0
- package/dist/context/react/index.d.ts +2 -1
- package/dist/context/react/index.d.ts.map +1 -1
- package/dist/context/react/index.js +3 -2
- package/dist/context/react/index.js.map +1 -1
- package/dist/context/react/index.mjs +4 -2
- package/dist/context/react/index.mjs.map +1 -1
- package/dist/context/stores/ThreadViewport.d.ts.map +1 -1
- package/dist/context/stores/ThreadViewport.js +1 -0
- package/dist/context/stores/ThreadViewport.js.map +1 -1
- package/dist/context/stores/ThreadViewport.mjs +2 -0
- package/dist/context/stores/ThreadViewport.mjs.map +1 -1
- package/dist/model-context/ModelContextTypes.d.ts +3 -0
- package/dist/model-context/ModelContextTypes.d.ts.map +1 -1
- package/dist/model-context/ModelContextTypes.js.map +1 -1
- package/dist/model-context/ModelContextTypes.mjs.map +1 -1
- package/dist/primitives/contentPart/useContentPartReasoning.d.ts +5 -0
- package/dist/primitives/contentPart/useContentPartReasoning.d.ts.map +1 -0
- package/dist/primitives/contentPart/useContentPartReasoning.js +42 -0
- package/dist/primitives/contentPart/useContentPartReasoning.js.map +1 -0
- package/dist/primitives/contentPart/useContentPartReasoning.mjs +18 -0
- package/dist/primitives/contentPart/useContentPartReasoning.mjs.map +1 -0
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +3 -0
- package/dist/primitives/index.js.map +1 -1
- package/dist/primitives/index.mjs +2 -0
- package/dist/primitives/index.mjs.map +1 -1
- package/dist/primitives/message/MessageContent.d.ts +2 -1
- package/dist/primitives/message/MessageContent.d.ts.map +1 -1
- package/dist/primitives/message/MessageContent.js +5 -1
- package/dist/primitives/message/MessageContent.js.map +1 -1
- package/dist/primitives/message/MessageContent.mjs +5 -1
- package/dist/primitives/message/MessageContent.mjs.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.js +3 -4
- package/dist/primitives/thread/ThreadScrollToBottom.js.map +1 -1
- package/dist/primitives/thread/ThreadScrollToBottom.mjs +1 -2
- package/dist/primitives/thread/ThreadScrollToBottom.mjs.map +1 -1
- package/dist/primitives/thread/ThreadViewport.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadViewport.js +5 -1
- package/dist/primitives/thread/ThreadViewport.js.map +1 -1
- package/dist/primitives/thread/ThreadViewport.mjs +5 -1
- package/dist/primitives/thread/ThreadViewport.mjs.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.d.ts.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.js +2 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.js.map +1 -1
- package/dist/primitives/thread/useThreadViewportAutoScroll.mjs +2 -4
- package/dist/primitives/thread/useThreadViewportAutoScroll.mjs.map +1 -1
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.d.ts +1 -1
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.d.ts.map +1 -1
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js +1 -0
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.js.map +1 -1
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.mjs +1 -0
- package/dist/runtimes/composer/DefaultEditComposerRuntimeCore.mjs.map +1 -1
- package/dist/runtimes/edge/EdgeRuntimeRequestOptions.d.ts +6 -6
- package/dist/runtimes/edge/converters/toCoreMessages.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.js +2 -1
- package/dist/runtimes/edge/converters/toCoreMessages.js.map +1 -1
- package/dist/runtimes/edge/converters/toCoreMessages.mjs +2 -1
- package/dist/runtimes/edge/converters/toCoreMessages.mjs.map +1 -1
- package/dist/runtimes/edge/converters/toLanguageModelMessages.d.ts.map +1 -1
- package/dist/runtimes/edge/converters/toLanguageModelMessages.js +3 -0
- package/dist/runtimes/edge/converters/toLanguageModelMessages.js.map +1 -1
- package/dist/runtimes/edge/converters/toLanguageModelMessages.mjs +3 -0
- package/dist/runtimes/edge/converters/toLanguageModelMessages.mjs.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.d.ts +2 -2
- package/dist/runtimes/edge/createEdgeRuntimeAPI.d.ts.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.js +10 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.js.map +1 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.mjs +10 -1
- package/dist/runtimes/edge/createEdgeRuntimeAPI.mjs.map +1 -1
- package/dist/runtimes/edge/streams/assistantEncoderStream.d.ts.map +1 -1
- package/dist/runtimes/edge/streams/assistantEncoderStream.js +7 -0
- package/dist/runtimes/edge/streams/assistantEncoderStream.js.map +1 -1
- package/dist/runtimes/edge/streams/assistantEncoderStream.mjs +7 -0
- package/dist/runtimes/edge/streams/assistantEncoderStream.mjs.map +1 -1
- package/dist/runtimes/edge/streams/runResultStream.d.ts.map +1 -1
- package/dist/runtimes/edge/streams/runResultStream.js +19 -0
- package/dist/runtimes/edge/streams/runResultStream.js.map +1 -1
- package/dist/runtimes/edge/streams/runResultStream.mjs +19 -0
- package/dist/runtimes/edge/streams/runResultStream.mjs.map +1 -1
- package/dist/runtimes/edge/streams/toolResultStream.d.ts.map +1 -1
- package/dist/runtimes/edge/streams/toolResultStream.js +14 -15
- package/dist/runtimes/edge/streams/toolResultStream.js.map +1 -1
- package/dist/runtimes/edge/streams/toolResultStream.mjs +14 -15
- package/dist/runtimes/edge/streams/toolResultStream.mjs.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.d.ts +2 -2
- package/dist/runtimes/external-store/ThreadMessageLike.d.ts.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.js +1 -0
- package/dist/runtimes/external-store/ThreadMessageLike.js.map +1 -1
- package/dist/runtimes/external-store/ThreadMessageLike.mjs +1 -0
- package/dist/runtimes/external-store/ThreadMessageLike.mjs.map +1 -1
- package/dist/runtimes/local/ChatModelAdapter.d.ts +2 -2
- package/dist/runtimes/local/ChatModelAdapter.d.ts.map +1 -1
- package/dist/runtimes/local/ChatModelAdapter.js.map +1 -1
- package/dist/styles/index.css +57 -29
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/tailwindcss/thread.css +30 -23
- package/dist/styles/tailwindcss/thread.css.json +31 -25
- package/dist/types/AssistantTypes.d.ts +5 -1
- package/dist/types/AssistantTypes.d.ts.map +1 -1
- package/dist/types/AssistantTypes.js.map +1 -1
- package/dist/types/ContentPartComponentTypes.d.ts +3 -1
- package/dist/types/ContentPartComponentTypes.d.ts.map +1 -1
- package/dist/types/ContentPartComponentTypes.js.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/hooks/useOnScrollToBottom.js +2 -2
- package/dist/utils/hooks/useOnScrollToBottom.js.map +1 -1
- package/dist/utils/hooks/useOnScrollToBottom.mjs +1 -1
- package/dist/utils/hooks/useOnScrollToBottom.mjs.map +1 -1
- package/package.json +14 -14
- package/src/api/MessageRuntime.ts +14 -5
- package/src/cloud/auiV0.ts +11 -0
- package/src/context/providers/ThreadRuntimeProvider.tsx +4 -5
- package/src/context/providers/ThreadViewportProvider.tsx +49 -0
- package/src/context/react/ThreadContext.ts +0 -8
- package/src/context/react/ThreadViewportContext.ts +23 -0
- package/src/context/react/index.ts +4 -1
- package/src/context/stores/ThreadViewport.tsx +2 -0
- package/src/model-context/ModelContextTypes.ts +7 -0
- package/src/primitives/contentPart/useContentPartReasoning.tsx +18 -0
- package/src/primitives/index.ts +1 -0
- package/src/primitives/message/MessageContent.tsx +8 -0
- package/src/primitives/thread/ThreadScrollToBottom.tsx +1 -2
- package/src/primitives/thread/ThreadViewport.tsx +13 -1
- package/src/primitives/thread/useThreadViewportAutoScroll.tsx +2 -4
- package/src/runtimes/composer/DefaultEditComposerRuntimeCore.tsx +4 -1
- package/src/runtimes/edge/converters/toCoreMessages.ts +2 -1
- package/src/runtimes/edge/converters/toLanguageModelMessages.ts +4 -0
- package/src/runtimes/edge/createEdgeRuntimeAPI.ts +12 -3
- package/src/runtimes/edge/streams/assistantEncoderStream.ts +8 -0
- package/src/runtimes/edge/streams/runResultStream.ts +24 -0
- package/src/runtimes/edge/streams/toolResultStream.ts +21 -18
- package/src/runtimes/external-store/ThreadMessageLike.tsx +4 -2
- package/src/runtimes/local/ChatModelAdapter.tsx +2 -1
- package/src/styles/tailwindcss/thread.css +30 -23
- package/src/types/AssistantTypes.ts +7 -0
- package/src/types/ContentPartComponentTypes.tsx +4 -0
- package/src/types/index.ts +3 -0
- package/src/utils/hooks/useOnScrollToBottom.tsx +1 -1
@@ -14,6 +14,12 @@ export function runResultStream() {
|
|
14
14
|
transform(chunk, controller) {
|
15
15
|
const chunkType = chunk.type;
|
16
16
|
switch (chunkType) {
|
17
|
+
case "reasoning": {
|
18
|
+
message = appendOrUpdateReasoning(message, chunk.textDelta);
|
19
|
+
controller.enqueue(message);
|
20
|
+
break;
|
21
|
+
}
|
22
|
+
|
17
23
|
case "text-delta": {
|
18
24
|
message = appendOrUpdateText(message, chunk.textDelta);
|
19
25
|
controller.enqueue(message);
|
@@ -105,6 +111,24 @@ export function runResultStream() {
|
|
105
111
|
});
|
106
112
|
}
|
107
113
|
|
114
|
+
const appendOrUpdateReasoning= (
|
115
|
+
message: CoreChatModelRunResult,
|
116
|
+
textDelta: string,
|
117
|
+
) => {
|
118
|
+
let contentParts = message.content ?? [];
|
119
|
+
let contentPart = message.content?.at(-1);
|
120
|
+
if (contentPart?.type !== "reasoning") {
|
121
|
+
contentPart = { type: "reasoning", text: textDelta };
|
122
|
+
} else {
|
123
|
+
contentParts = contentParts.slice(0, -1);
|
124
|
+
contentPart = { type: "reasoning", text: contentPart.text + textDelta };
|
125
|
+
}
|
126
|
+
return {
|
127
|
+
...message,
|
128
|
+
content: contentParts.concat([contentPart]),
|
129
|
+
};
|
130
|
+
};
|
131
|
+
|
108
132
|
const appendOrUpdateText = (
|
109
133
|
message: CoreChatModelRunResult,
|
110
134
|
textDelta: string,
|
@@ -75,30 +75,32 @@ export function toolResultStream(
|
|
75
75
|
return;
|
76
76
|
}
|
77
77
|
|
78
|
-
if (tool.parameters instanceof z.ZodType) {
|
79
|
-
const result = tool.parameters.safeParse(args);
|
80
|
-
if (!result.success) {
|
81
|
-
controller.enqueue({
|
82
|
-
type: "tool-result",
|
83
|
-
toolCallType,
|
84
|
-
toolCallId,
|
85
|
-
toolName,
|
86
|
-
result:
|
87
|
-
"Function parameter validation failed. " +
|
88
|
-
JSON.stringify(result.error.issues),
|
89
|
-
isError: true,
|
90
|
-
});
|
91
|
-
return;
|
92
|
-
}
|
93
|
-
}
|
94
|
-
|
95
78
|
toolCallExecutions.set(
|
96
79
|
toolCallId,
|
97
80
|
(async () => {
|
98
81
|
if (!tool.execute) return;
|
99
82
|
|
83
|
+
let executeFn = tool.execute;
|
84
|
+
|
85
|
+
if (tool.parameters instanceof z.ZodType) {
|
86
|
+
const result = tool.parameters.safeParse(args);
|
87
|
+
if (!result.success) {
|
88
|
+
executeFn =
|
89
|
+
tool.experimental_onSchemaValidationError ??
|
90
|
+
(() => {
|
91
|
+
throw (
|
92
|
+
"Function parameter validation failed. " +
|
93
|
+
JSON.stringify(result.error.issues)
|
94
|
+
);
|
95
|
+
});
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
100
99
|
try {
|
101
|
-
const result = await
|
100
|
+
const result = await executeFn(args, {
|
101
|
+
toolCallId,
|
102
|
+
abortSignal,
|
103
|
+
});
|
102
104
|
|
103
105
|
controller.enqueue({
|
104
106
|
type: "tool-result",
|
@@ -126,6 +128,7 @@ export function toolResultStream(
|
|
126
128
|
|
127
129
|
// ignore other parts
|
128
130
|
case "text-delta":
|
131
|
+
case "reasoning":
|
129
132
|
case "tool-call-delta":
|
130
133
|
case "tool-result":
|
131
134
|
case "step-finish":
|
@@ -14,7 +14,7 @@ import {
|
|
14
14
|
FileContentPart,
|
15
15
|
Unstable_AudioContentPart,
|
16
16
|
} from "../../types";
|
17
|
-
import { ThreadStep } from "../../types/AssistantTypes";
|
17
|
+
import { ReasoningContentPart, ThreadStep } from "../../types/AssistantTypes";
|
18
18
|
import {
|
19
19
|
ReadonlyJSONObject,
|
20
20
|
ReadonlyJSONValue,
|
@@ -27,6 +27,7 @@ export type ThreadMessageLike = {
|
|
27
27
|
| string
|
28
28
|
| readonly (
|
29
29
|
| TextContentPart
|
30
|
+
| ReasoningContentPart
|
30
31
|
| ImageContentPart
|
31
32
|
| FileContentPart
|
32
33
|
| Unstable_AudioContentPart
|
@@ -92,6 +93,7 @@ export const fromThreadMessageLike = (
|
|
92
93
|
const type = part.type;
|
93
94
|
switch (type) {
|
94
95
|
case "text":
|
96
|
+
case "reasoning":
|
95
97
|
if (part.text.trim().length === 0) return null;
|
96
98
|
return part;
|
97
99
|
|
@@ -148,7 +150,7 @@ export const fromThreadMessageLike = (
|
|
148
150
|
return part;
|
149
151
|
|
150
152
|
default: {
|
151
|
-
const unhandledType: "tool-call" = type;
|
153
|
+
const unhandledType: "tool-call" | "reasoning" = type;
|
152
154
|
throw new Error(
|
153
155
|
`Unsupported user content part type: ${unhandledType}`,
|
154
156
|
);
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type {
|
2
2
|
MessageStatus,
|
3
|
+
ReasoningContentPart,
|
3
4
|
RunConfig,
|
4
5
|
TextContentPart,
|
5
6
|
ThreadAssistantContentPart,
|
@@ -27,7 +28,7 @@ export type ChatModelRunResult = {
|
|
27
28
|
};
|
28
29
|
|
29
30
|
export type CoreChatModelRunResult = Omit<ChatModelRunResult, "content"> & {
|
30
|
-
readonly content: readonly (TextContentPart | ToolCallContentPart)[];
|
31
|
+
readonly content: readonly (TextContentPart | ReasoningContentPart | ToolCallContentPart)[];
|
31
32
|
};
|
32
33
|
|
33
34
|
export type ChatModelRunOptions = {
|
@@ -1,11 +1,10 @@
|
|
1
1
|
/* thread */
|
2
2
|
.aui-thread-root {
|
3
3
|
@apply bg-aui-background box-border h-full;
|
4
|
-
@apply [&>.aui-thread-viewport]:bg-inherit;
|
5
4
|
}
|
6
5
|
|
7
6
|
.aui-thread-viewport {
|
8
|
-
@apply
|
7
|
+
@apply flex h-full flex-col items-center overflow-y-scroll scroll-smooth bg-inherit px-4 pt-8;
|
9
8
|
}
|
10
9
|
|
11
10
|
.aui-thread-viewport-footer {
|
@@ -60,8 +59,12 @@
|
|
60
59
|
@apply placeholder:text-aui-muted-foreground max-h-40 flex-grow resize-none border-none bg-transparent px-2 py-4 text-sm outline-none focus:ring-0 disabled:cursor-not-allowed;
|
61
60
|
}
|
62
61
|
|
63
|
-
.aui-composer-send
|
64
|
-
.
|
62
|
+
.aui-composer-send {
|
63
|
+
@apply my-2.5 size-8 p-2 transition-opacity ease-in;
|
64
|
+
}
|
65
|
+
.aui-composer-cancel {
|
66
|
+
@apply my-2.5 size-8 p-2 transition-opacity ease-in;
|
67
|
+
}
|
65
68
|
.aui-composer-attach {
|
66
69
|
@apply my-2.5 size-8 p-2 transition-opacity ease-in;
|
67
70
|
}
|
@@ -111,36 +114,35 @@
|
|
111
114
|
@apply max-w-[var(--aui-thread-max-width)] w-full py-4;
|
112
115
|
}
|
113
116
|
|
114
|
-
:where(.aui-user-message-root) > .aui-
|
115
|
-
@apply col-start-1 row-start-
|
116
|
-
|
117
|
-
|
118
|
-
:where(.aui-user-message-root) > .aui-user-message-attachments {
|
119
|
-
@apply col-span-full col-start-1 row-start-1;
|
120
|
-
@apply justify-end;
|
121
|
-
}
|
122
|
-
|
123
|
-
:where(.aui-user-message-root) > .aui-user-message-content {
|
124
|
-
@apply col-start-2 row-start-2;
|
117
|
+
:where(.aui-user-message-root) > .aui-branch-picker-root {
|
118
|
+
@apply col-span-full col-start-1 row-start-3;
|
119
|
+
@apply -mr-1 justify-end;
|
125
120
|
}
|
126
121
|
|
127
|
-
|
122
|
+
.aui-user-branch-picker {
|
128
123
|
@apply col-span-full col-start-1 row-start-3;
|
129
124
|
@apply -mr-1 justify-end;
|
130
125
|
}
|
131
126
|
|
132
127
|
.aui-user-message-content {
|
133
128
|
@apply bg-aui-muted text-aui-foreground max-w-[calc(var(--aui-thread-max-width)*0.8)] break-words rounded-3xl px-5 py-2.5;
|
129
|
+
|
130
|
+
@apply col-start-2 row-start-2;
|
134
131
|
}
|
135
132
|
|
136
133
|
.aui-user-message-attachments {
|
137
134
|
@apply flex w-full flex-row gap-3;
|
135
|
+
|
136
|
+
@apply col-span-full col-start-1 row-start-1;
|
137
|
+
@apply justify-end;
|
138
138
|
}
|
139
139
|
|
140
140
|
/* user action bar */
|
141
141
|
|
142
142
|
.aui-user-action-bar-root {
|
143
143
|
@apply flex flex-col items-end;
|
144
|
+
|
145
|
+
@apply col-start-1 row-start-2 mr-3 mt-2.5;
|
144
146
|
}
|
145
147
|
|
146
148
|
/* edit composer */
|
@@ -168,28 +170,33 @@
|
|
168
170
|
@apply col-start-1 row-span-full row-start-1 mr-4;
|
169
171
|
}
|
170
172
|
|
173
|
+
.aui-assistant-avatar {
|
174
|
+
@apply col-start-1 row-span-full row-start-1 mr-4;
|
175
|
+
}
|
176
|
+
|
171
177
|
:where(.aui-assistant-message-root) > .aui-branch-picker-root {
|
172
178
|
@apply col-start-2 row-start-2;
|
173
179
|
@apply -ml-2 mr-2;
|
174
180
|
}
|
175
181
|
|
176
|
-
|
177
|
-
@apply col-start-
|
178
|
-
@apply -ml-
|
179
|
-
}
|
180
|
-
|
181
|
-
:where(.aui-assistant-message-root) > .aui-assistant-message-content {
|
182
|
-
@apply col-span-2 col-start-2 row-start-1 my-1.5;
|
182
|
+
.aui-assistant-branch-picker {
|
183
|
+
@apply col-start-2 row-start-2;
|
184
|
+
@apply -ml-2 mr-2;
|
183
185
|
}
|
184
186
|
|
185
187
|
.aui-assistant-message-content {
|
186
188
|
@apply text-aui-foreground max-w-[calc(var(--aui-thread-max-width)*0.8)] break-words leading-7;
|
189
|
+
|
190
|
+
@apply col-span-2 col-start-2 row-start-1 my-1.5;
|
187
191
|
}
|
188
192
|
|
189
193
|
/* assistant action bar */
|
190
194
|
|
191
195
|
.aui-assistant-action-bar-root {
|
192
196
|
@apply text-aui-muted-foreground flex gap-1;
|
197
|
+
|
198
|
+
@apply col-start-3 row-start-2;
|
199
|
+
@apply -ml-1;
|
193
200
|
}
|
194
201
|
|
195
202
|
:where(.aui-assistant-action-bar-root)[data-floating] {
|
@@ -12,6 +12,12 @@ export type TextContentPart = {
|
|
12
12
|
readonly text: string;
|
13
13
|
};
|
14
14
|
|
15
|
+
export type ReasoningContentPart = {
|
16
|
+
readonly type: "reasoning";
|
17
|
+
readonly text: string;
|
18
|
+
};
|
19
|
+
|
20
|
+
|
15
21
|
export type ImageContentPart = {
|
16
22
|
readonly type: "image";
|
17
23
|
readonly image: string;
|
@@ -101,6 +107,7 @@ export type ThreadUserContentPart =
|
|
101
107
|
|
102
108
|
export type ThreadAssistantContentPart =
|
103
109
|
| TextContentPart
|
110
|
+
| ReasoningContentPart
|
104
111
|
| ToolCallContentPart
|
105
112
|
| UIContentPart;
|
106
113
|
|
@@ -3,6 +3,7 @@ import type {
|
|
3
3
|
ContentPartStatus,
|
4
4
|
FileContentPart,
|
5
5
|
ImageContentPart,
|
6
|
+
ReasoningContentPart,
|
6
7
|
TextContentPart,
|
7
8
|
ToolCallContentPart,
|
8
9
|
UIContentPart,
|
@@ -19,6 +20,9 @@ export type EmptyContentPartComponent = ComponentType<EmptyContentPartProps>;
|
|
19
20
|
export type TextContentPartProps = ContentPartState & TextContentPart;
|
20
21
|
export type TextContentPartComponent = ComponentType<TextContentPartProps>;
|
21
22
|
|
23
|
+
export type ReasoningContentPartProps = ContentPartState & ReasoningContentPart;
|
24
|
+
export type ReasoningContentPartComponent = ComponentType<ReasoningContentPartProps>;
|
25
|
+
|
22
26
|
export type ImageContentPartProps = ContentPartState & ImageContentPart;
|
23
27
|
export type ImageContentPartComponent = ComponentType<ImageContentPartProps>;
|
24
28
|
|
package/src/types/index.ts
CHANGED
@@ -8,6 +8,7 @@ export type {
|
|
8
8
|
export type {
|
9
9
|
AppendMessage,
|
10
10
|
TextContentPart,
|
11
|
+
ReasoningContentPart,
|
11
12
|
ImageContentPart,
|
12
13
|
FileContentPart,
|
13
14
|
Unstable_AudioContentPart,
|
@@ -37,6 +38,8 @@ export type {
|
|
37
38
|
EmptyContentPartComponent,
|
38
39
|
TextContentPartProps,
|
39
40
|
TextContentPartComponent,
|
41
|
+
ReasoningContentPartProps,
|
42
|
+
ReasoningContentPartComponent,
|
40
43
|
ImageContentPartProps,
|
41
44
|
ImageContentPartComponent,
|
42
45
|
FileContentPartProps,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
import { useCallbackRef } from "@radix-ui/react-use-callback-ref";
|
4
4
|
import { useEffect } from "react";
|
5
|
-
import { useThreadViewport } from "../../context/react/
|
5
|
+
import { useThreadViewport } from "../../context/react/ThreadViewportContext";
|
6
6
|
|
7
7
|
export const useOnScrollToBottom = (callback: () => void) => {
|
8
8
|
const callbackRef = useCallbackRef(callback);
|