@assistant-ui/mcp-docs-server 0.1.18 → 0.1.19
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/.docs/organized/code-examples/with-ag-ui.md +375 -85
- package/.docs/organized/code-examples/{with-ai-sdk-v5.md → with-ai-sdk-v6.md} +386 -94
- package/.docs/organized/code-examples/with-assistant-transport.md +374 -84
- package/.docs/organized/code-examples/with-cloud.md +405 -100
- package/.docs/organized/code-examples/with-custom-thread-list.md +412 -105
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +2241 -0
- package/.docs/organized/code-examples/with-external-store.md +374 -83
- package/.docs/organized/code-examples/with-ffmpeg.md +377 -87
- package/.docs/organized/code-examples/with-langgraph.md +403 -98
- package/.docs/organized/code-examples/with-parent-id-grouping.md +374 -83
- package/.docs/organized/code-examples/with-react-hook-form.md +379 -89
- package/.docs/organized/code-examples/with-react-router.md +2167 -0
- package/.docs/organized/code-examples/with-store.md +5 -5
- package/.docs/organized/code-examples/with-tanstack.md +10 -10
- package/.docs/raw/blog/2025-01-31-changelog/index.mdx +0 -2
- package/.docs/raw/docs/{about-assistantui.mdx → (docs)/about-assistantui.mdx} +2 -1
- package/.docs/raw/docs/{architecture.mdx → (docs)/architecture.mdx} +3 -2
- package/.docs/raw/docs/{cli.mdx → (docs)/cli.mdx} +1 -19
- package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-readable.mdx +1 -0
- package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-tool-ui.mdx +2 -1
- package/.docs/raw/docs/{copilots → (docs)/copilots}/make-assistant-tool.mdx +2 -1
- package/.docs/raw/docs/{copilots → (docs)/copilots}/model-context.mdx +1 -0
- package/.docs/raw/docs/{copilots → (docs)/copilots}/motivation.mdx +1 -0
- package/.docs/raw/docs/{copilots → (docs)/copilots}/use-assistant-instructions.mdx +1 -0
- package/.docs/raw/docs/{devtools.mdx → (docs)/devtools.mdx} +4 -4
- package/.docs/raw/docs/{guides/Attachments.mdx → (docs)/guides/attachments.mdx} +4 -5
- package/.docs/raw/docs/{guides/Branching.mdx → (docs)/guides/branching.mdx} +2 -1
- package/.docs/raw/docs/{guides → (docs)/guides}/context-api.mdx +1 -0
- package/.docs/raw/docs/(docs)/guides/dictation.mdx +370 -0
- package/.docs/raw/docs/{guides/Editing.mdx → (docs)/guides/editing.mdx} +1 -0
- package/.docs/raw/docs/{guides/Latex.mdx → (docs)/guides/latex.mdx} +1 -2
- package/.docs/raw/docs/{guides/Speech.mdx → (docs)/guides/speech.mdx} +9 -10
- package/.docs/raw/docs/{guides/ToolUI.mdx → (docs)/guides/tool-ui.mdx} +15 -14
- package/.docs/raw/docs/{guides/Tools.mdx → (docs)/guides/tools.mdx} +10 -7
- package/.docs/raw/docs/{getting-started.mdx → (docs)/index.mdx} +17 -22
- package/.docs/raw/docs/{mcp-docs-server.mdx → (docs)/mcp-docs-server.mdx} +1 -2
- package/.docs/raw/docs/{api-reference/context-providers/AssistantRuntimeProvider.mdx → (reference)/api-reference/context-providers/assistant-runtime-provider.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/context-providers/TextMessagePartProvider.mdx → (reference)/api-reference/context-providers/text-message-part-provider.mdx} +2 -1
- package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/react-data-stream.mdx +2 -1
- package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/react-hook-form.mdx +2 -1
- package/.docs/raw/docs/{api-reference → (reference)/api-reference}/integrations/vercel-ai-sdk.mdx +2 -2
- package/.docs/raw/docs/{api-reference → (reference)/api-reference}/overview.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +327 -0
- package/.docs/raw/docs/{api-reference/primitives/ActionBar.mdx → (reference)/api-reference/primitives/action-bar.mdx} +3 -1
- package/.docs/raw/docs/{api-reference/primitives/AssistantIf.mdx → (reference)/api-reference/primitives/assistant-if.mdx} +2 -2
- package/.docs/raw/docs/{api-reference/primitives/AssistantModal.mdx → (reference)/api-reference/primitives/assistant-modal.mdx} +3 -1
- package/.docs/raw/docs/{api-reference/primitives/Attachment.mdx → (reference)/api-reference/primitives/attachment.mdx} +3 -2
- package/.docs/raw/docs/{api-reference/primitives/BranchPicker.mdx → (reference)/api-reference/primitives/branch-picker.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/primitives/Composer.mdx → (reference)/api-reference/primitives/composer.mdx} +101 -2
- package/.docs/raw/docs/{api-reference → (reference)/api-reference}/primitives/composition.mdx +1 -0
- package/.docs/raw/docs/{api-reference/primitives/Error.mdx → (reference)/api-reference/primitives/error.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/primitives/MessagePart.mdx → (reference)/api-reference/primitives/message-part.mdx} +2 -2
- package/.docs/raw/docs/{api-reference/primitives/Message.mdx → (reference)/api-reference/primitives/message.mdx} +2 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +221 -0
- package/.docs/raw/docs/{api-reference/primitives/ThreadListItem.mdx → (reference)/api-reference/primitives/thread-list-item.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/primitives/ThreadList.mdx → (reference)/api-reference/primitives/thread-list.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/primitives/Thread.mdx → (reference)/api-reference/primitives/thread.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/runtimes/AssistantRuntime.mdx → (reference)/api-reference/runtimes/assistant-runtime.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/runtimes/AttachmentRuntime.mdx → (reference)/api-reference/runtimes/attachment-runtime.mdx} +3 -2
- package/.docs/raw/docs/{api-reference/runtimes/ComposerRuntime.mdx → (reference)/api-reference/runtimes/composer-runtime.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/runtimes/MessagePartRuntime.mdx → (reference)/api-reference/runtimes/message-part-runtime.mdx} +3 -2
- package/.docs/raw/docs/{api-reference/runtimes/MessageRuntime.mdx → (reference)/api-reference/runtimes/message-runtime.mdx} +3 -2
- package/.docs/raw/docs/{api-reference/runtimes/ThreadListItemRuntime.mdx → (reference)/api-reference/runtimes/thread-list-item-runtime.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/runtimes/ThreadListRuntime.mdx → (reference)/api-reference/runtimes/thread-list-runtime.mdx} +2 -1
- package/.docs/raw/docs/{api-reference/runtimes/ThreadRuntime.mdx → (reference)/api-reference/runtimes/thread-runtime.mdx} +3 -5
- package/.docs/raw/docs/{legacy/styled/AssistantModal.mdx → (reference)/legacy/styled/assistant-modal.mdx} +2 -3
- package/.docs/raw/docs/{legacy/styled/Decomposition.mdx → (reference)/legacy/styled/decomposition.mdx} +1 -0
- package/.docs/raw/docs/{legacy/styled/Markdown.mdx → (reference)/legacy/styled/markdown.mdx} +2 -4
- package/.docs/raw/docs/{legacy/styled/Scrollbar.mdx → (reference)/legacy/styled/scrollbar.mdx} +2 -1
- package/.docs/raw/docs/{legacy/styled/ThreadWidth.mdx → (reference)/legacy/styled/thread-width.mdx} +1 -0
- package/.docs/raw/docs/{legacy/styled/Thread.mdx → (reference)/legacy/styled/thread.mdx} +2 -3
- package/.docs/raw/docs/{migrations → (reference)/migrations}/deprecation-policy.mdx +1 -0
- package/.docs/raw/docs/{migrations → (reference)/migrations}/react-langgraph-v0-7.mdx +1 -2
- package/.docs/raw/docs/{migrations → (reference)/migrations}/v0-11.mdx +1 -0
- package/.docs/raw/docs/{migrations → (reference)/migrations}/v0-12.mdx +1 -0
- package/.docs/raw/docs/{react-compatibility.mdx → (reference)/react-compatibility.mdx} +2 -3
- package/.docs/raw/docs/cloud/authorization.mdx +1 -0
- package/.docs/raw/docs/cloud/overview.mdx +1 -0
- package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +2 -3
- package/.docs/raw/docs/cloud/persistence/langgraph.mdx +5 -7
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +9 -8
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +2 -3
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +7 -6
- package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +2 -3
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +6 -8
- package/.docs/raw/docs/runtimes/custom/local.mdx +12 -8
- package/.docs/raw/docs/runtimes/data-stream.mdx +32 -4
- package/.docs/raw/docs/runtimes/helicone.mdx +1 -0
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +3 -3
- package/.docs/raw/docs/runtimes/langgraph/tutorial/index.mdx +1 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +1 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +1 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +2 -1
- package/.docs/raw/docs/runtimes/langserve.mdx +2 -2
- package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +4 -5
- package/.docs/raw/docs/runtimes/mastra/overview.mdx +1 -0
- package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +3 -4
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +2 -4
- package/.docs/raw/docs/ui/assistant-modal.mdx +163 -0
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +90 -0
- package/.docs/raw/docs/ui/attachment.mdx +227 -0
- package/.docs/raw/docs/ui/{Markdown.mdx → markdown.mdx} +11 -6
- package/.docs/raw/docs/ui/{Mermaid.mdx → mermaid.mdx} +12 -5
- package/.docs/raw/docs/ui/{PartGrouping.mdx → part-grouping.mdx} +4 -6
- package/.docs/raw/docs/ui/reasoning.mdx +148 -0
- package/.docs/raw/docs/ui/{Scrollbar.mdx → scrollbar.mdx} +9 -1
- package/.docs/raw/docs/ui/sources.mdx +87 -0
- package/.docs/raw/docs/ui/{SyntaxHighlighting.mdx → syntax-highlighting.mdx} +9 -5
- package/.docs/raw/docs/ui/thread-list.mdx +275 -0
- package/.docs/raw/docs/ui/{Thread.mdx → thread.mdx} +5 -6
- package/.docs/raw/docs/ui/tool-fallback.mdx +112 -0
- package/.docs/raw/docs/ui/tool-group.mdx +214 -0
- package/dist/tools/docs.js +1 -1
- package/dist/tools/examples.js +1 -1
- package/dist/tools/examples.js.map +1 -1
- package/package.json +5 -5
- package/src/tools/docs.ts +1 -1
- package/src/tools/examples.ts +1 -1
- package/src/tools/tests/docs.test.ts +18 -16
- package/src/tools/tests/examples.test.ts +5 -5
- package/src/tools/tests/path-traversal.test.ts +3 -3
- package/src/utils/tests/security.test.ts +3 -3
- package/.docs/raw/docs/index.mdx +0 -7
- package/.docs/raw/docs/ui/AssistantModal.mdx +0 -45
- package/.docs/raw/docs/ui/AssistantSidebar.mdx +0 -41
- package/.docs/raw/docs/ui/Attachment.mdx +0 -84
- package/.docs/raw/docs/ui/Reasoning.mdx +0 -152
- package/.docs/raw/docs/ui/ThreadList.mdx +0 -90
- package/.docs/raw/docs/ui/ToolFallback.mdx +0 -63
- package/.docs/raw/docs/ui/ToolGroup.mdx +0 -96
- /package/.docs/raw/docs/{copilots → (docs)/copilots}/assistant-frame.mdx +0 -0
|
@@ -489,7 +489,7 @@ export const ComposerAddAttachment: FC = () => {
|
|
|
489
489
|
side="bottom"
|
|
490
490
|
variant="ghost"
|
|
491
491
|
size="icon"
|
|
492
|
-
className="aui-composer-add-attachment size-
|
|
492
|
+
className="aui-composer-add-attachment size-8.5 rounded-full p-1 font-semibold text-xs hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30"
|
|
493
493
|
aria-label="Add Attachment"
|
|
494
494
|
>
|
|
495
495
|
<PlusIcon className="aui-attachment-add-icon size-5 stroke-[1.5px]" />
|
|
@@ -748,6 +748,7 @@ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button
|
|
|
748
748
|
import { Button } from "@/components/ui/button";
|
|
749
749
|
import { cn } from "@/lib/utils";
|
|
750
750
|
import {
|
|
751
|
+
ActionBarMorePrimitive,
|
|
751
752
|
ActionBarPrimitive,
|
|
752
753
|
AssistantIf,
|
|
753
754
|
BranchPickerPrimitive,
|
|
@@ -764,6 +765,7 @@ import {
|
|
|
764
765
|
ChevronRightIcon,
|
|
765
766
|
CopyIcon,
|
|
766
767
|
DownloadIcon,
|
|
768
|
+
MoreHorizontalIcon,
|
|
767
769
|
PencilIcon,
|
|
768
770
|
RefreshCwIcon,
|
|
769
771
|
SquareIcon,
|
|
@@ -985,16 +987,33 @@ const AssistantActionBar: FC = () => {
|
|
|
985
987
|
</AssistantIf>
|
|
986
988
|
</TooltipIconButton>
|
|
987
989
|
</ActionBarPrimitive.Copy>
|
|
988
|
-
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
989
|
-
<TooltipIconButton tooltip="Export as Markdown">
|
|
990
|
-
<DownloadIcon />
|
|
991
|
-
</TooltipIconButton>
|
|
992
|
-
</ActionBarPrimitive.ExportMarkdown>
|
|
993
990
|
<ActionBarPrimitive.Reload asChild>
|
|
994
991
|
<TooltipIconButton tooltip="Refresh">
|
|
995
992
|
<RefreshCwIcon />
|
|
996
993
|
</TooltipIconButton>
|
|
997
994
|
</ActionBarPrimitive.Reload>
|
|
995
|
+
<ActionBarMorePrimitive.Root>
|
|
996
|
+
<ActionBarMorePrimitive.Trigger asChild>
|
|
997
|
+
<TooltipIconButton
|
|
998
|
+
tooltip="More"
|
|
999
|
+
className="data-[state=open]:bg-accent"
|
|
1000
|
+
>
|
|
1001
|
+
<MoreHorizontalIcon />
|
|
1002
|
+
</TooltipIconButton>
|
|
1003
|
+
</ActionBarMorePrimitive.Trigger>
|
|
1004
|
+
<ActionBarMorePrimitive.Content
|
|
1005
|
+
side="bottom"
|
|
1006
|
+
align="start"
|
|
1007
|
+
className="aui-action-bar-more-content z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md"
|
|
1008
|
+
>
|
|
1009
|
+
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
1010
|
+
<ActionBarMorePrimitive.Item className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
|
|
1011
|
+
<DownloadIcon className="size-4" />
|
|
1012
|
+
Export as Markdown
|
|
1013
|
+
</ActionBarMorePrimitive.Item>
|
|
1014
|
+
</ActionBarPrimitive.ExportMarkdown>
|
|
1015
|
+
</ActionBarMorePrimitive.Content>
|
|
1016
|
+
</ActionBarMorePrimitive.Root>
|
|
998
1017
|
</ActionBarPrimitive.Root>
|
|
999
1018
|
);
|
|
1000
1019
|
};
|
|
@@ -1095,98 +1114,329 @@ const BranchPicker: FC<BranchPickerPrimitive.Root.Props> = ({
|
|
|
1095
1114
|
## components/assistant-ui/tool-fallback.tsx
|
|
1096
1115
|
|
|
1097
1116
|
```tsx
|
|
1098
|
-
|
|
1117
|
+
"use client";
|
|
1118
|
+
|
|
1119
|
+
import { memo, useCallback, useRef, useState } from "react";
|
|
1099
1120
|
import {
|
|
1121
|
+
AlertCircleIcon,
|
|
1100
1122
|
CheckIcon,
|
|
1101
1123
|
ChevronDownIcon,
|
|
1102
|
-
|
|
1124
|
+
LoaderIcon,
|
|
1103
1125
|
XCircleIcon,
|
|
1104
1126
|
} from "lucide-react";
|
|
1105
|
-
import {
|
|
1106
|
-
|
|
1127
|
+
import {
|
|
1128
|
+
useScrollLock,
|
|
1129
|
+
type ToolCallMessagePartStatus,
|
|
1130
|
+
type ToolCallMessagePartComponent,
|
|
1131
|
+
} from "@assistant-ui/react";
|
|
1132
|
+
import {
|
|
1133
|
+
Collapsible,
|
|
1134
|
+
CollapsibleContent,
|
|
1135
|
+
CollapsibleTrigger,
|
|
1136
|
+
} from "@/components/ui/collapsible";
|
|
1107
1137
|
import { cn } from "@/lib/utils";
|
|
1108
1138
|
|
|
1109
|
-
|
|
1139
|
+
const ANIMATION_DURATION = 200;
|
|
1140
|
+
|
|
1141
|
+
export type ToolFallbackRootProps = Omit<
|
|
1142
|
+
React.ComponentProps<typeof Collapsible>,
|
|
1143
|
+
"open" | "onOpenChange"
|
|
1144
|
+
> & {
|
|
1145
|
+
open?: boolean;
|
|
1146
|
+
onOpenChange?: (open: boolean) => void;
|
|
1147
|
+
defaultOpen?: boolean;
|
|
1148
|
+
};
|
|
1149
|
+
|
|
1150
|
+
function ToolFallbackRoot({
|
|
1151
|
+
className,
|
|
1152
|
+
open: controlledOpen,
|
|
1153
|
+
onOpenChange: controlledOnOpenChange,
|
|
1154
|
+
defaultOpen = false,
|
|
1155
|
+
children,
|
|
1156
|
+
...props
|
|
1157
|
+
}: ToolFallbackRootProps) {
|
|
1158
|
+
const collapsibleRef = useRef<HTMLDivElement>(null);
|
|
1159
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
1160
|
+
const lockScroll = useScrollLock(collapsibleRef, ANIMATION_DURATION);
|
|
1161
|
+
|
|
1162
|
+
const isControlled = controlledOpen !== undefined;
|
|
1163
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
1164
|
+
|
|
1165
|
+
const handleOpenChange = useCallback(
|
|
1166
|
+
(open: boolean) => {
|
|
1167
|
+
if (!open) {
|
|
1168
|
+
lockScroll();
|
|
1169
|
+
}
|
|
1170
|
+
if (!isControlled) {
|
|
1171
|
+
setUncontrolledOpen(open);
|
|
1172
|
+
}
|
|
1173
|
+
controlledOnOpenChange?.(open);
|
|
1174
|
+
},
|
|
1175
|
+
[lockScroll, isControlled, controlledOnOpenChange],
|
|
1176
|
+
);
|
|
1177
|
+
|
|
1178
|
+
return (
|
|
1179
|
+
<Collapsible
|
|
1180
|
+
ref={collapsibleRef}
|
|
1181
|
+
data-slot="tool-fallback-root"
|
|
1182
|
+
open={isOpen}
|
|
1183
|
+
onOpenChange={handleOpenChange}
|
|
1184
|
+
className={cn(
|
|
1185
|
+
"aui-tool-fallback-root group/tool-fallback-root w-full rounded-lg border py-3",
|
|
1186
|
+
className,
|
|
1187
|
+
)}
|
|
1188
|
+
style={
|
|
1189
|
+
{
|
|
1190
|
+
"--animation-duration": `${ANIMATION_DURATION}ms`,
|
|
1191
|
+
} as React.CSSProperties
|
|
1192
|
+
}
|
|
1193
|
+
{...props}
|
|
1194
|
+
>
|
|
1195
|
+
{children}
|
|
1196
|
+
</Collapsible>
|
|
1197
|
+
);
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
type ToolStatus = ToolCallMessagePartStatus["type"];
|
|
1201
|
+
|
|
1202
|
+
const statusIconMap: Record<ToolStatus, React.ElementType> = {
|
|
1203
|
+
running: LoaderIcon,
|
|
1204
|
+
complete: CheckIcon,
|
|
1205
|
+
incomplete: XCircleIcon,
|
|
1206
|
+
"requires-action": AlertCircleIcon,
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
function ToolFallbackTrigger({
|
|
1110
1210
|
toolName,
|
|
1111
|
-
argsText,
|
|
1112
|
-
result,
|
|
1113
1211
|
status,
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1212
|
+
className,
|
|
1213
|
+
...props
|
|
1214
|
+
}: React.ComponentProps<typeof CollapsibleTrigger> & {
|
|
1215
|
+
toolName: string;
|
|
1216
|
+
status?: ToolCallMessagePartStatus;
|
|
1217
|
+
}) {
|
|
1218
|
+
const statusType = status?.type ?? "complete";
|
|
1219
|
+
const isRunning = statusType === "running";
|
|
1117
1220
|
const isCancelled =
|
|
1118
1221
|
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
? status.error
|
|
1123
|
-
: JSON.stringify(status.error)
|
|
1124
|
-
: null;
|
|
1222
|
+
|
|
1223
|
+
const Icon = statusIconMap[statusType];
|
|
1224
|
+
const label = isCancelled ? "Cancelled tool" : "Used tool";
|
|
1125
1225
|
|
|
1126
1226
|
return (
|
|
1127
|
-
<
|
|
1227
|
+
<CollapsibleTrigger
|
|
1228
|
+
data-slot="tool-fallback-trigger"
|
|
1128
1229
|
className={cn(
|
|
1129
|
-
"aui-tool-fallback-
|
|
1130
|
-
|
|
1230
|
+
"aui-tool-fallback-trigger group/trigger flex w-full items-center gap-2 px-4 text-sm transition-colors",
|
|
1231
|
+
className,
|
|
1131
1232
|
)}
|
|
1233
|
+
{...props}
|
|
1132
1234
|
>
|
|
1133
|
-
<
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1235
|
+
<Icon
|
|
1236
|
+
data-slot="tool-fallback-trigger-icon"
|
|
1237
|
+
className={cn(
|
|
1238
|
+
"aui-tool-fallback-trigger-icon size-4 shrink-0",
|
|
1239
|
+
isCancelled && "text-muted-foreground",
|
|
1240
|
+
isRunning && "animate-spin",
|
|
1138
1241
|
)}
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
<div className="aui-tool-fallback-cancelled-root px-4">
|
|
1156
|
-
<p className="aui-tool-fallback-cancelled-header font-semibold text-muted-foreground">
|
|
1157
|
-
Cancelled reason:
|
|
1158
|
-
</p>
|
|
1159
|
-
<p className="aui-tool-fallback-cancelled-reason text-muted-foreground">
|
|
1160
|
-
{cancelledReason}
|
|
1161
|
-
</p>
|
|
1162
|
-
</div>
|
|
1163
|
-
)}
|
|
1164
|
-
<div
|
|
1165
|
-
className={cn(
|
|
1166
|
-
"aui-tool-fallback-args-root px-4",
|
|
1167
|
-
isCancelled && "opacity-60",
|
|
1168
|
-
)}
|
|
1242
|
+
/>
|
|
1243
|
+
<span
|
|
1244
|
+
data-slot="tool-fallback-trigger-label"
|
|
1245
|
+
className={cn(
|
|
1246
|
+
"aui-tool-fallback-trigger-label-wrapper relative inline-block grow text-left leading-none",
|
|
1247
|
+
isCancelled && "text-muted-foreground line-through",
|
|
1248
|
+
)}
|
|
1249
|
+
>
|
|
1250
|
+
<span>
|
|
1251
|
+
{label}: <b>{toolName}</b>
|
|
1252
|
+
</span>
|
|
1253
|
+
{isRunning && (
|
|
1254
|
+
<span
|
|
1255
|
+
aria-hidden
|
|
1256
|
+
data-slot="tool-fallback-trigger-shimmer"
|
|
1257
|
+
className="aui-tool-fallback-trigger-shimmer shimmer pointer-events-none absolute inset-0 motion-reduce:animate-none"
|
|
1169
1258
|
>
|
|
1170
|
-
<
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1259
|
+
{label}: <b>{toolName}</b>
|
|
1260
|
+
</span>
|
|
1261
|
+
)}
|
|
1262
|
+
</span>
|
|
1263
|
+
<ChevronDownIcon
|
|
1264
|
+
data-slot="tool-fallback-trigger-chevron"
|
|
1265
|
+
className={cn(
|
|
1266
|
+
"aui-tool-fallback-trigger-chevron size-4 shrink-0",
|
|
1267
|
+
"transition-transform duration-(--animation-duration) ease-out",
|
|
1268
|
+
"group-data-[state=closed]/trigger:-rotate-90",
|
|
1269
|
+
"group-data-[state=open]/trigger:rotate-0",
|
|
1270
|
+
)}
|
|
1271
|
+
/>
|
|
1272
|
+
</CollapsibleTrigger>
|
|
1273
|
+
);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
function ToolFallbackContent({
|
|
1277
|
+
className,
|
|
1278
|
+
children,
|
|
1279
|
+
...props
|
|
1280
|
+
}: React.ComponentProps<typeof CollapsibleContent>) {
|
|
1281
|
+
return (
|
|
1282
|
+
<CollapsibleContent
|
|
1283
|
+
data-slot="tool-fallback-content"
|
|
1284
|
+
className={cn(
|
|
1285
|
+
"aui-tool-fallback-content relative overflow-hidden text-sm outline-none",
|
|
1286
|
+
"group/collapsible-content ease-out",
|
|
1287
|
+
"data-[state=closed]:animate-collapsible-up",
|
|
1288
|
+
"data-[state=open]:animate-collapsible-down",
|
|
1289
|
+
"data-[state=closed]:fill-mode-forwards",
|
|
1290
|
+
"data-[state=closed]:pointer-events-none",
|
|
1291
|
+
"data-[state=open]:duration-(--animation-duration)",
|
|
1292
|
+
"data-[state=closed]:duration-(--animation-duration)",
|
|
1293
|
+
className,
|
|
1294
|
+
)}
|
|
1295
|
+
{...props}
|
|
1296
|
+
>
|
|
1297
|
+
<div className="mt-3 flex flex-col gap-2 border-t pt-2">{children}</div>
|
|
1298
|
+
</CollapsibleContent>
|
|
1299
|
+
);
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
function ToolFallbackArgs({
|
|
1303
|
+
argsText,
|
|
1304
|
+
className,
|
|
1305
|
+
...props
|
|
1306
|
+
}: React.ComponentProps<"div"> & {
|
|
1307
|
+
argsText?: string;
|
|
1308
|
+
}) {
|
|
1309
|
+
if (!argsText) return null;
|
|
1310
|
+
|
|
1311
|
+
return (
|
|
1312
|
+
<div
|
|
1313
|
+
data-slot="tool-fallback-args"
|
|
1314
|
+
className={cn("aui-tool-fallback-args px-4", className)}
|
|
1315
|
+
{...props}
|
|
1316
|
+
>
|
|
1317
|
+
<pre className="aui-tool-fallback-args-value whitespace-pre-wrap">
|
|
1318
|
+
{argsText}
|
|
1319
|
+
</pre>
|
|
1320
|
+
</div>
|
|
1321
|
+
);
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
function ToolFallbackResult({
|
|
1325
|
+
result,
|
|
1326
|
+
className,
|
|
1327
|
+
...props
|
|
1328
|
+
}: React.ComponentProps<"div"> & {
|
|
1329
|
+
result?: unknown;
|
|
1330
|
+
}) {
|
|
1331
|
+
if (result === undefined) return null;
|
|
1332
|
+
|
|
1333
|
+
return (
|
|
1334
|
+
<div
|
|
1335
|
+
data-slot="tool-fallback-result"
|
|
1336
|
+
className={cn(
|
|
1337
|
+
"aui-tool-fallback-result border-t border-dashed px-4 pt-2",
|
|
1338
|
+
className,
|
|
1187
1339
|
)}
|
|
1340
|
+
{...props}
|
|
1341
|
+
>
|
|
1342
|
+
<p className="aui-tool-fallback-result-header font-semibold">Result:</p>
|
|
1343
|
+
<pre className="aui-tool-fallback-result-content whitespace-pre-wrap">
|
|
1344
|
+
{typeof result === "string" ? result : JSON.stringify(result, null, 2)}
|
|
1345
|
+
</pre>
|
|
1188
1346
|
</div>
|
|
1189
1347
|
);
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
function ToolFallbackError({
|
|
1351
|
+
status,
|
|
1352
|
+
className,
|
|
1353
|
+
...props
|
|
1354
|
+
}: React.ComponentProps<"div"> & {
|
|
1355
|
+
status?: ToolCallMessagePartStatus;
|
|
1356
|
+
}) {
|
|
1357
|
+
if (status?.type !== "incomplete") return null;
|
|
1358
|
+
|
|
1359
|
+
const error = status.error;
|
|
1360
|
+
const errorText = error
|
|
1361
|
+
? typeof error === "string"
|
|
1362
|
+
? error
|
|
1363
|
+
: JSON.stringify(error)
|
|
1364
|
+
: null;
|
|
1365
|
+
|
|
1366
|
+
if (!errorText) return null;
|
|
1367
|
+
|
|
1368
|
+
const isCancelled = status.reason === "cancelled";
|
|
1369
|
+
const headerText = isCancelled ? "Cancelled reason:" : "Error:";
|
|
1370
|
+
|
|
1371
|
+
return (
|
|
1372
|
+
<div
|
|
1373
|
+
data-slot="tool-fallback-error"
|
|
1374
|
+
className={cn("aui-tool-fallback-error px-4", className)}
|
|
1375
|
+
{...props}
|
|
1376
|
+
>
|
|
1377
|
+
<p className="aui-tool-fallback-error-header font-semibold text-muted-foreground">
|
|
1378
|
+
{headerText}
|
|
1379
|
+
</p>
|
|
1380
|
+
<p className="aui-tool-fallback-error-reason text-muted-foreground">
|
|
1381
|
+
{errorText}
|
|
1382
|
+
</p>
|
|
1383
|
+
</div>
|
|
1384
|
+
);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
const ToolFallbackImpl: ToolCallMessagePartComponent = ({
|
|
1388
|
+
toolName,
|
|
1389
|
+
argsText,
|
|
1390
|
+
result,
|
|
1391
|
+
status,
|
|
1392
|
+
}) => {
|
|
1393
|
+
const isCancelled =
|
|
1394
|
+
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1395
|
+
|
|
1396
|
+
return (
|
|
1397
|
+
<ToolFallbackRoot
|
|
1398
|
+
className={cn(isCancelled && "border-muted-foreground/30 bg-muted/30")}
|
|
1399
|
+
>
|
|
1400
|
+
<ToolFallbackTrigger toolName={toolName} status={status} />
|
|
1401
|
+
<ToolFallbackContent>
|
|
1402
|
+
<ToolFallbackError status={status} />
|
|
1403
|
+
<ToolFallbackArgs
|
|
1404
|
+
argsText={argsText}
|
|
1405
|
+
className={cn(isCancelled && "opacity-60")}
|
|
1406
|
+
/>
|
|
1407
|
+
{!isCancelled && <ToolFallbackResult result={result} />}
|
|
1408
|
+
</ToolFallbackContent>
|
|
1409
|
+
</ToolFallbackRoot>
|
|
1410
|
+
);
|
|
1411
|
+
};
|
|
1412
|
+
|
|
1413
|
+
const ToolFallback = memo(
|
|
1414
|
+
ToolFallbackImpl,
|
|
1415
|
+
) as unknown as ToolCallMessagePartComponent & {
|
|
1416
|
+
Root: typeof ToolFallbackRoot;
|
|
1417
|
+
Trigger: typeof ToolFallbackTrigger;
|
|
1418
|
+
Content: typeof ToolFallbackContent;
|
|
1419
|
+
Args: typeof ToolFallbackArgs;
|
|
1420
|
+
Result: typeof ToolFallbackResult;
|
|
1421
|
+
Error: typeof ToolFallbackError;
|
|
1422
|
+
};
|
|
1423
|
+
|
|
1424
|
+
ToolFallback.displayName = "ToolFallback";
|
|
1425
|
+
ToolFallback.Root = ToolFallbackRoot;
|
|
1426
|
+
ToolFallback.Trigger = ToolFallbackTrigger;
|
|
1427
|
+
ToolFallback.Content = ToolFallbackContent;
|
|
1428
|
+
ToolFallback.Args = ToolFallbackArgs;
|
|
1429
|
+
ToolFallback.Result = ToolFallbackResult;
|
|
1430
|
+
ToolFallback.Error = ToolFallbackError;
|
|
1431
|
+
|
|
1432
|
+
export {
|
|
1433
|
+
ToolFallback,
|
|
1434
|
+
ToolFallbackRoot,
|
|
1435
|
+
ToolFallbackTrigger,
|
|
1436
|
+
ToolFallbackContent,
|
|
1437
|
+
ToolFallbackArgs,
|
|
1438
|
+
ToolFallbackResult,
|
|
1439
|
+
ToolFallbackError,
|
|
1190
1440
|
};
|
|
1191
1441
|
|
|
1192
1442
|
```
|
|
@@ -1366,6 +1616,45 @@ export { Button, buttonVariants };
|
|
|
1366
1616
|
|
|
1367
1617
|
```
|
|
1368
1618
|
|
|
1619
|
+
## components/ui/collapsible.tsx
|
|
1620
|
+
|
|
1621
|
+
```tsx
|
|
1622
|
+
"use client";
|
|
1623
|
+
|
|
1624
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
1625
|
+
|
|
1626
|
+
function Collapsible({
|
|
1627
|
+
...props
|
|
1628
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
1629
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
function CollapsibleTrigger({
|
|
1633
|
+
...props
|
|
1634
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
1635
|
+
return (
|
|
1636
|
+
<CollapsiblePrimitive.CollapsibleTrigger
|
|
1637
|
+
data-slot="collapsible-trigger"
|
|
1638
|
+
{...props}
|
|
1639
|
+
/>
|
|
1640
|
+
);
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
function CollapsibleContent({
|
|
1644
|
+
...props
|
|
1645
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
1646
|
+
return (
|
|
1647
|
+
<CollapsiblePrimitive.CollapsibleContent
|
|
1648
|
+
data-slot="collapsible-content"
|
|
1649
|
+
{...props}
|
|
1650
|
+
/>
|
|
1651
|
+
);
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
1655
|
+
|
|
1656
|
+
```
|
|
1657
|
+
|
|
1369
1658
|
## components/ui/dialog.tsx
|
|
1370
1659
|
|
|
1371
1660
|
```tsx
|
|
@@ -1621,27 +1910,29 @@ export default nextConfig;
|
|
|
1621
1910
|
"start": "next start"
|
|
1622
1911
|
},
|
|
1623
1912
|
"dependencies": {
|
|
1913
|
+
"@ai-sdk/openai": "^3.0.13",
|
|
1624
1914
|
"@assistant-ui/react": "workspace:*",
|
|
1625
1915
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
1626
1916
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
1917
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
1627
1918
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
1628
1919
|
"@radix-ui/react-slot": "^1.2.4",
|
|
1629
1920
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
1630
1921
|
"class-variance-authority": "^0.7.1",
|
|
1631
1922
|
"clsx": "^2.1.1",
|
|
1632
1923
|
"lucide-react": "^0.562.0",
|
|
1633
|
-
"next": "16.1.
|
|
1634
|
-
"react": "19.2.3",
|
|
1635
|
-
"react-dom": "19.2.3",
|
|
1924
|
+
"next": "^16.1.4",
|
|
1925
|
+
"react": "^19.2.3",
|
|
1926
|
+
"react-dom": "^19.2.3",
|
|
1636
1927
|
"remark-gfm": "^4.0.1",
|
|
1637
1928
|
"tailwind-merge": "^3.4.0",
|
|
1638
|
-
"zustand": "^5.0.
|
|
1929
|
+
"zustand": "^5.0.10"
|
|
1639
1930
|
},
|
|
1640
1931
|
"devDependencies": {
|
|
1641
1932
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
1642
1933
|
"@tailwindcss/postcss": "^4.1.18",
|
|
1643
|
-
"@types/node": "^25.0.
|
|
1644
|
-
"@types/react": "^19.2.
|
|
1934
|
+
"@types/node": "^25.0.9",
|
|
1935
|
+
"@types/react": "^19.2.9",
|
|
1645
1936
|
"@types/react-dom": "^19.2.3",
|
|
1646
1937
|
"postcss": "^8.5.6",
|
|
1647
1938
|
"tailwindcss": "^4.1.18",
|