@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
|
@@ -583,7 +583,7 @@ export const ComposerAddAttachment: FC = () => {
|
|
|
583
583
|
side="bottom"
|
|
584
584
|
variant="ghost"
|
|
585
585
|
size="icon"
|
|
586
|
-
className="aui-composer-add-attachment size-
|
|
586
|
+
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"
|
|
587
587
|
aria-label="Add Attachment"
|
|
588
588
|
>
|
|
589
589
|
<PlusIcon className="aui-attachment-add-icon size-5 stroke-[1.5px]" />
|
|
@@ -842,6 +842,7 @@ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button
|
|
|
842
842
|
import { Button } from "@/components/ui/button";
|
|
843
843
|
import { cn } from "@/lib/utils";
|
|
844
844
|
import {
|
|
845
|
+
ActionBarMorePrimitive,
|
|
845
846
|
ActionBarPrimitive,
|
|
846
847
|
AssistantIf,
|
|
847
848
|
BranchPickerPrimitive,
|
|
@@ -858,6 +859,7 @@ import {
|
|
|
858
859
|
ChevronRightIcon,
|
|
859
860
|
CopyIcon,
|
|
860
861
|
DownloadIcon,
|
|
862
|
+
MoreHorizontalIcon,
|
|
861
863
|
PencilIcon,
|
|
862
864
|
RefreshCwIcon,
|
|
863
865
|
SquareIcon,
|
|
@@ -1079,16 +1081,33 @@ const AssistantActionBar: FC = () => {
|
|
|
1079
1081
|
</AssistantIf>
|
|
1080
1082
|
</TooltipIconButton>
|
|
1081
1083
|
</ActionBarPrimitive.Copy>
|
|
1082
|
-
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
1083
|
-
<TooltipIconButton tooltip="Export as Markdown">
|
|
1084
|
-
<DownloadIcon />
|
|
1085
|
-
</TooltipIconButton>
|
|
1086
|
-
</ActionBarPrimitive.ExportMarkdown>
|
|
1087
1084
|
<ActionBarPrimitive.Reload asChild>
|
|
1088
1085
|
<TooltipIconButton tooltip="Refresh">
|
|
1089
1086
|
<RefreshCwIcon />
|
|
1090
1087
|
</TooltipIconButton>
|
|
1091
1088
|
</ActionBarPrimitive.Reload>
|
|
1089
|
+
<ActionBarMorePrimitive.Root>
|
|
1090
|
+
<ActionBarMorePrimitive.Trigger asChild>
|
|
1091
|
+
<TooltipIconButton
|
|
1092
|
+
tooltip="More"
|
|
1093
|
+
className="data-[state=open]:bg-accent"
|
|
1094
|
+
>
|
|
1095
|
+
<MoreHorizontalIcon />
|
|
1096
|
+
</TooltipIconButton>
|
|
1097
|
+
</ActionBarMorePrimitive.Trigger>
|
|
1098
|
+
<ActionBarMorePrimitive.Content
|
|
1099
|
+
side="bottom"
|
|
1100
|
+
align="start"
|
|
1101
|
+
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"
|
|
1102
|
+
>
|
|
1103
|
+
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
1104
|
+
<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">
|
|
1105
|
+
<DownloadIcon className="size-4" />
|
|
1106
|
+
Export as Markdown
|
|
1107
|
+
</ActionBarMorePrimitive.Item>
|
|
1108
|
+
</ActionBarPrimitive.ExportMarkdown>
|
|
1109
|
+
</ActionBarMorePrimitive.Content>
|
|
1110
|
+
</ActionBarMorePrimitive.Root>
|
|
1092
1111
|
</ActionBarPrimitive.Root>
|
|
1093
1112
|
);
|
|
1094
1113
|
};
|
|
@@ -1189,98 +1208,329 @@ const BranchPicker: FC<BranchPickerPrimitive.Root.Props> = ({
|
|
|
1189
1208
|
## components/assistant-ui/tool-fallback.tsx
|
|
1190
1209
|
|
|
1191
1210
|
```tsx
|
|
1192
|
-
|
|
1211
|
+
"use client";
|
|
1212
|
+
|
|
1213
|
+
import { memo, useCallback, useRef, useState } from "react";
|
|
1193
1214
|
import {
|
|
1215
|
+
AlertCircleIcon,
|
|
1194
1216
|
CheckIcon,
|
|
1195
1217
|
ChevronDownIcon,
|
|
1196
|
-
|
|
1218
|
+
LoaderIcon,
|
|
1197
1219
|
XCircleIcon,
|
|
1198
1220
|
} from "lucide-react";
|
|
1199
|
-
import {
|
|
1200
|
-
|
|
1221
|
+
import {
|
|
1222
|
+
useScrollLock,
|
|
1223
|
+
type ToolCallMessagePartStatus,
|
|
1224
|
+
type ToolCallMessagePartComponent,
|
|
1225
|
+
} from "@assistant-ui/react";
|
|
1226
|
+
import {
|
|
1227
|
+
Collapsible,
|
|
1228
|
+
CollapsibleContent,
|
|
1229
|
+
CollapsibleTrigger,
|
|
1230
|
+
} from "@/components/ui/collapsible";
|
|
1201
1231
|
import { cn } from "@/lib/utils";
|
|
1202
1232
|
|
|
1203
|
-
|
|
1233
|
+
const ANIMATION_DURATION = 200;
|
|
1234
|
+
|
|
1235
|
+
export type ToolFallbackRootProps = Omit<
|
|
1236
|
+
React.ComponentProps<typeof Collapsible>,
|
|
1237
|
+
"open" | "onOpenChange"
|
|
1238
|
+
> & {
|
|
1239
|
+
open?: boolean;
|
|
1240
|
+
onOpenChange?: (open: boolean) => void;
|
|
1241
|
+
defaultOpen?: boolean;
|
|
1242
|
+
};
|
|
1243
|
+
|
|
1244
|
+
function ToolFallbackRoot({
|
|
1245
|
+
className,
|
|
1246
|
+
open: controlledOpen,
|
|
1247
|
+
onOpenChange: controlledOnOpenChange,
|
|
1248
|
+
defaultOpen = false,
|
|
1249
|
+
children,
|
|
1250
|
+
...props
|
|
1251
|
+
}: ToolFallbackRootProps) {
|
|
1252
|
+
const collapsibleRef = useRef<HTMLDivElement>(null);
|
|
1253
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
1254
|
+
const lockScroll = useScrollLock(collapsibleRef, ANIMATION_DURATION);
|
|
1255
|
+
|
|
1256
|
+
const isControlled = controlledOpen !== undefined;
|
|
1257
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
1258
|
+
|
|
1259
|
+
const handleOpenChange = useCallback(
|
|
1260
|
+
(open: boolean) => {
|
|
1261
|
+
if (!open) {
|
|
1262
|
+
lockScroll();
|
|
1263
|
+
}
|
|
1264
|
+
if (!isControlled) {
|
|
1265
|
+
setUncontrolledOpen(open);
|
|
1266
|
+
}
|
|
1267
|
+
controlledOnOpenChange?.(open);
|
|
1268
|
+
},
|
|
1269
|
+
[lockScroll, isControlled, controlledOnOpenChange],
|
|
1270
|
+
);
|
|
1271
|
+
|
|
1272
|
+
return (
|
|
1273
|
+
<Collapsible
|
|
1274
|
+
ref={collapsibleRef}
|
|
1275
|
+
data-slot="tool-fallback-root"
|
|
1276
|
+
open={isOpen}
|
|
1277
|
+
onOpenChange={handleOpenChange}
|
|
1278
|
+
className={cn(
|
|
1279
|
+
"aui-tool-fallback-root group/tool-fallback-root w-full rounded-lg border py-3",
|
|
1280
|
+
className,
|
|
1281
|
+
)}
|
|
1282
|
+
style={
|
|
1283
|
+
{
|
|
1284
|
+
"--animation-duration": `${ANIMATION_DURATION}ms`,
|
|
1285
|
+
} as React.CSSProperties
|
|
1286
|
+
}
|
|
1287
|
+
{...props}
|
|
1288
|
+
>
|
|
1289
|
+
{children}
|
|
1290
|
+
</Collapsible>
|
|
1291
|
+
);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
type ToolStatus = ToolCallMessagePartStatus["type"];
|
|
1295
|
+
|
|
1296
|
+
const statusIconMap: Record<ToolStatus, React.ElementType> = {
|
|
1297
|
+
running: LoaderIcon,
|
|
1298
|
+
complete: CheckIcon,
|
|
1299
|
+
incomplete: XCircleIcon,
|
|
1300
|
+
"requires-action": AlertCircleIcon,
|
|
1301
|
+
};
|
|
1302
|
+
|
|
1303
|
+
function ToolFallbackTrigger({
|
|
1204
1304
|
toolName,
|
|
1205
|
-
argsText,
|
|
1206
|
-
result,
|
|
1207
1305
|
status,
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1306
|
+
className,
|
|
1307
|
+
...props
|
|
1308
|
+
}: React.ComponentProps<typeof CollapsibleTrigger> & {
|
|
1309
|
+
toolName: string;
|
|
1310
|
+
status?: ToolCallMessagePartStatus;
|
|
1311
|
+
}) {
|
|
1312
|
+
const statusType = status?.type ?? "complete";
|
|
1313
|
+
const isRunning = statusType === "running";
|
|
1211
1314
|
const isCancelled =
|
|
1212
1315
|
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
? status.error
|
|
1217
|
-
: JSON.stringify(status.error)
|
|
1218
|
-
: null;
|
|
1316
|
+
|
|
1317
|
+
const Icon = statusIconMap[statusType];
|
|
1318
|
+
const label = isCancelled ? "Cancelled tool" : "Used tool";
|
|
1219
1319
|
|
|
1220
1320
|
return (
|
|
1221
|
-
<
|
|
1321
|
+
<CollapsibleTrigger
|
|
1322
|
+
data-slot="tool-fallback-trigger"
|
|
1222
1323
|
className={cn(
|
|
1223
|
-
"aui-tool-fallback-
|
|
1224
|
-
|
|
1324
|
+
"aui-tool-fallback-trigger group/trigger flex w-full items-center gap-2 px-4 text-sm transition-colors",
|
|
1325
|
+
className,
|
|
1225
1326
|
)}
|
|
1327
|
+
{...props}
|
|
1226
1328
|
>
|
|
1227
|
-
<
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1329
|
+
<Icon
|
|
1330
|
+
data-slot="tool-fallback-trigger-icon"
|
|
1331
|
+
className={cn(
|
|
1332
|
+
"aui-tool-fallback-trigger-icon size-4 shrink-0",
|
|
1333
|
+
isCancelled && "text-muted-foreground",
|
|
1334
|
+
isRunning && "animate-spin",
|
|
1232
1335
|
)}
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
<div className="aui-tool-fallback-cancelled-root px-4">
|
|
1250
|
-
<p className="aui-tool-fallback-cancelled-header font-semibold text-muted-foreground">
|
|
1251
|
-
Cancelled reason:
|
|
1252
|
-
</p>
|
|
1253
|
-
<p className="aui-tool-fallback-cancelled-reason text-muted-foreground">
|
|
1254
|
-
{cancelledReason}
|
|
1255
|
-
</p>
|
|
1256
|
-
</div>
|
|
1257
|
-
)}
|
|
1258
|
-
<div
|
|
1259
|
-
className={cn(
|
|
1260
|
-
"aui-tool-fallback-args-root px-4",
|
|
1261
|
-
isCancelled && "opacity-60",
|
|
1262
|
-
)}
|
|
1336
|
+
/>
|
|
1337
|
+
<span
|
|
1338
|
+
data-slot="tool-fallback-trigger-label"
|
|
1339
|
+
className={cn(
|
|
1340
|
+
"aui-tool-fallback-trigger-label-wrapper relative inline-block grow text-left leading-none",
|
|
1341
|
+
isCancelled && "text-muted-foreground line-through",
|
|
1342
|
+
)}
|
|
1343
|
+
>
|
|
1344
|
+
<span>
|
|
1345
|
+
{label}: <b>{toolName}</b>
|
|
1346
|
+
</span>
|
|
1347
|
+
{isRunning && (
|
|
1348
|
+
<span
|
|
1349
|
+
aria-hidden
|
|
1350
|
+
data-slot="tool-fallback-trigger-shimmer"
|
|
1351
|
+
className="aui-tool-fallback-trigger-shimmer shimmer pointer-events-none absolute inset-0 motion-reduce:animate-none"
|
|
1263
1352
|
>
|
|
1264
|
-
<
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1353
|
+
{label}: <b>{toolName}</b>
|
|
1354
|
+
</span>
|
|
1355
|
+
)}
|
|
1356
|
+
</span>
|
|
1357
|
+
<ChevronDownIcon
|
|
1358
|
+
data-slot="tool-fallback-trigger-chevron"
|
|
1359
|
+
className={cn(
|
|
1360
|
+
"aui-tool-fallback-trigger-chevron size-4 shrink-0",
|
|
1361
|
+
"transition-transform duration-(--animation-duration) ease-out",
|
|
1362
|
+
"group-data-[state=closed]/trigger:-rotate-90",
|
|
1363
|
+
"group-data-[state=open]/trigger:rotate-0",
|
|
1364
|
+
)}
|
|
1365
|
+
/>
|
|
1366
|
+
</CollapsibleTrigger>
|
|
1367
|
+
);
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
function ToolFallbackContent({
|
|
1371
|
+
className,
|
|
1372
|
+
children,
|
|
1373
|
+
...props
|
|
1374
|
+
}: React.ComponentProps<typeof CollapsibleContent>) {
|
|
1375
|
+
return (
|
|
1376
|
+
<CollapsibleContent
|
|
1377
|
+
data-slot="tool-fallback-content"
|
|
1378
|
+
className={cn(
|
|
1379
|
+
"aui-tool-fallback-content relative overflow-hidden text-sm outline-none",
|
|
1380
|
+
"group/collapsible-content ease-out",
|
|
1381
|
+
"data-[state=closed]:animate-collapsible-up",
|
|
1382
|
+
"data-[state=open]:animate-collapsible-down",
|
|
1383
|
+
"data-[state=closed]:fill-mode-forwards",
|
|
1384
|
+
"data-[state=closed]:pointer-events-none",
|
|
1385
|
+
"data-[state=open]:duration-(--animation-duration)",
|
|
1386
|
+
"data-[state=closed]:duration-(--animation-duration)",
|
|
1387
|
+
className,
|
|
1281
1388
|
)}
|
|
1389
|
+
{...props}
|
|
1390
|
+
>
|
|
1391
|
+
<div className="mt-3 flex flex-col gap-2 border-t pt-2">{children}</div>
|
|
1392
|
+
</CollapsibleContent>
|
|
1393
|
+
);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
function ToolFallbackArgs({
|
|
1397
|
+
argsText,
|
|
1398
|
+
className,
|
|
1399
|
+
...props
|
|
1400
|
+
}: React.ComponentProps<"div"> & {
|
|
1401
|
+
argsText?: string;
|
|
1402
|
+
}) {
|
|
1403
|
+
if (!argsText) return null;
|
|
1404
|
+
|
|
1405
|
+
return (
|
|
1406
|
+
<div
|
|
1407
|
+
data-slot="tool-fallback-args"
|
|
1408
|
+
className={cn("aui-tool-fallback-args px-4", className)}
|
|
1409
|
+
{...props}
|
|
1410
|
+
>
|
|
1411
|
+
<pre className="aui-tool-fallback-args-value whitespace-pre-wrap">
|
|
1412
|
+
{argsText}
|
|
1413
|
+
</pre>
|
|
1282
1414
|
</div>
|
|
1283
1415
|
);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
function ToolFallbackResult({
|
|
1419
|
+
result,
|
|
1420
|
+
className,
|
|
1421
|
+
...props
|
|
1422
|
+
}: React.ComponentProps<"div"> & {
|
|
1423
|
+
result?: unknown;
|
|
1424
|
+
}) {
|
|
1425
|
+
if (result === undefined) return null;
|
|
1426
|
+
|
|
1427
|
+
return (
|
|
1428
|
+
<div
|
|
1429
|
+
data-slot="tool-fallback-result"
|
|
1430
|
+
className={cn(
|
|
1431
|
+
"aui-tool-fallback-result border-t border-dashed px-4 pt-2",
|
|
1432
|
+
className,
|
|
1433
|
+
)}
|
|
1434
|
+
{...props}
|
|
1435
|
+
>
|
|
1436
|
+
<p className="aui-tool-fallback-result-header font-semibold">Result:</p>
|
|
1437
|
+
<pre className="aui-tool-fallback-result-content whitespace-pre-wrap">
|
|
1438
|
+
{typeof result === "string" ? result : JSON.stringify(result, null, 2)}
|
|
1439
|
+
</pre>
|
|
1440
|
+
</div>
|
|
1441
|
+
);
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
function ToolFallbackError({
|
|
1445
|
+
status,
|
|
1446
|
+
className,
|
|
1447
|
+
...props
|
|
1448
|
+
}: React.ComponentProps<"div"> & {
|
|
1449
|
+
status?: ToolCallMessagePartStatus;
|
|
1450
|
+
}) {
|
|
1451
|
+
if (status?.type !== "incomplete") return null;
|
|
1452
|
+
|
|
1453
|
+
const error = status.error;
|
|
1454
|
+
const errorText = error
|
|
1455
|
+
? typeof error === "string"
|
|
1456
|
+
? error
|
|
1457
|
+
: JSON.stringify(error)
|
|
1458
|
+
: null;
|
|
1459
|
+
|
|
1460
|
+
if (!errorText) return null;
|
|
1461
|
+
|
|
1462
|
+
const isCancelled = status.reason === "cancelled";
|
|
1463
|
+
const headerText = isCancelled ? "Cancelled reason:" : "Error:";
|
|
1464
|
+
|
|
1465
|
+
return (
|
|
1466
|
+
<div
|
|
1467
|
+
data-slot="tool-fallback-error"
|
|
1468
|
+
className={cn("aui-tool-fallback-error px-4", className)}
|
|
1469
|
+
{...props}
|
|
1470
|
+
>
|
|
1471
|
+
<p className="aui-tool-fallback-error-header font-semibold text-muted-foreground">
|
|
1472
|
+
{headerText}
|
|
1473
|
+
</p>
|
|
1474
|
+
<p className="aui-tool-fallback-error-reason text-muted-foreground">
|
|
1475
|
+
{errorText}
|
|
1476
|
+
</p>
|
|
1477
|
+
</div>
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
const ToolFallbackImpl: ToolCallMessagePartComponent = ({
|
|
1482
|
+
toolName,
|
|
1483
|
+
argsText,
|
|
1484
|
+
result,
|
|
1485
|
+
status,
|
|
1486
|
+
}) => {
|
|
1487
|
+
const isCancelled =
|
|
1488
|
+
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1489
|
+
|
|
1490
|
+
return (
|
|
1491
|
+
<ToolFallbackRoot
|
|
1492
|
+
className={cn(isCancelled && "border-muted-foreground/30 bg-muted/30")}
|
|
1493
|
+
>
|
|
1494
|
+
<ToolFallbackTrigger toolName={toolName} status={status} />
|
|
1495
|
+
<ToolFallbackContent>
|
|
1496
|
+
<ToolFallbackError status={status} />
|
|
1497
|
+
<ToolFallbackArgs
|
|
1498
|
+
argsText={argsText}
|
|
1499
|
+
className={cn(isCancelled && "opacity-60")}
|
|
1500
|
+
/>
|
|
1501
|
+
{!isCancelled && <ToolFallbackResult result={result} />}
|
|
1502
|
+
</ToolFallbackContent>
|
|
1503
|
+
</ToolFallbackRoot>
|
|
1504
|
+
);
|
|
1505
|
+
};
|
|
1506
|
+
|
|
1507
|
+
const ToolFallback = memo(
|
|
1508
|
+
ToolFallbackImpl,
|
|
1509
|
+
) as unknown as ToolCallMessagePartComponent & {
|
|
1510
|
+
Root: typeof ToolFallbackRoot;
|
|
1511
|
+
Trigger: typeof ToolFallbackTrigger;
|
|
1512
|
+
Content: typeof ToolFallbackContent;
|
|
1513
|
+
Args: typeof ToolFallbackArgs;
|
|
1514
|
+
Result: typeof ToolFallbackResult;
|
|
1515
|
+
Error: typeof ToolFallbackError;
|
|
1516
|
+
};
|
|
1517
|
+
|
|
1518
|
+
ToolFallback.displayName = "ToolFallback";
|
|
1519
|
+
ToolFallback.Root = ToolFallbackRoot;
|
|
1520
|
+
ToolFallback.Trigger = ToolFallbackTrigger;
|
|
1521
|
+
ToolFallback.Content = ToolFallbackContent;
|
|
1522
|
+
ToolFallback.Args = ToolFallbackArgs;
|
|
1523
|
+
ToolFallback.Result = ToolFallbackResult;
|
|
1524
|
+
ToolFallback.Error = ToolFallbackError;
|
|
1525
|
+
|
|
1526
|
+
export {
|
|
1527
|
+
ToolFallback,
|
|
1528
|
+
ToolFallbackRoot,
|
|
1529
|
+
ToolFallbackTrigger,
|
|
1530
|
+
ToolFallbackContent,
|
|
1531
|
+
ToolFallbackArgs,
|
|
1532
|
+
ToolFallbackResult,
|
|
1533
|
+
ToolFallbackError,
|
|
1284
1534
|
};
|
|
1285
1535
|
|
|
1286
1536
|
```
|
|
@@ -1460,6 +1710,45 @@ export { Button, buttonVariants };
|
|
|
1460
1710
|
|
|
1461
1711
|
```
|
|
1462
1712
|
|
|
1713
|
+
## components/ui/collapsible.tsx
|
|
1714
|
+
|
|
1715
|
+
```tsx
|
|
1716
|
+
"use client";
|
|
1717
|
+
|
|
1718
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
1719
|
+
|
|
1720
|
+
function Collapsible({
|
|
1721
|
+
...props
|
|
1722
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
1723
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
function CollapsibleTrigger({
|
|
1727
|
+
...props
|
|
1728
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
1729
|
+
return (
|
|
1730
|
+
<CollapsiblePrimitive.CollapsibleTrigger
|
|
1731
|
+
data-slot="collapsible-trigger"
|
|
1732
|
+
{...props}
|
|
1733
|
+
/>
|
|
1734
|
+
);
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
function CollapsibleContent({
|
|
1738
|
+
...props
|
|
1739
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
1740
|
+
return (
|
|
1741
|
+
<CollapsiblePrimitive.CollapsibleContent
|
|
1742
|
+
data-slot="collapsible-content"
|
|
1743
|
+
{...props}
|
|
1744
|
+
/>
|
|
1745
|
+
);
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
1749
|
+
|
|
1750
|
+
```
|
|
1751
|
+
|
|
1463
1752
|
## components/ui/dialog.tsx
|
|
1464
1753
|
|
|
1465
1754
|
```tsx
|
|
@@ -1728,25 +2017,26 @@ export default nextConfig;
|
|
|
1728
2017
|
"@assistant-ui/react-langgraph": "workspace:*",
|
|
1729
2018
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
1730
2019
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
2020
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
1731
2021
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
1732
2022
|
"@radix-ui/react-slot": "^1.2.4",
|
|
1733
2023
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
1734
2024
|
"class-variance-authority": "^0.7.1",
|
|
1735
2025
|
"clsx": "^2.1.1",
|
|
1736
2026
|
"lucide-react": "^0.562.0",
|
|
1737
|
-
"next": "16.1.
|
|
1738
|
-
"react": "19.2.3",
|
|
1739
|
-
"react-dom": "19.2.3",
|
|
2027
|
+
"next": "^16.1.4",
|
|
2028
|
+
"react": "^19.2.3",
|
|
2029
|
+
"react-dom": "^19.2.3",
|
|
1740
2030
|
"remark-gfm": "^4.0.1",
|
|
1741
2031
|
"tailwind-merge": "^3.4.0",
|
|
1742
|
-
"zod": "^4.
|
|
1743
|
-
"zustand": "^5.0.
|
|
2032
|
+
"zod": "^4.3.5",
|
|
2033
|
+
"zustand": "^5.0.10"
|
|
1744
2034
|
},
|
|
1745
2035
|
"devDependencies": {
|
|
1746
2036
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
1747
2037
|
"@tailwindcss/postcss": "^4.1.18",
|
|
1748
|
-
"@types/node": "^25.0.
|
|
1749
|
-
"@types/react": "^19.2.
|
|
2038
|
+
"@types/node": "^25.0.9",
|
|
2039
|
+
"@types/react": "^19.2.9",
|
|
1750
2040
|
"@types/react-dom": "^19.2.3",
|
|
1751
2041
|
"postcss": "^8.5.6",
|
|
1752
2042
|
"tailwindcss": "^4.1.18",
|