@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
|
@@ -649,7 +649,7 @@ export const ComposerAddAttachment: FC = () => {
|
|
|
649
649
|
side="bottom"
|
|
650
650
|
variant="ghost"
|
|
651
651
|
size="icon"
|
|
652
|
-
className="aui-composer-add-attachment size-
|
|
652
|
+
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"
|
|
653
653
|
aria-label="Add Attachment"
|
|
654
654
|
>
|
|
655
655
|
<PlusIcon className="aui-attachment-add-icon size-5 stroke-[1.5px]" />
|
|
@@ -908,6 +908,7 @@ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button
|
|
|
908
908
|
import { Button } from "@/components/ui/button";
|
|
909
909
|
import { cn } from "@/lib/utils";
|
|
910
910
|
import {
|
|
911
|
+
ActionBarMorePrimitive,
|
|
911
912
|
ActionBarPrimitive,
|
|
912
913
|
AssistantIf,
|
|
913
914
|
BranchPickerPrimitive,
|
|
@@ -924,6 +925,7 @@ import {
|
|
|
924
925
|
ChevronRightIcon,
|
|
925
926
|
CopyIcon,
|
|
926
927
|
DownloadIcon,
|
|
928
|
+
MoreHorizontalIcon,
|
|
927
929
|
PencilIcon,
|
|
928
930
|
RefreshCwIcon,
|
|
929
931
|
SquareIcon,
|
|
@@ -1145,16 +1147,33 @@ const AssistantActionBar: FC = () => {
|
|
|
1145
1147
|
</AssistantIf>
|
|
1146
1148
|
</TooltipIconButton>
|
|
1147
1149
|
</ActionBarPrimitive.Copy>
|
|
1148
|
-
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
1149
|
-
<TooltipIconButton tooltip="Export as Markdown">
|
|
1150
|
-
<DownloadIcon />
|
|
1151
|
-
</TooltipIconButton>
|
|
1152
|
-
</ActionBarPrimitive.ExportMarkdown>
|
|
1153
1150
|
<ActionBarPrimitive.Reload asChild>
|
|
1154
1151
|
<TooltipIconButton tooltip="Refresh">
|
|
1155
1152
|
<RefreshCwIcon />
|
|
1156
1153
|
</TooltipIconButton>
|
|
1157
1154
|
</ActionBarPrimitive.Reload>
|
|
1155
|
+
<ActionBarMorePrimitive.Root>
|
|
1156
|
+
<ActionBarMorePrimitive.Trigger asChild>
|
|
1157
|
+
<TooltipIconButton
|
|
1158
|
+
tooltip="More"
|
|
1159
|
+
className="data-[state=open]:bg-accent"
|
|
1160
|
+
>
|
|
1161
|
+
<MoreHorizontalIcon />
|
|
1162
|
+
</TooltipIconButton>
|
|
1163
|
+
</ActionBarMorePrimitive.Trigger>
|
|
1164
|
+
<ActionBarMorePrimitive.Content
|
|
1165
|
+
side="bottom"
|
|
1166
|
+
align="start"
|
|
1167
|
+
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"
|
|
1168
|
+
>
|
|
1169
|
+
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
1170
|
+
<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">
|
|
1171
|
+
<DownloadIcon className="size-4" />
|
|
1172
|
+
Export as Markdown
|
|
1173
|
+
</ActionBarMorePrimitive.Item>
|
|
1174
|
+
</ActionBarPrimitive.ExportMarkdown>
|
|
1175
|
+
</ActionBarMorePrimitive.Content>
|
|
1176
|
+
</ActionBarMorePrimitive.Root>
|
|
1158
1177
|
</ActionBarPrimitive.Root>
|
|
1159
1178
|
);
|
|
1160
1179
|
};
|
|
@@ -1255,98 +1274,329 @@ const BranchPicker: FC<BranchPickerPrimitive.Root.Props> = ({
|
|
|
1255
1274
|
## components/assistant-ui/tool-fallback.tsx
|
|
1256
1275
|
|
|
1257
1276
|
```tsx
|
|
1258
|
-
|
|
1277
|
+
"use client";
|
|
1278
|
+
|
|
1279
|
+
import { memo, useCallback, useRef, useState } from "react";
|
|
1259
1280
|
import {
|
|
1281
|
+
AlertCircleIcon,
|
|
1260
1282
|
CheckIcon,
|
|
1261
1283
|
ChevronDownIcon,
|
|
1262
|
-
|
|
1284
|
+
LoaderIcon,
|
|
1263
1285
|
XCircleIcon,
|
|
1264
1286
|
} from "lucide-react";
|
|
1265
|
-
import {
|
|
1266
|
-
|
|
1287
|
+
import {
|
|
1288
|
+
useScrollLock,
|
|
1289
|
+
type ToolCallMessagePartStatus,
|
|
1290
|
+
type ToolCallMessagePartComponent,
|
|
1291
|
+
} from "@assistant-ui/react";
|
|
1292
|
+
import {
|
|
1293
|
+
Collapsible,
|
|
1294
|
+
CollapsibleContent,
|
|
1295
|
+
CollapsibleTrigger,
|
|
1296
|
+
} from "@/components/ui/collapsible";
|
|
1267
1297
|
import { cn } from "@/lib/utils";
|
|
1268
1298
|
|
|
1269
|
-
|
|
1299
|
+
const ANIMATION_DURATION = 200;
|
|
1300
|
+
|
|
1301
|
+
export type ToolFallbackRootProps = Omit<
|
|
1302
|
+
React.ComponentProps<typeof Collapsible>,
|
|
1303
|
+
"open" | "onOpenChange"
|
|
1304
|
+
> & {
|
|
1305
|
+
open?: boolean;
|
|
1306
|
+
onOpenChange?: (open: boolean) => void;
|
|
1307
|
+
defaultOpen?: boolean;
|
|
1308
|
+
};
|
|
1309
|
+
|
|
1310
|
+
function ToolFallbackRoot({
|
|
1311
|
+
className,
|
|
1312
|
+
open: controlledOpen,
|
|
1313
|
+
onOpenChange: controlledOnOpenChange,
|
|
1314
|
+
defaultOpen = false,
|
|
1315
|
+
children,
|
|
1316
|
+
...props
|
|
1317
|
+
}: ToolFallbackRootProps) {
|
|
1318
|
+
const collapsibleRef = useRef<HTMLDivElement>(null);
|
|
1319
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
1320
|
+
const lockScroll = useScrollLock(collapsibleRef, ANIMATION_DURATION);
|
|
1321
|
+
|
|
1322
|
+
const isControlled = controlledOpen !== undefined;
|
|
1323
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
1324
|
+
|
|
1325
|
+
const handleOpenChange = useCallback(
|
|
1326
|
+
(open: boolean) => {
|
|
1327
|
+
if (!open) {
|
|
1328
|
+
lockScroll();
|
|
1329
|
+
}
|
|
1330
|
+
if (!isControlled) {
|
|
1331
|
+
setUncontrolledOpen(open);
|
|
1332
|
+
}
|
|
1333
|
+
controlledOnOpenChange?.(open);
|
|
1334
|
+
},
|
|
1335
|
+
[lockScroll, isControlled, controlledOnOpenChange],
|
|
1336
|
+
);
|
|
1337
|
+
|
|
1338
|
+
return (
|
|
1339
|
+
<Collapsible
|
|
1340
|
+
ref={collapsibleRef}
|
|
1341
|
+
data-slot="tool-fallback-root"
|
|
1342
|
+
open={isOpen}
|
|
1343
|
+
onOpenChange={handleOpenChange}
|
|
1344
|
+
className={cn(
|
|
1345
|
+
"aui-tool-fallback-root group/tool-fallback-root w-full rounded-lg border py-3",
|
|
1346
|
+
className,
|
|
1347
|
+
)}
|
|
1348
|
+
style={
|
|
1349
|
+
{
|
|
1350
|
+
"--animation-duration": `${ANIMATION_DURATION}ms`,
|
|
1351
|
+
} as React.CSSProperties
|
|
1352
|
+
}
|
|
1353
|
+
{...props}
|
|
1354
|
+
>
|
|
1355
|
+
{children}
|
|
1356
|
+
</Collapsible>
|
|
1357
|
+
);
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
type ToolStatus = ToolCallMessagePartStatus["type"];
|
|
1361
|
+
|
|
1362
|
+
const statusIconMap: Record<ToolStatus, React.ElementType> = {
|
|
1363
|
+
running: LoaderIcon,
|
|
1364
|
+
complete: CheckIcon,
|
|
1365
|
+
incomplete: XCircleIcon,
|
|
1366
|
+
"requires-action": AlertCircleIcon,
|
|
1367
|
+
};
|
|
1368
|
+
|
|
1369
|
+
function ToolFallbackTrigger({
|
|
1270
1370
|
toolName,
|
|
1271
|
-
argsText,
|
|
1272
|
-
result,
|
|
1273
1371
|
status,
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1372
|
+
className,
|
|
1373
|
+
...props
|
|
1374
|
+
}: React.ComponentProps<typeof CollapsibleTrigger> & {
|
|
1375
|
+
toolName: string;
|
|
1376
|
+
status?: ToolCallMessagePartStatus;
|
|
1377
|
+
}) {
|
|
1378
|
+
const statusType = status?.type ?? "complete";
|
|
1379
|
+
const isRunning = statusType === "running";
|
|
1277
1380
|
const isCancelled =
|
|
1278
1381
|
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
? status.error
|
|
1283
|
-
: JSON.stringify(status.error)
|
|
1284
|
-
: null;
|
|
1382
|
+
|
|
1383
|
+
const Icon = statusIconMap[statusType];
|
|
1384
|
+
const label = isCancelled ? "Cancelled tool" : "Used tool";
|
|
1285
1385
|
|
|
1286
1386
|
return (
|
|
1287
|
-
<
|
|
1387
|
+
<CollapsibleTrigger
|
|
1388
|
+
data-slot="tool-fallback-trigger"
|
|
1288
1389
|
className={cn(
|
|
1289
|
-
"aui-tool-fallback-
|
|
1290
|
-
|
|
1390
|
+
"aui-tool-fallback-trigger group/trigger flex w-full items-center gap-2 px-4 text-sm transition-colors",
|
|
1391
|
+
className,
|
|
1291
1392
|
)}
|
|
1393
|
+
{...props}
|
|
1292
1394
|
>
|
|
1293
|
-
<
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1395
|
+
<Icon
|
|
1396
|
+
data-slot="tool-fallback-trigger-icon"
|
|
1397
|
+
className={cn(
|
|
1398
|
+
"aui-tool-fallback-trigger-icon size-4 shrink-0",
|
|
1399
|
+
isCancelled && "text-muted-foreground",
|
|
1400
|
+
isRunning && "animate-spin",
|
|
1298
1401
|
)}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
<div className="aui-tool-fallback-cancelled-root px-4">
|
|
1316
|
-
<p className="aui-tool-fallback-cancelled-header font-semibold text-muted-foreground">
|
|
1317
|
-
Cancelled reason:
|
|
1318
|
-
</p>
|
|
1319
|
-
<p className="aui-tool-fallback-cancelled-reason text-muted-foreground">
|
|
1320
|
-
{cancelledReason}
|
|
1321
|
-
</p>
|
|
1322
|
-
</div>
|
|
1323
|
-
)}
|
|
1324
|
-
<div
|
|
1325
|
-
className={cn(
|
|
1326
|
-
"aui-tool-fallback-args-root px-4",
|
|
1327
|
-
isCancelled && "opacity-60",
|
|
1328
|
-
)}
|
|
1402
|
+
/>
|
|
1403
|
+
<span
|
|
1404
|
+
data-slot="tool-fallback-trigger-label"
|
|
1405
|
+
className={cn(
|
|
1406
|
+
"aui-tool-fallback-trigger-label-wrapper relative inline-block grow text-left leading-none",
|
|
1407
|
+
isCancelled && "text-muted-foreground line-through",
|
|
1408
|
+
)}
|
|
1409
|
+
>
|
|
1410
|
+
<span>
|
|
1411
|
+
{label}: <b>{toolName}</b>
|
|
1412
|
+
</span>
|
|
1413
|
+
{isRunning && (
|
|
1414
|
+
<span
|
|
1415
|
+
aria-hidden
|
|
1416
|
+
data-slot="tool-fallback-trigger-shimmer"
|
|
1417
|
+
className="aui-tool-fallback-trigger-shimmer shimmer pointer-events-none absolute inset-0 motion-reduce:animate-none"
|
|
1329
1418
|
>
|
|
1330
|
-
<
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1419
|
+
{label}: <b>{toolName}</b>
|
|
1420
|
+
</span>
|
|
1421
|
+
)}
|
|
1422
|
+
</span>
|
|
1423
|
+
<ChevronDownIcon
|
|
1424
|
+
data-slot="tool-fallback-trigger-chevron"
|
|
1425
|
+
className={cn(
|
|
1426
|
+
"aui-tool-fallback-trigger-chevron size-4 shrink-0",
|
|
1427
|
+
"transition-transform duration-(--animation-duration) ease-out",
|
|
1428
|
+
"group-data-[state=closed]/trigger:-rotate-90",
|
|
1429
|
+
"group-data-[state=open]/trigger:rotate-0",
|
|
1430
|
+
)}
|
|
1431
|
+
/>
|
|
1432
|
+
</CollapsibleTrigger>
|
|
1433
|
+
);
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
function ToolFallbackContent({
|
|
1437
|
+
className,
|
|
1438
|
+
children,
|
|
1439
|
+
...props
|
|
1440
|
+
}: React.ComponentProps<typeof CollapsibleContent>) {
|
|
1441
|
+
return (
|
|
1442
|
+
<CollapsibleContent
|
|
1443
|
+
data-slot="tool-fallback-content"
|
|
1444
|
+
className={cn(
|
|
1445
|
+
"aui-tool-fallback-content relative overflow-hidden text-sm outline-none",
|
|
1446
|
+
"group/collapsible-content ease-out",
|
|
1447
|
+
"data-[state=closed]:animate-collapsible-up",
|
|
1448
|
+
"data-[state=open]:animate-collapsible-down",
|
|
1449
|
+
"data-[state=closed]:fill-mode-forwards",
|
|
1450
|
+
"data-[state=closed]:pointer-events-none",
|
|
1451
|
+
"data-[state=open]:duration-(--animation-duration)",
|
|
1452
|
+
"data-[state=closed]:duration-(--animation-duration)",
|
|
1453
|
+
className,
|
|
1347
1454
|
)}
|
|
1455
|
+
{...props}
|
|
1456
|
+
>
|
|
1457
|
+
<div className="mt-3 flex flex-col gap-2 border-t pt-2">{children}</div>
|
|
1458
|
+
</CollapsibleContent>
|
|
1459
|
+
);
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
function ToolFallbackArgs({
|
|
1463
|
+
argsText,
|
|
1464
|
+
className,
|
|
1465
|
+
...props
|
|
1466
|
+
}: React.ComponentProps<"div"> & {
|
|
1467
|
+
argsText?: string;
|
|
1468
|
+
}) {
|
|
1469
|
+
if (!argsText) return null;
|
|
1470
|
+
|
|
1471
|
+
return (
|
|
1472
|
+
<div
|
|
1473
|
+
data-slot="tool-fallback-args"
|
|
1474
|
+
className={cn("aui-tool-fallback-args px-4", className)}
|
|
1475
|
+
{...props}
|
|
1476
|
+
>
|
|
1477
|
+
<pre className="aui-tool-fallback-args-value whitespace-pre-wrap">
|
|
1478
|
+
{argsText}
|
|
1479
|
+
</pre>
|
|
1480
|
+
</div>
|
|
1481
|
+
);
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
function ToolFallbackResult({
|
|
1485
|
+
result,
|
|
1486
|
+
className,
|
|
1487
|
+
...props
|
|
1488
|
+
}: React.ComponentProps<"div"> & {
|
|
1489
|
+
result?: unknown;
|
|
1490
|
+
}) {
|
|
1491
|
+
if (result === undefined) return null;
|
|
1492
|
+
|
|
1493
|
+
return (
|
|
1494
|
+
<div
|
|
1495
|
+
data-slot="tool-fallback-result"
|
|
1496
|
+
className={cn(
|
|
1497
|
+
"aui-tool-fallback-result border-t border-dashed px-4 pt-2",
|
|
1498
|
+
className,
|
|
1499
|
+
)}
|
|
1500
|
+
{...props}
|
|
1501
|
+
>
|
|
1502
|
+
<p className="aui-tool-fallback-result-header font-semibold">Result:</p>
|
|
1503
|
+
<pre className="aui-tool-fallback-result-content whitespace-pre-wrap">
|
|
1504
|
+
{typeof result === "string" ? result : JSON.stringify(result, null, 2)}
|
|
1505
|
+
</pre>
|
|
1348
1506
|
</div>
|
|
1349
1507
|
);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
function ToolFallbackError({
|
|
1511
|
+
status,
|
|
1512
|
+
className,
|
|
1513
|
+
...props
|
|
1514
|
+
}: React.ComponentProps<"div"> & {
|
|
1515
|
+
status?: ToolCallMessagePartStatus;
|
|
1516
|
+
}) {
|
|
1517
|
+
if (status?.type !== "incomplete") return null;
|
|
1518
|
+
|
|
1519
|
+
const error = status.error;
|
|
1520
|
+
const errorText = error
|
|
1521
|
+
? typeof error === "string"
|
|
1522
|
+
? error
|
|
1523
|
+
: JSON.stringify(error)
|
|
1524
|
+
: null;
|
|
1525
|
+
|
|
1526
|
+
if (!errorText) return null;
|
|
1527
|
+
|
|
1528
|
+
const isCancelled = status.reason === "cancelled";
|
|
1529
|
+
const headerText = isCancelled ? "Cancelled reason:" : "Error:";
|
|
1530
|
+
|
|
1531
|
+
return (
|
|
1532
|
+
<div
|
|
1533
|
+
data-slot="tool-fallback-error"
|
|
1534
|
+
className={cn("aui-tool-fallback-error px-4", className)}
|
|
1535
|
+
{...props}
|
|
1536
|
+
>
|
|
1537
|
+
<p className="aui-tool-fallback-error-header font-semibold text-muted-foreground">
|
|
1538
|
+
{headerText}
|
|
1539
|
+
</p>
|
|
1540
|
+
<p className="aui-tool-fallback-error-reason text-muted-foreground">
|
|
1541
|
+
{errorText}
|
|
1542
|
+
</p>
|
|
1543
|
+
</div>
|
|
1544
|
+
);
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
const ToolFallbackImpl: ToolCallMessagePartComponent = ({
|
|
1548
|
+
toolName,
|
|
1549
|
+
argsText,
|
|
1550
|
+
result,
|
|
1551
|
+
status,
|
|
1552
|
+
}) => {
|
|
1553
|
+
const isCancelled =
|
|
1554
|
+
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1555
|
+
|
|
1556
|
+
return (
|
|
1557
|
+
<ToolFallbackRoot
|
|
1558
|
+
className={cn(isCancelled && "border-muted-foreground/30 bg-muted/30")}
|
|
1559
|
+
>
|
|
1560
|
+
<ToolFallbackTrigger toolName={toolName} status={status} />
|
|
1561
|
+
<ToolFallbackContent>
|
|
1562
|
+
<ToolFallbackError status={status} />
|
|
1563
|
+
<ToolFallbackArgs
|
|
1564
|
+
argsText={argsText}
|
|
1565
|
+
className={cn(isCancelled && "opacity-60")}
|
|
1566
|
+
/>
|
|
1567
|
+
{!isCancelled && <ToolFallbackResult result={result} />}
|
|
1568
|
+
</ToolFallbackContent>
|
|
1569
|
+
</ToolFallbackRoot>
|
|
1570
|
+
);
|
|
1571
|
+
};
|
|
1572
|
+
|
|
1573
|
+
const ToolFallback = memo(
|
|
1574
|
+
ToolFallbackImpl,
|
|
1575
|
+
) as unknown as ToolCallMessagePartComponent & {
|
|
1576
|
+
Root: typeof ToolFallbackRoot;
|
|
1577
|
+
Trigger: typeof ToolFallbackTrigger;
|
|
1578
|
+
Content: typeof ToolFallbackContent;
|
|
1579
|
+
Args: typeof ToolFallbackArgs;
|
|
1580
|
+
Result: typeof ToolFallbackResult;
|
|
1581
|
+
Error: typeof ToolFallbackError;
|
|
1582
|
+
};
|
|
1583
|
+
|
|
1584
|
+
ToolFallback.displayName = "ToolFallback";
|
|
1585
|
+
ToolFallback.Root = ToolFallbackRoot;
|
|
1586
|
+
ToolFallback.Trigger = ToolFallbackTrigger;
|
|
1587
|
+
ToolFallback.Content = ToolFallbackContent;
|
|
1588
|
+
ToolFallback.Args = ToolFallbackArgs;
|
|
1589
|
+
ToolFallback.Result = ToolFallbackResult;
|
|
1590
|
+
ToolFallback.Error = ToolFallbackError;
|
|
1591
|
+
|
|
1592
|
+
export {
|
|
1593
|
+
ToolFallback,
|
|
1594
|
+
ToolFallbackRoot,
|
|
1595
|
+
ToolFallbackTrigger,
|
|
1596
|
+
ToolFallbackContent,
|
|
1597
|
+
ToolFallbackArgs,
|
|
1598
|
+
ToolFallbackResult,
|
|
1599
|
+
ToolFallbackError,
|
|
1350
1600
|
};
|
|
1351
1601
|
|
|
1352
1602
|
```
|
|
@@ -1526,6 +1776,45 @@ export { Button, buttonVariants };
|
|
|
1526
1776
|
|
|
1527
1777
|
```
|
|
1528
1778
|
|
|
1779
|
+
## components/ui/collapsible.tsx
|
|
1780
|
+
|
|
1781
|
+
```tsx
|
|
1782
|
+
"use client";
|
|
1783
|
+
|
|
1784
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
1785
|
+
|
|
1786
|
+
function Collapsible({
|
|
1787
|
+
...props
|
|
1788
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
1789
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
function CollapsibleTrigger({
|
|
1793
|
+
...props
|
|
1794
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
1795
|
+
return (
|
|
1796
|
+
<CollapsiblePrimitive.CollapsibleTrigger
|
|
1797
|
+
data-slot="collapsible-trigger"
|
|
1798
|
+
{...props}
|
|
1799
|
+
/>
|
|
1800
|
+
);
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
function CollapsibleContent({
|
|
1804
|
+
...props
|
|
1805
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
1806
|
+
return (
|
|
1807
|
+
<CollapsiblePrimitive.CollapsibleContent
|
|
1808
|
+
data-slot="collapsible-content"
|
|
1809
|
+
{...props}
|
|
1810
|
+
/>
|
|
1811
|
+
);
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
1815
|
+
|
|
1816
|
+
```
|
|
1817
|
+
|
|
1529
1818
|
## components/ui/dialog.tsx
|
|
1530
1819
|
|
|
1531
1820
|
```tsx
|
|
@@ -1781,27 +2070,29 @@ export default nextConfig;
|
|
|
1781
2070
|
"start": "next start"
|
|
1782
2071
|
},
|
|
1783
2072
|
"dependencies": {
|
|
2073
|
+
"@ai-sdk/openai": "^3.0.13",
|
|
1784
2074
|
"@assistant-ui/react": "workspace:*",
|
|
1785
2075
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
1786
2076
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
2077
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
1787
2078
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
1788
2079
|
"@radix-ui/react-slot": "^1.2.4",
|
|
1789
2080
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
1790
2081
|
"class-variance-authority": "^0.7.1",
|
|
1791
2082
|
"clsx": "^2.1.1",
|
|
1792
2083
|
"lucide-react": "^0.562.0",
|
|
1793
|
-
"next": "16.1.
|
|
1794
|
-
"react": "19.2.3",
|
|
1795
|
-
"react-dom": "19.2.3",
|
|
2084
|
+
"next": "^16.1.4",
|
|
2085
|
+
"react": "^19.2.3",
|
|
2086
|
+
"react-dom": "^19.2.3",
|
|
1796
2087
|
"remark-gfm": "^4.0.1",
|
|
1797
2088
|
"tailwind-merge": "^3.4.0",
|
|
1798
|
-
"zustand": "^5.0.
|
|
2089
|
+
"zustand": "^5.0.10"
|
|
1799
2090
|
},
|
|
1800
2091
|
"devDependencies": {
|
|
1801
2092
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
1802
2093
|
"@tailwindcss/postcss": "^4.1.18",
|
|
1803
|
-
"@types/node": "^25.0.
|
|
1804
|
-
"@types/react": "^19.2.
|
|
2094
|
+
"@types/node": "^25.0.9",
|
|
2095
|
+
"@types/react": "^19.2.9",
|
|
1805
2096
|
"@types/react-dom": "^19.2.3",
|
|
1806
2097
|
"postcss": "^8.5.6",
|
|
1807
2098
|
"tailwindcss": "^4.1.18",
|