@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
|
@@ -567,7 +567,7 @@ export const ComposerAddAttachment: FC = () => {
|
|
|
567
567
|
side="bottom"
|
|
568
568
|
variant="ghost"
|
|
569
569
|
size="icon"
|
|
570
|
-
className="aui-composer-add-attachment size-
|
|
570
|
+
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"
|
|
571
571
|
aria-label="Add Attachment"
|
|
572
572
|
>
|
|
573
573
|
<PlusIcon className="aui-attachment-add-icon size-5 stroke-[1.5px]" />
|
|
@@ -815,15 +815,15 @@ const defaultComponents = memoizeMarkdownComponents({
|
|
|
815
815
|
## components/assistant-ui/thread-list.tsx
|
|
816
816
|
|
|
817
817
|
```tsx
|
|
818
|
-
import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button";
|
|
819
818
|
import { Button } from "@/components/ui/button";
|
|
820
819
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
821
820
|
import {
|
|
822
821
|
AssistantIf,
|
|
822
|
+
ThreadListItemMorePrimitive,
|
|
823
823
|
ThreadListItemPrimitive,
|
|
824
824
|
ThreadListPrimitive,
|
|
825
825
|
} from "@assistant-ui/react";
|
|
826
|
-
import { ArchiveIcon, PlusIcon } from "lucide-react";
|
|
826
|
+
import { ArchiveIcon, MoreHorizontalIcon, PlusIcon } from "lucide-react";
|
|
827
827
|
import type { FC } from "react";
|
|
828
828
|
|
|
829
829
|
export const ThreadList: FC = () => {
|
|
@@ -873,26 +873,41 @@ const ThreadListSkeleton: FC = () => {
|
|
|
873
873
|
|
|
874
874
|
const ThreadListItem: FC = () => {
|
|
875
875
|
return (
|
|
876
|
-
<ThreadListItemPrimitive.Root className="aui-thread-list-item group flex h-9 items-center rounded-lg transition-colors hover:bg-muted focus-visible:bg-muted focus-visible:outline-none data-active:bg-muted">
|
|
877
|
-
<ThreadListItemPrimitive.Trigger className="aui-thread-list-item-trigger flex h-full flex-1 items-center truncate px-3 text-start text-sm">
|
|
876
|
+
<ThreadListItemPrimitive.Root className="aui-thread-list-item group flex h-9 items-center gap-2 rounded-lg transition-colors hover:bg-muted focus-visible:bg-muted focus-visible:outline-none data-active:bg-muted">
|
|
877
|
+
<ThreadListItemPrimitive.Trigger className="aui-thread-list-item-trigger flex h-full min-w-0 flex-1 items-center truncate px-3 text-start text-sm">
|
|
878
878
|
<ThreadListItemPrimitive.Title fallback="New Chat" />
|
|
879
879
|
</ThreadListItemPrimitive.Trigger>
|
|
880
|
-
<
|
|
880
|
+
<ThreadListItemMore />
|
|
881
881
|
</ThreadListItemPrimitive.Root>
|
|
882
882
|
);
|
|
883
883
|
};
|
|
884
884
|
|
|
885
|
-
const
|
|
885
|
+
const ThreadListItemMore: FC = () => {
|
|
886
886
|
return (
|
|
887
|
-
<
|
|
888
|
-
<
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
887
|
+
<ThreadListItemMorePrimitive.Root>
|
|
888
|
+
<ThreadListItemMorePrimitive.Trigger asChild>
|
|
889
|
+
<Button
|
|
890
|
+
variant="ghost"
|
|
891
|
+
size="icon"
|
|
892
|
+
className="aui-thread-list-item-more mr-2 size-7 p-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:bg-accent data-[state=open]:opacity-100 group-data-active:opacity-100"
|
|
893
|
+
>
|
|
894
|
+
<MoreHorizontalIcon className="size-4" />
|
|
895
|
+
<span className="sr-only">More options</span>
|
|
896
|
+
</Button>
|
|
897
|
+
</ThreadListItemMorePrimitive.Trigger>
|
|
898
|
+
<ThreadListItemMorePrimitive.Content
|
|
899
|
+
side="bottom"
|
|
900
|
+
align="start"
|
|
901
|
+
className="aui-thread-list-item-more-content z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md"
|
|
892
902
|
>
|
|
893
|
-
<
|
|
894
|
-
|
|
895
|
-
|
|
903
|
+
<ThreadListItemPrimitive.Archive asChild>
|
|
904
|
+
<ThreadListItemMorePrimitive.Item className="aui-thread-list-item-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">
|
|
905
|
+
<ArchiveIcon className="size-4" />
|
|
906
|
+
Archive
|
|
907
|
+
</ThreadListItemMorePrimitive.Item>
|
|
908
|
+
</ThreadListItemPrimitive.Archive>
|
|
909
|
+
</ThreadListItemMorePrimitive.Content>
|
|
910
|
+
</ThreadListItemMorePrimitive.Root>
|
|
896
911
|
);
|
|
897
912
|
};
|
|
898
913
|
|
|
@@ -912,6 +927,7 @@ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button
|
|
|
912
927
|
import { Button } from "@/components/ui/button";
|
|
913
928
|
import { cn } from "@/lib/utils";
|
|
914
929
|
import {
|
|
930
|
+
ActionBarMorePrimitive,
|
|
915
931
|
ActionBarPrimitive,
|
|
916
932
|
AssistantIf,
|
|
917
933
|
BranchPickerPrimitive,
|
|
@@ -928,6 +944,7 @@ import {
|
|
|
928
944
|
ChevronRightIcon,
|
|
929
945
|
CopyIcon,
|
|
930
946
|
DownloadIcon,
|
|
947
|
+
MoreHorizontalIcon,
|
|
931
948
|
PencilIcon,
|
|
932
949
|
RefreshCwIcon,
|
|
933
950
|
SquareIcon,
|
|
@@ -1149,16 +1166,33 @@ const AssistantActionBar: FC = () => {
|
|
|
1149
1166
|
</AssistantIf>
|
|
1150
1167
|
</TooltipIconButton>
|
|
1151
1168
|
</ActionBarPrimitive.Copy>
|
|
1152
|
-
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
1153
|
-
<TooltipIconButton tooltip="Export as Markdown">
|
|
1154
|
-
<DownloadIcon />
|
|
1155
|
-
</TooltipIconButton>
|
|
1156
|
-
</ActionBarPrimitive.ExportMarkdown>
|
|
1157
1169
|
<ActionBarPrimitive.Reload asChild>
|
|
1158
1170
|
<TooltipIconButton tooltip="Refresh">
|
|
1159
1171
|
<RefreshCwIcon />
|
|
1160
1172
|
</TooltipIconButton>
|
|
1161
1173
|
</ActionBarPrimitive.Reload>
|
|
1174
|
+
<ActionBarMorePrimitive.Root>
|
|
1175
|
+
<ActionBarMorePrimitive.Trigger asChild>
|
|
1176
|
+
<TooltipIconButton
|
|
1177
|
+
tooltip="More"
|
|
1178
|
+
className="data-[state=open]:bg-accent"
|
|
1179
|
+
>
|
|
1180
|
+
<MoreHorizontalIcon />
|
|
1181
|
+
</TooltipIconButton>
|
|
1182
|
+
</ActionBarMorePrimitive.Trigger>
|
|
1183
|
+
<ActionBarMorePrimitive.Content
|
|
1184
|
+
side="bottom"
|
|
1185
|
+
align="start"
|
|
1186
|
+
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"
|
|
1187
|
+
>
|
|
1188
|
+
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
1189
|
+
<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">
|
|
1190
|
+
<DownloadIcon className="size-4" />
|
|
1191
|
+
Export as Markdown
|
|
1192
|
+
</ActionBarMorePrimitive.Item>
|
|
1193
|
+
</ActionBarPrimitive.ExportMarkdown>
|
|
1194
|
+
</ActionBarMorePrimitive.Content>
|
|
1195
|
+
</ActionBarMorePrimitive.Root>
|
|
1162
1196
|
</ActionBarPrimitive.Root>
|
|
1163
1197
|
);
|
|
1164
1198
|
};
|
|
@@ -1259,98 +1293,329 @@ const BranchPicker: FC<BranchPickerPrimitive.Root.Props> = ({
|
|
|
1259
1293
|
## components/assistant-ui/tool-fallback.tsx
|
|
1260
1294
|
|
|
1261
1295
|
```tsx
|
|
1262
|
-
|
|
1296
|
+
"use client";
|
|
1297
|
+
|
|
1298
|
+
import { memo, useCallback, useRef, useState } from "react";
|
|
1263
1299
|
import {
|
|
1300
|
+
AlertCircleIcon,
|
|
1264
1301
|
CheckIcon,
|
|
1265
1302
|
ChevronDownIcon,
|
|
1266
|
-
|
|
1303
|
+
LoaderIcon,
|
|
1267
1304
|
XCircleIcon,
|
|
1268
1305
|
} from "lucide-react";
|
|
1269
|
-
import {
|
|
1270
|
-
|
|
1306
|
+
import {
|
|
1307
|
+
useScrollLock,
|
|
1308
|
+
type ToolCallMessagePartStatus,
|
|
1309
|
+
type ToolCallMessagePartComponent,
|
|
1310
|
+
} from "@assistant-ui/react";
|
|
1311
|
+
import {
|
|
1312
|
+
Collapsible,
|
|
1313
|
+
CollapsibleContent,
|
|
1314
|
+
CollapsibleTrigger,
|
|
1315
|
+
} from "@/components/ui/collapsible";
|
|
1271
1316
|
import { cn } from "@/lib/utils";
|
|
1272
1317
|
|
|
1273
|
-
|
|
1318
|
+
const ANIMATION_DURATION = 200;
|
|
1319
|
+
|
|
1320
|
+
export type ToolFallbackRootProps = Omit<
|
|
1321
|
+
React.ComponentProps<typeof Collapsible>,
|
|
1322
|
+
"open" | "onOpenChange"
|
|
1323
|
+
> & {
|
|
1324
|
+
open?: boolean;
|
|
1325
|
+
onOpenChange?: (open: boolean) => void;
|
|
1326
|
+
defaultOpen?: boolean;
|
|
1327
|
+
};
|
|
1328
|
+
|
|
1329
|
+
function ToolFallbackRoot({
|
|
1330
|
+
className,
|
|
1331
|
+
open: controlledOpen,
|
|
1332
|
+
onOpenChange: controlledOnOpenChange,
|
|
1333
|
+
defaultOpen = false,
|
|
1334
|
+
children,
|
|
1335
|
+
...props
|
|
1336
|
+
}: ToolFallbackRootProps) {
|
|
1337
|
+
const collapsibleRef = useRef<HTMLDivElement>(null);
|
|
1338
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
1339
|
+
const lockScroll = useScrollLock(collapsibleRef, ANIMATION_DURATION);
|
|
1340
|
+
|
|
1341
|
+
const isControlled = controlledOpen !== undefined;
|
|
1342
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
1343
|
+
|
|
1344
|
+
const handleOpenChange = useCallback(
|
|
1345
|
+
(open: boolean) => {
|
|
1346
|
+
if (!open) {
|
|
1347
|
+
lockScroll();
|
|
1348
|
+
}
|
|
1349
|
+
if (!isControlled) {
|
|
1350
|
+
setUncontrolledOpen(open);
|
|
1351
|
+
}
|
|
1352
|
+
controlledOnOpenChange?.(open);
|
|
1353
|
+
},
|
|
1354
|
+
[lockScroll, isControlled, controlledOnOpenChange],
|
|
1355
|
+
);
|
|
1356
|
+
|
|
1357
|
+
return (
|
|
1358
|
+
<Collapsible
|
|
1359
|
+
ref={collapsibleRef}
|
|
1360
|
+
data-slot="tool-fallback-root"
|
|
1361
|
+
open={isOpen}
|
|
1362
|
+
onOpenChange={handleOpenChange}
|
|
1363
|
+
className={cn(
|
|
1364
|
+
"aui-tool-fallback-root group/tool-fallback-root w-full rounded-lg border py-3",
|
|
1365
|
+
className,
|
|
1366
|
+
)}
|
|
1367
|
+
style={
|
|
1368
|
+
{
|
|
1369
|
+
"--animation-duration": `${ANIMATION_DURATION}ms`,
|
|
1370
|
+
} as React.CSSProperties
|
|
1371
|
+
}
|
|
1372
|
+
{...props}
|
|
1373
|
+
>
|
|
1374
|
+
{children}
|
|
1375
|
+
</Collapsible>
|
|
1376
|
+
);
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
type ToolStatus = ToolCallMessagePartStatus["type"];
|
|
1380
|
+
|
|
1381
|
+
const statusIconMap: Record<ToolStatus, React.ElementType> = {
|
|
1382
|
+
running: LoaderIcon,
|
|
1383
|
+
complete: CheckIcon,
|
|
1384
|
+
incomplete: XCircleIcon,
|
|
1385
|
+
"requires-action": AlertCircleIcon,
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
function ToolFallbackTrigger({
|
|
1274
1389
|
toolName,
|
|
1275
|
-
argsText,
|
|
1276
|
-
result,
|
|
1277
1390
|
status,
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1391
|
+
className,
|
|
1392
|
+
...props
|
|
1393
|
+
}: React.ComponentProps<typeof CollapsibleTrigger> & {
|
|
1394
|
+
toolName: string;
|
|
1395
|
+
status?: ToolCallMessagePartStatus;
|
|
1396
|
+
}) {
|
|
1397
|
+
const statusType = status?.type ?? "complete";
|
|
1398
|
+
const isRunning = statusType === "running";
|
|
1281
1399
|
const isCancelled =
|
|
1282
1400
|
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
? status.error
|
|
1287
|
-
: JSON.stringify(status.error)
|
|
1288
|
-
: null;
|
|
1401
|
+
|
|
1402
|
+
const Icon = statusIconMap[statusType];
|
|
1403
|
+
const label = isCancelled ? "Cancelled tool" : "Used tool";
|
|
1289
1404
|
|
|
1290
1405
|
return (
|
|
1291
|
-
<
|
|
1406
|
+
<CollapsibleTrigger
|
|
1407
|
+
data-slot="tool-fallback-trigger"
|
|
1292
1408
|
className={cn(
|
|
1293
|
-
"aui-tool-fallback-
|
|
1294
|
-
|
|
1409
|
+
"aui-tool-fallback-trigger group/trigger flex w-full items-center gap-2 px-4 text-sm transition-colors",
|
|
1410
|
+
className,
|
|
1295
1411
|
)}
|
|
1412
|
+
{...props}
|
|
1296
1413
|
>
|
|
1297
|
-
<
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1414
|
+
<Icon
|
|
1415
|
+
data-slot="tool-fallback-trigger-icon"
|
|
1416
|
+
className={cn(
|
|
1417
|
+
"aui-tool-fallback-trigger-icon size-4 shrink-0",
|
|
1418
|
+
isCancelled && "text-muted-foreground",
|
|
1419
|
+
isRunning && "animate-spin",
|
|
1302
1420
|
)}
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
<div className="aui-tool-fallback-cancelled-root px-4">
|
|
1320
|
-
<p className="aui-tool-fallback-cancelled-header font-semibold text-muted-foreground">
|
|
1321
|
-
Cancelled reason:
|
|
1322
|
-
</p>
|
|
1323
|
-
<p className="aui-tool-fallback-cancelled-reason text-muted-foreground">
|
|
1324
|
-
{cancelledReason}
|
|
1325
|
-
</p>
|
|
1326
|
-
</div>
|
|
1327
|
-
)}
|
|
1328
|
-
<div
|
|
1329
|
-
className={cn(
|
|
1330
|
-
"aui-tool-fallback-args-root px-4",
|
|
1331
|
-
isCancelled && "opacity-60",
|
|
1332
|
-
)}
|
|
1421
|
+
/>
|
|
1422
|
+
<span
|
|
1423
|
+
data-slot="tool-fallback-trigger-label"
|
|
1424
|
+
className={cn(
|
|
1425
|
+
"aui-tool-fallback-trigger-label-wrapper relative inline-block grow text-left leading-none",
|
|
1426
|
+
isCancelled && "text-muted-foreground line-through",
|
|
1427
|
+
)}
|
|
1428
|
+
>
|
|
1429
|
+
<span>
|
|
1430
|
+
{label}: <b>{toolName}</b>
|
|
1431
|
+
</span>
|
|
1432
|
+
{isRunning && (
|
|
1433
|
+
<span
|
|
1434
|
+
aria-hidden
|
|
1435
|
+
data-slot="tool-fallback-trigger-shimmer"
|
|
1436
|
+
className="aui-tool-fallback-trigger-shimmer shimmer pointer-events-none absolute inset-0 motion-reduce:animate-none"
|
|
1333
1437
|
>
|
|
1334
|
-
<
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1438
|
+
{label}: <b>{toolName}</b>
|
|
1439
|
+
</span>
|
|
1440
|
+
)}
|
|
1441
|
+
</span>
|
|
1442
|
+
<ChevronDownIcon
|
|
1443
|
+
data-slot="tool-fallback-trigger-chevron"
|
|
1444
|
+
className={cn(
|
|
1445
|
+
"aui-tool-fallback-trigger-chevron size-4 shrink-0",
|
|
1446
|
+
"transition-transform duration-(--animation-duration) ease-out",
|
|
1447
|
+
"group-data-[state=closed]/trigger:-rotate-90",
|
|
1448
|
+
"group-data-[state=open]/trigger:rotate-0",
|
|
1449
|
+
)}
|
|
1450
|
+
/>
|
|
1451
|
+
</CollapsibleTrigger>
|
|
1452
|
+
);
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
function ToolFallbackContent({
|
|
1456
|
+
className,
|
|
1457
|
+
children,
|
|
1458
|
+
...props
|
|
1459
|
+
}: React.ComponentProps<typeof CollapsibleContent>) {
|
|
1460
|
+
return (
|
|
1461
|
+
<CollapsibleContent
|
|
1462
|
+
data-slot="tool-fallback-content"
|
|
1463
|
+
className={cn(
|
|
1464
|
+
"aui-tool-fallback-content relative overflow-hidden text-sm outline-none",
|
|
1465
|
+
"group/collapsible-content ease-out",
|
|
1466
|
+
"data-[state=closed]:animate-collapsible-up",
|
|
1467
|
+
"data-[state=open]:animate-collapsible-down",
|
|
1468
|
+
"data-[state=closed]:fill-mode-forwards",
|
|
1469
|
+
"data-[state=closed]:pointer-events-none",
|
|
1470
|
+
"data-[state=open]:duration-(--animation-duration)",
|
|
1471
|
+
"data-[state=closed]:duration-(--animation-duration)",
|
|
1472
|
+
className,
|
|
1351
1473
|
)}
|
|
1474
|
+
{...props}
|
|
1475
|
+
>
|
|
1476
|
+
<div className="mt-3 flex flex-col gap-2 border-t pt-2">{children}</div>
|
|
1477
|
+
</CollapsibleContent>
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
function ToolFallbackArgs({
|
|
1482
|
+
argsText,
|
|
1483
|
+
className,
|
|
1484
|
+
...props
|
|
1485
|
+
}: React.ComponentProps<"div"> & {
|
|
1486
|
+
argsText?: string;
|
|
1487
|
+
}) {
|
|
1488
|
+
if (!argsText) return null;
|
|
1489
|
+
|
|
1490
|
+
return (
|
|
1491
|
+
<div
|
|
1492
|
+
data-slot="tool-fallback-args"
|
|
1493
|
+
className={cn("aui-tool-fallback-args px-4", className)}
|
|
1494
|
+
{...props}
|
|
1495
|
+
>
|
|
1496
|
+
<pre className="aui-tool-fallback-args-value whitespace-pre-wrap">
|
|
1497
|
+
{argsText}
|
|
1498
|
+
</pre>
|
|
1499
|
+
</div>
|
|
1500
|
+
);
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
function ToolFallbackResult({
|
|
1504
|
+
result,
|
|
1505
|
+
className,
|
|
1506
|
+
...props
|
|
1507
|
+
}: React.ComponentProps<"div"> & {
|
|
1508
|
+
result?: unknown;
|
|
1509
|
+
}) {
|
|
1510
|
+
if (result === undefined) return null;
|
|
1511
|
+
|
|
1512
|
+
return (
|
|
1513
|
+
<div
|
|
1514
|
+
data-slot="tool-fallback-result"
|
|
1515
|
+
className={cn(
|
|
1516
|
+
"aui-tool-fallback-result border-t border-dashed px-4 pt-2",
|
|
1517
|
+
className,
|
|
1518
|
+
)}
|
|
1519
|
+
{...props}
|
|
1520
|
+
>
|
|
1521
|
+
<p className="aui-tool-fallback-result-header font-semibold">Result:</p>
|
|
1522
|
+
<pre className="aui-tool-fallback-result-content whitespace-pre-wrap">
|
|
1523
|
+
{typeof result === "string" ? result : JSON.stringify(result, null, 2)}
|
|
1524
|
+
</pre>
|
|
1525
|
+
</div>
|
|
1526
|
+
);
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
function ToolFallbackError({
|
|
1530
|
+
status,
|
|
1531
|
+
className,
|
|
1532
|
+
...props
|
|
1533
|
+
}: React.ComponentProps<"div"> & {
|
|
1534
|
+
status?: ToolCallMessagePartStatus;
|
|
1535
|
+
}) {
|
|
1536
|
+
if (status?.type !== "incomplete") return null;
|
|
1537
|
+
|
|
1538
|
+
const error = status.error;
|
|
1539
|
+
const errorText = error
|
|
1540
|
+
? typeof error === "string"
|
|
1541
|
+
? error
|
|
1542
|
+
: JSON.stringify(error)
|
|
1543
|
+
: null;
|
|
1544
|
+
|
|
1545
|
+
if (!errorText) return null;
|
|
1546
|
+
|
|
1547
|
+
const isCancelled = status.reason === "cancelled";
|
|
1548
|
+
const headerText = isCancelled ? "Cancelled reason:" : "Error:";
|
|
1549
|
+
|
|
1550
|
+
return (
|
|
1551
|
+
<div
|
|
1552
|
+
data-slot="tool-fallback-error"
|
|
1553
|
+
className={cn("aui-tool-fallback-error px-4", className)}
|
|
1554
|
+
{...props}
|
|
1555
|
+
>
|
|
1556
|
+
<p className="aui-tool-fallback-error-header font-semibold text-muted-foreground">
|
|
1557
|
+
{headerText}
|
|
1558
|
+
</p>
|
|
1559
|
+
<p className="aui-tool-fallback-error-reason text-muted-foreground">
|
|
1560
|
+
{errorText}
|
|
1561
|
+
</p>
|
|
1352
1562
|
</div>
|
|
1353
1563
|
);
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
const ToolFallbackImpl: ToolCallMessagePartComponent = ({
|
|
1567
|
+
toolName,
|
|
1568
|
+
argsText,
|
|
1569
|
+
result,
|
|
1570
|
+
status,
|
|
1571
|
+
}) => {
|
|
1572
|
+
const isCancelled =
|
|
1573
|
+
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1574
|
+
|
|
1575
|
+
return (
|
|
1576
|
+
<ToolFallbackRoot
|
|
1577
|
+
className={cn(isCancelled && "border-muted-foreground/30 bg-muted/30")}
|
|
1578
|
+
>
|
|
1579
|
+
<ToolFallbackTrigger toolName={toolName} status={status} />
|
|
1580
|
+
<ToolFallbackContent>
|
|
1581
|
+
<ToolFallbackError status={status} />
|
|
1582
|
+
<ToolFallbackArgs
|
|
1583
|
+
argsText={argsText}
|
|
1584
|
+
className={cn(isCancelled && "opacity-60")}
|
|
1585
|
+
/>
|
|
1586
|
+
{!isCancelled && <ToolFallbackResult result={result} />}
|
|
1587
|
+
</ToolFallbackContent>
|
|
1588
|
+
</ToolFallbackRoot>
|
|
1589
|
+
);
|
|
1590
|
+
};
|
|
1591
|
+
|
|
1592
|
+
const ToolFallback = memo(
|
|
1593
|
+
ToolFallbackImpl,
|
|
1594
|
+
) as unknown as ToolCallMessagePartComponent & {
|
|
1595
|
+
Root: typeof ToolFallbackRoot;
|
|
1596
|
+
Trigger: typeof ToolFallbackTrigger;
|
|
1597
|
+
Content: typeof ToolFallbackContent;
|
|
1598
|
+
Args: typeof ToolFallbackArgs;
|
|
1599
|
+
Result: typeof ToolFallbackResult;
|
|
1600
|
+
Error: typeof ToolFallbackError;
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
ToolFallback.displayName = "ToolFallback";
|
|
1604
|
+
ToolFallback.Root = ToolFallbackRoot;
|
|
1605
|
+
ToolFallback.Trigger = ToolFallbackTrigger;
|
|
1606
|
+
ToolFallback.Content = ToolFallbackContent;
|
|
1607
|
+
ToolFallback.Args = ToolFallbackArgs;
|
|
1608
|
+
ToolFallback.Result = ToolFallbackResult;
|
|
1609
|
+
ToolFallback.Error = ToolFallbackError;
|
|
1610
|
+
|
|
1611
|
+
export {
|
|
1612
|
+
ToolFallback,
|
|
1613
|
+
ToolFallbackRoot,
|
|
1614
|
+
ToolFallbackTrigger,
|
|
1615
|
+
ToolFallbackContent,
|
|
1616
|
+
ToolFallbackArgs,
|
|
1617
|
+
ToolFallbackResult,
|
|
1618
|
+
ToolFallbackError,
|
|
1354
1619
|
};
|
|
1355
1620
|
|
|
1356
1621
|
```
|
|
@@ -1966,6 +2231,45 @@ export {
|
|
|
1966
2231
|
|
|
1967
2232
|
```
|
|
1968
2233
|
|
|
2234
|
+
## components/ui/collapsible.tsx
|
|
2235
|
+
|
|
2236
|
+
```tsx
|
|
2237
|
+
"use client";
|
|
2238
|
+
|
|
2239
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2240
|
+
|
|
2241
|
+
function Collapsible({
|
|
2242
|
+
...props
|
|
2243
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
2244
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
function CollapsibleTrigger({
|
|
2248
|
+
...props
|
|
2249
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
2250
|
+
return (
|
|
2251
|
+
<CollapsiblePrimitive.CollapsibleTrigger
|
|
2252
|
+
data-slot="collapsible-trigger"
|
|
2253
|
+
{...props}
|
|
2254
|
+
/>
|
|
2255
|
+
);
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
function CollapsibleContent({
|
|
2259
|
+
...props
|
|
2260
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
2261
|
+
return (
|
|
2262
|
+
<CollapsiblePrimitive.CollapsibleContent
|
|
2263
|
+
data-slot="collapsible-content"
|
|
2264
|
+
{...props}
|
|
2265
|
+
/>
|
|
2266
|
+
);
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
2270
|
+
|
|
2271
|
+
```
|
|
2272
|
+
|
|
1969
2273
|
## components/ui/dialog.tsx
|
|
1970
2274
|
|
|
1971
2275
|
```tsx
|
|
@@ -2327,26 +2631,27 @@ export default nextConfig;
|
|
|
2327
2631
|
"@assistant-ui/react": "workspace:*",
|
|
2328
2632
|
"@assistant-ui/react-langgraph": "workspace:*",
|
|
2329
2633
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
2330
|
-
"@langchain/langgraph-sdk": "^1.
|
|
2634
|
+
"@langchain/langgraph-sdk": "^1.5.4",
|
|
2331
2635
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
2636
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
2332
2637
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
2333
2638
|
"@radix-ui/react-slot": "^1.2.4",
|
|
2334
2639
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
2335
2640
|
"class-variance-authority": "^0.7.1",
|
|
2336
2641
|
"clsx": "^2.1.1",
|
|
2337
2642
|
"lucide-react": "^0.562.0",
|
|
2338
|
-
"next": "16.1.
|
|
2339
|
-
"react": "19.2.3",
|
|
2340
|
-
"react-dom": "19.2.3",
|
|
2643
|
+
"next": "^16.1.4",
|
|
2644
|
+
"react": "^19.2.3",
|
|
2645
|
+
"react-dom": "^19.2.3",
|
|
2341
2646
|
"remark-gfm": "^4.0.1",
|
|
2342
2647
|
"tailwind-merge": "^3.4.0",
|
|
2343
|
-
"zustand": "^5.0.
|
|
2648
|
+
"zustand": "^5.0.10"
|
|
2344
2649
|
},
|
|
2345
2650
|
"devDependencies": {
|
|
2346
2651
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
2347
2652
|
"@tailwindcss/postcss": "^4.1.18",
|
|
2348
|
-
"@types/node": "^25.0.
|
|
2349
|
-
"@types/react": "^19.2.
|
|
2653
|
+
"@types/node": "^25.0.9",
|
|
2654
|
+
"@types/react": "^19.2.9",
|
|
2350
2655
|
"@types/react-dom": "^19.2.3",
|
|
2351
2656
|
"postcss": "^8.5.6",
|
|
2352
2657
|
"tailwindcss": "^4.1.18",
|