@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
|
@@ -516,7 +516,7 @@ export const ComposerAddAttachment: FC = () => {
|
|
|
516
516
|
side="bottom"
|
|
517
517
|
variant="ghost"
|
|
518
518
|
size="icon"
|
|
519
|
-
className="aui-composer-add-attachment size-
|
|
519
|
+
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"
|
|
520
520
|
aria-label="Add Attachment"
|
|
521
521
|
>
|
|
522
522
|
<PlusIcon className="aui-attachment-add-icon size-5 stroke-[1.5px]" />
|
|
@@ -775,6 +775,7 @@ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button
|
|
|
775
775
|
import { Button } from "@/components/ui/button";
|
|
776
776
|
import { cn } from "@/lib/utils";
|
|
777
777
|
import {
|
|
778
|
+
ActionBarMorePrimitive,
|
|
778
779
|
ActionBarPrimitive,
|
|
779
780
|
AssistantIf,
|
|
780
781
|
BranchPickerPrimitive,
|
|
@@ -791,6 +792,7 @@ import {
|
|
|
791
792
|
ChevronRightIcon,
|
|
792
793
|
CopyIcon,
|
|
793
794
|
DownloadIcon,
|
|
795
|
+
MoreHorizontalIcon,
|
|
794
796
|
PencilIcon,
|
|
795
797
|
RefreshCwIcon,
|
|
796
798
|
SquareIcon,
|
|
@@ -1012,16 +1014,33 @@ const AssistantActionBar: FC = () => {
|
|
|
1012
1014
|
</AssistantIf>
|
|
1013
1015
|
</TooltipIconButton>
|
|
1014
1016
|
</ActionBarPrimitive.Copy>
|
|
1015
|
-
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
1016
|
-
<TooltipIconButton tooltip="Export as Markdown">
|
|
1017
|
-
<DownloadIcon />
|
|
1018
|
-
</TooltipIconButton>
|
|
1019
|
-
</ActionBarPrimitive.ExportMarkdown>
|
|
1020
1017
|
<ActionBarPrimitive.Reload asChild>
|
|
1021
1018
|
<TooltipIconButton tooltip="Refresh">
|
|
1022
1019
|
<RefreshCwIcon />
|
|
1023
1020
|
</TooltipIconButton>
|
|
1024
1021
|
</ActionBarPrimitive.Reload>
|
|
1022
|
+
<ActionBarMorePrimitive.Root>
|
|
1023
|
+
<ActionBarMorePrimitive.Trigger asChild>
|
|
1024
|
+
<TooltipIconButton
|
|
1025
|
+
tooltip="More"
|
|
1026
|
+
className="data-[state=open]:bg-accent"
|
|
1027
|
+
>
|
|
1028
|
+
<MoreHorizontalIcon />
|
|
1029
|
+
</TooltipIconButton>
|
|
1030
|
+
</ActionBarMorePrimitive.Trigger>
|
|
1031
|
+
<ActionBarMorePrimitive.Content
|
|
1032
|
+
side="bottom"
|
|
1033
|
+
align="start"
|
|
1034
|
+
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"
|
|
1035
|
+
>
|
|
1036
|
+
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
1037
|
+
<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">
|
|
1038
|
+
<DownloadIcon className="size-4" />
|
|
1039
|
+
Export as Markdown
|
|
1040
|
+
</ActionBarMorePrimitive.Item>
|
|
1041
|
+
</ActionBarPrimitive.ExportMarkdown>
|
|
1042
|
+
</ActionBarMorePrimitive.Content>
|
|
1043
|
+
</ActionBarMorePrimitive.Root>
|
|
1025
1044
|
</ActionBarPrimitive.Root>
|
|
1026
1045
|
);
|
|
1027
1046
|
};
|
|
@@ -1122,98 +1141,329 @@ const BranchPicker: FC<BranchPickerPrimitive.Root.Props> = ({
|
|
|
1122
1141
|
## components/assistant-ui/tool-fallback.tsx
|
|
1123
1142
|
|
|
1124
1143
|
```tsx
|
|
1125
|
-
|
|
1144
|
+
"use client";
|
|
1145
|
+
|
|
1146
|
+
import { memo, useCallback, useRef, useState } from "react";
|
|
1126
1147
|
import {
|
|
1148
|
+
AlertCircleIcon,
|
|
1127
1149
|
CheckIcon,
|
|
1128
1150
|
ChevronDownIcon,
|
|
1129
|
-
|
|
1151
|
+
LoaderIcon,
|
|
1130
1152
|
XCircleIcon,
|
|
1131
1153
|
} from "lucide-react";
|
|
1132
|
-
import {
|
|
1133
|
-
|
|
1154
|
+
import {
|
|
1155
|
+
useScrollLock,
|
|
1156
|
+
type ToolCallMessagePartStatus,
|
|
1157
|
+
type ToolCallMessagePartComponent,
|
|
1158
|
+
} from "@assistant-ui/react";
|
|
1159
|
+
import {
|
|
1160
|
+
Collapsible,
|
|
1161
|
+
CollapsibleContent,
|
|
1162
|
+
CollapsibleTrigger,
|
|
1163
|
+
} from "@/components/ui/collapsible";
|
|
1134
1164
|
import { cn } from "@/lib/utils";
|
|
1135
1165
|
|
|
1136
|
-
|
|
1166
|
+
const ANIMATION_DURATION = 200;
|
|
1167
|
+
|
|
1168
|
+
export type ToolFallbackRootProps = Omit<
|
|
1169
|
+
React.ComponentProps<typeof Collapsible>,
|
|
1170
|
+
"open" | "onOpenChange"
|
|
1171
|
+
> & {
|
|
1172
|
+
open?: boolean;
|
|
1173
|
+
onOpenChange?: (open: boolean) => void;
|
|
1174
|
+
defaultOpen?: boolean;
|
|
1175
|
+
};
|
|
1176
|
+
|
|
1177
|
+
function ToolFallbackRoot({
|
|
1178
|
+
className,
|
|
1179
|
+
open: controlledOpen,
|
|
1180
|
+
onOpenChange: controlledOnOpenChange,
|
|
1181
|
+
defaultOpen = false,
|
|
1182
|
+
children,
|
|
1183
|
+
...props
|
|
1184
|
+
}: ToolFallbackRootProps) {
|
|
1185
|
+
const collapsibleRef = useRef<HTMLDivElement>(null);
|
|
1186
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
1187
|
+
const lockScroll = useScrollLock(collapsibleRef, ANIMATION_DURATION);
|
|
1188
|
+
|
|
1189
|
+
const isControlled = controlledOpen !== undefined;
|
|
1190
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
1191
|
+
|
|
1192
|
+
const handleOpenChange = useCallback(
|
|
1193
|
+
(open: boolean) => {
|
|
1194
|
+
if (!open) {
|
|
1195
|
+
lockScroll();
|
|
1196
|
+
}
|
|
1197
|
+
if (!isControlled) {
|
|
1198
|
+
setUncontrolledOpen(open);
|
|
1199
|
+
}
|
|
1200
|
+
controlledOnOpenChange?.(open);
|
|
1201
|
+
},
|
|
1202
|
+
[lockScroll, isControlled, controlledOnOpenChange],
|
|
1203
|
+
);
|
|
1204
|
+
|
|
1205
|
+
return (
|
|
1206
|
+
<Collapsible
|
|
1207
|
+
ref={collapsibleRef}
|
|
1208
|
+
data-slot="tool-fallback-root"
|
|
1209
|
+
open={isOpen}
|
|
1210
|
+
onOpenChange={handleOpenChange}
|
|
1211
|
+
className={cn(
|
|
1212
|
+
"aui-tool-fallback-root group/tool-fallback-root w-full rounded-lg border py-3",
|
|
1213
|
+
className,
|
|
1214
|
+
)}
|
|
1215
|
+
style={
|
|
1216
|
+
{
|
|
1217
|
+
"--animation-duration": `${ANIMATION_DURATION}ms`,
|
|
1218
|
+
} as React.CSSProperties
|
|
1219
|
+
}
|
|
1220
|
+
{...props}
|
|
1221
|
+
>
|
|
1222
|
+
{children}
|
|
1223
|
+
</Collapsible>
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
type ToolStatus = ToolCallMessagePartStatus["type"];
|
|
1228
|
+
|
|
1229
|
+
const statusIconMap: Record<ToolStatus, React.ElementType> = {
|
|
1230
|
+
running: LoaderIcon,
|
|
1231
|
+
complete: CheckIcon,
|
|
1232
|
+
incomplete: XCircleIcon,
|
|
1233
|
+
"requires-action": AlertCircleIcon,
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1236
|
+
function ToolFallbackTrigger({
|
|
1137
1237
|
toolName,
|
|
1138
|
-
argsText,
|
|
1139
|
-
result,
|
|
1140
1238
|
status,
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1239
|
+
className,
|
|
1240
|
+
...props
|
|
1241
|
+
}: React.ComponentProps<typeof CollapsibleTrigger> & {
|
|
1242
|
+
toolName: string;
|
|
1243
|
+
status?: ToolCallMessagePartStatus;
|
|
1244
|
+
}) {
|
|
1245
|
+
const statusType = status?.type ?? "complete";
|
|
1246
|
+
const isRunning = statusType === "running";
|
|
1144
1247
|
const isCancelled =
|
|
1145
1248
|
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
? status.error
|
|
1150
|
-
: JSON.stringify(status.error)
|
|
1151
|
-
: null;
|
|
1249
|
+
|
|
1250
|
+
const Icon = statusIconMap[statusType];
|
|
1251
|
+
const label = isCancelled ? "Cancelled tool" : "Used tool";
|
|
1152
1252
|
|
|
1153
1253
|
return (
|
|
1154
|
-
<
|
|
1254
|
+
<CollapsibleTrigger
|
|
1255
|
+
data-slot="tool-fallback-trigger"
|
|
1155
1256
|
className={cn(
|
|
1156
|
-
"aui-tool-fallback-
|
|
1157
|
-
|
|
1257
|
+
"aui-tool-fallback-trigger group/trigger flex w-full items-center gap-2 px-4 text-sm transition-colors",
|
|
1258
|
+
className,
|
|
1158
1259
|
)}
|
|
1260
|
+
{...props}
|
|
1159
1261
|
>
|
|
1160
|
-
<
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1262
|
+
<Icon
|
|
1263
|
+
data-slot="tool-fallback-trigger-icon"
|
|
1264
|
+
className={cn(
|
|
1265
|
+
"aui-tool-fallback-trigger-icon size-4 shrink-0",
|
|
1266
|
+
isCancelled && "text-muted-foreground",
|
|
1267
|
+
isRunning && "animate-spin",
|
|
1165
1268
|
)}
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
<div className="aui-tool-fallback-cancelled-root px-4">
|
|
1183
|
-
<p className="aui-tool-fallback-cancelled-header font-semibold text-muted-foreground">
|
|
1184
|
-
Cancelled reason:
|
|
1185
|
-
</p>
|
|
1186
|
-
<p className="aui-tool-fallback-cancelled-reason text-muted-foreground">
|
|
1187
|
-
{cancelledReason}
|
|
1188
|
-
</p>
|
|
1189
|
-
</div>
|
|
1190
|
-
)}
|
|
1191
|
-
<div
|
|
1192
|
-
className={cn(
|
|
1193
|
-
"aui-tool-fallback-args-root px-4",
|
|
1194
|
-
isCancelled && "opacity-60",
|
|
1195
|
-
)}
|
|
1269
|
+
/>
|
|
1270
|
+
<span
|
|
1271
|
+
data-slot="tool-fallback-trigger-label"
|
|
1272
|
+
className={cn(
|
|
1273
|
+
"aui-tool-fallback-trigger-label-wrapper relative inline-block grow text-left leading-none",
|
|
1274
|
+
isCancelled && "text-muted-foreground line-through",
|
|
1275
|
+
)}
|
|
1276
|
+
>
|
|
1277
|
+
<span>
|
|
1278
|
+
{label}: <b>{toolName}</b>
|
|
1279
|
+
</span>
|
|
1280
|
+
{isRunning && (
|
|
1281
|
+
<span
|
|
1282
|
+
aria-hidden
|
|
1283
|
+
data-slot="tool-fallback-trigger-shimmer"
|
|
1284
|
+
className="aui-tool-fallback-trigger-shimmer shimmer pointer-events-none absolute inset-0 motion-reduce:animate-none"
|
|
1196
1285
|
>
|
|
1197
|
-
<
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1286
|
+
{label}: <b>{toolName}</b>
|
|
1287
|
+
</span>
|
|
1288
|
+
)}
|
|
1289
|
+
</span>
|
|
1290
|
+
<ChevronDownIcon
|
|
1291
|
+
data-slot="tool-fallback-trigger-chevron"
|
|
1292
|
+
className={cn(
|
|
1293
|
+
"aui-tool-fallback-trigger-chevron size-4 shrink-0",
|
|
1294
|
+
"transition-transform duration-(--animation-duration) ease-out",
|
|
1295
|
+
"group-data-[state=closed]/trigger:-rotate-90",
|
|
1296
|
+
"group-data-[state=open]/trigger:rotate-0",
|
|
1297
|
+
)}
|
|
1298
|
+
/>
|
|
1299
|
+
</CollapsibleTrigger>
|
|
1300
|
+
);
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
function ToolFallbackContent({
|
|
1304
|
+
className,
|
|
1305
|
+
children,
|
|
1306
|
+
...props
|
|
1307
|
+
}: React.ComponentProps<typeof CollapsibleContent>) {
|
|
1308
|
+
return (
|
|
1309
|
+
<CollapsibleContent
|
|
1310
|
+
data-slot="tool-fallback-content"
|
|
1311
|
+
className={cn(
|
|
1312
|
+
"aui-tool-fallback-content relative overflow-hidden text-sm outline-none",
|
|
1313
|
+
"group/collapsible-content ease-out",
|
|
1314
|
+
"data-[state=closed]:animate-collapsible-up",
|
|
1315
|
+
"data-[state=open]:animate-collapsible-down",
|
|
1316
|
+
"data-[state=closed]:fill-mode-forwards",
|
|
1317
|
+
"data-[state=closed]:pointer-events-none",
|
|
1318
|
+
"data-[state=open]:duration-(--animation-duration)",
|
|
1319
|
+
"data-[state=closed]:duration-(--animation-duration)",
|
|
1320
|
+
className,
|
|
1214
1321
|
)}
|
|
1322
|
+
{...props}
|
|
1323
|
+
>
|
|
1324
|
+
<div className="mt-3 flex flex-col gap-2 border-t pt-2">{children}</div>
|
|
1325
|
+
</CollapsibleContent>
|
|
1326
|
+
);
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
function ToolFallbackArgs({
|
|
1330
|
+
argsText,
|
|
1331
|
+
className,
|
|
1332
|
+
...props
|
|
1333
|
+
}: React.ComponentProps<"div"> & {
|
|
1334
|
+
argsText?: string;
|
|
1335
|
+
}) {
|
|
1336
|
+
if (!argsText) return null;
|
|
1337
|
+
|
|
1338
|
+
return (
|
|
1339
|
+
<div
|
|
1340
|
+
data-slot="tool-fallback-args"
|
|
1341
|
+
className={cn("aui-tool-fallback-args px-4", className)}
|
|
1342
|
+
{...props}
|
|
1343
|
+
>
|
|
1344
|
+
<pre className="aui-tool-fallback-args-value whitespace-pre-wrap">
|
|
1345
|
+
{argsText}
|
|
1346
|
+
</pre>
|
|
1347
|
+
</div>
|
|
1348
|
+
);
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
function ToolFallbackResult({
|
|
1352
|
+
result,
|
|
1353
|
+
className,
|
|
1354
|
+
...props
|
|
1355
|
+
}: React.ComponentProps<"div"> & {
|
|
1356
|
+
result?: unknown;
|
|
1357
|
+
}) {
|
|
1358
|
+
if (result === undefined) return null;
|
|
1359
|
+
|
|
1360
|
+
return (
|
|
1361
|
+
<div
|
|
1362
|
+
data-slot="tool-fallback-result"
|
|
1363
|
+
className={cn(
|
|
1364
|
+
"aui-tool-fallback-result border-t border-dashed px-4 pt-2",
|
|
1365
|
+
className,
|
|
1366
|
+
)}
|
|
1367
|
+
{...props}
|
|
1368
|
+
>
|
|
1369
|
+
<p className="aui-tool-fallback-result-header font-semibold">Result:</p>
|
|
1370
|
+
<pre className="aui-tool-fallback-result-content whitespace-pre-wrap">
|
|
1371
|
+
{typeof result === "string" ? result : JSON.stringify(result, null, 2)}
|
|
1372
|
+
</pre>
|
|
1373
|
+
</div>
|
|
1374
|
+
);
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
function ToolFallbackError({
|
|
1378
|
+
status,
|
|
1379
|
+
className,
|
|
1380
|
+
...props
|
|
1381
|
+
}: React.ComponentProps<"div"> & {
|
|
1382
|
+
status?: ToolCallMessagePartStatus;
|
|
1383
|
+
}) {
|
|
1384
|
+
if (status?.type !== "incomplete") return null;
|
|
1385
|
+
|
|
1386
|
+
const error = status.error;
|
|
1387
|
+
const errorText = error
|
|
1388
|
+
? typeof error === "string"
|
|
1389
|
+
? error
|
|
1390
|
+
: JSON.stringify(error)
|
|
1391
|
+
: null;
|
|
1392
|
+
|
|
1393
|
+
if (!errorText) return null;
|
|
1394
|
+
|
|
1395
|
+
const isCancelled = status.reason === "cancelled";
|
|
1396
|
+
const headerText = isCancelled ? "Cancelled reason:" : "Error:";
|
|
1397
|
+
|
|
1398
|
+
return (
|
|
1399
|
+
<div
|
|
1400
|
+
data-slot="tool-fallback-error"
|
|
1401
|
+
className={cn("aui-tool-fallback-error px-4", className)}
|
|
1402
|
+
{...props}
|
|
1403
|
+
>
|
|
1404
|
+
<p className="aui-tool-fallback-error-header font-semibold text-muted-foreground">
|
|
1405
|
+
{headerText}
|
|
1406
|
+
</p>
|
|
1407
|
+
<p className="aui-tool-fallback-error-reason text-muted-foreground">
|
|
1408
|
+
{errorText}
|
|
1409
|
+
</p>
|
|
1215
1410
|
</div>
|
|
1216
1411
|
);
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
const ToolFallbackImpl: ToolCallMessagePartComponent = ({
|
|
1415
|
+
toolName,
|
|
1416
|
+
argsText,
|
|
1417
|
+
result,
|
|
1418
|
+
status,
|
|
1419
|
+
}) => {
|
|
1420
|
+
const isCancelled =
|
|
1421
|
+
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1422
|
+
|
|
1423
|
+
return (
|
|
1424
|
+
<ToolFallbackRoot
|
|
1425
|
+
className={cn(isCancelled && "border-muted-foreground/30 bg-muted/30")}
|
|
1426
|
+
>
|
|
1427
|
+
<ToolFallbackTrigger toolName={toolName} status={status} />
|
|
1428
|
+
<ToolFallbackContent>
|
|
1429
|
+
<ToolFallbackError status={status} />
|
|
1430
|
+
<ToolFallbackArgs
|
|
1431
|
+
argsText={argsText}
|
|
1432
|
+
className={cn(isCancelled && "opacity-60")}
|
|
1433
|
+
/>
|
|
1434
|
+
{!isCancelled && <ToolFallbackResult result={result} />}
|
|
1435
|
+
</ToolFallbackContent>
|
|
1436
|
+
</ToolFallbackRoot>
|
|
1437
|
+
);
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1440
|
+
const ToolFallback = memo(
|
|
1441
|
+
ToolFallbackImpl,
|
|
1442
|
+
) as unknown as ToolCallMessagePartComponent & {
|
|
1443
|
+
Root: typeof ToolFallbackRoot;
|
|
1444
|
+
Trigger: typeof ToolFallbackTrigger;
|
|
1445
|
+
Content: typeof ToolFallbackContent;
|
|
1446
|
+
Args: typeof ToolFallbackArgs;
|
|
1447
|
+
Result: typeof ToolFallbackResult;
|
|
1448
|
+
Error: typeof ToolFallbackError;
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1451
|
+
ToolFallback.displayName = "ToolFallback";
|
|
1452
|
+
ToolFallback.Root = ToolFallbackRoot;
|
|
1453
|
+
ToolFallback.Trigger = ToolFallbackTrigger;
|
|
1454
|
+
ToolFallback.Content = ToolFallbackContent;
|
|
1455
|
+
ToolFallback.Args = ToolFallbackArgs;
|
|
1456
|
+
ToolFallback.Result = ToolFallbackResult;
|
|
1457
|
+
ToolFallback.Error = ToolFallbackError;
|
|
1458
|
+
|
|
1459
|
+
export {
|
|
1460
|
+
ToolFallback,
|
|
1461
|
+
ToolFallbackRoot,
|
|
1462
|
+
ToolFallbackTrigger,
|
|
1463
|
+
ToolFallbackContent,
|
|
1464
|
+
ToolFallbackArgs,
|
|
1465
|
+
ToolFallbackResult,
|
|
1466
|
+
ToolFallbackError,
|
|
1217
1467
|
};
|
|
1218
1468
|
|
|
1219
1469
|
```
|
|
@@ -1393,6 +1643,45 @@ export { Button, buttonVariants };
|
|
|
1393
1643
|
|
|
1394
1644
|
```
|
|
1395
1645
|
|
|
1646
|
+
## components/ui/collapsible.tsx
|
|
1647
|
+
|
|
1648
|
+
```tsx
|
|
1649
|
+
"use client";
|
|
1650
|
+
|
|
1651
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
1652
|
+
|
|
1653
|
+
function Collapsible({
|
|
1654
|
+
...props
|
|
1655
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
1656
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
function CollapsibleTrigger({
|
|
1660
|
+
...props
|
|
1661
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
1662
|
+
return (
|
|
1663
|
+
<CollapsiblePrimitive.CollapsibleTrigger
|
|
1664
|
+
data-slot="collapsible-trigger"
|
|
1665
|
+
{...props}
|
|
1666
|
+
/>
|
|
1667
|
+
);
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
function CollapsibleContent({
|
|
1671
|
+
...props
|
|
1672
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
1673
|
+
return (
|
|
1674
|
+
<CollapsiblePrimitive.CollapsibleContent
|
|
1675
|
+
data-slot="collapsible-content"
|
|
1676
|
+
{...props}
|
|
1677
|
+
/>
|
|
1678
|
+
);
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
1682
|
+
|
|
1683
|
+
```
|
|
1684
|
+
|
|
1396
1685
|
## components/ui/dialog.tsx
|
|
1397
1686
|
|
|
1398
1687
|
```tsx
|
|
@@ -1648,29 +1937,30 @@ export default nextConfig;
|
|
|
1648
1937
|
"start": "next start"
|
|
1649
1938
|
},
|
|
1650
1939
|
"dependencies": {
|
|
1940
|
+
"@ag-ui/client": "^0.0.43",
|
|
1651
1941
|
"@assistant-ui/react": "workspace:*",
|
|
1652
|
-
"@assistant-ui/react-markdown": "workspace:*",
|
|
1653
1942
|
"@assistant-ui/react-ag-ui": "workspace:*",
|
|
1654
|
-
"@
|
|
1943
|
+
"@assistant-ui/react-markdown": "workspace:*",
|
|
1655
1944
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
1945
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
1656
1946
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
1657
1947
|
"@radix-ui/react-slot": "^1.2.4",
|
|
1658
1948
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
1659
1949
|
"class-variance-authority": "^0.7.1",
|
|
1660
1950
|
"clsx": "^2.1.1",
|
|
1661
1951
|
"lucide-react": "^0.562.0",
|
|
1662
|
-
"next": "16.1.
|
|
1663
|
-
"react": "19.2.3",
|
|
1664
|
-
"react-dom": "19.2.3",
|
|
1952
|
+
"next": "^16.1.4",
|
|
1953
|
+
"react": "^19.2.3",
|
|
1954
|
+
"react-dom": "^19.2.3",
|
|
1665
1955
|
"remark-gfm": "^4.0.1",
|
|
1666
1956
|
"tailwind-merge": "^3.4.0",
|
|
1667
|
-
"zustand": "^5.0.
|
|
1957
|
+
"zustand": "^5.0.10"
|
|
1668
1958
|
},
|
|
1669
1959
|
"devDependencies": {
|
|
1670
1960
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
1671
1961
|
"@tailwindcss/postcss": "^4.1.18",
|
|
1672
|
-
"@types/node": "^25.0.
|
|
1673
|
-
"@types/react": "^19.2.
|
|
1962
|
+
"@types/node": "^25.0.9",
|
|
1963
|
+
"@types/react": "^19.2.9",
|
|
1674
1964
|
"@types/react-dom": "^19.2.3",
|
|
1675
1965
|
"postcss": "^8.5.6",
|
|
1676
1966
|
"tailwindcss": "^4.1.18",
|